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, each of which 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 that provide any Matroska Reader
with additional information to use in
the optimization of seeking performance.
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
Cues
unless it references aCluster
element that contains aCodecState
element but no keyframes. -
For each subtitle track present, each subtitle frame SHOULD be referenced by a
CuePoint
element with aCueDuration
element. -
References to audio tracks MAY be skipped in
CuePoint
elements if a video track is present. When included, theCuePoint
elements SHOULD reference audio keyframes once every 500 milliseconds at most. -
If the referenced frame is not stored within the first
SimpleBlock
or firstBlockGroup
within itsCluster
element, then theCueRelativePosition
element SHOULD be written to reference where in theCluster
the reference frame is stored. -
If a
CuePoint
element references aCluster
element that includes aCodecState
element, then thatCuePoint
element MUST use aCueCodecState
element. -
CuePoint
elements SHOULD be numerically sorted in storage order by the value of theCueTime
element.