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
Cues
unless it references aCluster Element
which 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 at most once every 500 milliseconds. - 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
referencesCluster 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
.