Cues
The Cues Element provides an index of certain Cluster Elements to allow for optimized
seeking to absolute timestamps within the Segment. The Cues Element contains one or
many CuePoint Elements which each MUST reference an absolute timestamp (via the
CueTime Element), a Track (via the CueTrack Element), and a Segment Position
(via the CueClusterPosition Element). Additional non-mandated Elements are part of
the CuePoint Element such as CueDuration, CueRelativePosition, CueCodecState
and others which provide any Matroska Reader with additional information to use in
the optimization of seeking performance.
Recommendations
The following recommendations are provided to optimize Matroska performance.
- Unless Matroska is used as a live stream, it SHOULD contain a
Cues Element. - For each video track, each keyframe SHOULD be referenced by a
CuePoint Element. - It is RECOMMENDED to not reference non-keyframes of video tracks in
Cuesunless it references aCluster Elementwhich contains aCodecState Elementbut no keyframes. - For each subtitle track present, each subtitle frame SHOULD be referenced by a
CuePoint Elementwith aCueDuration Element. - References to audio tracks MAY be skipped in
CuePoint Elementsif a video track is present. When included theCuePoint ElementsSHOULD reference audio keyframes at most once every 500 milliseconds. - If the referenced frame is not stored within the first
SimpleBlock, or firstBlockGroupwithin itsCluster Element, then theCueRelativePosition ElementSHOULD be written to reference where in theClusterthe reference frame is stored. - If a
CuePoint ElementreferencesCluster Elementthat includes aCodecState Element, then thatCuePoint ElementMUST use aCueCodecState Element. CuePoint ElementsSHOULD be numerically sorted in storage order by the value of theCueTime Element.
