Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ebml_matroska.xml
Original file line number Diff line number Diff line change
Expand Up @@ -649,15 +649,15 @@ The format depends on the `ChapProcessCodecID` used; see (#chapprocesscodecid-el
<extension type="webmproject.org" webm="1"/>
</element>
<element name="DisplayWidth" path="\Segment\Tracks\TrackEntry\Video\DisplayWidth" id="0x54B0" type="uinteger" range="not 0" maxOccurs="1">
<documentation lang="en" purpose="definition">Width of the video frames to display. Applies to the video frame after cropping (PixelCrop* Elements).</documentation>
<implementation_note note_attribute="default">If the DisplayUnit of the same `TrackEntry` is 0, then the default value for `DisplayWidth` is equal to `PixelWidth` - `PixelCropLeft` - `PixelCropRight`; else, there is no default value.</implementation_note>
<documentation lang="en" purpose="definition">The width of the video frames to be displayed, including any area cropped according to the PixelCrop* elements.</documentation>
<implementation_note note_attribute="default">If the DisplayUnit of the same `TrackEntry` is 0, then the default value for `DisplayWidth` is equal to `PixelWidth`, else there is no default value.</implementation_note>
<extension type="libmatroska" cppname="VideoDisplayWidth"/>
<extension type="stream copy" keep="1"/>
<extension type="webmproject.org" webm="1"/>
</element>
<element name="DisplayHeight" path="\Segment\Tracks\TrackEntry\Video\DisplayHeight" id="0x54BA" type="uinteger" range="not 0" maxOccurs="1">
<documentation lang="en" purpose="definition">Height of the video frames to display. Applies to the video frame after cropping (PixelCrop* Elements).</documentation>
<implementation_note note_attribute="default">If the DisplayUnit of the same `TrackEntry` is 0, then the default value for `DisplayHeight` is equal to `PixelHeight` - `PixelCropTop` - `PixelCropBottom`; else, there is no default value.</implementation_note>
<documentation lang="en" purpose="definition">The height of the video frames to be displayed, including any area cropped according to the PixelCrop* elements.</documentation>
<implementation_note note_attribute="default">If the DisplayUnit of the same `TrackEntry` is 0, then the default value for `DisplayHeight` is equal to `PixelHeight`, else there is no default value.</implementation_note>
<extension type="libmatroska" cppname="VideoDisplayHeight"/>
<extension type="stream copy" keep="1"/>
<extension type="webmproject.org" webm="1"/>
Expand Down
19 changes: 16 additions & 3 deletions notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -795,9 +795,22 @@ within the center of a padded 1920x1080 encoded image may set both
should crop off 240 columns of pixels from the left and right of
the encoded image to present the image with the pillar-boxes hidden.

Cropping has to be performed before resizing and the display dimensions
given by `DisplayWidth`, `DisplayHeight`, and
`DisplayUnit` apply to the already-cropped image.
Cropping must be performed before resizing to the display dimensions to prevent
the cropped pixels from affecting the resized image. The numbers given in the
PixelCrop elements refer to pixels of the stored video before resizing.
The display dimensions given by `DisplayWidth`, `DisplayHeight`, and `DisplayUnit`
describe the area occupied by the full image, including the cropped pixels,
so the actual displayed image may be smaller after cropping is applied.

Whether cropping is applied or not, it should not affect the displayed geometry
of the image, except for removing the cropped area. The geometry defined
by `DisplayWidth` and `DisplayHeight` always corresponds to the whole image
including the cropped area, and if cropping is in fact applied,
the remaining area is not further stretched or compressed.

When subtitles are displayed on the video (if relevant to the particular
subtitle format), they are associated with the full (uncropped) video frame and
are cropped along with the video.

## Rotation

Expand Down