<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-ietf-cellar-matroska-06" sortRefs="true" submissionType="IETF" category="info" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" consensus="true">

<front>
<title abbrev="Matroska Format">Matroska Media Container Format Specifications</title><seriesInfo value="draft-ietf-cellar-matroska-06" stream="IETF" status="informational" name="Internet-Draft"></seriesInfo>
<author initials="S." surname="Lhomme" fullname="Steve Lhomme"><organization></organization><address><postal><street></street>
</postal><email>slhomme@matroska.org</email>
</address></author>
<author initials="M." surname="Bunkus" fullname="Moritz Bunkus"><organization></organization><address><postal><street></street>
</postal><email>moritz@bunkus.org</email>
</address></author>
<author initials="D." surname="Rice" fullname="Dave Rice"><organization></organization><address><postal><street></street>
</postal><email>dave@dericed.com</email>
</address></author>
<date year="2020" month="October" day="19"></date>
<area>art</area>
<workgroup>cellar</workgroup>
<keyword>binary</keyword>
<keyword>storage</keyword>
<keyword>matroska</keyword>
<keyword>ebml</keyword>
<keyword>webm</keyword>

<abstract>
<t>This document defines the Matroska audiovisual container, including definitions of its structural elements,
as well as its terminology, vocabulary, and application.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>Matroska aims to become THE standard of multimedia container formats. It was derived from a project called <xref target="MCF"></xref>,
but differentiates from it significantly because it is based on EBML (Extensible Binary Meta Language) <xref target="RFC8794"></xref>,
a binary derivative of XML. EBML enables significant advantages in terms of future format extensibility,
without breaking file support in old parsers.</t>
<t>First, it is essential to clarify exactly &quot;What an Audio/Video container is&quot;, to avoid any misunderstandings:</t>

<ul>
<li>It is NOT a video or audio compression format (codec)</li>
<li>It is an envelope for which there can be many audio, video, and subtitles streams,
allowing the user to store a complete movie or CD in a single file.</li>
</ul>
<t>Matroska is designed with the future in mind. It incorporates features like:</t>

<ul>
<li>Fast seeking in the file</li>
<li>Chapter entries</li>
<li>Full metadata (tags) support</li>
<li>Selectable subtitle/audio/video streams</li>
<li>Modularly expandable</li>
<li>Error resilience (can recover playback even when the stream is damaged)</li>
<li>Streamable over the internet and local networks (HTTP, CIFS, FTP, etc)</li>
<li>Menus (like DVDs have)</li>
</ul>
<t>Matroska is an open standards project. This means for personal use it is absolutely free to use
and that the technical specifications describing the bitstream are open to everybody,
even to companies that would like to support it in their products.</t>
</section>

<section anchor="status-of-this-document"><name>Status of this document</name>
<t>This document is a work-in-progress specification defining the Matroska file format as part of
the <eref target="https://datatracker.ietf.org/wg/cellar/charter/">IETF Cellar working group</eref>.
But since it's quite complete it is used as a reference for the development of libmatroska.
A legacy version of the specification can be found <eref target="https://www.matroska.org/files/matroska_file_format_alexander_noe.pdf">here</eref> (PDF doc by Alexander Noé -- outdated).</t>
<t>For a simplified diagram of the layout of a Matroska file, see the <eref target="diagram.md">Diagram page</eref>.</t>
<t>The table found below is now generated from the &quot;source&quot; of the Matroska specification.
This <eref target="https://github.com/Matroska-Org/foundation-source/blob/master/spectool/specdata.xml">XML file</eref> is also used to generate the semantic data
used in libmatroska and libmatroska2. We encourage anyone to use and monitor its
changes so your code is spec-proof and always up to date.</t>
<t>Note that versions 1, 2, and 3 have been finalized. Version 4 is currently work in progress.
There <bcp14>MAY</bcp14> be further additions to v4.</t>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>Matroska inherits security considerations from EBML.</t>
<t>Attacks on a <tt>Matroska Reader</tt> could include:</t>

<ul>
<li>Storage of a arbitrary and potentially executable data within an <tt>Attachment Element</tt>.
<tt>Matroska Readers</tt> that extract or use data from Matroska Attachments SHOULD
check that the data adheres to expectations.</li>
<li>A <tt>Matroska Attachment</tt> with an inaccurate mime-type.</li>
</ul>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>To be determined.</t>
</section>

<section anchor="notation-and-conventions"><name>Notation and Conventions</name>
<t>The key words &quot;<bcp14>MUST</bcp14>&quot;, &quot;<bcp14>MUST NOT</bcp14>&quot;,
&quot;<bcp14>REQUIRED</bcp14>&quot;, &quot;<bcp14>SHALL</bcp14>&quot;, &quot;<bcp14>SHALL NOT</bcp14>&quot;,
&quot;<bcp14>SHOULD</bcp14>&quot;, &quot;<bcp14>SHOULD NOT</bcp14>&quot;,
&quot;<bcp14>RECOMMENDED</bcp14>&quot;, &quot;<bcp14>NOT RECOMMENDED</bcp14>&quot;,
&quot;<bcp14>MAY</bcp14>&quot;, and &quot;<bcp14>OPTIONAL</bcp14>&quot; in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"></xref> <xref target="RFC8174"></xref>
when, and only when, they appear in all capitals, as shown here.</t>
<t>This document defines specific terms in order to define the format and application of <tt>Matroska</tt>.
Specific terms are defined below:</t>

<dl>
<dt><tt>Matroska</tt>:</dt>
<dd>A multimedia container format based on EBML (Extensible Binary Meta Language).</dd>
<dt><tt>Matroska Reader</tt>:</dt>
<dd>A data parser that interprets the semantics of a Matroska document and creates a way for programs to use <tt>Matroska</tt>.</dd>
<dt><tt>Matroska Player</tt>:</dt>
<dd>A <tt>Matroska Reader</tt> with a primary purpose of playing audiovisual files, including <tt>Matroska</tt> documents.</dd>
</dl>
</section>

<section anchor="basis-in-ebml"><name>Basis in EBML</name>
<t>Matroska is a Document Type of EBML (Extensible Binary Meta Language).
This specification is dependent on the EBML Specification <xref target="RFC8794"></xref>.
For an understanding of Matroska's EBML Schema, see in particular the sections of the EBML Specification covering
EBML Element Types (Section 7),
EBML Schema (Section 11.1),
and EBML Structure (Section 3).</t>

<section anchor="added-constraints-on-ebml"><name>Added Constraints on EBML</name>
<t>As an EBML Document Type, Matroska adds the following constraints to the EBML specification.</t>

<ul>
<li>The <tt>docType</tt> of the <tt>EBML Header</tt> <bcp14>MUST</bcp14> be &quot;matroska&quot;.</li>
<li>The <tt>EBMLMaxIDLength</tt> of the <tt>EBML Header</tt> <bcp14>MUST</bcp14> be &quot;4&quot;.</li>
<li>The <tt>EBMLMaxSizeLength</tt> of the <tt>EBML Header</tt> <bcp14>MUST</bcp14> be between &quot;1&quot; and &quot;8&quot; inclusive.</li>
</ul>
</section>

<section anchor="matroska-design"><name>Matroska Design</name>
<t>All top-levels elements (Segment and direct sub-elements) are coded on 4 octets -- i.e. class D elements.</t>

<section anchor="language-codes"><name>Language Codes</name>
<t>Matroska from version 1 through 3 uses language codes that can be either the 3 letters
<eref target="https://www.loc.gov/standards/iso639-2/php/English_list.php">bibliographic ISO-639-2</eref> form (like &quot;fre&quot; for french),
or such a language code followed by a dash and a country code for specialities in languages (like &quot;fre-ca&quot; for Canadian French).
The <tt>ISO 639-2 Language Elements</tt> are &quot;Language Element&quot;, &quot;TagLanguage Element&quot;, and &quot;ChapLanguage Element&quot;.</t>
<t>Starting in Matroska version 4, either <tt>ISO 639-2</tt> or <eref target="https://tools.ietf.org/html/bcp47">BCP 47</eref> <bcp14>MAY</bcp14> be used,
although <tt>BCP 47</tt> is <bcp14>RECOMMENDED</bcp14>. The <tt>BCP 47 Language Elements</tt> are &quot;LanguageIETF Element&quot;,
&quot;TagLanguageIETF Element&quot;, and &quot;ChapLanguageIETF Element&quot;. If a <tt>BCP 47 Language Element</tt> and an <tt>ISO 639-2 Language Element</tt>
are used within the same <tt>Parent Element</tt>, then the <tt>ISO 639-2 Language Element</tt> <bcp14>MUST</bcp14> be ignored and precedence given to the <tt>BCP 47 Language Element</tt>.</t>
<t>Country codes are the same as used for <eref target="https://www.iana.org/domains/root/db">internet domains</eref>.</t>
</section>

<section anchor="physical-types"><name>Physical Types</name>
<t>Each level can have different meanings for audio and video. The ORIGINAL_MEDIUM tag can be used to
specify a string for ChapterPhysicalEquiv = 60. Here is the list of possible levels for both audio and video:</t>
<table>
<thead>
<tr>
<th align="left">ChapterPhysicalEquiv</th>
<th align="left">Audio</th>
<th align="left">Video</th>
<th align="left">Comment</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">70</td>
<td align="left">SET / PACKAGE</td>
<td align="left">SET / PACKAGE</td>
<td align="left">the collection of different media</td>
</tr>

<tr>
<td align="left">60</td>
<td align="left">CD / 12&quot; / 10&quot; / 7&quot; / TAPE / MINIDISC / DAT</td>
<td align="left">DVD / VHS / LASERDISC</td>
<td align="left">the physical medium like a CD or a DVD</td>
</tr>

<tr>
<td align="left">50</td>
<td align="left">SIDE</td>
<td align="left">SIDE</td>
<td align="left">when the original medium (LP/DVD) has different sides</td>
</tr>

<tr>
<td align="left">40</td>
<td align="left">-</td>
<td align="left">LAYER</td>
<td align="left">another physical level on DVDs</td>
</tr>

<tr>
<td align="left">30</td>
<td align="left">SESSION</td>
<td align="left">SESSION</td>
<td align="left">as found on CDs and DVDs</td>
</tr>

<tr>
<td align="left">20</td>
<td align="left">TRACK</td>
<td align="left">-</td>
<td align="left">as found on audio CDs</td>
</tr>

<tr>
<td align="left">10</td>
<td align="left">INDEX</td>
<td align="left">-</td>
<td align="left">the first logical level of the side/medium</td>
</tr>
</tbody>
</table></section>

<section anchor="block-structure"><name>Block Structure</name>
<t>Bit 0 is the most significant bit.</t>
<t>Frames using references <bcp14>SHOULD</bcp14> be stored in &quot;coding order&quot;. That means the references first, and then
the frames referencing them. A consequence is that timestamps might not be consecutive.
But a frame with a past timestamp <bcp14>MUST</bcp14> reference a frame already known, otherwise it's considered bad/void.</t>

<section anchor="block-header"><name>Block Header</name>
<table>
<thead>
<tr>
<th align="left">Offset</th>
<th align="left">Player</th>
<th align="left">Description</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">0x00+</td>
<td align="left"><bcp14>MUST</bcp14></td>
<td align="left">Track Number (Track Entry). It is coded in EBML like form (1 octet if the value is &lt; 0x80, 2 if &lt; 0x4000, etc) (most significant bits set to increase the range).</td>
</tr>

<tr>
<td align="left">0x01+</td>
<td align="left"><bcp14>MUST</bcp14></td>
<td align="left">Timestamp (relative to Cluster timestamp, signed int16)</td>
</tr>
</tbody>
</table></section>

<section anchor="block-header-flags"><name>Block Header Flags</name>
<table>
<thead>
<tr>
<th align="left">Offset</th>
<th align="left">Bit</th>
<th align="left">Player</th>
<th align="left">Description</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">0x03+</td>
<td align="left">0-3</td>
<td align="left">-</td>
<td align="left">Reserved, set to 0</td>
</tr>

<tr>
<td align="left">0x03+</td>
<td align="left">4</td>
<td align="left">-</td>
<td align="left">Invisible, the codec <bcp14>SHOULD</bcp14> decode this frame but not display it</td>
</tr>

<tr>
<td align="left">0x03+</td>
<td align="left">5-6</td>
<td align="left"><bcp14>MUST</bcp14></td>
<td align="left">Lacing</td>
</tr>

<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left">*   00 : no lacing</td>
</tr>

<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left">*   01 : Xiph lacing</td>
</tr>

<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left">*   11 : EBML lacing</td>
</tr>

<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left">*   10 : fixed-size lacing</td>
</tr>

<tr>
<td align="left">0x03+</td>
<td align="left">7</td>
<td align="left">-</td>
<td align="left">not used</td>
</tr>
</tbody>
</table></section>
</section>

<section anchor="lacing"><name>Lacing</name>
<t>Lacing is a mechanism to save space when storing data. It is typically used for small blocks
of data (referred to as frames in Matroska). There are 3 types of lacing:</t>

<ol>
<li>Xiph, inspired by what is found in the Ogg container</li>
<li>EBML, which is the same with sizes coded differently</li>
<li>fixed-size, where the size is not coded</li>
</ol>
<t>For example, a user wants to store 3 frames of the same track. The first frame is 800 octets long,
the second is 500 octets long and the third is 1000 octets long. As these data are small,
they can be stored in a lace to save space. They will then be stored in the same block as follows:</t>

<section anchor="xiph-lacing"><name>Xiph lacing</name>

<ul>
<li>Block head (with lacing bits set to 01)</li>
<li>Lacing head: Number of frames in the lace -1 -- i.e. 2 (the 800 and 500 octets one)</li>
<li>Lacing sizes: only the 2 first ones will be coded, 800 gives 255;255;255;35, 500 gives
255;245. The size of the last frame is deduced from the total size of the Block.</li>
<li>Data in frame 1</li>
<li>Data in frame 2</li>
<li>Data in frame 3</li>
</ul>
<t>A frame with a size multiple of 255 is coded with a 0 at the end of the size -- for example, 765 is coded 255;255;255;0.</t>
</section>

<section anchor="ebml-lacing"><name>EBML lacing</name>
<t>In this case, the size is not coded as blocks of 255 bytes, but as a difference with the previous size
and this size is coded as in EBML. The first size in the lace is unsigned as in EBML.
The others use a range shifting to get a sign on each value:</t>
<table>
<thead>
<tr>
<th align="left">Bit Representation</th>
<th align="left">Value</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">1xxx xxxx</td>
<td align="left">value -(2<sup>6</sup>-1) to 2<sup>6</sup>-1 (ie 0 to 2<sup>7</sup>-2 minus 2<sup>6</sup>-1, half of the range)</td>
</tr>

<tr>
<td align="left">01xx xxxx  xxxx xxxx</td>
<td align="left">value -(2<sup>13</sup>-1) to 2<sup>13</sup>-1</td>
</tr>

<tr>
<td align="left">001x xxxx  xxxx xxxx  xxxx xxxx</td>
<td align="left">value -(2<sup>20</sup>-1) to 2<sup>20</sup>-1</td>
</tr>

<tr>
<td align="left">0001 xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx</td>
<td align="left">value -(2<sup>27</sup>-1) to 2<sup>27</sup>-1</td>
</tr>

<tr>
<td align="left">0000 1xxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx</td>
<td align="left">value -(2<sup>34</sup>-1) to 2<sup>34</sup>-1</td>
</tr>

<tr>
<td align="left">0000 01xx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx</td>
<td align="left">value -(2<sup>41</sup>-1) to 2<sup>41</sup>-1</td>
</tr>

<tr>
<td align="left">0000 001x  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx</td>
<td align="left">value -(2<sup>48</sup>-1) to 2<sup>48</sup>-1</td>
</tr>
</tbody>
</table>
<ul>
<li>Block head (with lacing bits set to 11)</li>
<li>Lacing head: Number of frames in the lace -1 -- i.e. 2 (the 800 and 500 octets one)</li>
<li>Lacing sizes: only the 2 first ones will be coded, 800 gives 0x320 0x4000 = 0x4320,
500 is coded as -300 : - 0x12C + 0x1FFF + 0x4000 = 0x5ED3.
The size of the last frame is deduced from the total size of the Block.</li>
<li>Data in frame 1</li>
<li>Data in frame 2</li>
<li>Data in frame 3</li>
</ul>
</section>

<section anchor="fixed-size-lacing"><name>Fixed-size lacing</name>
<t>In this case, only the number of frames in the lace is saved, the size of each frame is deduced
from the total size of the Block. For example, for 3 frames of 800 octets each:</t>

<ul>
<li>Block head (with lacing bits set to 10)</li>
<li>Lacing head: Number of frames in the lace -1 -- i.e. 2</li>
<li>Data in frame 1</li>
<li>Data in frame 2</li>
<li>Data in frame 3</li>
</ul>
</section>

<section anchor="simpleblock-structure"><name>SimpleBlock Structure</name>
<t>The <tt>SimpleBlock</tt> is inspired by the Block structure; see <xref target="block-structure"></xref>.
The main differences are the added Keyframe flag and Discardable flag. Otherwise everything is the same.</t>
<t>Bit 0 is the most significant bit.</t>
<t>Frames using references <bcp14>SHOULD</bcp14> be stored in &quot;coding order&quot;. That means the references first, and then
the frames referencing them. A consequence is that timestamps might not be consecutive.
But a frame with a past timestamp <bcp14>MUST</bcp14> reference a frame already known, otherwise it's considered bad/void.</t>

<section anchor="simpleblock-header"><name>SimpleBlock Header</name>
<table>
<thead>
<tr>
<th align="left">Offset</th>
<th align="left">Player</th>
<th align="left">Description</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">0x00+</td>
<td align="left"><bcp14>MUST</bcp14></td>
<td align="left">Track Number (Track Entry). It is coded in EBML like form (1 octet if the value is &lt; 0x80, 2 if &lt; 0x4000, etc) (most significant bits set to increase the range).</td>
</tr>

<tr>
<td align="left">0x01+</td>
<td align="left"><bcp14>MUST</bcp14></td>
<td align="left">Timestamp (relative to Cluster timestamp, signed int16)</td>
</tr>
</tbody>
</table></section>

<section anchor="simpleblock-header-flags"><name>SimpleBlock Header Flags</name>
<table>
<thead>
<tr>
<th align="left">Offset</th>
<th align="left">Bit</th>
<th align="left">Player</th>
<th align="left">Description</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">0x03+</td>
<td align="left">0</td>
<td align="left">-</td>
<td align="left">Keyframe, set when the Block contains only keyframes</td>
</tr>

<tr>
<td align="left">0x03+</td>
<td align="left">1-3</td>
<td align="left">-</td>
<td align="left">Reserved, set to 0</td>
</tr>

<tr>
<td align="left">0x03+</td>
<td align="left">4</td>
<td align="left">-</td>
<td align="left">Invisible, the codec <bcp14>SHOULD</bcp14> decode this frame but not display it</td>
</tr>

<tr>
<td align="left">0x03+</td>
<td align="left">5-6</td>
<td align="left"><bcp14>MUST</bcp14></td>
<td align="left">Lacing</td>
</tr>

<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left">*   00 : no lacing</td>
</tr>

<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left">*   01 : Xiph lacing</td>
</tr>

<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left">*   11 : EBML lacing</td>
</tr>

<tr>
<td align="left"></td>
<td align="left"></td>
<td align="left"></td>
<td align="left">*   10 : fixed-size lacing</td>
</tr>

<tr>
<td align="left">0x03+</td>
<td align="left">7</td>
<td align="left">-</td>
<td align="left">Discardable, the frames of the Block can be discarded during playing if needed</td>
</tr>
</tbody>
</table></section>
</section>

<section anchor="laced-data"><name>Laced Data</name>
<t>When lacing bit is set.</t>
<table>
<thead>
<tr>
<th align="left">Offset</th>
<th align="left">Player</th>
<th align="left">Description</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">0x00</td>
<td align="left"><bcp14>MUST</bcp14></td>
<td align="left">Number of frames in the lace-1 (uint8)</td>
</tr>

<tr>
<td align="left">0x01 / 0xXX</td>
<td align="left"><bcp14>MUST</bcp14>*</td>
<td align="left">Lace-coded size of each frame of the lace, except for the last one (multiple uint8). *This is not used with Fixed-size lacing as it is calculated automatically from (total size of lace) / (number of frames in lace).</td>
</tr>
</tbody>
</table><t>For (possibly) Laced Data</t>
<table>
<thead>
<tr>
<th align="left">Offset</th>
<th align="left">Player</th>
<th align="left">Description</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">0x00</td>
<td align="left"><bcp14>MUST</bcp14></td>
<td align="left">Consecutive laced frames</td>
</tr>
</tbody>
</table></section>
</section>
</section>
</section>

<section anchor="matroska-structure"><name>Matroska Structure</name>
<t>A Matroska file <bcp14>MUST</bcp14> be composed of at least one <tt>EBML Document</tt> using the <tt>Matroska Document Type</tt>.
Each <tt>EBML Document</tt> <bcp14>MUST</bcp14> start with an <tt>EBML Header</tt> and <bcp14>MUST</bcp14> be followed by the <tt>EBML Root Element</tt>,
defined as <tt>Segment</tt> in Matroska. Matroska defines several <tt>Top Level Elements</tt>
which <bcp14>MAY</bcp14> occur within the <tt>Segment</tt>.</t>
<t>As an example, a simple Matroska file consisting of a single <tt>EBML Document</tt> could be represented like this:</t>

<ul>
<li><tt>EBML Header</tt></li>
<li><tt>Segment</tt></li>
</ul>
<t>A more complex Matroska file consisting of an <tt>EBML Stream</tt> (consisting of two <tt>EBML Documents</tt>) could be represented like this:</t>

<ul>
<li><tt>EBML Header</tt></li>
<li><tt>Segment</tt></li>
<li><tt>EBML Header</tt></li>
<li><tt>Segment</tt></li>
</ul>
<t>The following diagram represents a simple Matroska file, comprised of an <tt>EBML Document</tt>
with an <tt>EBML Header</tt>, a <tt>Segment Element</tt> (the <tt>Root Element</tt>), and all eight Matroska
<tt>Top Level Elements</tt>. In the following diagrams of this section, horizontal spacing expresses
a parent-child relationship between Matroska Elements (e.g., the <tt>Info Element</tt> is contained within
the <tt>Segment Element</tt>) whereas vertical alignment represents the storage order within the file.</t>

<artwork>+-------------+
| EBML Header |
+---------------------------+
| Segment     | SeekHead    |
|             |-------------|
|             | Info        |
|             |-------------|
|             | Tracks      |
|             |-------------|
|             | Chapters    |
|             |-------------|
|             | Cluster     |
|             |-------------|
|             | Cues        |
|             |-------------|
|             | Attachments |
|             |-------------|
|             | Tags        |
+---------------------------+
</artwork>
<t>The Matroska <tt>EBML Schema</tt> defines eight <tt>Top Level Elements</tt>: <tt>SeekHead</tt>, <tt>Info</tt>, <tt>Tracks</tt>,
<tt>Chapters</tt>, <tt>Cluster</tt>, <tt>Cues</tt>, <tt>Attachments</tt>, and <tt>Tags</tt>.</t>
<t>The <tt>SeekHead Element</tt> (also known as <tt>MetaSeek</tt>) contains an index of <tt>Top Level Elements</tt>
locations within the <tt>Segment</tt>. Use of the <tt>SeekHead Element</tt> is <bcp14>RECOMMENDED</bcp14>. Without a <tt>SeekHead Element</tt>,
a Matroska parser would have to search the entire file to find all of the other <tt>Top Level Elements</tt>.
This is due to Matroska's flexible ordering requirements; for instance, it is acceptable for
the <tt>Chapters Element</tt> to be stored after the <tt>Cluster Elements</tt>.</t>
<figure><name>Representation of a <tt>SeekHead Element</tt>.
</name>
<artwork>+--------------------------------+
| SeekHead | Seek | SeekID       |
|          |      |--------------|
|          |      | SeekPosition |
+--------------------------------+
</artwork>
</figure>
<t>The <tt>Info Element</tt> contains vital information for identifying the whole <tt>Segment</tt>.
This includes the title for the <tt>Segment</tt>, a randomly generated unique identifier,
and the unique identifier(s) of any linked <tt>Segment Elements</tt>.</t>
<figure><name>Representation of an <tt>Info Element</tt> and its <tt>Child Elements</tt>.
</name>
<artwork>+-------------------------+
| Info | SegmentUID       |
|      |------------------|
|      | SegmentFilename  |
|      |------------------|
|      | PrevUID          |
|      |------------------|
|      | PrevFilename     |
|      |------------------|
|      | NextUID          |
|      |------------------|
|      | NextFilename     |
|      |------------------|
|      | SegmentFamily    |
|      |------------------|
|      | ChapterTranslate |
|      |------------------|
|      | TimestampScale   |
|      |------------------|
|      | Duration         |
|      |------------------|
|      | DateUTC          |
|      |------------------|
|      | Title            |
|      |------------------|
|      | MuxingApp        |
|      |------------------|
|      | WritingApp       |
|-------------------------|
</artwork>
</figure>
<t>The <tt>Tracks Element</tt> defines the technical details for each track and can store the name,
number, unique identifier, language, and type (audio, video, subtitles, etc.) of each track.
For example, the <tt>Tracks Element</tt> <bcp14>MAY</bcp14> store information about the resolution of a video track
or sample rate of an audio track.</t>
<t>The <tt>Tracks Element</tt> <bcp14>MUST</bcp14> identify all the data needed by the codec to decode the data of the
specified track. However, the data required is contingent on the codec used for the track.
For example, a <tt>Track Element</tt> for uncompressed audio only requires the audio bit rate to be present.
A codec such as AC-3 would require that the <tt>CodecID Element</tt> be present for all tracks,
as it is the primary way to identify which codec to use to decode the track.</t>
<figure><name>Representation of the <tt>Tracks Element</tt> and a selection of its <tt>Descendant Elements</tt>.
</name>
<artwork>+------------------------------------+
| Tracks | TrackEntry | TrackNumber  |
|        |            |--------------|
|        |            | TrackUID     |
|        |            |--------------|
|        |            | TrackType    |
|        |            |--------------|
|        |            | Name         |
|        |            |--------------|
|        |            | Language     |
|        |            |--------------|
|        |            | CodecID      |
|        |            |--------------|
|        |            | CodecPrivate |
|        |            |--------------|
|        |            | CodecName    |
|        |            |----------------------------------+
|        |            | Video        | FlagInterlaced    |
|        |            |              |-------------------|
|        |            |              | FieldOrder        |
|        |            |              |-------------------|
|        |            |              | StereoMode        |
|        |            |              |-------------------|
|        |            |              | AlphaMode         |
|        |            |              |-------------------|
|        |            |              | PixelWidth        |
|        |            |              |-------------------|
|        |            |              | PixelHeight       |
|        |            |              |-------------------|
|        |            |              | DisplayWidth      |
|        |            |              |-------------------|
|        |            |              | DisplayHeight     |
|        |            |              |-------------------|
|        |            |              | AspectRatioType   |
|        |            |              |-------------------|
|        |            |              | Color             |
|        |            |----------------------------------|
|        |            | Audio        | SamplingFrequency |
|        |            |              |-------------------|
|        |            |              | Channels          |
|        |            |              |-------------------|
|        |            |              | BitDepth          |
|--------------------------------------------------------|

</artwork>
</figure>
<t>The <tt>Chapters Element</tt> lists all of the chapters. Chapters are a way to set predefined
points to jump to in video or audio.</t>
<figure><name>Representation of the <tt>Chapters Element</tt> and a selection of its <tt>Descendant Elements</tt>.
</name>
<artwork>+-----------------------------------------+
| Chapters | Edition | EditionUID         |
|          | Entry   |--------------------|
|          |         | EditionFlagHidden  |
|          |         |--------------------|
|          |         | EditionFlagDefault |
|          |         |--------------------|
|          |         | EditionFlagOrdered |
|          |         |---------------------------------+
|          |         | ChapterAtom | ChapterUID        |
|          |         |             |-------------------|
|          |         |             | ChapterStringUID  |
|          |         |             |-------------------|
|          |         |             | ChapterTimeStart  |
|          |         |             |-------------------|
|          |         |             | ChapterTimeEnd    |
|          |         |             |-------------------|
|          |         |             | ChapterFlagHidden |
|          |         |             |-------------------------------+
|          |         |             | ChapterDisplay | ChapString   |
|          |         |             |                |--------------|
|          |         |             |                | ChapLanguage |
+------------------------------------------------------------------+
</artwork>
</figure>
<t><tt>Cluster Elements</tt> contain the content for each track, e.g., video frames. A Matroska file
<bcp14>SHOULD</bcp14> contain at least one <tt>Cluster Element</tt>. The <tt>Cluster Element</tt> helps to break up
<tt>SimpleBlock</tt> or <tt>BlockGroup Elements</tt> and helps with seeking and error protection.
It is <bcp14>RECOMMENDED</bcp14> that the size of each individual <tt>Cluster Element</tt> be limited to store
no more than 5 seconds or 5 megabytes. Every <tt>Cluster Element</tt> <bcp14>MUST</bcp14> contain a <tt>Timestamp Element</tt>.
This <bcp14>SHOULD</bcp14> be the <tt>Timestamp Element</tt> used to play the first <tt>Block</tt> in the <tt>Cluster Element</tt>.
There <bcp14>SHOULD</bcp14> be one or more <tt>BlockGroup</tt> or <tt>SimpleBlock Element</tt> in each <tt>Cluster Element</tt>.
 A <tt>BlockGroup Element</tt> <bcp14>MAY</bcp14> contain a <tt>Block</tt> of data and any information relating directly to that <tt>Block</tt>.</t>
<figure><name>Representation of a <tt>Cluster Element</tt> and its immediate <tt>Child Elements</tt>.
</name>
<artwork>+--------------------------+
| Cluster | Timestamp      |
|         |----------------|
|         | SilentTracks   |
|         |----------------|
|         | Position       |
|         |----------------|
|         | PrevSize       |
|         |----------------|
|         | SimpleBlock    |
|         |----------------|
|         | BlockGroup     |
|         |----------------|
|         | EncryptedBlock |
+--------------------------+
</artwork>
</figure>
<figure><name>Representation of the <tt>Block Element</tt> structure.
</name>
<artwork>+----------------------------------+
| Block | Portion of | Data Type   |
|       | a Block    |  - Bit Flag |
|       |--------------------------+
|       | Header     | TrackNumber |
|       |            |-------------|
|       |            | Timestamp   |
|       |            |-------------|
|       |            | Flags       |
|       |            |  - Gap      |
|       |            |  - Lacing   |
|       |            |  - Reserved |
|       |--------------------------|
|       | Optional   | FrameSize   |
|       |--------------------------|
|       | Data       | Frame       |
+----------------------------------+
</artwork>
</figure>
<t>Each <tt>Cluster</tt> <bcp14>MUST</bcp14> contain exactly one <tt>Timestamp Element</tt>. The <tt>Timestamp Element</tt> value <bcp14>MUST</bcp14>
be stored once per <tt>Cluster</tt>. The <tt>Timestamp Element</tt> in the <tt>Cluster</tt> is relative to the entire <tt>Segment</tt>.
The <tt>Timestamp Element</tt> <bcp14>SHOULD</bcp14> be the first <tt>Element</tt> in the <tt>Cluster</tt>.</t>
<t>Additionally, the <tt>Block</tt> contains an offset that, when added to the <tt>Cluster</tt>'s <tt>Timestamp Element</tt> value,
yields the <tt>Block</tt>'s effective timestamp. Therefore, timestamp in the <tt>Block</tt> itself is relative to
the <tt>Timestamp Element</tt> in the <tt>Cluster</tt>. For example, if the <tt>Timestamp Element</tt> in the <tt>Cluster</tt>
is set to 10 seconds and a <tt>Block</tt> in that <tt>Cluster</tt> is supposed to be played 12 seconds into the clip,
the timestamp in the <tt>Block</tt> would be set to 2 seconds.</t>
<t>The <tt>ReferenceBlock</tt> in the <tt>BlockGroup</tt> is used instead of the basic &quot;P-frame&quot;/&quot;B-frame&quot; description.
Instead of simply saying that this <tt>Block</tt> depends on the <tt>Block</tt> directly before, or directly afterwards,
the <tt>Timestamp</tt> of the necessary <tt>Block</tt> is used. Because there can be as many <tt>ReferenceBlock Elements</tt>
as necessary for a <tt>Block</tt>, it allows for some extremely complex referencing.</t>
<t>The <tt>Cues Element</tt> is used to seek when playing back a file by providing a temporal index
for some of the <tt>Tracks</tt>. It is similar to the <tt>SeekHead Element</tt>, but used for seeking to
a specific time when playing back the file. It is possible to seek without this element,
but it is much more difficult because a <tt>Matroska Reader</tt> would have to 'hunt and peck'
through the file looking for the correct timestamp.</t>
<t>The <tt>Cues Element</tt> <bcp14>SHOULD</bcp14> contain at least one <tt>CuePoint Element</tt>. Each <tt>CuePoint Element</tt>
stores the position of the <tt>Cluster</tt> that contains the <tt>BlockGroup</tt> or <tt>SimpleBlock Element</tt>.
The timestamp is stored in the <tt>CueTime Element</tt> and location is stored in the <tt>CueTrackPositions Element</tt>.</t>
<t>The <tt>Cues Element</tt> is flexible. For instance, <tt>Cues Element</tt> can be used to index every
single timestamp of every <tt>Block</tt> or they can be indexed selectively. For video files,
it is <bcp14>RECOMMENDED</bcp14> to index at least the keyframes of the video track.</t>
<figure><name>Representation of a <tt>Cues Element</tt> and two levels of its <tt>Descendant Elements</tt>.
</name>
<artwork>+-------------------------------------+
| Cues | CuePoint | CueTime           |
|      |          |-------------------|
|      |          | CueTrackPositions |
|      |------------------------------|
|      | CuePoint | CueTime           |
|      |          |-------------------|
|      |          | CueTrackPositions |
+-------------------------------------+
</artwork>
</figure>
<t>The <tt>Attachments Element</tt> is for attaching files to a Matroska file such as pictures,
webpages, programs, or even the codec needed to play back the file.</t>
<figure><name>Representation of a <tt>Attachments Element</tt>.
</name>
<artwork>+------------------------------------------------+
| Attachments | AttachedFile | FileDescription   |
|             |              |-------------------|
|             |              | FileName          |
|             |              |-------------------|
|             |              | FileMimeType      |
|             |              |-------------------|
|             |              | FileData          |
|             |              |-------------------|
|             |              | FileUID           |
|             |              |-------------------|
|             |              | FileName          |
|             |              |-------------------|
|             |              | FileReferral      |
|             |              |-------------------|
|             |              | FileUsedStartTime |
|             |              |-------------------|
|             |              | FileUsedEndTime   |
+------------------------------------------------+
</artwork>
</figure>
<t>The <tt>Tags Element</tt> contains metadata that describes the <tt>Segment</tt> and potentially
its <tt>Tracks</tt>, <tt>Chapters</tt>, and <tt>Attachments</tt>. Each <tt>Track</tt> or <tt>Chapter</tt> that those tags
applies to has its UID listed in the <tt>Tags</tt>. The <tt>Tags</tt> contain all extra information about
the file: scriptwriter, singer, actors, directors, titles, edition, price, dates, genre, comments,
etc. Tags can contain their values in multiple languages. For example, a movie's &quot;title&quot; <tt>Tag</tt>
might contain both the original English title as well as the title it was released as in Germany.</t>
<figure><name>Representation of a <tt>Tags Element</tt> and three levels of its <tt>Children Elements</tt>.
</name>
<artwork>+-------------------------------------------+
| Tags | Tag | Targets   | TargetTypeValue  |
|      |     |           |------------------|
|      |     |           | TargetType       |
|      |     |           |------------------|
|      |     |           | TagTrackUID      |
|      |     |           |------------------|
|      |     |           | TagEditionUID    |
|      |     |           |------------------|
|      |     |           | TagChapterUID    |
|      |     |           |------------------|
|      |     |           | TagAttachmentUID |
|      |     |------------------------------|
|      |     | SimpleTag | TagName          |
|      |     |           |------------------|
|      |     |           | TagLanguage      |
|      |     |           |------------------|
|      |     |           | TagDefault       |
|      |     |           |------------------|
|      |     |           | TagString        |
|      |     |           |------------------|
|      |     |           | TagBinary        |
|      |     |           |------------------|
|      |     |           | SimpleTag        |
+-------------------------------------------+
</artwork>
</figure>
</section>

<section anchor="matroska-additions-to-schema-element-attributes"><name>Matroska Additions to Schema Element Attributes</name>
<t>In addition to the EBML Schema definition provided by the EBML Specification,
Matroska adds the following additional attributes:</t>
<table>
<thead>
<tr>
<th align="left">attribute name</th>
<th align="left">required</th>
<th align="left">definition</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">webm</td>
<td align="left">No</td>
<td align="left">A boolean to express if the Matroska Element is also supported within version 2 of the <tt>webm</tt> specification. Please consider the <eref target="http://www.webmproject.org/docs/container/">webm specification</eref> as the authoritative on <tt>webm</tt>.</td>
</tr>
</tbody>
</table></section>

<section anchor="matroska-schema"><name>Matroska Schema</name>
<t>This specification includes an <tt>EBML Schema</tt>, which defines the Elements and structure
of Matroska as an EBML Document Type. The EBML Schema defines every valid
Matroska element in a manner defined by the EBML specification.</t>
<t>Here the definition of each Matroska Element is provided.</t>

<section anchor="ebmlmaxidlength-element"><name>EBMLMaxIDLength Element</name>

<dl>
<dt>name:</dt>
<dd>EBMLMaxIDLength</dd>
<dt>path:</dt>
<dd><tt>\EBML\EBMLMaxIDLength</tt></dd>
<dt>id:</dt>
<dd>0x42F2</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>4</dd>
<dt>default:</dt>
<dd>4</dd>
<dt>type:</dt>
<dd>uinteger</dd>
</dl>
</section>

<section anchor="ebmlmaxsizelength-element"><name>EBMLMaxSizeLength Element</name>

<dl>
<dt>name:</dt>
<dd>EBMLMaxSizeLength</dd>
<dt>path:</dt>
<dd><tt>\EBML\EBMLMaxSizeLength</tt></dd>
<dt>id:</dt>
<dd>0x42F3</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>1-8</dd>
<dt>default:</dt>
<dd>8</dd>
<dt>type:</dt>
<dd>uinteger</dd>
</dl>
</section>
</section>

<section anchor="segment-element"><name>Segment Element</name>

<dl>
<dt>name:</dt>
<dd>Segment</dd>
<dt>path:</dt>
<dd><tt>\Segment</tt></dd>
<dt>id:</dt>
<dd>0x18538067</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>unknownsizeallowed:</dt>
<dd>1</dd>
<dt>definition:</dt>
<dd>The Root Element that contains all other Top-Level Elements (Elements defined only at Level 1).
A Matroska file is composed of 1 Segment.</dd>
</dl>

<section anchor="seekhead-element"><name>SeekHead Element</name>

<dl>
<dt>name:</dt>
<dd>SeekHead</dd>
<dt>path:</dt>
<dd><tt>\Segment\SeekHead</tt></dd>
<dt>id:</dt>
<dd>0x114D9B74</dd>
<dt>maxOccurs:</dt>
<dd>2</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Contains the Segment Position of other Top-Level Elements.</dd>
</dl>

<section anchor="seek-element"><name>Seek Element</name>

<dl>
<dt>name:</dt>
<dd>Seek</dd>
<dt>path:</dt>
<dd><tt>\Segment\SeekHead\Seek</tt></dd>
<dt>id:</dt>
<dd>0x4DBB</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Contains a single seek entry to an EBML Element.</dd>
</dl>

<section anchor="seekid-element"><name>SeekID Element</name>

<dl>
<dt>name:</dt>
<dd>SeekID</dd>
<dt>path:</dt>
<dd><tt>\Segment\SeekHead\Seek\SeekID</tt></dd>
<dt>id:</dt>
<dd>0x53AB</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>The binary ID corresponding to the Element name.</dd>
</dl>
</section>

<section anchor="seekposition-element"><name>SeekPosition Element</name>

<dl>
<dt>name:</dt>
<dd>SeekPosition</dd>
<dt>path:</dt>
<dd><tt>\Segment\SeekHead\Seek\SeekPosition</tt></dd>
<dt>id:</dt>
<dd>0x53AC</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The Segment Position of the Element.</dd>
</dl>
</section>
</section>
</section>

<section anchor="info-element"><name>Info Element</name>

<dl>
<dt>name:</dt>
<dd>Info</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info</tt></dd>
<dt>id:</dt>
<dd>0x1549A966</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>recurring:</dt>
<dd>1</dd>
<dt>definition:</dt>
<dd>Contains general information about the Segment.</dd>
</dl>

<section anchor="segmentuid-element"><name>SegmentUID Element</name>

<dl>
<dt>name:</dt>
<dd>SegmentUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\SegmentUID</tt></dd>
<dt>id:</dt>
<dd>0x73A4</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>A randomly generated unique ID to identify the Segment amongst many others (128 bits).</dd>
<dt>usage notes:</dt>
<dd>If the Segment is a part of a Linked Segment, then this Element is <bcp14>REQUIRED</bcp14>.</dd>
</dl>
</section>

<section anchor="segmentfilename-element"><name>SegmentFilename Element</name>

<dl>
<dt>name:</dt>
<dd>SegmentFilename</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\SegmentFilename</tt></dd>
<dt>id:</dt>
<dd>0x7384</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>A filename corresponding to this Segment.</dd>
</dl>
</section>

<section anchor="prevuid-element"><name>PrevUID Element</name>

<dl>
<dt>name:</dt>
<dd>PrevUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\PrevUID</tt></dd>
<dt>id:</dt>
<dd>0x3CB923</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>A unique ID to identify the previous Segment of a Linked Segment (128 bits).</dd>
<dt>usage notes:</dt>
<dd>If the Segment is a part of a Linked Segment that uses Hard Linking,
then either the PrevUID or the NextUID Element is <bcp14>REQUIRED</bcp14>. If a Segment contains a PrevUID but not a NextUID,
then it <bcp14>MAY</bcp14> be considered as the last Segment of the Linked Segment. The PrevUID <bcp14>MUST NOT</bcp14> be equal to the SegmentUID.</dd>
</dl>
</section>

<section anchor="prevfilename-element"><name>PrevFilename Element</name>

<dl>
<dt>name:</dt>
<dd>PrevFilename</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\PrevFilename</tt></dd>
<dt>id:</dt>
<dd>0x3C83AB</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>A filename corresponding to the file of the previous Linked Segment.</dd>
<dt>usage notes:</dt>
<dd>Provision of the previous filename is for display convenience,
but PrevUID <bcp14>SHOULD</bcp14> be considered authoritative for identifying the previous Segment in a Linked Segment.</dd>
</dl>
</section>

<section anchor="nextuid-element"><name>NextUID Element</name>

<dl>
<dt>name:</dt>
<dd>NextUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\NextUID</tt></dd>
<dt>id:</dt>
<dd>0x3EB923</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>A unique ID to identify the next Segment of a Linked Segment (128 bits).</dd>
<dt>usage notes:</dt>
<dd>If the Segment is a part of a Linked Segment that uses Hard Linking,
then either the PrevUID or the NextUID Element is <bcp14>REQUIRED</bcp14>. If a Segment contains a NextUID but not a PrevUID,
then it <bcp14>MAY</bcp14> be considered as the first Segment of the Linked Segment. The NextUID <bcp14>MUST NOT</bcp14> be equal to the SegmentUID.</dd>
</dl>
</section>

<section anchor="nextfilename-element"><name>NextFilename Element</name>

<dl>
<dt>name:</dt>
<dd>NextFilename</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\NextFilename</tt></dd>
<dt>id:</dt>
<dd>0x3E83BB</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>A filename corresponding to the file of the next Linked Segment.</dd>
<dt>usage notes:</dt>
<dd>Provision of the next filename is for display convenience,
but NextUID <bcp14>SHOULD</bcp14> be considered authoritative for identifying the Next Segment.</dd>
</dl>
</section>

<section anchor="segmentfamily-element"><name>SegmentFamily Element</name>

<dl>
<dt>name:</dt>
<dd>SegmentFamily</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\SegmentFamily</tt></dd>
<dt>id:</dt>
<dd>0x4444</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>A randomly generated unique ID that all Segments of a Linked Segment <bcp14>MUST</bcp14> share (128 bits).</dd>
<dt>usage notes:</dt>
<dd>If the Segment is a part of a Linked Segment that uses Soft Linking, then this Element is <bcp14>REQUIRED</bcp14>.</dd>
</dl>
</section>

<section anchor="chaptertranslate-element"><name>ChapterTranslate Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterTranslate</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\ChapterTranslate</tt></dd>
<dt>id:</dt>
<dd>0x6924</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>A tuple of corresponding ID used by chapter codecs to represent this Segment.</dd>
</dl>

<section anchor="chaptertranslateeditionuid-element"><name>ChapterTranslateEditionUID Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterTranslateEditionUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\ChapterTranslate\ChapterTranslateEditionUID</tt></dd>
<dt>id:</dt>
<dd>0x69FC</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Specify an edition UID on which this correspondence applies.
When not specified, it means for all editions found in the Segment.</dd>
</dl>
</section>

<section anchor="chaptertranslatecodec-element"><name>ChapterTranslateCodec Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterTranslateCodec</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\ChapterTranslate\ChapterTranslateCodec</tt></dd>
<dt>id:</dt>
<dd>0x69BF</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The chapter codec; see <xref target="chapprocesscodecid-element"></xref>.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">Matroska Script</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">DVD-menu</td>
</tr>
</tbody>
</table></section>

<section anchor="chaptertranslateid-element"><name>ChapterTranslateID Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterTranslateID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\ChapterTranslate\ChapterTranslateID</tt></dd>
<dt>id:</dt>
<dd>0x69A5</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>The binary value used to represent this Segment in the chapter codec data.
The format depends on the ChapProcessCodecID used; see <xref target="chapprocesscodecid-element"></xref>.</dd>
</dl>
</section>
</section>

<section anchor="timestampscale-element"><name>TimestampScale Element</name>

<dl>
<dt>name:</dt>
<dd>TimestampScale</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\TimestampScale</tt></dd>
<dt>id:</dt>
<dd>0x2AD7B1</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>default:</dt>
<dd>1000000</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Timestamp scale in nanoseconds (1.000.000 means all timestamps in the Segment are expressed in milliseconds).</dd>
</dl>
</section>

<section anchor="duration-element"><name>Duration Element</name>

<dl>
<dt>name:</dt>
<dd>Duration</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\Duration</tt></dd>
<dt>id:</dt>
<dd>0x4489</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>&gt; 0x0p+0</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>definition:</dt>
<dd>Duration of the Segment in nanoseconds based on TimestampScale.</dd>
</dl>
</section>

<section anchor="dateutc-element"><name>DateUTC Element</name>

<dl>
<dt>name:</dt>
<dd>DateUTC</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\DateUTC</tt></dd>
<dt>id:</dt>
<dd>0x4461</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>date</dd>
<dt>definition:</dt>
<dd>The date and time that the Segment was created by the muxing application or library.</dd>
</dl>
</section>

<section anchor="title-element"><name>Title Element</name>

<dl>
<dt>name:</dt>
<dd>Title</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\Title</tt></dd>
<dt>id:</dt>
<dd>0x7BA9</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>General name of the Segment.</dd>
</dl>
</section>

<section anchor="muxingapp-element"><name>MuxingApp Element</name>

<dl>
<dt>name:</dt>
<dd>MuxingApp</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\MuxingApp</tt></dd>
<dt>id:</dt>
<dd>0x4D80</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>Muxing application or library (example: &quot;libmatroska-0.4.3&quot;).</dd>
<dt>usage notes:</dt>
<dd>Include the full name of the application or library followed by the version number.</dd>
</dl>
</section>

<section anchor="writingapp-element"><name>WritingApp Element</name>

<dl>
<dt>name:</dt>
<dd>WritingApp</dd>
<dt>path:</dt>
<dd><tt>\Segment\Info\WritingApp</tt></dd>
<dt>id:</dt>
<dd>0x5741</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>Writing application (example: &quot;mkvmerge-0.3.3&quot;).</dd>
<dt>usage notes:</dt>
<dd>Include the full name of the application followed by the version number.</dd>
</dl>
</section>
</section>

<section anchor="cluster-element"><name>Cluster Element</name>

<dl>
<dt>name:</dt>
<dd>Cluster</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster</tt></dd>
<dt>id:</dt>
<dd>0x1F43B675</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>unknownsizeallowed:</dt>
<dd>1</dd>
<dt>definition:</dt>
<dd>The Top-Level Element containing the (monolithic) Block structure.</dd>
</dl>

<section anchor="timestamp-element"><name>Timestamp Element</name>

<dl>
<dt>name:</dt>
<dd>Timestamp</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\Timestamp</tt></dd>
<dt>id:</dt>
<dd>0xE7</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Absolute timestamp of the cluster (based on TimestampScale).</dd>
</dl>
</section>

<section anchor="silenttracks-element"><name>SilentTracks Element</name>

<dl>
<dt>name:</dt>
<dd>SilentTracks</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\SilentTracks</tt></dd>
<dt>id:</dt>
<dd>0x5854</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>The list of tracks that are not used in that part of the stream.
It is useful when using overlay tracks on seeking or to decide what track to use.</dd>
</dl>

<section anchor="silenttracknumber-element"><name>SilentTrackNumber Element</name>

<dl>
<dt>name:</dt>
<dd>SilentTrackNumber</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\SilentTracks\SilentTrackNumber</tt></dd>
<dt>id:</dt>
<dd>0x58D7</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>One of the track number that are not used from now on in the stream.
It could change later if not specified as silent in a further Cluster.</dd>
</dl>
</section>
</section>

<section anchor="position-element"><name>Position Element</name>

<dl>
<dt>name:</dt>
<dd>Position</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\Position</tt></dd>
<dt>id:</dt>
<dd>0xA7</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The Segment Position of the Cluster in the Segment (0 in live streams).
It might help to resynchronise offset on damaged streams.</dd>
</dl>
</section>

<section anchor="prevsize-element"><name>PrevSize Element</name>

<dl>
<dt>name:</dt>
<dd>PrevSize</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\PrevSize</tt></dd>
<dt>id:</dt>
<dd>0xAB</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Size of the previous Cluster, in octets. Can be useful for backward playing.</dd>
</dl>
</section>

<section anchor="simpleblock-element"><name>SimpleBlock Element</name>

<dl>
<dt>name:</dt>
<dd>SimpleBlock</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\SimpleBlock</tt></dd>
<dt>id:</dt>
<dd>0xA3</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>minver:</dt>
<dd>2</dd>
<dt>definition:</dt>
<dd>Similar to Block, see <xref target="block-structure"></xref>, but without all the extra information,
mostly used to reduced overhead when no extra feature is needed; see <xref target="simpleblock-structure"></xref> on SimpleBlock Structure.</dd>
</dl>
</section>

<section anchor="blockgroup-element"><name>BlockGroup Element</name>

<dl>
<dt>name:</dt>
<dd>BlockGroup</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup</tt></dd>
<dt>id:</dt>
<dd>0xA0</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Basic container of information containing a single Block and information specific to that Block.</dd>
</dl>

<section anchor="block-element"><name>Block Element</name>

<dl>
<dt>name:</dt>
<dd>Block</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\Block</tt></dd>
<dt>id:</dt>
<dd>0xA1</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>Block containing the actual data to be rendered and a timestamp relative to the Cluster Timestamp;
see <xref target="block-structure"></xref> on Block Structure.</dd>
</dl>
</section>

<section anchor="blockvirtual-element"><name>BlockVirtual Element</name>

<dl>
<dt>name:</dt>
<dd>BlockVirtual</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\BlockVirtual</tt></dd>
<dt>id:</dt>
<dd>0xA2</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>A Block with no data. It <bcp14>MUST</bcp14> be stored in the stream at the place the real Block would be in display order.</dd>
</dl>
</section>

<section anchor="blockadditions-element"><name>BlockAdditions Element</name>

<dl>
<dt>name:</dt>
<dd>BlockAdditions</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\BlockAdditions</tt></dd>
<dt>id:</dt>
<dd>0x75A1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Contain additional blocks to complete the main one.
An EBML parser that has no knowledge of the Block structure could still see and use/skip these data.</dd>
</dl>

<section anchor="blockmore-element"><name>BlockMore Element</name>

<dl>
<dt>name:</dt>
<dd>BlockMore</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore</tt></dd>
<dt>id:</dt>
<dd>0xA6</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Contain the BlockAdditional and some parameters.</dd>
</dl>

<section anchor="blockaddid-element"><name>BlockAddID Element</name>

<dl>
<dt>name:</dt>
<dd>BlockAddID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\BlockAddID</tt></dd>
<dt>id:</dt>
<dd>0xEE</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>default:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>An ID to identify the BlockAdditional level.
If BlockAddIDType of the corresponding block is 0, this value is also the value of BlockAddIDType for the meaning of the content of BlockAdditional.</dd>
</dl>
</section>

<section anchor="blockadditional-element"><name>BlockAdditional Element</name>

<dl>
<dt>name:</dt>
<dd>BlockAdditional</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\BlockAdditional</tt></dd>
<dt>id:</dt>
<dd>0xA5</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>Interpreted by the codec as it wishes (using the BlockAddID).</dd>
</dl>
</section>
</section>
</section>

<section anchor="blockduration-element"><name>BlockDuration Element</name>

<dl>
<dt>name:</dt>
<dd>BlockDuration</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\BlockDuration</tt></dd>
<dt>id:</dt>
<dd>0x9B</dd>
</dl>
<t>minOccurs: see implementation notes</t>

<dl>
<dt>maxOccurs:</dt>
<dd>1</dd>
</dl>
<t>default: see implementation notes</t>

<dl>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The duration of the Block (based on TimestampScale).
The BlockDuration Element can be useful at the end of a Track to define the duration of the last frame (as there is no subsequent Block available),
or when there is a break in a track like for subtitle tracks.</dd>
</dl>
<t>implementation notes:</t>
<table>
<thead>
<tr>
<th align="left">attribute</th>
<th align="left">note</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">minOccurs</td>
<td align="left">BlockDuration <bcp14>MUST</bcp14> be set (minOccurs=1) if the associated TrackEntry stores a DefaultDuration value.</td>
</tr>

<tr>
<td align="left">default</td>
<td align="left">When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp</td>
</tr>

<tr>
<td align="left">of this Block and the timestamp of the next Block in &quot;display&quot; order (not coding order).</td>
<td align="left"></td>
</tr>
</tbody>
</table></section>

<section anchor="referencepriority-element"><name>ReferencePriority Element</name>

<dl>
<dt>name:</dt>
<dd>ReferencePriority</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\ReferencePriority</tt></dd>
<dt>id:</dt>
<dd>0xFA</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>This frame is referenced and has the specified cache priority.
In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced.</dd>
</dl>
</section>

<section anchor="referenceblock-element"><name>ReferenceBlock Element</name>

<dl>
<dt>name:</dt>
<dd>ReferenceBlock</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\ReferenceBlock</tt></dd>
<dt>id:</dt>
<dd>0xFB</dd>
<dt>type:</dt>
<dd>integer</dd>
<dt>definition:</dt>
<dd>Timestamp of another frame used as a reference (ie: B or P frame).
The timestamp is relative to the block it's attached to.</dd>
</dl>
</section>

<section anchor="referencevirtual-element"><name>ReferenceVirtual Element</name>

<dl>
<dt>name:</dt>
<dd>ReferenceVirtual</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\ReferenceVirtual</tt></dd>
<dt>id:</dt>
<dd>0xFD</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>integer</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>The Segment Position of the data that would otherwise be in position of the virtual block.</dd>
</dl>
</section>

<section anchor="codecstate-element"><name>CodecState Element</name>

<dl>
<dt>name:</dt>
<dd>CodecState</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\CodecState</tt></dd>
<dt>id:</dt>
<dd>0xA4</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>minver:</dt>
<dd>2</dd>
<dt>definition:</dt>
<dd>The new codec state to use. Data interpretation is private to the codec.
This information <bcp14>SHOULD</bcp14> always be referenced by a seek entry.</dd>
</dl>
</section>

<section anchor="discardpadding-element"><name>DiscardPadding Element</name>

<dl>
<dt>name:</dt>
<dd>DiscardPadding</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\DiscardPadding</tt></dd>
<dt>id:</dt>
<dd>0x75A2</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>integer</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Duration in nanoseconds of the silent data added to the Block
(padding at the end of the Block for positive value, at the beginning of the Block for negative value).
The duration of DiscardPadding is not calculated in the duration of the TrackEntry and <bcp14>SHOULD</bcp14> be discarded during playback.</dd>
</dl>
</section>

<section anchor="slices-element"><name>Slices Element</name>

<dl>
<dt>name:</dt>
<dd>Slices</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\Slices</tt></dd>
<dt>id:</dt>
<dd>0x8E</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Contains slices description.</dd>
</dl>

<section anchor="timeslice-element"><name>TimeSlice Element</name>

<dl>
<dt>name:</dt>
<dd>TimeSlice</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\Slices\TimeSlice</tt></dd>
<dt>id:</dt>
<dd>0xE8</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>maxver:</dt>
<dd>1</dd>
<dt>definition:</dt>
<dd>Contains extra time information about the data contained in the Block.
Being able to interpret this Element is not <bcp14>REQUIRED</bcp14> for playback.</dd>
</dl>

<section anchor="lacenumber-element"><name>LaceNumber Element</name>

<dl>
<dt>name:</dt>
<dd>LaceNumber</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\Slices\TimeSlice\LaceNumber</tt></dd>
<dt>id:</dt>
<dd>0xCC</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>maxver:</dt>
<dd>1</dd>
<dt>definition:</dt>
<dd>The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc).
Being able to interpret this Element is not <bcp14>REQUIRED</bcp14> for playback.</dd>
</dl>
</section>

<section anchor="framenumber-element"><name>FrameNumber Element</name>

<dl>
<dt>name:</dt>
<dd>FrameNumber</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\Slices\TimeSlice\FrameNumber</tt></dd>
<dt>id:</dt>
<dd>0xCD</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>The number of the frame to generate from this lace with this delay
(allow you to generate many frames from the same Block/Frame).</dd>
</dl>
</section>

<section anchor="blockadditionid-element"><name>BlockAdditionID Element</name>

<dl>
<dt>name:</dt>
<dd>BlockAdditionID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\Slices\TimeSlice\BlockAdditionID</tt></dd>
<dt>id:</dt>
<dd>0xCB</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>The ID of the BlockAdditional Element (0 is the main Block).</dd>
</dl>
</section>

<section anchor="delay-element"><name>Delay Element</name>

<dl>
<dt>name:</dt>
<dd>Delay</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\Slices\TimeSlice\Delay</tt></dd>
<dt>id:</dt>
<dd>0xCE</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>The (scaled) delay to apply to the Element.</dd>
</dl>
</section>

<section anchor="sliceduration-element"><name>SliceDuration Element</name>

<dl>
<dt>name:</dt>
<dd>SliceDuration</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\Slices\TimeSlice\SliceDuration</tt></dd>
<dt>id:</dt>
<dd>0xCF</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>The (scaled) duration to apply to the Element.</dd>
</dl>
</section>
</section>
</section>

<section anchor="referenceframe-element"><name>ReferenceFrame Element</name>

<dl>
<dt>name:</dt>
<dd>ReferenceFrame</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\ReferenceFrame</tt></dd>
<dt>id:</dt>
<dd>0xC8</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>
  DivX trick track extensions</dd>
</dl>

<section anchor="referenceoffset-element"><name>ReferenceOffset Element</name>

<dl>
<dt>name:</dt>
<dd>ReferenceOffset</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceOffset</tt></dd>
<dt>id:</dt>
<dd>0xC9</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>
  DivX trick track extensions</dd>
</dl>
</section>

<section anchor="referencetimestamp-element"><name>ReferenceTimestamp Element</name>

<dl>
<dt>name:</dt>
<dd>ReferenceTimestamp</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceTimestamp</tt></dd>
<dt>id:</dt>
<dd>0xCA</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>
  DivX trick track extensions</dd>
</dl>
</section>
</section>
</section>

<section anchor="encryptedblock-element"><name>EncryptedBlock Element</name>

<dl>
<dt>name:</dt>
<dd>EncryptedBlock</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cluster\EncryptedBlock</tt></dd>
<dt>id:</dt>
<dd>0xAF</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>Similar to SimpleBlock, see <xref target="simpleblock-structure"></xref>,
but the data inside the Block are Transformed (encrypt and/or signed).</dd>
</dl>
</section>
</section>

<section anchor="tracks-element"><name>Tracks Element</name>

<dl>
<dt>name:</dt>
<dd>Tracks</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks</tt></dd>
<dt>id:</dt>
<dd>0x1654AE6B</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>recurring:</dt>
<dd>1</dd>
<dt>definition:</dt>
<dd>A Top-Level Element of information with many tracks described.</dd>
</dl>

<section anchor="trackentry-element"><name>TrackEntry Element</name>

<dl>
<dt>name:</dt>
<dd>TrackEntry</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry</tt></dd>
<dt>id:</dt>
<dd>0xAE</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Describes a track with all Elements.</dd>
</dl>

<section anchor="tracknumber-element"><name>TrackNumber Element</name>

<dl>
<dt>name:</dt>
<dd>TrackNumber</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackNumber</tt></dd>
<dt>id:</dt>
<dd>0xD7</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The track number as used in the Block Header (using more than 127 tracks is not encouraged,
though the design allows an unlimited number).</dd>
</dl>
</section>

<section anchor="trackuid-element"><name>TrackUID Element</name>

<dl>
<dt>name:</dt>
<dd>TrackUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackUID</tt></dd>
<dt>id:</dt>
<dd>0x73C5</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>A unique ID to identify the Track.
This <bcp14>SHOULD</bcp14> be kept the same when making a direct stream copy of the Track to another file.</dd>
</dl>
</section>

<section anchor="tracktype-element"><name>TrackType Element</name>

<dl>
<dt>name:</dt>
<dd>TrackType</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackType</tt></dd>
<dt>id:</dt>
<dd>0x83</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>1-254</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>A set of track types coded on 8 bits.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>1</tt></td>
<td align="left">video</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">audio</td>
</tr>

<tr>
<td align="left"><tt>3</tt></td>
<td align="left">complex</td>
</tr>

<tr>
<td align="left"><tt>16</tt></td>
<td align="left">logo</td>
</tr>

<tr>
<td align="left"><tt>17</tt></td>
<td align="left">subtitle</td>
</tr>

<tr>
<td align="left"><tt>18</tt></td>
<td align="left">buttons</td>
</tr>

<tr>
<td align="left"><tt>32</tt></td>
<td align="left">control</td>
</tr>

<tr>
<td align="left"><tt>33</tt></td>
<td align="left">metadata</td>
</tr>
</tbody>
</table></section>

<section anchor="flagenabled-element"><name>FlagEnabled Element</name>

<dl>
<dt>name:</dt>
<dd>FlagEnabled</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\FlagEnabled</tt></dd>
<dt>id:</dt>
<dd>0xB9</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>default:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>2</dd>
<dt>definition:</dt>
<dd>Set if the track is usable. (1 bit)</dd>
</dl>
</section>

<section anchor="flagdefault-element"><name>FlagDefault Element</name>

<dl>
<dt>name:</dt>
<dd>FlagDefault</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\FlagDefault</tt></dd>
<dt>id:</dt>
<dd>0x88</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>default:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Set if that track (audio, video or subs) <bcp14>SHOULD</bcp14> be active if no language found matches the user preference. (1 bit)</dd>
</dl>
</section>

<section anchor="flagforced-element"><name>FlagForced Element</name>

<dl>
<dt>name:</dt>
<dd>FlagForced</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\FlagForced</tt></dd>
<dt>id:</dt>
<dd>0x55AA</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Set if that track <bcp14>MUST</bcp14> be active during playback. There can be many forced track for a kind (audio, video or subs),
the player <bcp14>SHOULD</bcp14> select the one which language matches the user preference or the default + forced track.
Overlay <bcp14>MAY</bcp14> happen between a forced and non-forced track of the same kind. (1 bit)</dd>
</dl>
</section>

<section anchor="flaglacing-element"><name>FlagLacing Element</name>

<dl>
<dt>name:</dt>
<dd>FlagLacing</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\FlagLacing</tt></dd>
<dt>id:</dt>
<dd>0x9C</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>default:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Set if the track <bcp14>MAY</bcp14> contain blocks using lacing. (1 bit)</dd>
</dl>
</section>

<section anchor="mincache-element"><name>MinCache Element</name>

<dl>
<dt>name:</dt>
<dd>MinCache</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\MinCache</tt></dd>
<dt>id:</dt>
<dd>0x6DE7</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The minimum number of frames a player <bcp14>SHOULD</bcp14> be able to cache during playback.
If set to 0, the reference pseudo-cache system is not used.</dd>
</dl>
</section>

<section anchor="maxcache-element"><name>MaxCache Element</name>

<dl>
<dt>name:</dt>
<dd>MaxCache</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\MaxCache</tt></dd>
<dt>id:</dt>
<dd>0x6DF8</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The maximum cache size necessary to store referenced frames in and the current frame.
0 means no cache is needed.</dd>
</dl>
</section>

<section anchor="defaultduration-element"><name>DefaultDuration Element</name>

<dl>
<dt>name:</dt>
<dd>DefaultDuration</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\DefaultDuration</tt></dd>
<dt>id:</dt>
<dd>0x23E383</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Number of nanoseconds (not scaled via TimestampScale) per frame
(frame in the Matroska sense -- one Element put into a (Simple)Block).</dd>
</dl>
</section>

<section anchor="defaultdecodedfieldduration-element"><name>DefaultDecodedFieldDuration Element</name>

<dl>
<dt>name:</dt>
<dd>DefaultDecodedFieldDuration</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\DefaultDecodedFieldDuration</tt></dd>
<dt>id:</dt>
<dd>0x234E7A</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>The period in nanoseconds (not scaled by TimestampScale) between two successive fields at the output of the decoding process,
see <xref target="defaultdecodedfieldduration"></xref> for more information</dd>
</dl>
</section>

<section anchor="tracktimestampscale-element"><name>TrackTimestampScale Element</name>

<dl>
<dt>name:</dt>
<dd>TrackTimestampScale</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackTimestampScale</tt></dd>
<dt>id:</dt>
<dd>0x23314F</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>&gt; 0x0p+0</dd>
<dt>default:</dt>
<dd>0x1p+0</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>maxver:</dt>
<dd>3</dd>
<dt>definition:</dt>
<dd>DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks
(mostly used to adjust video speed when the audio length differs).</dd>
</dl>
</section>

<section anchor="trackoffset-element"><name>TrackOffset Element</name>

<dl>
<dt>name:</dt>
<dd>TrackOffset</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackOffset</tt></dd>
<dt>id:</dt>
<dd>0x537F</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>integer</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>A value to add to the Block's Timestamp.
This can be used to adjust the playback offset of a track.</dd>
</dl>
</section>

<section anchor="maxblockadditionid-element"><name>MaxBlockAdditionID Element</name>

<dl>
<dt>name:</dt>
<dd>MaxBlockAdditionID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\MaxBlockAdditionID</tt></dd>
<dt>id:</dt>
<dd>0x55EE</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The maximum value of BlockAddID (<xref target="blockaddid-element"></xref>).
A value 0 means there is no BlockAdditions (<xref target="blockadditions-element"></xref>) for this track.</dd>
</dl>
</section>

<section anchor="blockadditionmapping-element"><name>BlockAdditionMapping Element</name>

<dl>
<dt>name:</dt>
<dd>BlockAdditionMapping</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\BlockAdditionMapping</tt></dd>
<dt>id:</dt>
<dd>0x41E4</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Contains elements that extend the track format, by adding content either to each frame,
with BlockAddID (<xref target="blockaddid-element"></xref>), or to the track as a whole
with BlockAddIDExtraData.</dd>
</dl>

<section anchor="blockaddidvalue-element"><name>BlockAddIDValue Element</name>

<dl>
<dt>name:</dt>
<dd>BlockAddIDValue</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\BlockAdditionMapping\BlockAddIDValue</tt></dd>
<dt>id:</dt>
<dd>0x41F0</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>&gt;=2</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>If the track format extension needs content beside frames,
the value refers to the BlockAddID (<xref target="blockaddid-element"></xref>), value being described.
To keep MaxBlockAdditionID as low as possible, small values <bcp14>SHOULD</bcp14> be used.</dd>
</dl>
</section>

<section anchor="blockaddidname-element"><name>BlockAddIDName Element</name>

<dl>
<dt>name:</dt>
<dd>BlockAddIDName</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\BlockAdditionMapping\BlockAddIDName</tt></dd>
<dt>id:</dt>
<dd>0x41A4</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>A human-friendly name describing the type of BlockAdditional data,
as defined by the associated Block Additional Mapping.</dd>
</dl>
</section>

<section anchor="blockaddidtype-element"><name>BlockAddIDType Element</name>

<dl>
<dt>name:</dt>
<dd>BlockAddIDType</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\BlockAdditionMapping\BlockAddIDType</tt></dd>
<dt>id:</dt>
<dd>0x41E7</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Stores the registered identifer of the Block Additional Mapping
to define how the BlockAdditional data should be handled.</dd>
</dl>
</section>

<section anchor="blockaddidextradata-element"><name>BlockAddIDExtraData Element</name>

<dl>
<dt>name:</dt>
<dd>BlockAddIDExtraData</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\BlockAdditionMapping\BlockAddIDExtraData</tt></dd>
<dt>id:</dt>
<dd>0x41ED</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Extra binary data that the BlockAddIDType can use to interpret the BlockAdditional data.
The intepretation of the binary data depends on the BlockAddIDType value and the corresponding Block Additional Mapping.</dd>
</dl>
</section>
</section>

<section anchor="name-element"><name>Name Element</name>

<dl>
<dt>name:</dt>
<dd>Name</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Name</tt></dd>
<dt>id:</dt>
<dd>0x536E</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>A human-readable track name.</dd>
</dl>
</section>

<section anchor="language-element"><name>Language Element</name>

<dl>
<dt>name:</dt>
<dd>Language</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Language</tt></dd>
<dt>id:</dt>
<dd>0x22B59C</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>eng</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>definition:</dt>
<dd>Specifies the language of the track in the Matroska languages form;
see <xref target="language-codes"></xref> on language codes.
This Element <bcp14>MUST</bcp14> be ignored if the LanguageIETF Element is used in the same TrackEntry.</dd>
</dl>
</section>

<section anchor="languageietf-element"><name>LanguageIETF Element</name>

<dl>
<dt>name:</dt>
<dd>LanguageIETF</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\LanguageIETF</tt></dd>
<dt>id:</dt>
<dd>0x22B59D</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Specifies the language of the track according to BCP 47
and using the IANA Language Subtag Registry.
If this Element is used, then any Language Elements used in the same TrackEntry <bcp14>MUST</bcp14> be ignored.</dd>
</dl>
</section>

<section anchor="codecid-element"><name>CodecID Element</name>

<dl>
<dt>name:</dt>
<dd>CodecID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\CodecID</tt></dd>
<dt>id:</dt>
<dd>0x86</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>definition:</dt>
<dd>An ID corresponding to the codec,
see <xref target="I-D.ietf-cellar-codec"></xref> for more info.</dd>
</dl>
</section>

<section anchor="codecprivate-element"><name>CodecPrivate Element</name>

<dl>
<dt>name:</dt>
<dd>CodecPrivate</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\CodecPrivate</tt></dd>
<dt>id:</dt>
<dd>0x63A2</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>Private data only known to the codec.</dd>
</dl>
</section>

<section anchor="codecname-element"><name>CodecName Element</name>

<dl>
<dt>name:</dt>
<dd>CodecName</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\CodecName</tt></dd>
<dt>id:</dt>
<dd>0x258688</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>A human-readable string specifying the codec.</dd>
</dl>
</section>

<section anchor="attachmentlink-element"><name>AttachmentLink Element</name>

<dl>
<dt>name:</dt>
<dd>AttachmentLink</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\AttachmentLink</tt></dd>
<dt>id:</dt>
<dd>0x7446</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>maxver:</dt>
<dd>3</dd>
<dt>definition:</dt>
<dd>The UID of an attachment that is used by this codec.</dd>
</dl>
</section>

<section anchor="codecsettings-element"><name>CodecSettings Element</name>

<dl>
<dt>name:</dt>
<dd>CodecSettings</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\CodecSettings</tt></dd>
<dt>id:</dt>
<dd>0x3A9697</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>A string describing the encoding setting used.</dd>
</dl>
</section>

<section anchor="codecinfourl-element"><name>CodecInfoURL Element</name>

<dl>
<dt>name:</dt>
<dd>CodecInfoURL</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\CodecInfoURL</tt></dd>
<dt>id:</dt>
<dd>0x3B4040</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>A URL to find information about the codec used.</dd>
</dl>
</section>

<section anchor="codecdownloadurl-element"><name>CodecDownloadURL Element</name>

<dl>
<dt>name:</dt>
<dd>CodecDownloadURL</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\CodecDownloadURL</tt></dd>
<dt>id:</dt>
<dd>0x26B240</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>A URL to download about the codec used.</dd>
</dl>
</section>

<section anchor="codecdecodeall-element"><name>CodecDecodeAll Element</name>

<dl>
<dt>name:</dt>
<dd>CodecDecodeAll</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\CodecDecodeAll</tt></dd>
<dt>id:</dt>
<dd>0xAA</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>default:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>2</dd>
<dt>definition:</dt>
<dd>The codec can decode potentially damaged data (1 bit).</dd>
</dl>
</section>

<section anchor="trackoverlay-element"><name>TrackOverlay Element</name>

<dl>
<dt>name:</dt>
<dd>TrackOverlay</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackOverlay</tt></dd>
<dt>id:</dt>
<dd>0x6FAB</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Specify that this track is an overlay track for the Track specified (in the u-integer).
That means when this track has a gap, see <xref target="silenttracks-element"></xref> on SilentTracks,
the overlay track <bcp14>SHOULD</bcp14> be used instead. The order of multiple TrackOverlay matters, the first one is the one that <bcp14>SHOULD</bcp14> be used.
If not found it <bcp14>SHOULD</bcp14> be the second, etc.</dd>
</dl>
</section>

<section anchor="codecdelay-element"><name>CodecDelay Element</name>

<dl>
<dt>name:</dt>
<dd>CodecDelay</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\CodecDelay</tt></dd>
<dt>id:</dt>
<dd>0x56AA</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>CodecDelay is The codec-built-in delay in nanoseconds.
This value <bcp14>MUST</bcp14> be subtracted from each block timestamp in order to get the actual timestamp.
The value <bcp14>SHOULD</bcp14> be small so the muxing of tracks with the same actual timestamp are in the same Cluster.</dd>
</dl>
</section>

<section anchor="seekpreroll-element"><name>SeekPreRoll Element</name>

<dl>
<dt>name:</dt>
<dd>SeekPreRoll</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\SeekPreRoll</tt></dd>
<dt>id:</dt>
<dd>0x56BB</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data
the decoder <bcp14>MUST</bcp14> decode before the decoded data is valid.</dd>
</dl>
</section>

<section anchor="tracktranslate-element"><name>TrackTranslate Element</name>

<dl>
<dt>name:</dt>
<dd>TrackTranslate</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackTranslate</tt></dd>
<dt>id:</dt>
<dd>0x6624</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>The track identification for the given Chapter Codec.</dd>
</dl>

<section anchor="tracktranslateeditionuid-element"><name>TrackTranslateEditionUID Element</name>

<dl>
<dt>name:</dt>
<dd>TrackTranslateEditionUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateEditionUID</tt></dd>
<dt>id:</dt>
<dd>0x66FC</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Specify an edition UID on which this translation applies. When not specified,
it means for all editions found in the Segment.</dd>
</dl>
</section>

<section anchor="tracktranslatecodec-element"><name>TrackTranslateCodec Element</name>

<dl>
<dt>name:</dt>
<dd>TrackTranslateCodec</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateCodec</tt></dd>
<dt>id:</dt>
<dd>0x66BF</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The chapter codec; see <xref target="chapprocesscodecid-element"></xref>.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">Matroska Script</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">DVD-menu</td>
</tr>
</tbody>
</table></section>

<section anchor="tracktranslatetrackid-element"><name>TrackTranslateTrackID Element</name>

<dl>
<dt>name:</dt>
<dd>TrackTranslateTrackID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateTrackID</tt></dd>
<dt>id:</dt>
<dd>0x66A5</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>The binary value used to represent this track in the chapter codec data.
The format depends on the ChapProcessCodecID used; see <xref target="chapprocesscodecid-element"></xref>.</dd>
</dl>
</section>
</section>

<section anchor="video-element"><name>Video Element</name>

<dl>
<dt>name:</dt>
<dd>Video</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video</tt></dd>
<dt>id:</dt>
<dd>0xE0</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Video settings.</dd>
</dl>

<section anchor="flaginterlaced-element"><name>FlagInterlaced Element</name>

<dl>
<dt>name:</dt>
<dd>FlagInterlaced</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\FlagInterlaced</tt></dd>
<dt>id:</dt>
<dd>0x9A</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-2</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>2</dd>
<dt>definition:</dt>
<dd>A flag to declare if the video is known to be progressive,
or interlaced, and if applicable to declare details about the interlacement.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">undetermined</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">interlaced</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">progressive</td>
</tr>
</tbody>
</table></section>

<section anchor="fieldorder-element"><name>FieldOrder Element</name>

<dl>
<dt>name:</dt>
<dd>FieldOrder</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\FieldOrder</tt></dd>
<dt>id:</dt>
<dd>0x9D</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-14</dd>
<dt>default:</dt>
<dd>2</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Declare the field ordering of the video.
If FlagInterlaced is not set to 1, this Element <bcp14>MUST</bcp14> be ignored.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
<th align="left">documentation</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">progressive</td>
<td align="left"></td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">tff</td>
<td align="left">Top field displayed first. Top field stored first.</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">undetermined</td>
<td align="left"></td>
</tr>

<tr>
<td align="left"><tt>6</tt></td>
<td align="left">bff</td>
<td align="left">Bottom field displayed first. Bottom field stored first.</td>
</tr>

<tr>
<td align="left"><tt>9</tt></td>
<td align="left">bff(swapped)</td>
<td align="left">Top field displayed first. Fields are interleaved in storage</td>
</tr>

<tr>
<td align="left">with the top line of the top field stored first.</td>
<td align="left"></td>
<td align="left"></td>
</tr>

<tr>
<td align="left"><tt>14</tt></td>
<td align="left">tff(swapped)</td>
<td align="left">Bottom field displayed first. Fields are interleaved in storage</td>
</tr>

<tr>
<td align="left">with the top line of the top field stored first.</td>
<td align="left"></td>
<td align="left"></td>
</tr>
</tbody>
</table></section>

<section anchor="stereomode-element"><name>StereoMode Element</name>

<dl>
<dt>name:</dt>
<dd>StereoMode</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\StereoMode</tt></dd>
<dt>id:</dt>
<dd>0x53B8</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>3</dd>
<dt>definition:</dt>
<dd>Stereo-3D video mode. There are some more details in <xref target="multi-planar-and-3d-videos"></xref>.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">mono</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">side by side (left eye first)</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">top - bottom (right eye is first)</td>
</tr>

<tr>
<td align="left"><tt>3</tt></td>
<td align="left">top - bottom (left eye is first)</td>
</tr>

<tr>
<td align="left"><tt>4</tt></td>
<td align="left">checkboard (right eye is first)</td>
</tr>

<tr>
<td align="left"><tt>5</tt></td>
<td align="left">checkboard (left eye is first)</td>
</tr>

<tr>
<td align="left"><tt>6</tt></td>
<td align="left">row interleaved (right eye is first)</td>
</tr>

<tr>
<td align="left"><tt>7</tt></td>
<td align="left">row interleaved (left eye is first)</td>
</tr>

<tr>
<td align="left"><tt>8</tt></td>
<td align="left">column interleaved (right eye is first)</td>
</tr>

<tr>
<td align="left"><tt>9</tt></td>
<td align="left">column interleaved (left eye is first)</td>
</tr>

<tr>
<td align="left"><tt>10</tt></td>
<td align="left">anaglyph (cyan/red)</td>
</tr>

<tr>
<td align="left"><tt>11</tt></td>
<td align="left">side by side (right eye first)</td>
</tr>

<tr>
<td align="left"><tt>12</tt></td>
<td align="left">anaglyph (green/magenta)</td>
</tr>

<tr>
<td align="left"><tt>13</tt></td>
<td align="left">both eyes laced in one Block (left eye is first)</td>
</tr>

<tr>
<td align="left"><tt>14</tt></td>
<td align="left">both eyes laced in one Block (right eye is first)</td>
</tr>
</tbody>
</table></section>

<section anchor="alphamode-element"><name>AlphaMode Element</name>

<dl>
<dt>name:</dt>
<dd>AlphaMode</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\AlphaMode</tt></dd>
<dt>id:</dt>
<dd>0x53C0</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>3</dd>
<dt>definition:</dt>
<dd>Alpha Video Mode. Presence of this Element indicates that
the BlockAdditional Element could contain Alpha data.</dd>
</dl>
</section>

<section anchor="oldstereomode-element"><name>OldStereoMode Element</name>

<dl>
<dt>name:</dt>
<dd>OldStereoMode</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\OldStereoMode</tt></dd>
<dt>id:</dt>
<dd>0x53B9</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">mono</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">right eye</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">left eye</td>
</tr>

<tr>
<td align="left"><tt>3</tt></td>
<td align="left">both eyes</td>
</tr>
</tbody>
</table></section>

<section anchor="pixelwidth-element"><name>PixelWidth Element</name>

<dl>
<dt>name:</dt>
<dd>PixelWidth</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\PixelWidth</tt></dd>
<dt>id:</dt>
<dd>0xB0</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Width of the encoded video frames in pixels.</dd>
</dl>
</section>

<section anchor="pixelheight-element"><name>PixelHeight Element</name>

<dl>
<dt>name:</dt>
<dd>PixelHeight</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\PixelHeight</tt></dd>
<dt>id:</dt>
<dd>0xBA</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Height of the encoded video frames in pixels.</dd>
</dl>
</section>

<section anchor="pixelcropbottom-element"><name>PixelCropBottom Element</name>

<dl>
<dt>name:</dt>
<dd>PixelCropBottom</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\PixelCropBottom</tt></dd>
<dt>id:</dt>
<dd>0x54AA</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The number of video pixels to remove at the bottom of the image.</dd>
</dl>
</section>

<section anchor="pixelcroptop-element"><name>PixelCropTop Element</name>

<dl>
<dt>name:</dt>
<dd>PixelCropTop</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\PixelCropTop</tt></dd>
<dt>id:</dt>
<dd>0x54BB</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The number of video pixels to remove at the top of the image.</dd>
</dl>
</section>

<section anchor="pixelcropleft-element"><name>PixelCropLeft Element</name>

<dl>
<dt>name:</dt>
<dd>PixelCropLeft</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\PixelCropLeft</tt></dd>
<dt>id:</dt>
<dd>0x54CC</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The number of video pixels to remove on the left of the image.</dd>
</dl>
</section>

<section anchor="pixelcropright-element"><name>PixelCropRight Element</name>

<dl>
<dt>name:</dt>
<dd>PixelCropRight</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\PixelCropRight</tt></dd>
<dt>id:</dt>
<dd>0x54DD</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The number of video pixels to remove on the right of the image.</dd>
</dl>
</section>

<section anchor="displaywidth-element"><name>DisplayWidth Element</name>

<dl>
<dt>name:</dt>
<dd>DisplayWidth</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\DisplayWidth</tt></dd>
<dt>id:</dt>
<dd>0x54B0</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
</dl>
<t>default: see implementation notes</t>

<dl>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Width of the video frames to display. Applies to the video frame after cropping (PixelCrop* Elements).</dd>
</dl>
<t>implementation notes:</t>
<table>
<thead>
<tr>
<th align="left">attribute</th>
<th align="left">note</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">default</td>
<td align="left">If the DisplayUnit of the same TrackEntry is 0, then the default value for DisplayWidth is equal to</td>
</tr>

<tr>
<td align="left">PixelWidth - PixelCropLeft - PixelCropRight, else there is no default value.</td>
<td align="left"></td>
</tr>
</tbody>
</table></section>

<section anchor="displayheight-element"><name>DisplayHeight Element</name>

<dl>
<dt>name:</dt>
<dd>DisplayHeight</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\DisplayHeight</tt></dd>
<dt>id:</dt>
<dd>0x54BA</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
</dl>
<t>default: see implementation notes</t>

<dl>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Height of the video frames to display. Applies to the video frame after cropping (PixelCrop* Elements).</dd>
</dl>
<t>implementation notes:</t>
<table>
<thead>
<tr>
<th align="left">attribute</th>
<th align="left">note</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">default</td>
<td align="left">If the DisplayUnit of the same TrackEntry is 0, then the default value for DisplayHeight is equal to</td>
</tr>

<tr>
<td align="left">PixelHeight - PixelCropTop - PixelCropBottom, else there is no default value.</td>
<td align="left"></td>
</tr>
</tbody>
</table></section>

<section anchor="displayunit-element"><name>DisplayUnit Element</name>

<dl>
<dt>name:</dt>
<dd>DisplayUnit</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\DisplayUnit</tt></dd>
<dt>id:</dt>
<dd>0x54B2</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>How DisplayWidth &amp; DisplayHeight are interpreted.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">pixels</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">centimeters</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">inches</td>
</tr>

<tr>
<td align="left"><tt>3</tt></td>
<td align="left">display aspect ratio</td>
</tr>

<tr>
<td align="left"><tt>4</tt></td>
<td align="left">unknown</td>
</tr>
</tbody>
</table></section>

<section anchor="aspectratiotype-element"><name>AspectRatioType Element</name>

<dl>
<dt>name:</dt>
<dd>AspectRatioType</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\AspectRatioType</tt></dd>
<dt>id:</dt>
<dd>0x54B3</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Specify the possible modifications to the aspect ratio.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">free resizing</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">keep aspect ratio</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">fixed</td>
</tr>
</tbody>
</table></section>

<section anchor="colourspace-element"><name>ColourSpace Element</name>

<dl>
<dt>name:</dt>
<dd>ColourSpace</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\ColourSpace</tt></dd>
<dt>id:</dt>
<dd>0x2EB524</dd>
</dl>
<t>minOccurs: see implementation notes</t>

<dl>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>Specify the pixel format used for the Track's data as a FourCC.
This value is similar in scope to the biCompression value of AVI's BITMAPINFOHEADER.</dd>
</dl>
<t>implementation notes:</t>
<table>
<thead>
<tr>
<th align="left">attribute</th>
<th align="left">note</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">minOccurs</td>
<td align="left">ColourSpace <bcp14>MUST</bcp14> be set (minOccurs=1) in TrackEntry, when the CodecID Element of the TrackEntry is set to &quot;V_UNCOMPRESSED&quot;.</td>
</tr>
</tbody>
</table></section>

<section anchor="gammavalue-element"><name>GammaValue Element</name>

<dl>
<dt>name:</dt>
<dd>GammaValue</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\GammaValue</tt></dd>
<dt>id:</dt>
<dd>0x2FB523</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>&gt; 0x0p+0</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>Gamma Value.</dd>
</dl>
</section>

<section anchor="framerate-element"><name>FrameRate Element</name>

<dl>
<dt>name:</dt>
<dd>FrameRate</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\FrameRate</tt></dd>
<dt>id:</dt>
<dd>0x2383E3</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>&gt; 0x0p+0</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>Number of frames per second. Informational only.</dd>
</dl>
</section>

<section anchor="colour-element"><name>Colour Element</name>

<dl>
<dt>name:</dt>
<dd>Colour</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour</tt></dd>
<dt>id:</dt>
<dd>0x55B0</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Settings describing the colour format.</dd>
</dl>

<section anchor="matrixcoefficients-element"><name>MatrixCoefficients Element</name>

<dl>
<dt>name:</dt>
<dd>MatrixCoefficients</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MatrixCoefficients</tt></dd>
<dt>id:</dt>
<dd>0x55B1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>2</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>The Matrix Coefficients of the video used to derive luma and chroma values from red, green, and blue color primaries.
For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">Identity</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">ITU-R BT.709</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">unspecified</td>
</tr>

<tr>
<td align="left"><tt>3</tt></td>
<td align="left">reserved</td>
</tr>

<tr>
<td align="left"><tt>4</tt></td>
<td align="left">US FCC 73.682</td>
</tr>

<tr>
<td align="left"><tt>5</tt></td>
<td align="left">ITU-R BT.470BG</td>
</tr>

<tr>
<td align="left"><tt>6</tt></td>
<td align="left">SMPTE 170M</td>
</tr>

<tr>
<td align="left"><tt>7</tt></td>
<td align="left">SMPTE 240M</td>
</tr>

<tr>
<td align="left"><tt>8</tt></td>
<td align="left">YCoCg</td>
</tr>

<tr>
<td align="left"><tt>9</tt></td>
<td align="left">BT2020 Non-constant Luminance</td>
</tr>

<tr>
<td align="left"><tt>10</tt></td>
<td align="left">BT2020 Constant Luminance</td>
</tr>

<tr>
<td align="left"><tt>11</tt></td>
<td align="left">SMPTE ST 2085</td>
</tr>

<tr>
<td align="left"><tt>12</tt></td>
<td align="left">Chroma-derived Non-constant Luminance</td>
</tr>

<tr>
<td align="left"><tt>13</tt></td>
<td align="left">Chroma-derived Constant Luminance</td>
</tr>

<tr>
<td align="left"><tt>14</tt></td>
<td align="left">ITU-R BT.2100-0</td>
</tr>
</tbody>
</table></section>

<section anchor="bitsperchannel-element"><name>BitsPerChannel Element</name>

<dl>
<dt>name:</dt>
<dd>BitsPerChannel</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\BitsPerChannel</tt></dd>
<dt>id:</dt>
<dd>0x55B2</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Number of decoded bits per channel. A value of 0 indicates that the BitsPerChannel is unspecified.</dd>
</dl>
</section>

<section anchor="chromasubsamplinghorz-element"><name>ChromaSubsamplingHorz Element</name>

<dl>
<dt>name:</dt>
<dd>ChromaSubsamplingHorz</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingHorz</tt></dd>
<dt>id:</dt>
<dd>0x55B3</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>The amount of pixels to remove in the Cr and Cb channels for every pixel not removed horizontally.
Example: For video with 4:2:0 chroma subsampling, the ChromaSubsamplingHorz <bcp14>SHOULD</bcp14> be set to 1.</dd>
</dl>
</section>

<section anchor="chromasubsamplingvert-element"><name>ChromaSubsamplingVert Element</name>

<dl>
<dt>name:</dt>
<dd>ChromaSubsamplingVert</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingVert</tt></dd>
<dt>id:</dt>
<dd>0x55B4</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>The amount of pixels to remove in the Cr and Cb channels for every pixel not removed vertically.
Example: For video with 4:2:0 chroma subsampling, the ChromaSubsamplingVert <bcp14>SHOULD</bcp14> be set to 1.</dd>
</dl>
</section>

<section anchor="cbsubsamplinghorz-element"><name>CbSubsamplingHorz Element</name>

<dl>
<dt>name:</dt>
<dd>CbSubsamplingHorz</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingHorz</tt></dd>
<dt>id:</dt>
<dd>0x55B5</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>The amount of pixels to remove in the Cb channel for every pixel not removed horizontally.
This is additive with ChromaSubsamplingHorz. Example: For video with 4:2:1 chroma subsampling,
the ChromaSubsamplingHorz <bcp14>SHOULD</bcp14> be set to 1 and CbSubsamplingHorz <bcp14>SHOULD</bcp14> be set to 1.</dd>
</dl>
</section>

<section anchor="cbsubsamplingvert-element"><name>CbSubsamplingVert Element</name>

<dl>
<dt>name:</dt>
<dd>CbSubsamplingVert</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingVert</tt></dd>
<dt>id:</dt>
<dd>0x55B6</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>The amount of pixels to remove in the Cb channel for every pixel not removed vertically.
This is additive with ChromaSubsamplingVert.</dd>
</dl>
</section>

<section anchor="chromasitinghorz-element"><name>ChromaSitingHorz Element</name>

<dl>
<dt>name:</dt>
<dd>ChromaSitingHorz</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingHorz</tt></dd>
<dt>id:</dt>
<dd>0x55B7</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>How chroma is subsampled horizontally.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">unspecified</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">left collocated</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">half</td>
</tr>
</tbody>
</table></section>

<section anchor="chromasitingvert-element"><name>ChromaSitingVert Element</name>

<dl>
<dt>name:</dt>
<dd>ChromaSitingVert</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingVert</tt></dd>
<dt>id:</dt>
<dd>0x55B8</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>How chroma is subsampled vertically.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">unspecified</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">top collocated</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">half</td>
</tr>
</tbody>
</table></section>

<section anchor="range-element"><name>Range Element</name>

<dl>
<dt>name:</dt>
<dd>Range</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\Range</tt></dd>
<dt>id:</dt>
<dd>0x55B9</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Clipping of the color ranges.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">unspecified</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">broadcast range</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">full range (no clipping)</td>
</tr>

<tr>
<td align="left"><tt>3</tt></td>
<td align="left">defined by MatrixCoefficients / TransferCharacteristics</td>
</tr>
</tbody>
</table></section>

<section anchor="transfercharacteristics-element"><name>TransferCharacteristics Element</name>

<dl>
<dt>name:</dt>
<dd>TransferCharacteristics</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\TransferCharacteristics</tt></dd>
<dt>id:</dt>
<dd>0x55BA</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>2</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>The transfer characteristics of the video. For clarity,
the value and meanings for TransferCharacteristics are adopted from Table 3 of ISO/IEC 23091-4 or ITU-T H.273.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">reserved</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">ITU-R BT.709</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">unspecified</td>
</tr>

<tr>
<td align="left"><tt>3</tt></td>
<td align="left">reserved</td>
</tr>

<tr>
<td align="left"><tt>4</tt></td>
<td align="left">Gamma 2.2 curve - BT.470M</td>
</tr>

<tr>
<td align="left"><tt>5</tt></td>
<td align="left">Gamma 2.8 curve - BT.470BG</td>
</tr>

<tr>
<td align="left"><tt>6</tt></td>
<td align="left">SMPTE 170M</td>
</tr>

<tr>
<td align="left"><tt>7</tt></td>
<td align="left">SMPTE 240M</td>
</tr>

<tr>
<td align="left"><tt>8</tt></td>
<td align="left">Linear</td>
</tr>

<tr>
<td align="left"><tt>9</tt></td>
<td align="left">Log</td>
</tr>

<tr>
<td align="left"><tt>10</tt></td>
<td align="left">Log Sqrt</td>
</tr>

<tr>
<td align="left"><tt>11</tt></td>
<td align="left">IEC 61966-2-4</td>
</tr>

<tr>
<td align="left"><tt>12</tt></td>
<td align="left">ITU-R BT.1361 Extended Colour Gamut</td>
</tr>

<tr>
<td align="left"><tt>13</tt></td>
<td align="left">IEC 61966-2-1</td>
</tr>

<tr>
<td align="left"><tt>14</tt></td>
<td align="left">ITU-R BT.2020 10 bit</td>
</tr>

<tr>
<td align="left"><tt>15</tt></td>
<td align="left">ITU-R BT.2020 12 bit</td>
</tr>

<tr>
<td align="left"><tt>16</tt></td>
<td align="left">ITU-R BT.2100 Perceptual Quantization</td>
</tr>

<tr>
<td align="left"><tt>17</tt></td>
<td align="left">SMPTE ST 428-1</td>
</tr>

<tr>
<td align="left"><tt>18</tt></td>
<td align="left">ARIB STD-B67 (HLG)</td>
</tr>
</tbody>
</table></section>

<section anchor="primaries-element"><name>Primaries Element</name>

<dl>
<dt>name:</dt>
<dd>Primaries</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\Primaries</tt></dd>
<dt>id:</dt>
<dd>0x55BB</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>2</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>The colour primaries of the video. For clarity,
the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23091-4 or ITU-T H.273.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">reserved</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">ITU-R BT.709</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">unspecified</td>
</tr>

<tr>
<td align="left"><tt>3</tt></td>
<td align="left">reserved</td>
</tr>

<tr>
<td align="left"><tt>4</tt></td>
<td align="left">ITU-R BT.470M</td>
</tr>

<tr>
<td align="left"><tt>5</tt></td>
<td align="left">ITU-R BT.470BG - BT.601 625</td>
</tr>

<tr>
<td align="left"><tt>6</tt></td>
<td align="left">ITU-R BT.601 525 - SMPTE 170M</td>
</tr>

<tr>
<td align="left"><tt>7</tt></td>
<td align="left">SMPTE 240M</td>
</tr>

<tr>
<td align="left"><tt>8</tt></td>
<td align="left">FILM</td>
</tr>

<tr>
<td align="left"><tt>9</tt></td>
<td align="left">ITU-R BT.2020</td>
</tr>

<tr>
<td align="left"><tt>10</tt></td>
<td align="left">SMPTE ST 428-1</td>
</tr>

<tr>
<td align="left"><tt>11</tt></td>
<td align="left">SMPTE RP 432-2</td>
</tr>

<tr>
<td align="left"><tt>12</tt></td>
<td align="left">SMPTE EG 432-2</td>
</tr>

<tr>
<td align="left"><tt>22</tt></td>
<td align="left">EBU Tech. 3213-E - JEDEC P22 phosphors</td>
</tr>
</tbody>
</table></section>

<section anchor="maxcll-element"><name>MaxCLL Element</name>

<dl>
<dt>name:</dt>
<dd>MaxCLL</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MaxCLL</tt></dd>
<dt>id:</dt>
<dd>0x55BC</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Maximum brightness of a single pixel (Maximum Content Light Level)
in candelas per square meter (cd/m²).</dd>
</dl>
</section>

<section anchor="maxfall-element"><name>MaxFALL Element</name>

<dl>
<dt>name:</dt>
<dd>MaxFALL</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MaxFALL</tt></dd>
<dt>id:</dt>
<dd>0x55BD</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Maximum brightness of a single full frame (Maximum Frame-Average Light Level)
in candelas per square meter (cd/m²).</dd>
</dl>
</section>

<section anchor="masteringmetadata-element"><name>MasteringMetadata Element</name>

<dl>
<dt>name:</dt>
<dd>MasteringMetadata</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata</tt></dd>
<dt>id:</dt>
<dd>0x55D0</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>SMPTE 2086 mastering data.</dd>
</dl>
</section>

<section anchor="primaryrchromaticityx-element"><name>PrimaryRChromaticityX Element</name>

<dl>
<dt>name:</dt>
<dd>PrimaryRChromaticityX</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryRChromaticityX</tt></dd>
<dt>id:</dt>
<dd>0x55D1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Red X chromaticity coordinate, as defined by CIE 1931.</dd>
</dl>
</section>

<section anchor="primaryrchromaticityy-element"><name>PrimaryRChromaticityY Element</name>

<dl>
<dt>name:</dt>
<dd>PrimaryRChromaticityY</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryRChromaticityY</tt></dd>
<dt>id:</dt>
<dd>0x55D2</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Red Y chromaticity coordinate, as defined by CIE 1931.</dd>
</dl>
</section>

<section anchor="primarygchromaticityx-element"><name>PrimaryGChromaticityX Element</name>

<dl>
<dt>name:</dt>
<dd>PrimaryGChromaticityX</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryGChromaticityX</tt></dd>
<dt>id:</dt>
<dd>0x55D3</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Green X chromaticity coordinate, as defined by CIE 1931.</dd>
</dl>
</section>

<section anchor="primarygchromaticityy-element"><name>PrimaryGChromaticityY Element</name>

<dl>
<dt>name:</dt>
<dd>PrimaryGChromaticityY</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryGChromaticityY</tt></dd>
<dt>id:</dt>
<dd>0x55D4</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Green Y chromaticity coordinate, as defined by CIE 1931.</dd>
</dl>
</section>

<section anchor="primarybchromaticityx-element"><name>PrimaryBChromaticityX Element</name>

<dl>
<dt>name:</dt>
<dd>PrimaryBChromaticityX</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryBChromaticityX</tt></dd>
<dt>id:</dt>
<dd>0x55D5</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Blue X chromaticity coordinate, as defined by CIE 1931.</dd>
</dl>
</section>

<section anchor="primarybchromaticityy-element"><name>PrimaryBChromaticityY Element</name>

<dl>
<dt>name:</dt>
<dd>PrimaryBChromaticityY</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryBChromaticityY</tt></dd>
<dt>id:</dt>
<dd>0x55D6</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Blue Y chromaticity coordinate, as defined by CIE 1931.</dd>
</dl>
</section>

<section anchor="whitepointchromaticityx-element"><name>WhitePointChromaticityX Element</name>

<dl>
<dt>name:</dt>
<dd>WhitePointChromaticityX</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\WhitePointChromaticityX</tt></dd>
<dt>id:</dt>
<dd>0x55D7</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>White X chromaticity coordinate, as defined by CIE 1931.</dd>
</dl>
</section>

<section anchor="whitepointchromaticityy-element"><name>WhitePointChromaticityY Element</name>

<dl>
<dt>name:</dt>
<dd>WhitePointChromaticityY</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\WhitePointChromaticityY</tt></dd>
<dt>id:</dt>
<dd>0x55D8</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>White Y chromaticity coordinate, as defined by CIE 1931.</dd>
</dl>
</section>

<section anchor="luminancemax-element"><name>LuminanceMax Element</name>

<dl>
<dt>name:</dt>
<dd>LuminanceMax</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\LuminanceMax</tt></dd>
<dt>id:</dt>
<dd>0x55D9</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>&gt;= 0x0p+0</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Maximum luminance. Represented in candelas per square meter (cd/m²).</dd>
</dl>
</section>

<section anchor="luminancemin-element"><name>LuminanceMin Element</name>

<dl>
<dt>name:</dt>
<dd>LuminanceMin</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\LuminanceMin</tt></dd>
<dt>id:</dt>
<dd>0x55DA</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>&gt;= 0x0p+0</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Minimum luminance. Represented in candelas per square meter (cd/m²).</dd>
</dl>
</section>
</section>

<section anchor="projection-element"><name>Projection Element</name>

<dl>
<dt>name:</dt>
<dd>Projection</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Projection</tt></dd>
<dt>id:</dt>
<dd>0x7670</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Describes the video projection details. Used to render spherical and VR videos.</dd>
</dl>

<section anchor="projectiontype-element"><name>ProjectionType Element</name>

<dl>
<dt>name:</dt>
<dd>ProjectionType</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Projection\ProjectionType</tt></dd>
<dt>id:</dt>
<dd>0x7671</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-3</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Describes the projection used for this video track.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">rectangular</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">equirectangular</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">cubemap</td>
</tr>

<tr>
<td align="left"><tt>3</tt></td>
<td align="left">mesh</td>
</tr>
</tbody>
</table></section>

<section anchor="projectionprivate-element"><name>ProjectionPrivate Element</name>

<dl>
<dt>name:</dt>
<dd>ProjectionPrivate</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPrivate</tt></dd>
<dt>id:</dt>
<dd>0x7672</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Private data that only applies to a specific projection.</dd>
</dl>

<ul>
<li>If <tt>ProjectionType</tt> equals 0 (Rectangular),
 then this element must not be present.</li>
<li>If <tt>ProjectionType</tt> equals 1 (Equirectangular), then this element must be present and contain the same binary data that would be stored inside
  an ISOBMFF Equirectangular Projection Box ('equi').</li>
<li>If <tt>ProjectionType</tt> equals 2 (Cubemap), then this element must be present and contain the same binary data that would be stored
  inside an ISOBMFF Cubemap Projection Box ('cbmp').</li>
<li>If <tt>ProjectionType</tt> equals 3 (Mesh), then this element must be present and contain the same binary data that would be stored inside
   an ISOBMFF Mesh Projection Box ('mshp').</li>
</ul>

<dl>
<dt>usage notes:</dt>
<dd>ISOBMFF box size and fourcc fields are not included in the binary data,
but the FullBox version and flag fields are. This is to avoid
redundant framing information while preserving versioning and semantics between the two container formats.</dd>
</dl>
</section>

<section anchor="projectionposeyaw-element"><name>ProjectionPoseYaw Element</name>

<dl>
<dt>name:</dt>
<dd>ProjectionPoseYaw</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPoseYaw</tt></dd>
<dt>id:</dt>
<dd>0x7673</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0x0p+0</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Specifies a yaw rotation to the projection.</dd>
</dl>
<t>Value represents a clockwise rotation, in degrees, around the up vector. This rotation must be applied
before any <tt>ProjectionPosePitch</tt> or <tt>ProjectionPoseRoll</tt> rotations.
The value of this field should be in the -180 to 180 degree range.</t>
</section>

<section anchor="projectionposepitch-element"><name>ProjectionPosePitch Element</name>

<dl>
<dt>name:</dt>
<dd>ProjectionPosePitch</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPosePitch</tt></dd>
<dt>id:</dt>
<dd>0x7674</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0x0p+0</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Specifies a pitch rotation to the projection.</dd>
</dl>
<t>Value represents a counter-clockwise rotation, in degrees, around the right vector. This rotation must be applied
after the <tt>ProjectionPoseYaw</tt> rotation and before the <tt>ProjectionPoseRoll</tt> rotation.
The value of this field should be in the -90 to 90 degree range.</t>
</section>

<section anchor="projectionposeroll-element"><name>ProjectionPoseRoll Element</name>

<dl>
<dt>name:</dt>
<dd>ProjectionPoseRoll</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPoseRoll</tt></dd>
<dt>id:</dt>
<dd>0x7675</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0x0p+0</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Specifies a roll rotation to the projection.</dd>
</dl>
<t>Value represents a counter-clockwise rotation, in degrees, around the forward vector. This rotation must be applied
after the <tt>ProjectionPoseYaw</tt> and <tt>ProjectionPosePitch</tt> rotations.
The value of this field should be in the -180 to 180 degree range.</t>
</section>
</section>
</section>

<section anchor="audio-element"><name>Audio Element</name>

<dl>
<dt>name:</dt>
<dd>Audio</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Audio</tt></dd>
<dt>id:</dt>
<dd>0xE1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Audio settings.</dd>
</dl>

<section anchor="samplingfrequency-element"><name>SamplingFrequency Element</name>

<dl>
<dt>name:</dt>
<dd>SamplingFrequency</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Audio\SamplingFrequency</tt></dd>
<dt>id:</dt>
<dd>0xB5</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>&gt; 0x0p+0</dd>
<dt>default:</dt>
<dd>0x1.f4p+12</dd>
<dt>type:</dt>
<dd>float</dd>
<dt>definition:</dt>
<dd>Sampling frequency in Hz.</dd>
</dl>
</section>

<section anchor="outputsamplingfrequency-element"><name>OutputSamplingFrequency Element</name>

<dl>
<dt>name:</dt>
<dd>OutputSamplingFrequency</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Audio\OutputSamplingFrequency</tt></dd>
<dt>id:</dt>
<dd>0x78B5</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>&gt; 0x0p+0</dd>
</dl>
<t>default: see implementation notes</t>

<dl>
<dt>type:</dt>
<dd>float</dd>
<dt>definition:</dt>
<dd>Real output sampling frequency in Hz (used for SBR techniques).</dd>
</dl>
<t>implementation notes:</t>
<table>
<thead>
<tr>
<th align="left">attribute</th>
<th align="left">note</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">default</td>
<td align="left">The default value for OutputSamplingFrequency of the same TrackEntry is equal to the SamplingFrequency.</td>
</tr>
</tbody>
</table></section>

<section anchor="channels-element"><name>Channels Element</name>

<dl>
<dt>name:</dt>
<dd>Channels</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Audio\Channels</tt></dd>
<dt>id:</dt>
<dd>0x9F</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>default:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Numbers of channels in the track.</dd>
</dl>
</section>

<section anchor="channelpositions-element"><name>ChannelPositions Element</name>

<dl>
<dt>name:</dt>
<dd>ChannelPositions</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Audio\ChannelPositions</tt></dd>
<dt>id:</dt>
<dd>0x7D7B</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>Table of horizontal angles for each successive channel.</dd>
</dl>
</section>

<section anchor="bitdepth-element"><name>BitDepth Element</name>

<dl>
<dt>name:</dt>
<dd>BitDepth</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\Audio\BitDepth</tt></dd>
<dt>id:</dt>
<dd>0x6264</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Bits per sample, mostly used for PCM.</dd>
</dl>
</section>
</section>

<section anchor="trackoperation-element"><name>TrackOperation Element</name>

<dl>
<dt>name:</dt>
<dd>TrackOperation</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackOperation</tt></dd>
<dt>id:</dt>
<dd>0xE2</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>minver:</dt>
<dd>3</dd>
<dt>definition:</dt>
<dd>Operation that needs to be applied on tracks to create this virtual track.
For more details look at <xref target="track-operation"></xref>.</dd>
</dl>

<section anchor="trackcombineplanes-element"><name>TrackCombinePlanes Element</name>

<dl>
<dt>name:</dt>
<dd>TrackCombinePlanes</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes</tt></dd>
<dt>id:</dt>
<dd>0xE3</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>minver:</dt>
<dd>3</dd>
<dt>definition:</dt>
<dd>Contains the list of all video plane tracks that need to be combined to create this 3D track</dd>
</dl>

<section anchor="trackplane-element"><name>TrackPlane Element</name>

<dl>
<dt>name:</dt>
<dd>TrackPlane</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\TrackPlane</tt></dd>
<dt>id:</dt>
<dd>0xE4</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>minver:</dt>
<dd>3</dd>
<dt>definition:</dt>
<dd>Contains a video plane track that need to be combined to create this 3D track</dd>
</dl>
</section>

<section anchor="trackplaneuid-element"><name>TrackPlaneUID Element</name>

<dl>
<dt>name:</dt>
<dd>TrackPlaneUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\TrackPlane\TrackPlaneUID</tt></dd>
<dt>id:</dt>
<dd>0xE5</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>3</dd>
<dt>definition:</dt>
<dd>The trackUID number of the track representing the plane.</dd>
</dl>
</section>

<section anchor="trackplanetype-element"><name>TrackPlaneType Element</name>

<dl>
<dt>name:</dt>
<dd>TrackPlaneType</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\TrackPlane\TrackPlaneType</tt></dd>
<dt>id:</dt>
<dd>0xE6</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>3</dd>
<dt>definition:</dt>
<dd>The kind of plane this track corresponds to.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">left eye</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">right eye</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">background</td>
</tr>
</tbody>
</table></section>
</section>

<section anchor="trackjoinblocks-element"><name>TrackJoinBlocks Element</name>

<dl>
<dt>name:</dt>
<dd>TrackJoinBlocks</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks</tt></dd>
<dt>id:</dt>
<dd>0xE9</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>minver:</dt>
<dd>3</dd>
<dt>definition:</dt>
<dd>Contains the list of all tracks whose Blocks need to be combined to create this virtual track</dd>
</dl>

<section anchor="trackjoinuid-element"><name>TrackJoinUID Element</name>

<dl>
<dt>name:</dt>
<dd>TrackJoinUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks\TrackJoinUID</tt></dd>
<dt>id:</dt>
<dd>0xED</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>3</dd>
<dt>definition:</dt>
<dd>The trackUID number of a track whose blocks are used to create this virtual track.</dd>
</dl>
</section>
</section>
</section>

<section anchor="tricktrackuid-element"><name>TrickTrackUID Element</name>

<dl>
<dt>name:</dt>
<dd>TrickTrackUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrickTrackUID</tt></dd>
<dt>id:</dt>
<dd>0xC0</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>
  DivX trick track extensions</dd>
</dl>
</section>

<section anchor="tricktracksegmentuid-element"><name>TrickTrackSegmentUID Element</name>

<dl>
<dt>name:</dt>
<dd>TrickTrackSegmentUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrickTrackSegmentUID</tt></dd>
<dt>id:</dt>
<dd>0xC1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>
  DivX trick track extensions</dd>
</dl>
</section>

<section anchor="tricktrackflag-element"><name>TrickTrackFlag Element</name>

<dl>
<dt>name:</dt>
<dd>TrickTrackFlag</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrickTrackFlag</tt></dd>
<dt>id:</dt>
<dd>0xC6</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>
  DivX trick track extensions</dd>
</dl>
</section>

<section anchor="trickmastertrackuid-element"><name>TrickMasterTrackUID Element</name>

<dl>
<dt>name:</dt>
<dd>TrickMasterTrackUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrickMasterTrackUID</tt></dd>
<dt>id:</dt>
<dd>0xC7</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>
  DivX trick track extensions</dd>
</dl>
</section>

<section anchor="trickmastertracksegmentuid-element"><name>TrickMasterTrackSegmentUID Element</name>

<dl>
<dt>name:</dt>
<dd>TrickMasterTrackSegmentUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\TrickMasterTrackSegmentUID</tt></dd>
<dt>id:</dt>
<dd>0xC4</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>
  DivX trick track extensions</dd>
</dl>
</section>

<section anchor="contentencodings-element"><name>ContentEncodings Element</name>

<dl>
<dt>name:</dt>
<dd>ContentEncodings</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings</tt></dd>
<dt>id:</dt>
<dd>0x6D80</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Settings for several content encoding mechanisms like compression or encryption.</dd>
</dl>

<section anchor="contentencoding-element"><name>ContentEncoding Element</name>

<dl>
<dt>name:</dt>
<dd>ContentEncoding</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding</tt></dd>
<dt>id:</dt>
<dd>0x6240</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Settings for one content encoding like compression or encryption.</dd>
</dl>

<section anchor="contentencodingorder-element"><name>ContentEncodingOrder Element</name>

<dl>
<dt>name:</dt>
<dd>ContentEncodingOrder</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncodingOrder</tt></dd>
<dt>id:</dt>
<dd>0x5031</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Tells when this modification was used during encoding/muxing starting with 0 and counting upwards.
The decoder/demuxer has to start with the highest order number it finds and work its way down.
This value has to be unique over all ContentEncodingOrder Elements in the TrackEntry that contains this ContentEncodingOrder element.</dd>
</dl>
</section>

<section anchor="contentencodingscope-element"><name>ContentEncodingScope Element</name>

<dl>
<dt>name:</dt>
<dd>ContentEncodingScope</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncodingScope</tt></dd>
<dt>id:</dt>
<dd>0x5032</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>default:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>A bit field that describes which Elements have been modified in this way.
Values (big-endian) can be OR'ed.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>1</tt></td>
<td align="left">All frame contents, excluding lacing data</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">The track's private data</td>
</tr>

<tr>
<td align="left"><tt>4</tt></td>
<td align="left">The next ContentEncoding (next <tt>ContentEncodingOrder</tt>. Either the data inside <tt>ContentCompression</tt> and/or <tt>ContentEncryption</tt>)</td>
</tr>
</tbody>
</table></section>

<section anchor="contentencodingtype-element"><name>ContentEncodingType Element</name>

<dl>
<dt>name:</dt>
<dd>ContentEncodingType</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncodingType</tt></dd>
<dt>id:</dt>
<dd>0x5033</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>A value describing what kind of transformation is applied.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">Compression</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">Encryption</td>
</tr>
</tbody>
</table></section>

<section anchor="contentcompression-element"><name>ContentCompression Element</name>

<dl>
<dt>name:</dt>
<dd>ContentCompression</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentCompression</tt></dd>
<dt>id:</dt>
<dd>0x5034</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Settings describing the compression used.
This Element <bcp14>MUST</bcp14> be present if the value of ContentEncodingType is 0 and absent otherwise.
Each block <bcp14>MUST</bcp14> be decompressable even if no previous block is available in order not to prevent seeking.</dd>
</dl>
</section>

<section anchor="contentcompalgo-element"><name>ContentCompAlgo Element</name>

<dl>
<dt>name:</dt>
<dd>ContentCompAlgo</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentCompression\ContentCompAlgo</tt></dd>
<dt>id:</dt>
<dd>0x4254</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The compression algorithm used.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">zlib</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">bzlib</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">lzo1x</td>
</tr>

<tr>
<td align="left"><tt>3</tt></td>
<td align="left">Header Stripping</td>
</tr>
</tbody>
</table></section>

<section anchor="contentcompsettings-element"><name>ContentCompSettings Element</name>

<dl>
<dt>name:</dt>
<dd>ContentCompSettings</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentCompression\ContentCompSettings</tt></dd>
<dt>id:</dt>
<dd>0x4255</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>Settings that might be needed by the decompressor. For Header Stripping (<tt>ContentCompAlgo</tt>=3),
the bytes that were removed from the beginning of each frames of the track.</dd>
</dl>
</section>

<section anchor="contentencryption-element"><name>ContentEncryption Element</name>

<dl>
<dt>name:</dt>
<dd>ContentEncryption</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption</tt></dd>
<dt>id:</dt>
<dd>0x5035</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Settings describing the encryption used.
This Element <bcp14>MUST</bcp14> be present if the value of <tt>ContentEncodingType</tt> is 1 (encryption) and <bcp14>MUST</bcp14> be ignored otherwise.</dd>
</dl>
</section>

<section anchor="contentencalgo-element"><name>ContentEncAlgo Element</name>

<dl>
<dt>name:</dt>
<dd>ContentEncAlgo</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentEncAlgo</tt></dd>
<dt>id:</dt>
<dd>0x47E1</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The encryption algorithm used.
The value &quot;0&quot; means that the contents have not been encrypted but only signed.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">Not encrypted</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">DES - FIPS 46-3</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">Triple DES - RFC 1851</td>
</tr>

<tr>
<td align="left"><tt>3</tt></td>
<td align="left">Twofish</td>
</tr>

<tr>
<td align="left"><tt>4</tt></td>
<td align="left">Blowfish</td>
</tr>

<tr>
<td align="left"><tt>5</tt></td>
<td align="left">AES - FIPS 187</td>
</tr>
</tbody>
</table></section>

<section anchor="contentenckeyid-element"><name>ContentEncKeyID Element</name>

<dl>
<dt>name:</dt>
<dd>ContentEncKeyID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentEncKeyID</tt></dd>
<dt>id:</dt>
<dd>0x47E2</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>For public key algorithms this is the ID of the public key the the data was encrypted with.</dd>
</dl>
</section>

<section anchor="contentencaessettings-element"><name>ContentEncAESSettings Element</name>

<dl>
<dt>name:</dt>
<dd>ContentEncAESSettings</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentEncAESSettings</tt></dd>
<dt>id:</dt>
<dd>0x47E7</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Settings describing the encryption algorithm used.
If <tt>ContentEncAlgo</tt> != 5 this <bcp14>MUST</bcp14> be ignored.</dd>
</dl>
</section>

<section anchor="aessettingsciphermode-element"><name>AESSettingsCipherMode Element</name>

<dl>
<dt>name:</dt>
<dd>AESSettingsCipherMode</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentEncAESSettings\AESSettingsCipherMode</tt></dd>
<dt>id:</dt>
<dd>0x47E8</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>The AES cipher mode used in the encryption.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>1</tt></td>
<td align="left">AES-CTR / Counter, NIST SP 800-38A</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">AES-CBC / Cipher Block Chaining, NIST SP 800-38A</td>
</tr>
</tbody>
</table></section>

<section anchor="contentsignature-element"><name>ContentSignature Element</name>

<dl>
<dt>name:</dt>
<dd>ContentSignature</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentSignature</tt></dd>
<dt>id:</dt>
<dd>0x47E3</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>A cryptographic signature of the contents.</dd>
</dl>
</section>

<section anchor="contentsigkeyid-element"><name>ContentSigKeyID Element</name>

<dl>
<dt>name:</dt>
<dd>ContentSigKeyID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentSigKeyID</tt></dd>
<dt>id:</dt>
<dd>0x47E4</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>This is the ID of the private key the data was signed with.</dd>
</dl>
</section>

<section anchor="contentsigalgo-element"><name>ContentSigAlgo Element</name>

<dl>
<dt>name:</dt>
<dd>ContentSigAlgo</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentSigAlgo</tt></dd>
<dt>id:</dt>
<dd>0x47E5</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The algorithm used for the signature.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">Not signed</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">RSA</td>
</tr>
</tbody>
</table></section>

<section anchor="contentsighashalgo-element"><name>ContentSigHashAlgo Element</name>

<dl>
<dt>name:</dt>
<dd>ContentSigHashAlgo</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentSigHashAlgo</tt></dd>
<dt>id:</dt>
<dd>0x47E6</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The hash algorithm used for the signature.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">Not signed</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">SHA1-160</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">MD5</td>
</tr>
</tbody>
</table></section>
</section>
</section>
</section>
</section>

<section anchor="cues-element"><name>Cues Element</name>

<dl>
<dt>name:</dt>
<dd>Cues</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues</tt></dd>
<dt>id:</dt>
<dd>0x1C53BB6B</dd>
</dl>
<t>minOccurs: see implementation notes</t>

<dl>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>A Top-Level Element to speed seeking access.
All entries are local to the Segment.</dd>
</dl>
<t>implementation notes:</t>
<table>
<thead>
<tr>
<th align="left">attribute</th>
<th align="left">note</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">minOccurs</td>
<td align="left">This Element <bcp14>SHOULD</bcp14> be set when the Segment is not transmitted as a live stream (see #livestreaming).</td>
</tr>
</tbody>
</table>
<section anchor="cuepoint-element"><name>CuePoint Element</name>

<dl>
<dt>name:</dt>
<dd>CuePoint</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint</tt></dd>
<dt>id:</dt>
<dd>0xBB</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Contains all information relative to a seek point in the Segment.</dd>
</dl>

<section anchor="cuetime-element"><name>CueTime Element</name>

<dl>
<dt>name:</dt>
<dd>CueTime</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTime</tt></dd>
<dt>id:</dt>
<dd>0xB3</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Absolute timestamp according to the Segment time base.</dd>
</dl>
</section>

<section anchor="cuetrackpositions-element"><name>CueTrackPositions Element</name>

<dl>
<dt>name:</dt>
<dd>CueTrackPositions</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTrackPositions</tt></dd>
<dt>id:</dt>
<dd>0xB7</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Contain positions for different tracks corresponding to the timestamp.</dd>
</dl>

<section anchor="cuetrack-element"><name>CueTrack Element</name>

<dl>
<dt>name:</dt>
<dd>CueTrack</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTrackPositions\CueTrack</tt></dd>
<dt>id:</dt>
<dd>0xF7</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The track for which a position is given.</dd>
</dl>
</section>

<section anchor="cueclusterposition-element"><name>CueClusterPosition Element</name>

<dl>
<dt>name:</dt>
<dd>CueClusterPosition</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTrackPositions\CueClusterPosition</tt></dd>
<dt>id:</dt>
<dd>0xF1</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The Segment Position of the Cluster containing the associated Block.</dd>
</dl>
</section>

<section anchor="cuerelativeposition-element"><name>CueRelativePosition Element</name>

<dl>
<dt>name:</dt>
<dd>CueRelativePosition</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTrackPositions\CueRelativePosition</tt></dd>
<dt>id:</dt>
<dd>0xF0</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>The relative position inside the Cluster of the referenced SimpleBlock or BlockGroup
with 0 being the first possible position for an Element inside that Cluster.</dd>
</dl>
</section>

<section anchor="cueduration-element"><name>CueDuration Element</name>

<dl>
<dt>name:</dt>
<dd>CueDuration</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTrackPositions\CueDuration</tt></dd>
<dt>id:</dt>
<dd>0xB2</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>The duration of the block according to the Segment time base.
If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues.</dd>
</dl>
</section>

<section anchor="cueblocknumber-element"><name>CueBlockNumber Element</name>

<dl>
<dt>name:</dt>
<dd>CueBlockNumber</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTrackPositions\CueBlockNumber</tt></dd>
<dt>id:</dt>
<dd>0x5378</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>default:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Number of the Block in the specified Cluster.</dd>
</dl>
</section>

<section anchor="cuecodecstate-element"><name>CueCodecState Element</name>

<dl>
<dt>name:</dt>
<dd>CueCodecState</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTrackPositions\CueCodecState</tt></dd>
<dt>id:</dt>
<dd>0xEA</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>2</dd>
<dt>definition:</dt>
<dd>The Segment Position of the Codec State corresponding to this Cue Element.
0 means that the data is taken from the initial Track Entry.</dd>
</dl>
</section>

<section anchor="cuereference-element"><name>CueReference Element</name>

<dl>
<dt>name:</dt>
<dd>CueReference</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTrackPositions\CueReference</tt></dd>
<dt>id:</dt>
<dd>0xDB</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>minver:</dt>
<dd>2</dd>
<dt>definition:</dt>
<dd>The Clusters containing the referenced Blocks.</dd>
</dl>

<section anchor="cuereftime-element"><name>CueRefTime Element</name>

<dl>
<dt>name:</dt>
<dd>CueRefTime</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefTime</tt></dd>
<dt>id:</dt>
<dd>0x96</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>2</dd>
<dt>definition:</dt>
<dd>Timestamp of the referenced Block.</dd>
</dl>
</section>

<section anchor="cuerefcluster-element"><name>CueRefCluster Element</name>

<dl>
<dt>name:</dt>
<dd>CueRefCluster</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefCluster</tt></dd>
<dt>id:</dt>
<dd>0x97</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>The Segment Position of the Cluster containing the referenced Block.</dd>
</dl>
</section>

<section anchor="cuerefnumber-element"><name>CueRefNumber Element</name>

<dl>
<dt>name:</dt>
<dd>CueRefNumber</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefNumber</tt></dd>
<dt>id:</dt>
<dd>0x535F</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>default:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>Number of the referenced Block of Track X in the specified Cluster.</dd>
</dl>
</section>

<section anchor="cuerefcodecstate-element"><name>CueRefCodecState Element</name>

<dl>
<dt>name:</dt>
<dd>CueRefCodecState</dd>
<dt>path:</dt>
<dd><tt>\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefCodecState</tt></dd>
<dt>id:</dt>
<dd>0xEB</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>The Segment Position of the Codec State corresponding to this referenced Element.
0 means that the data is taken from the initial Track Entry.</dd>
</dl>
</section>
</section>
</section>
</section>
</section>

<section anchor="attachments-element"><name>Attachments Element</name>

<dl>
<dt>name:</dt>
<dd>Attachments</dd>
<dt>path:</dt>
<dd><tt>\Segment\Attachments</tt></dd>
<dt>id:</dt>
<dd>0x1941A469</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Contain attached files.</dd>
</dl>

<section anchor="attachedfile-element"><name>AttachedFile Element</name>

<dl>
<dt>name:</dt>
<dd>AttachedFile</dd>
<dt>path:</dt>
<dd><tt>\Segment\Attachments\AttachedFile</tt></dd>
<dt>id:</dt>
<dd>0x61A7</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>An attached file.</dd>
</dl>

<section anchor="filedescription-element"><name>FileDescription Element</name>

<dl>
<dt>name:</dt>
<dd>FileDescription</dd>
<dt>path:</dt>
<dd><tt>\Segment\Attachments\AttachedFile\FileDescription</tt></dd>
<dt>id:</dt>
<dd>0x467E</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>A human-friendly name for the attached file.</dd>
</dl>
</section>

<section anchor="filename-element"><name>FileName Element</name>

<dl>
<dt>name:</dt>
<dd>FileName</dd>
<dt>path:</dt>
<dd><tt>\Segment\Attachments\AttachedFile\FileName</tt></dd>
<dt>id:</dt>
<dd>0x466E</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>Filename of the attached file.</dd>
</dl>
</section>

<section anchor="filemimetype-element"><name>FileMimeType Element</name>

<dl>
<dt>name:</dt>
<dd>FileMimeType</dd>
<dt>path:</dt>
<dd><tt>\Segment\Attachments\AttachedFile\FileMimeType</tt></dd>
<dt>id:</dt>
<dd>0x4660</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>definition:</dt>
<dd>MIME type of the file.</dd>
</dl>
</section>

<section anchor="filedata-element"><name>FileData Element</name>

<dl>
<dt>name:</dt>
<dd>FileData</dd>
<dt>path:</dt>
<dd><tt>\Segment\Attachments\AttachedFile\FileData</tt></dd>
<dt>id:</dt>
<dd>0x465C</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>The data of the file.</dd>
</dl>
</section>

<section anchor="fileuid-element"><name>FileUID Element</name>

<dl>
<dt>name:</dt>
<dd>FileUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Attachments\AttachedFile\FileUID</tt></dd>
<dt>id:</dt>
<dd>0x46AE</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Unique ID representing the file, as random as possible.</dd>
</dl>
</section>

<section anchor="filereferral-element"><name>FileReferral Element</name>

<dl>
<dt>name:</dt>
<dd>FileReferral</dd>
<dt>path:</dt>
<dd><tt>\Segment\Attachments\AttachedFile\FileReferral</tt></dd>
<dt>id:</dt>
<dd>0x4675</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>A binary value that a track/codec can refer to when the attachment is needed.</dd>
</dl>
</section>

<section anchor="fileusedstarttime-element"><name>FileUsedStartTime Element</name>

<dl>
<dt>name:</dt>
<dd>FileUsedStartTime</dd>
<dt>path:</dt>
<dd><tt>\Segment\Attachments\AttachedFile\FileUsedStartTime</tt></dd>
<dt>id:</dt>
<dd>0x4661</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>
  DivX font extension</dd>
</dl>
</section>

<section anchor="fileusedendtime-element"><name>FileUsedEndTime Element</name>

<dl>
<dt>name:</dt>
<dd>FileUsedEndTime</dd>
<dt>path:</dt>
<dd><tt>\Segment\Attachments\AttachedFile\FileUsedEndTime</tt></dd>
<dt>id:</dt>
<dd>0x4662</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>minver:</dt>
<dd>0</dd>
<dt>maxver:</dt>
<dd>0</dd>
<dt>definition:</dt>
<dd>
  DivX font extension</dd>
</dl>
</section>
</section>
</section>

<section anchor="chapters-element"><name>Chapters Element</name>

<dl>
<dt>name:</dt>
<dd>Chapters</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters</tt></dd>
<dt>id:</dt>
<dd>0x1043A770</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>recurring:</dt>
<dd>1</dd>
<dt>definition:</dt>
<dd>A system to define basic menus and partition data.
For more detailed information, look at the Chapters explanation in <xref target="chapters"></xref>.</dd>
</dl>

<section anchor="editionentry-element"><name>EditionEntry Element</name>

<dl>
<dt>name:</dt>
<dd>EditionEntry</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry</tt></dd>
<dt>id:</dt>
<dd>0x45B9</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Contains all information about a Segment edition.</dd>
</dl>

<section anchor="editionuid-element"><name>EditionUID Element</name>

<dl>
<dt>name:</dt>
<dd>EditionUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\EditionUID</tt></dd>
<dt>id:</dt>
<dd>0x45BC</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>A unique ID to identify the edition. It's useful for tagging an edition.</dd>
</dl>
</section>

<section anchor="editionflaghidden-element"><name>EditionFlagHidden Element</name>

<dl>
<dt>name:</dt>
<dd>EditionFlagHidden</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\EditionFlagHidden</tt></dd>
<dt>id:</dt>
<dd>0x45BD</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>If an edition is hidden (1), it <bcp14>SHOULD NOT</bcp14> be available to the user interface
(but still to Control Tracks; see <xref target="chapter-flags"></xref> on Chapter flags). (1 bit)</dd>
</dl>
</section>

<section anchor="editionflagdefault-element"><name>EditionFlagDefault Element</name>

<dl>
<dt>name:</dt>
<dd>EditionFlagDefault</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\EditionFlagDefault</tt></dd>
<dt>id:</dt>
<dd>0x45DB</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>If a flag is set (1) the edition <bcp14>SHOULD</bcp14> be used as the default one. (1 bit)</dd>
</dl>
</section>

<section anchor="editionflagordered-element"><name>EditionFlagOrdered Element</name>

<dl>
<dt>name:</dt>
<dd>EditionFlagOrdered</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\EditionFlagOrdered</tt></dd>
<dt>id:</dt>
<dd>0x45DD</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)</dd>
</dl>
</section>

<section anchor="chapteratom-element"><name>ChapterAtom Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterAtom</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom</tt></dd>
<dt>id:</dt>
<dd>0xB6</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>recursive:</dt>
<dd>1</dd>
<dt>definition:</dt>
<dd>Contains the atom information to use as the chapter atom (apply to all tracks).</dd>
</dl>

<section anchor="chapteruid-element"><name>ChapterUID Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterUID</tt></dd>
<dt>id:</dt>
<dd>0x73C4</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>A unique ID to identify the Chapter.</dd>
</dl>
</section>

<section anchor="chapterstringuid-element"><name>ChapterStringUID Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterStringUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterStringUID</tt></dd>
<dt>id:</dt>
<dd>0x5654</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>minver:</dt>
<dd>3</dd>
<dt>definition:</dt>
<dd>A unique string ID to identify the Chapter.
Use for WebVTT cue identifier storage.</dd>
</dl>
</section>

<section anchor="chaptertimestart-element"><name>ChapterTimeStart Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterTimeStart</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterTimeStart</tt></dd>
<dt>id:</dt>
<dd>0x91</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Timestamp of the start of Chapter (not scaled).</dd>
</dl>
</section>

<section anchor="chaptertimeend-element"><name>ChapterTimeEnd Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterTimeEnd</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterTimeEnd</tt></dd>
<dt>id:</dt>
<dd>0x92</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Timestamp of the end of Chapter (timestamp excluded, not scaled).</dd>
</dl>
</section>

<section anchor="chapterflaghidden-element"><name>ChapterFlagHidden Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterFlagHidden</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterFlagHidden</tt></dd>
<dt>id:</dt>
<dd>0x98</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>If a chapter is hidden (1), it <bcp14>SHOULD NOT</bcp14> be available to the user interface
(but still to Control Tracks; see <xref target="chapter-flags"></xref> on Chapter flags). (1 bit)</dd>
</dl>
</section>

<section anchor="chapterflagenabled-element"><name>ChapterFlagEnabled Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterFlagEnabled</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterFlagEnabled</tt></dd>
<dt>id:</dt>
<dd>0x4598</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>default:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Specify whether the chapter is enabled. It can be enabled/disabled by a Control Track.
When disabled, the movie <bcp14>SHOULD</bcp14> skip all the content between the TimeStart and TimeEnd of this chapter; see <xref target="chapter-flags"></xref> on Chapter flags. (1 bit)</dd>
</dl>
</section>

<section anchor="chaptersegmentuid-element"><name>ChapterSegmentUID Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterSegmentUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterSegmentUID</tt></dd>
<dt>id:</dt>
<dd>0x6E67</dd>
</dl>
<t>minOccurs: see implementation notes</t>

<dl>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>&gt;0</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>The SegmentUID of another Segment to play during this chapter.</dd>
</dl>
<t>implementation notes:</t>
<table>
<thead>
<tr>
<th align="left">attribute</th>
<th align="left">note</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">minOccurs</td>
<td align="left">ChapterSegmentUID <bcp14>MUST</bcp14> be set (minOccurs=1) if ChapterSegmentEditionUID is used.</td>
</tr>
</tbody>
</table></section>

<section anchor="chaptersegmenteditionuid-element"><name>ChapterSegmentEditionUID Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterSegmentEditionUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterSegmentEditionUID</tt></dd>
<dt>id:</dt>
<dd>0x6EBC</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>The EditionUID to play from the Segment linked in ChapterSegmentUID.
If ChapterSegmentEditionUID is undeclared, then no Edition of the linked Segment is used.</dd>
</dl>
</section>

<section anchor="chapterphysicalequiv-element"><name>ChapterPhysicalEquiv Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterPhysicalEquiv</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterPhysicalEquiv</tt></dd>
<dt>id:</dt>
<dd>0x63C3</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Specify the physical equivalent of this ChapterAtom like &quot;DVD&quot; (60) or &quot;SIDE&quot; (50);
see <xref target="physical-types"></xref> for a complete list of values.</dd>
</dl>
</section>

<section anchor="chaptertrack-element"><name>ChapterTrack Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterTrack</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterTrack</tt></dd>
<dt>id:</dt>
<dd>0x8F</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>List of tracks on which the chapter applies. If this Element is not present, all tracks apply</dd>
</dl>

<section anchor="chaptertrackuid-element"><name>ChapterTrackUID Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterTrackUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterTrack\ChapterTrackUID</tt></dd>
<dt>id:</dt>
<dd>0x89</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>not 0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>UID of the Track to apply this chapter to.
In the absence of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks.
Absence of this Element indicates that the Chapter <bcp14>SHOULD</bcp14> be applied to any currently used Tracks.</dd>
</dl>
</section>
</section>

<section anchor="chapterdisplay-element"><name>ChapterDisplay Element</name>

<dl>
<dt>name:</dt>
<dd>ChapterDisplay</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay</tt></dd>
<dt>id:</dt>
<dd>0x80</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Contains all possible strings to use for the chapter display.</dd>
</dl>

<section anchor="chapstring-element"><name>ChapString Element</name>

<dl>
<dt>name:</dt>
<dd>ChapString</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay\ChapString</tt></dd>
<dt>id:</dt>
<dd>0x85</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>Contains the string to use as the chapter atom.</dd>
</dl>
</section>

<section anchor="chaplanguage-element"><name>ChapLanguage Element</name>

<dl>
<dt>name:</dt>
<dd>ChapLanguage</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay\ChapLanguage</tt></dd>
<dt>id:</dt>
<dd>0x437C</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>eng</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>definition:</dt>
<dd>The languages corresponding to the string,
in the bibliographic ISO-639-2 form.
This Element <bcp14>MUST</bcp14> be ignored if the ChapLanguageIETF Element is used within the same ChapterDisplay Element.</dd>
</dl>
</section>

<section anchor="chaplanguageietf-element"><name>ChapLanguageIETF Element</name>

<dl>
<dt>name:</dt>
<dd>ChapLanguageIETF</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay\ChapLanguageIETF</tt></dd>
<dt>id:</dt>
<dd>0x437D</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Specifies the language used in the ChapString according to BCP 47
and using the IANA Language Subtag Registry.
If this Element is used, then any ChapLanguage Elements used in the same ChapterDisplay <bcp14>MUST</bcp14> be ignored.</dd>
</dl>
</section>

<section anchor="chapcountry-element"><name>ChapCountry Element</name>

<dl>
<dt>name:</dt>
<dd>ChapCountry</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay\ChapCountry</tt></dd>
<dt>id:</dt>
<dd>0x437E</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>definition:</dt>
<dd>The countries corresponding to the string, same 2 octets as in Internet domains.
This Element <bcp14>MUST</bcp14> be ignored if the ChapLanguageIETF Element is used within the same ChapterDisplay Element.</dd>
</dl>
</section>
</section>

<section anchor="chapprocess-element"><name>ChapProcess Element</name>

<dl>
<dt>name:</dt>
<dd>ChapProcess</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess</tt></dd>
<dt>id:</dt>
<dd>0x6944</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Contains all the commands associated to the Atom.</dd>
</dl>

<section anchor="chapprocesscodecid-element"><name>ChapProcessCodecID Element</name>

<dl>
<dt>name:</dt>
<dd>ChapProcessCodecID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapProcessCodecID</tt></dd>
<dt>id:</dt>
<dd>0x6955</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Contains the type of the codec used for the processing.
A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used; see <xref target="dvd-menu-1"></xref> on DVD menus.
More codec IDs can be added later.</dd>
</dl>
</section>

<section anchor="chapprocessprivate-element"><name>ChapProcessPrivate Element</name>

<dl>
<dt>name:</dt>
<dd>ChapProcessPrivate</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapProcessPrivate</tt></dd>
<dt>id:</dt>
<dd>0x450D</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>Some optional data attached to the ChapProcessCodecID information.
For ChapProcessCodecID = 1, it is the &quot;DVD level&quot; equivalent; see <xref target="dvd-menu-1"></xref> on DVD menus.</dd>
</dl>
</section>

<section anchor="chapprocesscommand-element"><name>ChapProcessCommand Element</name>

<dl>
<dt>name:</dt>
<dd>ChapProcessCommand</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapProcessCommand</tt></dd>
<dt>id:</dt>
<dd>0x6911</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Contains all the commands associated to the Atom.</dd>
</dl>
</section>

<section anchor="chapprocesstime-element"><name>ChapProcessTime Element</name>

<dl>
<dt>name:</dt>
<dd>ChapProcessTime</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapProcessCommand\ChapProcessTime</tt></dd>
<dt>id:</dt>
<dd>0x6922</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>Defines when the process command <bcp14>SHOULD</bcp14> be handled</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>0</tt></td>
<td align="left">during the whole chapter</td>
</tr>

<tr>
<td align="left"><tt>1</tt></td>
<td align="left">before starting playback</td>
</tr>

<tr>
<td align="left"><tt>2</tt></td>
<td align="left">after playback of the chapter</td>
</tr>
</tbody>
</table></section>

<section anchor="chapprocessdata-element"><name>ChapProcessData Element</name>

<dl>
<dt>name:</dt>
<dd>ChapProcessData</dd>
<dt>path:</dt>
<dd><tt>\Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapProcessCommand\ChapProcessData</tt></dd>
<dt>id:</dt>
<dd>0x6933</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>Contains the command information.
The data <bcp14>SHOULD</bcp14> be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1,
the data correspond to the binary DVD cell pre/post commands; see <xref target="dvd-menu-1"></xref> on DVD menus.</dd>
</dl>
</section>
</section>
</section>
</section>
</section>

<section anchor="tags-element"><name>Tags Element</name>

<dl>
<dt>name:</dt>
<dd>Tags</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags</tt></dd>
<dt>id:</dt>
<dd>0x1254C367</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Element containing metadata describing Tracks, Editions, Chapters, Attachments, or the Segment as a whole.
A list of valid tags can be found in <xref target="I-D.ietf-cellar-tags"></xref>.</dd>
</dl>

<section anchor="tag-element"><name>Tag Element</name>

<dl>
<dt>name:</dt>
<dd>Tag</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag</tt></dd>
<dt>id:</dt>
<dd>0x7373</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>A single metadata descriptor.</dd>
</dl>

<section anchor="targets-element"><name>Targets Element</name>

<dl>
<dt>name:</dt>
<dd>Targets</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\Targets</tt></dd>
<dt>id:</dt>
<dd>0x63C0</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>definition:</dt>
<dd>Specifies which other elements the metadata represented by the Tag applies to.
If empty or not present, then the Tag describes everything in the Segment.</dd>
</dl>

<section anchor="targettypevalue-element"><name>TargetTypeValue Element</name>

<dl>
<dt>name:</dt>
<dd>TargetTypeValue</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\Targets\TargetTypeValue</tt></dd>
<dt>id:</dt>
<dd>0x68CA</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>50</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>A number to indicate the logical level of the target.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
<th align="left">documentation</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>70</tt></td>
<td align="left">COLLECTION</td>
<td align="left">The highest hierarchical level that tags can describe.</td>
</tr>

<tr>
<td align="left"><tt>60</tt></td>
<td align="left">EDITION / ISSUE / VOLUME / OPUS / SEASON / SEQUEL</td>
<td align="left">A list of lower levels grouped together.</td>
</tr>

<tr>
<td align="left"><tt>50</tt></td>
<td align="left">ALBUM / OPERA / CONCERT / MOVIE / EPISODE / CONCERT</td>
<td align="left">The most common grouping level of music and video (equals to an episode for TV series).</td>
</tr>

<tr>
<td align="left"><tt>40</tt></td>
<td align="left">PART / SESSION</td>
<td align="left">When an album or episode has different logical parts.</td>
</tr>

<tr>
<td align="left"><tt>30</tt></td>
<td align="left">TRACK / SONG / CHAPTER</td>
<td align="left">The common parts of an album or movie.</td>
</tr>

<tr>
<td align="left"><tt>20</tt></td>
<td align="left">SUBTRACK / PART / MOVEMENT / SCENE</td>
<td align="left">Corresponds to parts of a track for audio (like a movement).</td>
</tr>

<tr>
<td align="left"><tt>10</tt></td>
<td align="left">SHOT</td>
<td align="left">The lowest hierarchy found in music or movies.</td>
</tr>
</tbody>
</table></section>

<section anchor="targettype-element"><name>TargetType Element</name>

<dl>
<dt>name:</dt>
<dd>TargetType</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\Targets\TargetType</tt></dd>
<dt>id:</dt>
<dd>0x63CA</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>definition:</dt>
<dd>An informational string that can be used to display the logical level of the target like &quot;ALBUM&quot;, &quot;TRACK&quot;, &quot;MOVIE&quot;, &quot;CHAPTER&quot;, etc
; see Section 6.4 of <xref target="I-D.ietf-cellar-tags"></xref>.</dd>
</dl>
<t>restrictions:</t>
<table>
<thead>
<tr>
<th align="left">value</th>
<th align="left">label</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>COLLECTION</tt></td>
<td align="left">COLLECTION</td>
</tr>

<tr>
<td align="left"><tt>EDITION</tt></td>
<td align="left">EDITION</td>
</tr>

<tr>
<td align="left"><tt>ISSUE</tt></td>
<td align="left">ISSUE</td>
</tr>

<tr>
<td align="left"><tt>VOLUME</tt></td>
<td align="left">VOLUME</td>
</tr>

<tr>
<td align="left"><tt>OPUS</tt></td>
<td align="left">OPUS</td>
</tr>

<tr>
<td align="left"><tt>SEASON</tt></td>
<td align="left">SEASON</td>
</tr>

<tr>
<td align="left"><tt>SEQUEL</tt></td>
<td align="left">SEQUEL</td>
</tr>

<tr>
<td align="left"><tt>ALBUM</tt></td>
<td align="left">ALBUM</td>
</tr>

<tr>
<td align="left"><tt>OPERA</tt></td>
<td align="left">OPERA</td>
</tr>

<tr>
<td align="left"><tt>CONCERT</tt></td>
<td align="left">CONCERT</td>
</tr>

<tr>
<td align="left"><tt>MOVIE</tt></td>
<td align="left">MOVIE</td>
</tr>

<tr>
<td align="left"><tt>EPISODE</tt></td>
<td align="left">EPISODE</td>
</tr>

<tr>
<td align="left"><tt>PART</tt></td>
<td align="left">PART</td>
</tr>

<tr>
<td align="left"><tt>SESSION</tt></td>
<td align="left">SESSION</td>
</tr>

<tr>
<td align="left"><tt>TRACK</tt></td>
<td align="left">TRACK</td>
</tr>

<tr>
<td align="left"><tt>SONG</tt></td>
<td align="left">SONG</td>
</tr>

<tr>
<td align="left"><tt>CHAPTER</tt></td>
<td align="left">CHAPTER</td>
</tr>

<tr>
<td align="left"><tt>SUBTRACK</tt></td>
<td align="left">SUBTRACK</td>
</tr>

<tr>
<td align="left"><tt>PART</tt></td>
<td align="left">PART</td>
</tr>

<tr>
<td align="left"><tt>MOVEMENT</tt></td>
<td align="left">MOVEMENT</td>
</tr>

<tr>
<td align="left"><tt>SCENE</tt></td>
<td align="left">SCENE</td>
</tr>

<tr>
<td align="left"><tt>SHOT</tt></td>
<td align="left">SHOT</td>
</tr>
</tbody>
</table></section>

<section anchor="tagtrackuid-element"><name>TagTrackUID Element</name>

<dl>
<dt>name:</dt>
<dd>TagTrackUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\Targets\TagTrackUID</tt></dd>
<dt>id:</dt>
<dd>0x63C5</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>A unique ID to identify the Track(s) the tags belong to.
If the value is 0 at this level, the tags apply to all tracks in the Segment.</dd>
</dl>
</section>

<section anchor="tageditionuid-element"><name>TagEditionUID Element</name>

<dl>
<dt>name:</dt>
<dd>TagEditionUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\Targets\TagEditionUID</tt></dd>
<dt>id:</dt>
<dd>0x63C9</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>A unique ID to identify the EditionEntry(s) the tags belong to.
If the value is 0 at this level, the tags apply to all editions in the Segment.</dd>
</dl>
</section>

<section anchor="tagchapteruid-element"><name>TagChapterUID Element</name>

<dl>
<dt>name:</dt>
<dd>TagChapterUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\Targets\TagChapterUID</tt></dd>
<dt>id:</dt>
<dd>0x63C4</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>A unique ID to identify the Chapter(s) the tags belong to.
If the value is 0 at this level, the tags apply to all chapters in the Segment.</dd>
</dl>
</section>

<section anchor="tagattachmentuid-element"><name>TagAttachmentUID Element</name>

<dl>
<dt>name:</dt>
<dd>TagAttachmentUID</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\Targets\TagAttachmentUID</tt></dd>
<dt>id:</dt>
<dd>0x63C6</dd>
<dt>default:</dt>
<dd>0</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>A unique ID to identify the Attachment(s) the tags belong to.
If the value is 0 at this level, the tags apply to all the attachments in the Segment.</dd>
</dl>
</section>
</section>

<section anchor="simpletag-element"><name>SimpleTag Element</name>

<dl>
<dt>name:</dt>
<dd>SimpleTag</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\+SimpleTag</tt></dd>
<dt>id:</dt>
<dd>0x67C8</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>master</dd>
<dt>recursive:</dt>
<dd>1</dd>
<dt>definition:</dt>
<dd>Contains general information about the target.</dd>
</dl>

<section anchor="tagname-element"><name>TagName Element</name>

<dl>
<dt>name:</dt>
<dd>TagName</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\+SimpleTag\TagName</tt></dd>
<dt>id:</dt>
<dd>0x45A3</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>The name of the Tag that is going to be stored.</dd>
</dl>
</section>

<section anchor="taglanguage-element"><name>TagLanguage Element</name>

<dl>
<dt>name:</dt>
<dd>TagLanguage</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\+SimpleTag\TagLanguage</tt></dd>
<dt>id:</dt>
<dd>0x447A</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>default:</dt>
<dd>und</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>definition:</dt>
<dd>Specifies the language of the tag specified, in the Matroska languages form;
see <xref target="language-codes"></xref> on language codes.
This Element <bcp14>MUST</bcp14> be ignored if the TagLanguageIETF Element is used within the same SimpleTag Element.</dd>
</dl>
</section>

<section anchor="taglanguageietf-element"><name>TagLanguageIETF Element</name>

<dl>
<dt>name:</dt>
<dd>TagLanguageIETF</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\+SimpleTag\TagLanguageIETF</tt></dd>
<dt>id:</dt>
<dd>0x447B</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>string</dd>
<dt>minver:</dt>
<dd>4</dd>
<dt>definition:</dt>
<dd>Specifies the language used in the TagString according to BCP 47
and using the IANA Language Subtag Registry.
If this Element is used, then any TagLanguage Elements used in the same SimpleTag <bcp14>MUST</bcp14> be ignored.</dd>
</dl>
</section>

<section anchor="tagdefault-element"><name>TagDefault Element</name>

<dl>
<dt>name:</dt>
<dd>TagDefault</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\+SimpleTag\TagDefault</tt></dd>
<dt>id:</dt>
<dd>0x4484</dd>
<dt>minOccurs:</dt>
<dd>1</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>range:</dt>
<dd>0-1</dd>
<dt>default:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>uinteger</dd>
<dt>definition:</dt>
<dd>A boolean value to indicate if this is the default/original language to use for the given tag.</dd>
</dl>
</section>

<section anchor="tagstring-element"><name>TagString Element</name>

<dl>
<dt>name:</dt>
<dd>TagString</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\+SimpleTag\TagString</tt></dd>
<dt>id:</dt>
<dd>0x4487</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>utf-8</dd>
<dt>definition:</dt>
<dd>The value of the Tag.</dd>
</dl>
</section>

<section anchor="tagbinary-element"><name>TagBinary Element</name>

<dl>
<dt>name:</dt>
<dd>TagBinary</dd>
<dt>path:</dt>
<dd><tt>\Segment\Tags\Tag\+SimpleTag\TagBinary</tt></dd>
<dt>id:</dt>
<dd>0x4485</dd>
<dt>maxOccurs:</dt>
<dd>1</dd>
<dt>type:</dt>
<dd>binary</dd>
<dt>definition:</dt>
<dd>The values of the Tag, if it is binary. Note that this cannot be used in the same SimpleTag as TagString.</dd>
</dl>
</section>
</section>
</section>
</section>
</section>

<section anchor="matroska-element-ordering"><name>Matroska Element Ordering</name>
<t>Except for the <tt>EBML Header</tt> and the <tt>CRC-32 Element</tt>, the EBML specification does not
require any particular storage order for <tt>Elements</tt>. The Matroska specification however
defines mandates and recommendations for ordering certain <tt>Elements</tt> in order to facilitate
better playback, seeking, and editing efficiency. This section describes and offers
rationale for ordering requirements and recommendations for Matroska.</t>

<section anchor="top-level-elements"><name>Top-Level Elements</name>
<t>The <tt>Info Element</tt> is the only <bcp14>REQUIRED</bcp14> <tt>Top-Level Element</tt> in a Matroska file.
To be playable, Matroska <bcp14>MUST</bcp14> also contain at least one <tt>Tracks Element</tt> and <tt>Cluster Element</tt>.
The first <tt>Info Element</tt> and the first <tt>Tracks Element</tt> <bcp14>MUST</bcp14> either be stored before the first
<tt>Cluster Element</tt> or both <bcp14>SHALL</bcp14> be referenced by a <tt>SeekHead Element</tt> occurring before the first <tt>Cluster Element</tt>.</t>
<t>It is possible to edit a Matroska file after it has been created. For example, chapters,
tags, or attachments can be added. When new <tt>Top-Level Elements</tt> are added to a Matroska file,
the <tt>SeekHead</tt> Element(s) <bcp14>MUST</bcp14> be updated so that the <tt>SeekHead</tt> Element(s) itemize
the identity and position of all <tt>Top-Level Elements</tt>. Editing, removing, or adding
<tt>Elements</tt> to a Matroska file often requires that some existing <tt>Elements</tt> be voided
or extended; therefore, it is <bcp14>RECOMMENDED</bcp14> to use <tt>Void Elements</tt> as padding in
between <tt>Top-Level Elements</tt>.</t>
</section>

<section anchor="crc-32"><name>CRC-32</name>
<t>As noted by the EBML specification, if a <tt>CRC-32 Element</tt> is used, then the <tt>CRC-32 Element</tt>
<bcp14>MUST</bcp14> be the first ordered <tt>Element</tt> within its <tt>Parent Element</tt>. The Matroska specification
recommends that <tt>CRC-32 Elements</tt> <bcp14>SHOULD NOT</bcp14> be used as an immediate <tt>Child Element</tt>
of the <tt>Segment Element</tt>; however all <tt>Top-Level Elements</tt> of an <tt>EBML Document</tt>
<bcp14>SHOULD</bcp14> include a <tt>CRC-32 Element</tt> as a <tt>Child Element</tt>.</t>
</section>

<section anchor="seekhead"><name>SeekHead</name>
<t>If used, the first <tt>SeekHead Element</tt> <bcp14>SHOULD</bcp14> be the first non-<tt>CRC-32 Child Element</tt>
of the <tt>Segment Element</tt>. If a second <tt>SeekHead Element</tt> is used, then the first
<tt>SeekHead Element</tt> <bcp14>MUST</bcp14> reference the identity and position of the second <tt>SeekHead</tt>.
Additionally, the second <tt>SeekHead Element</tt> <bcp14>MUST</bcp14> only reference <tt>Cluster</tt> Elements
and not any other <tt>Top-Level Element</tt> already contained within the first <tt>SeekHead Element</tt>.
The second <tt>SeekHead Element</tt> <bcp14>MAY</bcp14> be stored in any order relative to the other <tt>Top-Level Elements</tt>.
Whether one or two <tt>SeekHead Element(s)</tt> are used, the <tt>SeekHead Element(s)</tt> <bcp14>MUST</bcp14>
collectively reference the identity and position of all <tt>Top-Level Elements</tt> except
for the first <tt>SeekHead Element</tt>.</t>
<t>It is <bcp14>RECOMMENDED</bcp14> that the first <tt>SeekHead Element</tt> be followed by a <tt>Void Element</tt> to
allow for the <tt>SeekHead Element</tt> to be expanded to cover new <tt>Top-Level Elements</tt>
that could be added to the Matroska file, such as <tt>Tags</tt>, <tt>Chapters</tt>, and <tt>Attachments Elements</tt>.</t>
</section>

<section anchor="cues-index"><name>Cues (index)</name>
<t>The <tt>Cues Element</tt> is <bcp14>RECOMMENDED</bcp14> to optimize seeking access in Matroska. It is
programmatically simpler to add the <tt>Cues Element</tt> after all <tt>Cluster Elements</tt>
have been written because this does not require a prediction of how much space to
reserve before writing the <tt>Cluster Elements</tt>. However, storing the <tt>Cues Element</tt>
before the <tt>Cluster Elements</tt> can provide some seeking advantages. If the <tt>Cues Element</tt>
is present, then it <bcp14>SHOULD</bcp14> either be stored before the first <tt>Cluster Element</tt>
or be referenced by a <tt>SeekHead Element</tt>.</t>
</section>

<section anchor="info"><name>Info</name>
<t>The first <tt>Info Element</tt> <bcp14>SHOULD</bcp14> occur before the first <tt>Tracks Element</tt> and first
<tt>Cluster Element</tt> except when referenced by a <tt>SeekHead Element</tt>.</t>
</section>

<section anchor="chapters-element-1"><name>Chapters Element</name>
<t>The <tt>Chapters Element</tt> <bcp14>SHOULD</bcp14> be placed before the <tt>Cluster Element(s)</tt>. The
<tt>Chapters Element</tt> can be used during playback even if the user does not need to seek.
It immediately gives the user information about what section is being read and what
other sections are available. In the case of Ordered Chapters it is <bcp14>RECOMMENDED</bcp14> to evaluate
the logical linking even before playing. The <tt>Chapters Element</tt> <bcp14>SHOULD</bcp14> be placed before
the first <tt>Tracks Element</tt> and after the first <tt>Info Element</tt>.</t>
</section>

<section anchor="attachments"><name>Attachments</name>
<t>The <tt>Attachments Element</tt> is not intended to be used by default when playing the file,
but could contain information relevant to the content, such as cover art or fonts.
Cover art is useful even before the file is played and fonts could be needed before playback
starts for initialization of subtitles. The <tt>Attachments Element</tt> <bcp14>MAY</bcp14> be placed before
the first <tt>Cluster Element</tt>; however if the <tt>Attachments Element</tt> is likely to be edited,
then it <bcp14>SHOULD</bcp14> be placed after the last <tt>Cluster Element</tt>.</t>
</section>

<section anchor="tags"><name>Tags</name>
<t>The <tt>Tags Element</tt> is most subject to changes after the file was originally created.
For easier editing, the <tt>Tags Element</tt> <bcp14>SHOULD</bcp14> be placed at the end of the <tt>Segment Element</tt>,
even after the <tt>Attachments Element</tt>. On the other hand, it is inconvenient to have to
seek in the <tt>Segment</tt> for tags, especially for network streams. So it's better if the
<tt>Tags Element</tt> is found early in the stream. When editing the <tt>Tags Element</tt>, the original
<tt>Tags Element</tt> at the beginning can be overwritten with a <tt>Void Element</tt> and a
new <tt>Tags Element</tt> written at the end of the <tt>Segment Element</tt>. The file size will only marginally change.</t>
</section>

<section anchor="optimum-layout-from-a-muxer"><name>Optimum layout from a muxer</name>

<ul>
<li>SeekHead</li>
<li>Info</li>
<li>Tracks</li>
<li>Chapters</li>
<li>Attachments</li>
<li>Tags</li>
<li>Clusters</li>
<li>Cues</li>
</ul>
</section>

<section anchor="optimum-layout-after-editing-tags"><name>Optimum layout after editing tags</name>

<ul>
<li>SeekHead</li>
<li>Info</li>
<li>Tracks</li>
<li>Chapters</li>
<li>Attachments</li>
<li>Void</li>
<li>Clusters</li>
<li>Cues</li>
<li>Tags</li>
</ul>
</section>

<section anchor="optimum-layout-with-cues-at-the-front"><name>Optimum layout with Cues at the front</name>

<ul>
<li>SeekHead</li>
<li>Info</li>
<li>Tracks</li>
<li>Chapters</li>
<li>Attachments</li>
<li>Tags</li>
<li>Cues</li>
<li>Clusters</li>
</ul>
</section>

<section anchor="cluster-timestamp"><name>Cluster Timestamp</name>
<t>The <tt>Timestamp Element</tt> <bcp14>MUST</bcp14> occur as in storage order before any <tt>SimpleBlock</tt>,
<tt>BlockGroup</tt>, or <tt>EncryptedBlock</tt>, within the <tt>Cluster Element</tt>.</t>
</section>
</section>

<section anchor="chapters"><name>Chapters</name>

<section anchor="edition-and-chapter-flags"><name>Edition and Chapter Flags</name>

<section anchor="chapter-flags"><name>Chapter Flags</name>
<t>Two <tt>Chapter Flags</tt> are defined to describe the behavior of the <tt>ChapterAtom Element</tt>:
<tt>ChapterFlagHidden</tt> and <tt>ChapterFlagEnabled</tt>.</t>
<t>If a <tt>ChapterAtom Element</tt> is the <tt>Child Element</tt> of another <tt>ChapterAtom Element</tt>
with a <tt>Chapter Flag</tt> set to <tt>true</tt>, then the <tt>Child ChapterAtom Element</tt> <bcp14>MUST</bcp14> be
interpreted as having its same <tt>Chapter Flag</tt> set to <tt>true</tt>. If a <tt>ChapterAtom Element</tt>
is the <tt>Child Element</tt> of another <tt>ChapterAtom Element</tt> with a <tt>Chapter Flag</tt> set to <tt>false</tt>,
or if the <tt>ChapterAtom Element</tt> does not have a <tt>ChapterAtom Element</tt> as its <tt>Parent Element</tt>,
then it <bcp14>MUST</bcp14> be interpreted according to its own <tt>Chapter Flag</tt>.</t>
<t>As an example, consider a <tt>Parent ChapterAtom Element</tt> that has its <tt>ChapterFlagHidden</tt>
set to <tt>true</tt> and also contains two child <tt>ChapterAtoms</tt>, the first with <tt>ChapterFlagHidden</tt>
set to <tt>true</tt> and the second with <tt>ChapterFlagHidden</tt> either set to <tt>false</tt> or not present
at all (in which case the default value of the Element applies, which is <tt>false</tt>).
Since the parent <tt>ChapterAtom</tt> has its <tt>ChapterFlagHidden</tt> set to <tt>true</tt>, all of its
children <tt>ChapterAtoms</tt> <bcp14>MUST</bcp14> also be interpreted as if their <tt>ChapterFlagHidden</tt> is also
set to <tt>true</tt>. However, if a <tt>Control Track</tt> toggles the parent's <tt>ChapterFlagHidden</tt>
flag to <tt>false</tt>, then only the parent <tt>ChapterAtom</tt> and its second child <tt>ChapterAtom</tt>
<bcp14>MUST</bcp14> be interpreted as if <tt>ChapterFlagHidden</tt> is set to <tt>false</tt>. The first child
<tt>ChapterAtom</tt>, which has the <tt>ChapterFlagHidden</tt> flag set to <tt>true</tt>, retains its value
until its value is toggled to <tt>false</tt> by a <tt>Control Track</tt>.</t>
</section>

<section anchor="edition-flags"><name>Edition Flags</name>
<t>Three <tt>Edition Flags</tt> are defined to describe the behavior of the <tt>EditionEntry Element</tt>:
<tt>EditionFlagHidden</tt>, <tt>EditionFlagDefault</tt>, and <tt>EditionFlagOrdered</tt>.</t>

<section anchor="editionflaghidden"><name>EditionFlagHidden</name>
<t>The <tt>EditionFlagHidden Flag</tt> behaves similarly to the <tt>ChapterFlagHidden Flag</tt>:
if <tt>EditionFlagHidden</tt> is set to <tt>true</tt>, its <tt>Child ChapterAtoms Elements</tt> <bcp14>MUST</bcp14> also
be interpreted as if their <tt>ChapterFlagHidden</tt> is also set to <tt>true</tt>, regardless
of their own <tt>ChapterFlagHidden Flags</tt>. If <tt>EditionFlagHidden</tt> is toggled by a
<tt>Control Track</tt> to <tt>false</tt>, the <tt>ChapterFlagHidden Flags</tt> of the <tt>Child ChapterAtoms Elements</tt>
<bcp14>SHALL</bcp14> determine whether the <tt>ChapterAtom</tt> is hidden or not.</t>
</section>

<section anchor="editionflagdefault"><name>EditionFlagDefault</name>
<t>It is <bcp14>RECOMMENDED</bcp14> that no more than one <tt>Edition</tt> have an <tt>EditionFlagDefault Flag</tt>
set to <tt>true</tt>. The first <tt>Edition</tt> with both the <tt>EditionFlagDefault Flag</tt> set to <tt>true</tt>
and the <tt>EditionFlagHidden Flag</tt> set to <tt>false</tt> is the Default Edition. When all
<tt>EditionFlagDefault Flags</tt> are set to <tt>false</tt>, then the first <tt>Edition</tt> with the
<tt>EditionFlagHidden Flag</tt> set to <tt>false</tt> is the Default Edition. The Default Edition
is the edition that should be used for playback by default.</t>
</section>

<section anchor="editionflagordered"><name>EditionFlagOrdered</name>
<t>The <tt>EditionFlagOrdered Flag</tt> is a significant feature as it enables an <tt>Edition</tt>
of <tt>Ordered Chapters</tt> which defines and arranges a virtual timeline rather than simply
labeling points within the timeline. For example, with <tt>Editions</tt> of <tt>Ordered Chapters</tt>
a single <tt>Matroska file</tt> can present multiple edits of a film without duplicating content.
Alternatively, if a videotape is digitized in full, one <tt>Ordered Edition</tt> could present
the full content (including colorbars, countdown, slate, a feature presentation, and
black frames), while another <tt>Edition</tt> of <tt>Ordered Chapters</tt> can use <tt>Chapters</tt> that only
mark the intended presentation with the colorbars and other ancillary visual information
excluded. If an <tt>Edition</tt> of <tt>Ordered Chapters</tt> is enabled, then the <tt>Matroska Player</tt> <bcp14>MUST</bcp14>
play those Chapters in their stored order from the timestamp marked in the
<tt>ChapterTimeStart Element</tt> to the timestamp marked in to <tt>ChapterTimeEnd Element</tt>.</t>
<t>If the <tt>EditionFlagOrdered Flag</tt> is set to <tt>false</tt>, <tt>Simple Chapters</tt> are used and
only the <tt>ChapterTimeStart</tt> of a <tt>Chapter</tt> is used as chapter mark to jump to the
predefined point in the timeline. With <tt>Simple Chapters</tt>, a <tt>Matroska Player</tt> <bcp14>MUST</bcp14>
ignore certain <tt>Chapter Elements</tt>. All these elements are now informational only.</t>
<t>The following list shows the different usage of <tt>Chapter Elements</tt> between an ordered
and non-ordered <tt>Edition</tt>.</t>
<table>
<thead>
<tr>
<th align="left">Chapter elements / ordered Edition</th>
<th align="center">False</th>
<th align="center">True</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">ChapterUID</td>
<td align="center">X</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">ChapterStringUID</td>
<td align="center">X</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">ChapterTimeStart</td>
<td align="center">X</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">ChapterTimeEnd</td>
<td align="center">-</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">ChapterFlagHidden</td>
<td align="center">X</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">ChapterFlagEnabled</td>
<td align="center">X</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">ChapterSegmentUID</td>
<td align="center">-</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">ChapterSegmentEditionUID</td>
<td align="center">-</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">ChapterPhysicalEquiv</td>
<td align="center">X</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">ChapterTrack</td>
<td align="center">-</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">ChapterDisplay</td>
<td align="center">X</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">ChapProcess</td>
<td align="center">-</td>
<td align="center">X</td>
</tr>
</tbody>
</table><t>Furthermore there are other EBML <tt>Elements</tt> which could be used if the
<tt>EditionFlagOrdered Flag</tt> is set to <tt>true</tt>.</t>
<table>
<thead>
<tr>
<th align="left">Other elements / ordered Edition</th>
<th align="center">False</th>
<th align="center">True</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">Info/SegmentFamily</td>
<td align="center">-</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">Info/ChapterTranslate</td>
<td align="center">-</td>
<td align="center">X</td>
</tr>

<tr>
<td align="left">Track/TrackTranslate</td>
<td align="center">-</td>
<td align="center">X</td>
</tr>
</tbody>
</table><t>These other <tt>Elements</tt> belong to the Matroska DVD menu system and are only used
when the <tt>ChapProcessCodecID Element</tt> is set to 1.</t>

<section anchor="ordered-edition-and-matroska-segment-linking"><name>Ordered-Edition and Matroska Segment-Linking</name>

<ul>
<li>Hard Linking: <tt>Ordered-Chapters</tt> supersedes the <tt>Hard Linking</tt>.</li>
<li>Soft Linking: In this complex system <tt>Ordered Chapters</tt> are <bcp14>REQUIRED</bcp14> and a
<tt>Chapter CODEC</tt> <bcp14>MUST</bcp14> interpret the <tt>ChapProcess</tt> of all chapters.</li>
<li>Medium Linking: <tt>Ordered Chapters</tt> are used in a normal way and can be combined
with the <tt>ChapterSegmentUID</tt> element which establishes a link to another Segment.</li>
</ul>
<t>See <xref target="linked-segments"></xref> on the Linked Segments for more information
about <tt>Hard Linking</tt>, <tt>Soft Linking</tt>, and <tt>Medium Linking</tt>.</t>
</section>
</section>
</section>

<section anchor="chaptersegmentuid"><name>ChapterSegmentUID</name>
<t>The <tt>ChapterSegmentUID</tt> is a binary value and the base element to set up a
<tt>Linked Chapter</tt> in 2 variations: the Linked-Duration linking and the Linked-Edition
linking. For both variations, the following 3 conditions <bcp14>MUST</bcp14> be met:</t>

<ol>
<li>The <tt>EditionFlagOrdered Flag</tt> <bcp14>MUST</bcp14> be true.</li>
<li>The <tt>ChapterSegmentUID</tt> <bcp14>MUST NOT</bcp14> be the <tt>SegmentUID</tt> of its own <tt>Segment</tt>.</li>
<li>The linked Segments <bcp14>MUST</bcp14> BE in the same folder.</li>
</ol>

<section anchor="variation-1-linked-duration"><name>Variation 1: Linked-Duration</name>
<t>Two more conditions <bcp14>MUST</bcp14> be met:</t>

<ol>
<li><tt>ChapterTimeStart</tt> and <tt>ChapterTimeEnd</tt> timestamps <bcp14>MUST</bcp14> be in the range of the
linked Segment duration.</li>
<li><tt>ChapterSegmentEditionUID</tt> <bcp14>MUST</bcp14> be not set.</li>
</ol>
<t>A <tt>Matroska Player</tt> <bcp14>MUST</bcp14> play the content of the linked Segment from the
<tt>ChapterTimeStart</tt> until <tt>ChapterTimeEnd</tt> timestamp.</t>
</section>

<section anchor="variation-2-linked-edition"><name>Variation 2: Linked-Edition</name>
<t>When the <tt>ChapterSegmentEditionUID</tt> is set to a valid <tt>EditionUID</tt> from the linked
Segment. A <tt>Matroska Player</tt> <bcp14>MUST</bcp14> play these linked <tt>Edition</tt>.</t>
</section>
</section>
</section>

<section anchor="menu-features"><name>Menu features</name>
<t>The menu features are handled like a <em>chapter codec</em>. That means each codec has a type,
some private data and some data in the chapters.</t>
<t>The type of the menu system is defined by the <tt>ChapProcessCodecID</tt> parameter. For now,
only 2 values are supported : 0 matroska script, 1 menu borrowed from the DVD.
he private data depend on the type of menu system (stored in ChapProcessPrivate),
idem for the data in the chapters (stored in ChapProcessData).</t>

<section anchor="matroska-script-0"><name>Matroska Script (0)</name>
<t>This is the case when <tt>ChapProcessCodecID</tt> = 0. This is a script language build for
Matroska purposes. The inspiration comes from ActionScript, javascript and other similar
scripting languages. The commands are stored as text commands, in UTF-8. The syntax is C like,
with commands spanned on many lines, each terminating with a &quot;;&quot;. You can also include comments
at the end of lines with &quot;//&quot; or comment many lines using &quot;/* */&quot;. The scripts are stored
in ChapProcessData. For the moment ChapProcessPrivate is not used.</t>
<t>The one and only command existing for the moment is <tt>GotoAndPlay( ChapterUID );</tt>. As the
same suggests, it means that, when this command is encountered, the <tt>Matroska Player</tt>
<bcp14>SHOULD</bcp14> jump to the <tt>Chapter</tt> specified by the UID and play it.</t>
</section>

<section anchor="dvd-menu-1"><name>DVD menu (1)</name>
<t>This is the case when <tt>ChapProcessCodecID</tt> = 1. Each level of a chapter corresponds
to a logical level in the DVD system that is stored in the first octet of the ChapProcessPrivate.
This DVD hierarchy is as follows:</t>
<table>
<thead>
<tr>
<th>ChapProcessPrivate</th>
<th>DVD Name</th>
<th>Hierarchy</th>
<th>Commands Possible</th>
<th>Comment</th>
</tr>
</thead>

<tbody>
<tr>
<td>0x30</td>
<td>SS</td>
<td>DVD domain</td>
<td>-</td>
<td>First Play, Video Manager, Video Title</td>
</tr>

<tr>
<td>0x2A</td>
<td>LU</td>
<td>Language Unit</td>
<td>-</td>
<td>Contains only PGCs</td>
</tr>

<tr>
<td>0x28</td>
<td>TT</td>
<td>Title</td>
<td>-</td>
<td>Contains only PGCs</td>
</tr>

<tr>
<td>0x20</td>
<td>PGC</td>
<td>Program Group Chain (PGC)</td>
<td>*</td>
<td></td>
</tr>

<tr>
<td>0x18</td>
<td>PG</td>
<td>Program 1 / Program 2 / Program 3</td>
<td>-</td>
<td></td>
</tr>

<tr>
<td>0x10</td>
<td>PTT</td>
<td>Part Of Title 1 / Part Of Title 2</td>
<td>-</td>
<td>Equivalent to the chapters on the sleeve.</td>
</tr>

<tr>
<td>0x08</td>
<td>CN</td>
<td>Cell 1 / Cell 2 / Cell 3 / Cell 4 / Cell 5 / Cell 6</td>
<td>-</td>
<td></td>
</tr>
</tbody>
</table><t>You can also recover wether a Segment is a Video Manager (VMG), Video Title Set (VTS)
or Video Title Set Menu (VTSM) from the ChapterTranslateID element found in the Segment Info.
This field uses 2 octets as follows:</t>

<ol>
<li>Domain Type: 0 for VMG, the domain number for VTS and VTSM</li>
<li>Domain Value: 0 for VMG and VTSM, 1 for the VTS source.</li>
</ol>
<t>For instance, the menu part from VTS<em>01</em>0.VOB would be coded [1,0] and the content
part from VTS<em>02</em>3.VOB would be [2,1]. The VMG is always [0,0]</t>
<t>The following octets of ChapProcessPrivate are as follows:</t>
<table>
<thead>
<tr>
<th>Octet 1</th>
<th>DVD Name</th>
<th>Following Octets</th>
</tr>
</thead>

<tbody>
<tr>
<td>0x30</td>
<td>SS</td>
<td>Domain name code (1: 0x00= First play, 0xC0= VMG, 0x40= VTSM, 0x80= VTS) + VTS(M) number (2)</td>
</tr>

<tr>
<td>0x2A</td>
<td>LU</td>
<td>Language code (2) + Language extension (1)</td>
</tr>

<tr>
<td>0x28</td>
<td>TT</td>
<td>global Title number (2) + corresponding TTN of the VTS (1)</td>
</tr>

<tr>
<td>0x20</td>
<td>PGC</td>
<td>PGC number (2) + Playback Type (1) + Disabled User Operations (4)</td>
</tr>

<tr>
<td>0x18</td>
<td>PG</td>
<td>Program number (2)</td>
</tr>

<tr>
<td>0x10</td>
<td>PTT</td>
<td>PTT-chapter number (1)</td>
</tr>

<tr>
<td>0x08</td>
<td>CN</td>
<td>Cell number [VOB ID(2)][Cell ID(1)][Angle Num(1)]</td>
</tr>
</tbody>
</table><t>If the level specified in ChapProcessPrivate is a PGC (0x20), there is an octet
called the Playback Type, specifying the kind of PGC defined:</t>

<ul>
<li>0x00: entry only/basic PGC</li>
<li>0x82: Title+Entry Menu (only found in the Video Manager domain)</li>
<li>0x83: Root Menu (only found in the VTSM domain)</li>
<li>0x84: Subpicture Menu (only found in the VTSM domain)</li>
<li>0x85: Audio Menu (only found in the VTSM domain)</li>
<li>0x86: Angle Menu (only found in the VTSM domain)</li>
<li>0x87: Chapter Menu (only found in the VTSM domain)</li>
</ul>
<t>The next 4 following octets correspond to the <eref target="http://dvd.sourceforge.net/dvdinfo/uops.html">User Operation flags</eref>
in the standard PGC. When a bit is set, the command <bcp14>SHOULD</bcp14> be disabled.</t>
<t>ChapProcessData contains the pre/post/cell commands in binary format as there are stored on a DVD.
There is just an octet preceding these data to specify the number of commands in the element.
As follows: [# of commands(1)][command 1 (8)][command 2 (8)][command 3 (8)].</t>
<t>More information on the DVD commands and format on <eref target="http://www.dvd-replica.com/DVD/">DVD-replica</eref>,
where we got most of the info about it. You can also get information on DVD
from <eref target="http://dvd.sourceforge.net/dvdinfo/">the DVDinfo project</eref>.</t>
</section>
</section>

<section anchor="example-1-basic-chaptering"><name>Example 1 : basic chaptering</name>
<t>In this example a movie is split in different chapters. It could also just be an
audio file (album) on which each track corresponds to a chapter.</t>

<ul>
<li>00000ms - 05000ms : Intro</li>
<li>05000ms - 25000ms : Before the crime</li>
<li>25000ms - 27500ms : The crime</li>
<li>27500ms - 38000ms : The killer arrested</li>
<li>38000ms - 43000ms : Credits</li>
</ul>
<t>This would translate in the following matroska form :</t>

<sourcecode type="xml">&lt;Chapters&gt;
  &lt;EditionEntry&gt;
    &lt;EditionUID&gt;16603393396715046047&lt;/EditionUID&gt;
    &lt;ChapterAtom&gt;
      &lt;ChapterUID&gt;1193046&lt;/ChapterUID&gt;
      &lt;ChapterTimeStart&gt;0&lt;/ChapterTimeStart&gt;
      &lt;ChapterTimeEnd&gt;5000000000&lt;/ChapterTimeEnd&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Intro&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
      &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
    &lt;/ChapterAtom&gt;
    &lt;ChapterAtom&gt;
      &lt;ChapterUID&gt;2311527&lt;/ChapterUID&gt;
      &lt;ChapterTimeStart&gt;5000000000&lt;/ChapterTimeStart&gt;
      &lt;ChapterTimeEnd&gt;25000000000&lt;/ChapterTimeEnd&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Before the crime&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Avant le crime&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;fra&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
      &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
    &lt;/ChapterAtom&gt;
    &lt;ChapterAtom&gt;
      &lt;ChapterUID&gt;3430008&lt;/ChapterUID&gt;
      &lt;ChapterTimeStart&gt;25000000000&lt;/ChapterTimeStart&gt;
      &lt;ChapterTimeEnd&gt;27500000000&lt;/ChapterTimeEnd&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;The crime&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Le crime&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;fra&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
      &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
    &lt;/ChapterAtom&gt;
    &lt;ChapterAtom&gt;
      &lt;ChapterUID&gt;4548489&lt;/ChapterUID&gt;
      &lt;ChapterTimeStart&gt;27500000000&lt;/ChapterTimeStart&gt;
      &lt;ChapterTimeEnd&gt;38000000000&lt;/ChapterTimeEnd&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;After the crime&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Après le crime&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;fra&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
      &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
    &lt;/ChapterAtom&gt;
    &lt;ChapterAtom&gt;
      &lt;ChapterUID&gt;5666960&lt;/ChapterUID&gt;
      &lt;ChapterTimeStart&gt;38000000000&lt;/ChapterTimeStart&gt;
      &lt;ChapterTimeEnd&gt;43000000000&lt;/ChapterTimeEnd&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Credits&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Générique&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;fra&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
      &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
    &lt;/ChapterAtom&gt;
    &lt;EditionFlagDefault&gt;0&lt;/EditionFlagDefault&gt;
    &lt;EditionFlagHidden&gt;0&lt;/EditionFlagHidden&gt;
  &lt;/EditionEntry&gt;
&lt;/Chapters&gt;
</sourcecode>
</section>

<section anchor="example-2-nested-chapters"><name>Example 2 : nested chapters</name>
<t>In this example an (existing) album is split into different chapters, and one
of them contain another splitting.</t>

<section anchor="the-micronauts-bleep-to-bleep"><name>The Micronauts &quot;Bleep To Bleep&quot;</name>

<ul>
<li><t>00:00 - 12:28 : Baby Wants To Bleep/Rock</t>

<ul>
<li>00:00 - 04:38 : Baby wants to bleep (pt.1)</li>
<li>04:38 - 07:12 : Baby wants to rock</li>
<li>07:12 - 10:33 : Baby wants to bleep (pt.2)</li>
<li>10:33 - 12:28 : Baby wants to bleep (pt.3)</li>
</ul></li>
<li>12:30 - 19:38 : Bleeper_O+2</li>
<li>19:40 - 22:20 : Baby wants to bleep (pt.4)</li>
<li>22:22 - 25:18 : Bleep to bleep</li>
<li>25:20 - 33:35 : Baby wants to bleep (k)</li>
<li>33:37 - 44:28 : Bleeper</li>
</ul>

<sourcecode type="xml">&lt;Chapters&gt;
  &lt;EditionEntry&gt;
    &lt;EditionUID&gt;1281690858003401414&lt;/EditionUID&gt;
    &lt;ChapterAtom&gt;
      &lt;ChapterUID&gt;1&lt;/ChapterUID&gt;
      &lt;ChapterTimeStart&gt;0&lt;/ChapterTimeStart&gt;
      &lt;ChapterTimeEnd&gt;748000000&lt;/ChapterTimeEnd&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Baby wants to Bleep/Rock&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterAtom&gt;
        &lt;ChapterUID&gt;2&lt;/ChapterUID&gt;
        &lt;ChapterTimeStart&gt;0&lt;/ChapterTimeStart&gt;
        &lt;ChapterTimeEnd&gt;278000000&lt;/ChapterTimeEnd&gt;
        &lt;ChapterDisplay&gt;
          &lt;ChapString&gt;Baby wants to bleep (pt.1)&lt;/ChapString&gt;
          &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
        &lt;/ChapterDisplay&gt;
        &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
        &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
      &lt;/ChapterAtom&gt;
      &lt;ChapterAtom&gt;
        &lt;ChapterUID&gt;3&lt;/ChapterUID&gt;
        &lt;ChapterTimeStart&gt;278000000&lt;/ChapterTimeStart&gt;
        &lt;ChapterTimeEnd&gt;432000000&lt;/ChapterTimeEnd&gt;
        &lt;ChapterDisplay&gt;
          &lt;ChapString&gt;Baby wants to rock&lt;/ChapString&gt;
          &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
        &lt;/ChapterDisplay&gt;
        &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
        &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
      &lt;/ChapterAtom&gt;
      &lt;ChapterAtom&gt;
        &lt;ChapterUID&gt;4&lt;/ChapterUID&gt;
        &lt;ChapterTimeStart&gt;432000000&lt;/ChapterTimeStart&gt;
        &lt;ChapterTimeEnd&gt;633000000&lt;/ChapterTimeEnd&gt;
        &lt;ChapterDisplay&gt;
          &lt;ChapString&gt;Baby wants to bleep (pt.2)&lt;/ChapString&gt;
          &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
        &lt;/ChapterDisplay&gt;
        &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
        &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
      &lt;/ChapterAtom&gt;
      &lt;ChapterAtom&gt;
        &lt;ChapterUID&gt;5&lt;/ChapterUID&gt;
        &lt;ChapterTimeStart&gt;633000000&lt;/ChapterTimeStart&gt;
        &lt;ChapterTimeEnd&gt;748000000&lt;/ChapterTimeEnd&gt;
        &lt;ChapterDisplay&gt;
          &lt;ChapString&gt;Baby wants to bleep (pt.3)&lt;/ChapString&gt;
          &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
        &lt;/ChapterDisplay&gt;
        &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
        &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
      &lt;/ChapterAtom&gt;
      &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
      &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
    &lt;/ChapterAtom&gt;
    &lt;ChapterAtom&gt;
      &lt;ChapterUID&gt;6&lt;/ChapterUID&gt;
      &lt;ChapterTimeStart&gt;750000000&lt;/ChapterTimeStart&gt;
      &lt;ChapterTimeEnd&gt;1178500000&lt;/ChapterTimeEnd&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Bleeper_O+2&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
      &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
    &lt;/ChapterAtom&gt;
    &lt;ChapterAtom&gt;
      &lt;ChapterUID&gt;7&lt;/ChapterUID&gt;
      &lt;ChapterTimeStart&gt;1180500000&lt;/ChapterTimeStart&gt;
      &lt;ChapterTimeEnd&gt;1340000000&lt;/ChapterTimeEnd&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Baby wants to bleep (pt.4)&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
      &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
    &lt;/ChapterAtom&gt;
    &lt;ChapterAtom&gt;
      &lt;ChapterUID&gt;8&lt;/ChapterUID&gt;
      &lt;ChapterTimeStart&gt;1342000000&lt;/ChapterTimeStart&gt;
      &lt;ChapterTimeEnd&gt;1518000000&lt;/ChapterTimeEnd&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Bleep to bleep&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
      &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
    &lt;/ChapterAtom&gt;
    &lt;ChapterAtom&gt;
      &lt;ChapterUID&gt;9&lt;/ChapterUID&gt;
      &lt;ChapterTimeStart&gt;1520000000&lt;/ChapterTimeStart&gt;
      &lt;ChapterTimeEnd&gt;2015000000&lt;/ChapterTimeEnd&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Baby wants to bleep (k)&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
      &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
    &lt;/ChapterAtom&gt;
    &lt;ChapterAtom&gt;
      &lt;ChapterUID&gt;10&lt;/ChapterUID&gt;
      &lt;ChapterTimeStart&gt;2017000000&lt;/ChapterTimeStart&gt;
      &lt;ChapterTimeEnd&gt;2668000000&lt;/ChapterTimeEnd&gt;
      &lt;ChapterDisplay&gt;
        &lt;ChapString&gt;Bleeper&lt;/ChapString&gt;
        &lt;ChapLanguage&gt;eng&lt;/ChapLanguage&gt;
      &lt;/ChapterDisplay&gt;
      &lt;ChapterFlagHidden&gt;0&lt;/ChapterFlagHidden&gt;
      &lt;ChapterFlagEnabled&gt;1&lt;/ChapterFlagEnabled&gt;
    &lt;/ChapterAtom&gt;
    &lt;EditionFlagDefault&gt;0&lt;/EditionFlagDefault&gt;
    &lt;EditionFlagHidden&gt;0&lt;/EditionFlagHidden&gt;
  &lt;/EditionEntry&gt;
&lt;/Chapters&gt;
</sourcecode>
</section>
</section>
</section>

<section anchor="attachments-1"><name>Attachments</name>
<t>Matroska supports storage of related files and data in the <tt>Attachments Element</tt>
(a <tt>Top-Level Element</tt>). <tt>Attachment Elements</tt> can be used to store related cover art,
font files, transcripts, reports, error recovery files, picture, or text-based annotations,
copies of specifications, or other ancillary files related to the <tt>Segment</tt>.</t>
<t><tt>Matroska Readers</tt> <bcp14>MUST NOT</bcp14> execute files stored as <tt>Attachment Elements</tt>.</t>

<section anchor="cover-art"><name>Cover Art</name>
<t>This section defines a set of guidelines for the storage of cover art in Matroska files.
A <tt>Matroska Reader</tt> <bcp14>MAY</bcp14> use embedded cover art to display a representational
still-image depiction of the multimedia contents of the Matroska file.</t>
<t>Only JPEG and PNG image formats <bcp14>SHOULD</bcp14> be used for cover art pictures.</t>
<t>There can be two different covers for a movie/album: a portrait style (e.g., a DVD case)
and a landscape style (e.g., a wide banner ad).</t>
<t>There can be two versions of the same cover, the <tt>normal cover</tt> and the <tt>small cover</tt>.
The dimension of the <tt>normal cover</tt> <bcp14>SHOULD</bcp14> be 600 pixels on the smallest side -- for example,
960x600 for landscape, 600x800 for portrait, or 600x600 for square. The dimension of
the <tt>small cover</tt> <bcp14>SHOULD</bcp14> be 120 pixels on the smallest side -- for example, 192x120 or 120x160.</t>
<t>Versions of cover art can be differentiated by the filename, which is stored in the
<tt>FileName Element</tt>. The default filename of the <tt>normal cover</tt> in square or portrait mode
is <tt>cover.(jpg|png)</tt>. When stored, the <tt>normal cover</tt> <bcp14>SHOULD</bcp14> be the first Attachment in
storage order. The <tt>small cover</tt> <bcp14>SHOULD</bcp14> be prefixed with &quot;small_&quot;, such as
<tt>small_cover.(jpg|png)</tt>. The landscape variant <bcp14>SHOULD</bcp14> be suffixed with &quot;_land&quot;,
such as <tt>cover_land.(jpg|png)</tt>. The filenames are case sensitive.</t>
<t>The following table provides examples of file names for cover art in Attachments.</t>
<table>
<thead>
<tr>
<th>FileName</th>
<th>Image Orientation</th>
<th>Pixel Length of Smallest Side</th>
</tr>
</thead>

<tbody>
<tr>
<td>cover.jpg</td>
<td>Portrait or square</td>
<td>600</td>
</tr>

<tr>
<td>small_cover.png</td>
<td>Portrait or square</td>
<td>120</td>
</tr>

<tr>
<td>cover_land.png</td>
<td>Landscape</td>
<td>600</td>
</tr>

<tr>
<td>small<em>cover</em>land.jpg</td>
<td>Landscape</td>
<td>120</td>
</tr>
</tbody>
</table></section>
</section>

<section anchor="cues"><name>Cues</name>
<t>The <tt>Cues Element</tt> provides an index of certain <tt>Cluster Elements</tt> to allow for optimized
seeking to absolute timestamps within the <tt>Segment</tt>. The <tt>Cues Element</tt> contains one or
many <tt>CuePoint Elements</tt> which each <bcp14>MUST</bcp14> reference an absolute timestamp (via the
<tt>CueTime Element</tt>), a <tt>Track</tt> (via the <tt>CueTrack Element</tt>), and a <tt>Segment Position</tt>
(via the <tt>CueClusterPosition Element</tt>). Additional non-mandated Elements are part of
the <tt>CuePoint Element</tt> such as <tt>CueDuration</tt>, <tt>CueRelativePosition</tt>, <tt>CueCodecState</tt>
and others which provide any <tt>Matroska Reader</tt> with additional information to use in
the optimization of seeking performance.</t>

<section anchor="recommendations"><name>Recommendations</name>
<t>The following recommendations are provided to optimize Matroska performance.</t>

<ul>
<li>Unless Matroska is used as a live stream, it <bcp14>SHOULD</bcp14> contain a <tt>Cues Element</tt>.</li>
<li>For each video track, each keyframe <bcp14>SHOULD</bcp14> be referenced by a <tt>CuePoint Element</tt>.</li>
<li>It is <bcp14>RECOMMENDED</bcp14> to not reference non-keyframes of video tracks in <tt>Cues</tt> unless
it references a <tt>Cluster Element</tt> which contains a <tt>CodecState Element</tt> but no keyframes.</li>
<li>For each subtitle track present, each subtitle frame <bcp14>SHOULD</bcp14> be referenced by a
<tt>CuePoint Element</tt> with a <tt>CueDuration Element</tt>.</li>
<li>References to audio tracks <bcp14>MAY</bcp14> be skipped in <tt>CuePoint Elements</tt> if a video track
is present. When included the <tt>CuePoint Elements</tt> <bcp14>SHOULD</bcp14> reference audio keyframes
at most once every 500 milliseconds.</li>
<li>If the referenced frame is not stored within the first <tt>SimpleBlock</tt>, or first
<tt>BlockGroup</tt> within its <tt>Cluster Element</tt>, then the <tt>CueRelativePosition Element</tt>
<bcp14>SHOULD</bcp14> be written to reference where in the <tt>Cluster</tt> the reference frame is stored.</li>
<li>If a <tt>CuePoint Element</tt> references <tt>Cluster Element</tt> that includes a <tt>CodecState Element</tt>,
then that <tt>CuePoint Element</tt> <bcp14>MUST</bcp14> use a <tt>CueCodecState Element</tt>.</li>
<li><tt>CuePoint Elements</tt> <bcp14>SHOULD</bcp14> be numerically sorted in storage order by the value of the <tt>CueTime Element</tt>.</li>
</ul>
</section>
</section>

<section anchor="matroska-streaming"><name>Matroska Streaming</name>
<t>In Matroska, there are two kinds of streaming: file access and livestreaming.</t>

<section anchor="file-access"><name>File Access</name>
<t>File access can simply be reading a file located on your computer, but also includes
accessing a file from an HTTP (web) server or CIFS (Windows share) server. These protocols
are usually safe from reading errors and seeking in the stream is possible. However,
when a file is stored far away or on a slow server, seeking can be an expensive operation
and <bcp14>SHOULD</bcp14> be avoided. The following guidelines, when followed, help reduce the number
of seeking operations for regular playback and also have the playback start quickly without
a lot of data needed to read first (like a <tt>Cues Element</tt>, <tt>Attachment Element</tt> or <tt>SeekHead Element</tt>).</t>
<t>Matroska, having a small overhead, is well suited for storing music/videos on file
servers without a big impact on the bandwidth used. Matroska does not require the index
to be loaded before playing, which allows playback to start very quickly. The index can
be loaded only when seeking is requested the first time.</t>
</section>

<section anchor="livestreaming"><name>Livestreaming</name>
<t>Livestreaming is the equivalent of television broadcasting on the internet. There are 2
families of servers for livestreaming: RTP/RTSP and HTTP. Matroska is not meant to be
used over RTP. RTP already has timing and channel mechanisms that would be wasted if doubled
in Matroska. Additionally, having the same information at the RTP and Matroska level would
be a source of confusion if they do not match. Livestreaming of Matroska over HTTP
(or any other plain protocol based on TCP) is possible.</t>
<t>A live Matroska stream is different from a file because it usually has no known end
(only ending when the client disconnects). For this, all bits of the &quot;size&quot; portion
of the <tt>Segment Element</tt> <bcp14>MUST</bcp14> be set to 1. Another option is to concatenate <tt>Segment Elements</tt>
with known sizes, one after the other. This solution allows a change of codec/resolution
between each segment. For example, this allows for a switch between 4:3 and 16:9 in a television program.</t>
<t>When <tt>Segment Elements</tt> are continuous, certain <tt>Elements</tt>, like <tt>MetaSeek</tt>, <tt>Cues</tt>,
<tt>Chapters</tt>, and <tt>Attachments</tt>, <bcp14>MUST NOT</bcp14> be used.</t>
<t>It is possible for a <tt>Matroska Player</tt> to detect that a stream is not seekable.
If the stream has neither a <tt>MetaSeek</tt> list or a <tt>Cues</tt> list at the beginning of the stream,
it <bcp14>SHOULD</bcp14> be considered non-seekable. Even though it is possible to seek blindly forward
in the stream, it is <bcp14>NOT RECOMMENDED</bcp14>.</t>
<t>In the context of live radio or web TV, it is possible to &quot;tag&quot; the content while it is
playing. The <tt>Tags Element</tt> can be placed between <tt>Clusters</tt> each time it is necessary.
In that case, the new <tt>Tags Element</tt> <bcp14>MUST</bcp14> reset the previously encountered <tt>Tags Elements</tt>
and use the new values instead.</t>
</section>
</section>

<section anchor="menu-specifications"><name>Menu Specifications</name>
<t>This document is a <em>draft of the Menu system</em> that will be the default one in <tt>Matroska</tt>.
As it will just be composed of a Control Track, it will be seen as a &quot;codec&quot; and could be
replaced later by something else if needed.</t>
<t>A menu is like what you see on DVDs, when you have some screens to select the audio format,
subtitles or scene selection.</t>

<section anchor="requirements"><name>Requirements</name>
<t>What we'll try to have is a system that can do almost everything done on a DVD, or more,
or better, or drop the unused features if necessary.</t>
<t>As the name suggests, a Control Track is a track that can control the playback of the file
and/or all the playback features. To make it as simple as possible for <tt>Matroska Players</tt>,
the Control Track will just give orders to the <tt>Matroska Player</tt> and get the actions
associated with the highlights/hotspots.</t>

<section anchor="highlights-hotspots"><name>Highlights/Hotspots</name>
<t>A highlight is basically a rectangle/key associated with an action UID. When that
rectangle/key is activated, the <tt>Matroska Player</tt> send the UID of the action to the
Control Track handler (codec). The fact that it can also be a key means that even for
audio only files, a keyboard shortcut or button panel could be used for menus.
But in that case, the hotspot will have to be associated with a name to display.</t>
<t>This highlight is sent from the Control Track to the <tt>Matroska Player</tt>. Then the
<tt>Matroska Player</tt> has to handle that highlight until it's deactivated; see <xref target="playback-features"></xref>.</t>
<t>The highlight contains a UID of the action, a displayable name (UTF-8), an associated
key (list of keys to be defined, probably up/down/left/right/select), a screen position/range
and an image to display. The image will be displayed either when the user place
the mouse over the rectangle (or any other shape), or when an option of the screen
is selected (not activated). There could be a second image used when the option is activated.
And there could be a third image that can serve as background. This way you could have
a still image (like in some DVDs) for the menu and behind that image blank video (small bitrate).</t>
<t>When a highlight is activated by the user, the <tt>Matroska Player</tt> has to send the UID of
the action to the Control Track. Then the Control Track codec will handle the action
and possibly give new orders to the <tt>Matroska Player</tt>.</t>
<t>The format used for storing images <bcp14>SHOULD</bcp14> be extensible. For the moment we'll use
PNG and BMP, both with alpha channel.</t>
</section>

<section anchor="playback-features"><name>Playback features</name>
<t>All the following features will be sent from the Control Track to the <tt>Matroska Player</tt> :</t>

<ul>
<li>Jump to chapter (UID, prev, next, number)</li>
<li>Disable all tracks of a kind (audio, video, subtitle)</li>
<li>Enable track UID (the kind doesn't matter)</li>
<li>Define/Disable a highlight</li>
<li>Enable/Disable jumping</li>
<li>Enable/Disable track selection of a kind</li>
<li>Select Edition ID (see chapters)</li>
<li>Pause playback</li>
<li>Stop playback</li>
<li>Enable/Disable a Chapter UID</li>
<li>Hide/Unhide a Chapter UID</li>
</ul>
<t>All the actions will be written in a normal Matroska track, with a timestamp.
A &quot;Menu Frame&quot; <bcp14>SHOULD</bcp14> be able to contain more that one action/highlight for a given
timestamp. (to be determined, EBML format structure)</t>
</section>

<section anchor="player-requirements"><name>Player requirements</name>
<t>Some <tt>Matroska Players</tt> might not support the control track. That mean they will play
the active/looped parts as part of the data. So I suggest putting the active/looped
parts of a movie at the end of a movie. When a Menu-aware <tt>Matroska Player</tt> encounter
the default Control Track of a <tt>Matroska</tt> file, the first order <bcp14>SHOULD</bcp14> be to jump at
the start of the active/looped part of the movie.</t>
</section>
</section>

<section anchor="working-graph"><name>Working Graph</name>

<artwork>Matroska Source file -&gt; Control Track &lt;-&gt; Player.
                     -&gt; other tracks   -&gt; rendered
</artwork>
</section>
</section>

<section anchor="unknown-elements"><name>Unknown elements</name>
<t>Matroska is based upon the principle that a reading application does not have to support
100% of the specifications in order to be able to play the file. A Matroska file therefore
contains version indicators that tell a reading application what to expect.</t>
<t>It is possible and valid to have the version fields indicate that the file contains
Matroska <tt>Elements</tt> from a higher specification version number while signaling that a
reading application <bcp14>MUST</bcp14> only support a lower version number properly in order to play
it back (possibly with a reduced feature set). For example, a reading application
supporting at least Matroska version <tt>V</tt> reading a file whose <tt>DocTypeReadVersion</tt>
field is equal to or lower than <tt>V</tt> <bcp14>MUST</bcp14> skip Matroska/EBML <tt>Elements</tt> it encounters
but does not know about if that unknown element fits into the size constraints set
by the current <tt>Parent Element</tt>.</t>
</section>

<section anchor="default-values"><name>Default Values</name>
<t>The default value of an <tt>Element</tt> is assumed when not present in the data stream.
It is assumed only in the scope of its <tt>Parent Element</tt>. For example, the <tt>Language Element</tt>
is in the scope of the <tt>Track Element</tt>. If the <tt>Parent Element</tt> is not present or assumed,
then the <tt>Child Element</tt> cannot be assumed.</t>
</section>

<section anchor="defaultdecodedfieldduration"><name>DefaultDecodedFieldDuration</name>
<t>The <tt>DefaultDecodedFieldDuration Element</tt> can signal to the displaying application how
often fields of a video sequence will be available for displaying. It can be used for both
interlaced and progressive content. If the video sequence is signaled as interlaced,
then the period between two successive fields at the output of the decoding process
equals <tt>DefaultDecodedFieldDuration</tt>.</t>
<t>For video sequences signaled as progressive, it is twice the value of <tt>DefaultDecodedFieldDuration</tt>.</t>
<t>These values are valid at the end of the decoding process before post-processing
(such as deinterlacing or inverse telecine) is applied.</t>
<t>Examples:</t>

<ul>
<li>Blu-ray movie: 1000000000ns/(48/1.001) = 20854167ns</li>
<li>PAL broadcast/DVD: 1000000000ns/(50/1.000) = 20000000ns</li>
<li>N/ATSC broadcast: 1000000000ns/(60/1.001) = 16683333ns</li>
<li>hard-telecined DVD: 1000000000ns/(60/1.001) = 16683333ns (60 encoded interlaced fields per second)</li>
<li>soft-telecined DVD: 1000000000ns/(60/1.001) = 16683333ns (48 encoded interlaced fields per second, with &quot;repeat<em>first</em>field = 1&quot;)</li>
</ul>
</section>

<section anchor="encryption"><name>Encryption</name>
<t>Encryption in Matroska is designed in a very generic style to allow people to
implement whatever form of encryption is best for them. It is possible to use the
encryption framework in Matroska as a type of DRM (Digital Rights Management).</t>
<t>Because encryption occurs within the <tt>Block Element</tt>, it is possible to manipulate
encrypted streams without decrypting them. The streams could potentially be copied,
deleted, cut, appended, or any number of other possible editing techniques without
decryption. The data can be used without having to expose it or go through the decrypting process.</t>
<t>Encryption can also be layered within Matroska. This means that two completely different
types of encryption can be used, requiring two separate keys to be able to decrypt a stream.</t>
<t>Encryption information is stored in the <tt>ContentEncodings Element</tt> under the <tt>ContentEncryption Element</tt>.</t>
</section>

<section anchor="image-presentation"><name>Image Presentation</name>

<section anchor="cropping"><name>Cropping</name>
<t>The <tt>PixelCrop Elements</tt> (<tt>PixelCropTop</tt>, <tt>PixelCropBottom</tt>, <tt>PixelCropRight</tt>, and <tt>PixelCropLeft</tt>)
indicate when, and by how much, encoded videos frames <bcp14>SHOULD</bcp14> be cropped for display.
These Elements allow edges of the frame that are not intended for display, such as the
sprockets of a full-frame film scan or the VANC area of a digitized analog videotape,
to be stored but hidden. <tt>PixelCropTop</tt> and <tt>PixelCropBottom</tt> store an integer of how many
rows of pixels <bcp14>SHOULD</bcp14> be cropped from the top and bottom of the image (respectively).
 <tt>PixelCropLeft</tt> and <tt>PixelCropRight</tt> store an integer of how many columns of pixels
 <bcp14>SHOULD</bcp14> be cropped from the left and right of the image (respectively). For example,
 a pillar-boxed video that stores a 1440x1080 visual image within the center of a padded
 1920x1080 encoded image <bcp14>MAY</bcp14> set both <tt>PixelCropLeft</tt> and <tt>PixelCropRight</tt> to &quot;240&quot;,
 so that a <tt>Matroska Player</tt> <bcp14>SHOULD</bcp14> crop off 240 columns of pixels from the left and
 right of the encoded image to present the image with the pillar-boxes hidden.</t>
</section>

<section anchor="rotation"><name>Rotation</name>
<t>The ProjectionPoseRoll Element (see <xref target="projectionposeroll-element"></xref>) can be used to indicate
that the image from the associated video track <bcp14>SHOULD</bcp14> be rotated for presentation.
For instance, the following representation of the Projection Element <xref target="projection-element"></xref>)
and the ProjectionPoseRoll Element represents a video track where the image <bcp14>SHOULD</bcp14> be
presentation with a 90 degree counter-clockwise rotation.</t>

<sourcecode type="xml">&lt;Projection&gt;
  &lt;ProjectionPoseRoll&gt;90&lt;/ProjectionPoseRoll&gt;
&lt;/Projection&gt;
</sourcecode>
</section>
</section>

<section anchor="matroska-versioning"><name>Matroska versioning</name>
<t>The <tt>EBML Header</tt> of each Matroska document informs the reading application on what
version of Matroska to expect. The <tt>Elements</tt> within <tt>EBML Header</tt> with jurisdiction
over this information are <tt>DocTypeVersion</tt> and <tt>DocTypeReadVersion</tt>.</t>
<t><tt>DocTypeVersion</tt> <bcp14>MUST</bcp14> be equal to or greater than the highest Matroska version number of
any <tt>Element</tt> present in the Matroska file. For example, a file using the <tt>SimpleBlock Element</tt>
<bcp14>MUST</bcp14> have a <tt>DocTypeVersion</tt> equal to or greater than 2. A file containing <tt>CueRelativePosition</tt>
Elements <bcp14>MUST</bcp14> have a <tt>DocTypeVersion</tt> equal to or greater than 4.</t>
<t>The <tt>DocTypeReadVersion</tt> <bcp14>MUST</bcp14> contain the minimum version number that a reading application
can minimally support in order to play the file back -- optionally with a reduced feature
set. For example, if a file contains only <tt>Elements</tt> of version 2 or lower except for
<tt>CueRelativePosition</tt> (which is a version 4 Matroska <tt>Element</tt>), then <tt>DocTypeReadVersion</tt>
<bcp14>SHOULD</bcp14> still be set to 2 and not 4 because evaluating <tt>CueRelativePosition</tt> is not
necessary for standard playback -- it makes seeking more precise if used.</t>
<t><tt>DocTypeVersion</tt> <bcp14>MUST</bcp14> always be equal to or greater than <tt>DocTypeReadVersion</tt>.</t>
<t>A reading application supporting Matroska version <tt>V</tt> <bcp14>MUST NOT</bcp14> refuse to read an
application with <tt>DocReadTypeVersion</tt> equal to or lower than <tt>V</tt> even if <tt>DocTypeVersion</tt>
is greater than <tt>V</tt>. See also the note about Unknown Elements in <xref target="unknown-elements"></xref>.</t>
</section>

<section anchor="mime-types"><name>MIME Types</name>
<t>There is no IETF endorsed MIME type for Matroska files. These definitions can be used:</t>

<ul>
<li>.mka : Matroska audio <tt>audio/x-matroska</tt></li>
<li>.mkv : Matroska video <tt>video/x-matroska</tt></li>
<li>.mk3d : Matroska 3D video <tt>video/x-matroska-3d</tt></li>
</ul>
</section>

<section anchor="segment-position"><name>Segment Position</name>
<t>The <tt>Segment Position</tt> of an <tt>Element</tt> refers to the position of the first octet of the
<tt>Element ID</tt> of that <tt>Element</tt>, measured in octets, from the beginning of the <tt>Element Data</tt>
section of the containing <tt>Segment Element</tt>. In other words, the <tt>Segment Position</tt> of an
<tt>Element</tt> is the distance in octets from the beginning of its containing <tt>Segment Element</tt>
minus the size of the <tt>Element ID</tt> and <tt>Element Data Size</tt> of that <tt>Segment Element</tt>.
The <tt>Segment Position</tt> of the first <tt>Child Element</tt> of the <tt>Segment Element</tt> is 0.
An <tt>Element</tt> which is not stored within a <tt>Segment Element</tt>, such as the <tt>Elements</tt> of
the <tt>EBML Header</tt>, do not have a <tt>Segment Position</tt>.</t>

<section anchor="segment-position-exception"><name>Segment Position Exception</name>
<t><tt>Elements</tt> that are defined to store a <tt>Segment Position</tt> <bcp14>MAY</bcp14> define reserved values to
indicate a special meaning.</t>
</section>

<section anchor="example-of-segment-position"><name>Example of Segment Position</name>
<t>This table presents an example of <tt>Segment Position</tt> by showing a hexadecimal representation
of a very small Matroska file with labels to show the offsets in octets. The file contains
a <tt>Segment Element</tt> with an <tt>Element ID</tt> of &quot;0x18538067&quot; and a <tt>MuxingApp Element</tt> with an <tt>Element ID</tt> of &quot;0x4D80&quot;.</t>

<artwork>     0                             1                             2
     0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5  6  7  8  9  0
     +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
   0 |1A|45|DF|A3|8B|42|82|88|6D|61|74|72|6F|73|6B|61|18|53|80|67|
  20 |93|15|49|A9|66|8E|4D|80|84|69|65|74|66|57|41|84|69|65|74|66|
</artwork>
<t>In the above example, the <tt>Element ID</tt> of the <tt>Segment Element</tt> is stored at offset 16,
the <tt>Element Data Size</tt> of the <tt>Segment Element</tt> is stored at offset 20, and the
<tt>Element Data</tt> of the <tt>Segment Element</tt> is stored at offset 21.</t>
<t>The <tt>MuxingApp Element</tt> is stored at offset 26. Since the <tt>Segment Position</tt> of
an <tt>Element</tt> is calculated by subtracting the position of the <tt>Element Data</tt> of
the containing <tt>Segment Element</tt> from the position of that <tt>Element</tt>, the <tt>Segment Position</tt>
of <tt>MuxingApp Element</tt> in the above example is '26 - 21' or '5'.</t>
</section>
</section>

<section anchor="linked-segments"><name>Linked Segments</name>
<t>Matroska provides several methods to link two or many <tt>Segment Elements</tt> together to create
a <tt>Linked Segment</tt>. A <tt>Linked Segment</tt> is a set of multiple <tt>Segments</tt> related together into
a single presentation by using Hard Linking, Medium Linking, or Soft Linking. All <tt>Segments</tt>
within a <tt>Linked Segment</tt> <bcp14>MUST</bcp14> utilize the same track numbers and timescale. All <tt>Segments</tt>
within a <tt>Linked Segment</tt> <bcp14>MUST</bcp14> be stored within the same directory. All <tt>Segments</tt>
within a <tt>Linked Segment</tt> <bcp14>MUST</bcp14> store a <tt>SegmentUID</tt>.</t>

<section anchor="hard-linking"><name>Hard Linking</name>
<t>Hard Linking (also called splitting) is the process of creating a <tt>Linked Segment</tt>
by relating multiple <tt>Segment Elements</tt> using the <tt>NextUID</tt> and <tt>PrevUID</tt> Elements.
Within a <tt>Linked Segment</tt>, the timestamps of each <tt>Segment</tt> <bcp14>MUST</bcp14> follow consecutively
in linking order.
With Hard Linking, the chapters of any <tt>Segment</tt> within the <tt>Linked Segment</tt> <bcp14>MUST</bcp14>
only reference the current <tt>Segment</tt>. With Hard Linking, the <tt>NextUID</tt> and <tt>PrevUID</tt> <bcp14>MUST</bcp14>
reference the respective <tt>SegmentUID</tt> values of the next and previous <tt>Segments</tt>.
The first <tt>Segment</tt> of a <tt>Linked Segment</tt> <bcp14>SHOULD</bcp14> have a <tt>NextUID Element</tt> and <bcp14>MUST NOT</bcp14>
have a <tt>PrevUID Element</tt>.
The last <tt>Segment</tt> of a <tt>Linked Segment</tt> <bcp14>SHOULD</bcp14> have a <tt>PrevUID Element</tt> and <bcp14>MUST NOT</bcp14>
have a <tt>NextUID Element</tt>.
The middle <tt>Segments</tt> of a <tt>Linked Segment</tt> <bcp14>SHOULD</bcp14> have both a <tt>NextUID Element</tt>
and a <tt>PrevUID Element</tt>.</t>
<t>In a chain of <tt>Linked Segments</tt> the <tt>NextUID</tt> always takes precedence over the <tt>PrevUID</tt>.
So if SegmentA has a NextUID to SegmentB and SegmentB has a PrevUID to SegmentC,
the link to use is SegmentA to SegmentB.
If SegmentB has a PrevUID to SegmentA but SegmentA has no NextUID, then the Matroska Player
<bcp14>MAY</bcp14> consider these two Segments linked as SegmentA followed by SegmentB.</t>
<t>As an example, three <tt>Segments</tt> can be Hard Linked as a <tt>Linked Segment</tt> through
cross-referencing each other with <tt>SegmentUID</tt>, <tt>PrevUID</tt>, and <tt>NextUID</tt>, as in this table.</t>
<table>
<thead>
<tr>
<th align="left">file name</th>
<th align="left"><tt>SegmentUID</tt></th>
<th align="left"><tt>PrevUID</tt></th>
<th align="left"><tt>NextUID</tt></th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>start.mkv</tt></td>
<td align="left">71000c23cd310998 53fbc94dd984a5dd</td>
<td align="left">n/a</td>
<td align="left">a77b3598941cb803 eac0fcdafe44fac9</td>
</tr>

<tr>
<td align="left"><tt>middle.mkv</tt></td>
<td align="left">a77b3598941cb803 eac0fcdafe44fac9</td>
<td align="left">71000c23cd310998 53fbc94dd984a5dd</td>
<td align="left">6c92285fa6d3e827 b198d120ea3ac674</td>
</tr>

<tr>
<td align="left"><tt>end.mkv</tt></td>
<td align="left">6c92285fa6d3e827 b198d120ea3ac674</td>
<td align="left">a77b3598941cb803 eac0fcdafe44fac9</td>
<td align="left">n/a</td>
</tr>
</tbody>
</table><t>An other example where only the <tt>NextUID</tt> Element is used.</t>
<table>
<thead>
<tr>
<th align="left">file name</th>
<th align="left"><tt>SegmentUID</tt></th>
<th align="left"><tt>PrevUID</tt></th>
<th align="left"><tt>NextUID</tt></th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>start.mkv</tt></td>
<td align="left">71000c23cd310998 53fbc94dd984a5dd</td>
<td align="left">n/a</td>
<td align="left">a77b3598941cb803 eac0fcdafe44fac9</td>
</tr>

<tr>
<td align="left"><tt>middle.mkv</tt></td>
<td align="left">a77b3598941cb803 eac0fcdafe44fac9</td>
<td align="left">n/a</td>
<td align="left">6c92285fa6d3e827 b198d120ea3ac674</td>
</tr>

<tr>
<td align="left"><tt>end.mkv</tt></td>
<td align="left">6c92285fa6d3e827 b198d120ea3ac674</td>
<td align="left">n/a</td>
<td align="left">n/a</td>
</tr>
</tbody>
</table><t>A next example where only the <tt>PrevUID</tt> Element is used.</t>
<table>
<thead>
<tr>
<th align="left">file name</th>
<th align="left"><tt>SegmentUID</tt></th>
<th align="left"><tt>PrevUID</tt></th>
<th align="left"><tt>NextUID</tt></th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>start.mkv</tt></td>
<td align="left">71000c23cd310998 53fbc94dd984a5dd</td>
<td align="left">n/a</td>
<td align="left">n/a</td>
</tr>

<tr>
<td align="left"><tt>middle.mkv</tt></td>
<td align="left">a77b3598941cb803 eac0fcdafe44fac9</td>
<td align="left">71000c23cd310998 53fbc94dd984a5dd</td>
<td align="left">n/a</td>
</tr>

<tr>
<td align="left"><tt>end.mkv</tt></td>
<td align="left">6c92285fa6d3e827 b198d120ea3ac674</td>
<td align="left">a77b3598941cb803 eac0fcdafe44fac9</td>
<td align="left">n/a</td>
</tr>
</tbody>
</table><t>In this example only the <tt>middle.mkv</tt> is using the <tt>PrevUID</tt> and <tt>NextUID</tt> Elements.</t>
<table>
<thead>
<tr>
<th align="left">file name</th>
<th align="left"><tt>SegmentUID</tt></th>
<th align="left"><tt>PrevUID</tt></th>
<th align="left"><tt>NextUID</tt></th>
</tr>
</thead>

<tbody>
<tr>
<td align="left"><tt>start.mkv</tt></td>
<td align="left">71000c23cd310998 53fbc94dd984a5dd</td>
<td align="left">n/a</td>
<td align="left">n/a</td>
</tr>

<tr>
<td align="left"><tt>middle.mkv</tt></td>
<td align="left">a77b3598941cb803 eac0fcdafe44fac9</td>
<td align="left">71000c23cd310998 53fbc94dd984a5dd</td>
<td align="left">6c92285fa6d3e827 b198d120ea3ac674</td>
</tr>

<tr>
<td align="left"><tt>end.mkv</tt></td>
<td align="left">6c92285fa6d3e827 b198d120ea3ac674</td>
<td align="left">n/a</td>
<td align="left">n/a</td>
</tr>
</tbody>
</table></section>

<section anchor="medium-linking"><name>Medium Linking</name>
<t>Medium Linking creates relationships between <tt>Segments</tt> using Ordered Chapters and the
<tt>ChapterSegmentUID Element</tt>. A <tt>Segment Edition</tt> with Ordered Chapters <bcp14>MAY</bcp14> contain
<tt>Chapter Elements</tt> that reference timestamp ranges from other <tt>Segments</tt>. The <tt>Segment</tt>
referenced by the Ordered Chapter via the <tt>ChapterSegmentUID Element</tt> <bcp14>SHOULD</bcp14> be played as
part of a Linked Segment. The timestamps of Segment content referenced by Ordered Chapters
<bcp14>MUST</bcp14> be adjusted according to the cumulative duration of the the previous Ordered Chapters.</t>
<t>As an example a file named <tt>intro.mkv</tt> could have a <tt>SegmentUID</tt> of &quot;0xb16a58609fc7e60653a60c984fc11ead&quot;.
Another file called <tt>program.mkv</tt> could use a Chapter Edition that contains two Ordered Chapters.
The first chapter references the <tt>Segment</tt> of <tt>intro.mkv</tt> with the use of a <tt>ChapterSegmentUID</tt>,
<tt>ChapterSegmentEditionUID</tt>, <tt>ChapterTimeStart</tt>, and optionally a <tt>ChapterTimeEnd</tt> element.
The second chapter references content within the <tt>Segment</tt> of <tt>program.mkv</tt>. A <tt>Matroska Player</tt>
<bcp14>SHOULD</bcp14> recognize the <tt>Linked Segment</tt> created by the use of <tt>ChapterSegmentUID</tt> in an enabled
<tt>Edition</tt> and present the reference content of the two <tt>Segments</tt> together.</t>
</section>

<section anchor="soft-linking"><name>Soft Linking</name>
<t>Soft Linking is used by codec chapters. They can reference another <tt>Segment</tt> and jump to
that <tt>Segment</tt>. The way the <tt>Segments</tt> are described are internal to the chapter codec and
unknown to the Matroska level. But there are <tt>Elements</tt> within the <tt>Info Element</tt>
(such as <tt>ChapterTranslate</tt>) that can translate a value representing a <tt>Segment</tt> in the
chapter codec and to the current <tt>SegmentUID</tt>. All <tt>Segments</tt> that could be used in a <tt>Linked Segment</tt>
in this way <bcp14>SHOULD</bcp14> be marked as members of the same family via the <tt>SegmentFamily Element</tt>,
so that the <tt>Matroska Player</tt> can quickly switch from one to the other.</t>
</section>
</section>

<section anchor="track-flags"><name>Track Flags</name>

<section anchor="default-flag"><name>Default flag</name>
<t>The &quot;default track&quot; flag is a hint for a <tt>Matroska Player</tt> and <bcp14>SHOULD</bcp14> always be changeable
by the user. If the user wants to see or hear a track of a certain kind (audio, video, subtitles)
and hasn't chosen a specific track, the <tt>Matroska Player</tt> <bcp14>SHOULD</bcp14> use the first track
of that kind whose &quot;default track&quot; flag is set to &quot;1&quot;. If no such track is found,
then the first track of this kind <bcp14>SHOULD</bcp14> be chosen.</t>
<t>Only one track of a kind <bcp14>MAY</bcp14> have its &quot;default track&quot; flag set in a segment.
If a track entry does not contain the &quot;default track&quot; flag element, then its
default value &quot;1&quot; is to be used.</t>
</section>

<section anchor="forced-flag"><name>Forced flag</name>
<t>The &quot;forced&quot; flag tells the <tt>Matroska Player</tt> that it <bcp14>MUST</bcp14> display/play this track
or another track of the same kind that also has its &quot;forced&quot; flag set. When there are multiple
&quot;forced&quot; tracks, the <tt>Matroska Player</tt> <bcp14>SHOULD</bcp14> determine the track based upon the language
of the forced flag or use the default flag if no track matches the use languages.
Another track of the same kind without the &quot;forced&quot; flag may be use simultaneously
with the &quot;forced&quot; track, like DVD subtitles.</t>
</section>

<section anchor="track-operation"><name>Track Operation</name>
<t><tt>TrackOperation</tt> allows combining multiple tracks to make a virtual one. It uses
two separate system to combine tracks. One to create a 3D &quot;composition&quot; (left/right/background planes)
and one to simplify join two tracks together to make a single track.</t>
<t>A track created with <tt>TrackOperation</tt> is a proper track with a UID and all its flags.
However the codec ID is meaningless because each &quot;sub&quot; track needs to be decoded by its
own decoder before the &quot;operation&quot; is applied. The <tt>Cues Elements</tt> corresponding to such
a virtual track <bcp14>SHOULD</bcp14> be the sum of the <tt>Cues Elements</tt> for each of the tracks it's composed of (when the <tt>Cues</tt> are defined per track).</t>
<t>In the case of <tt>TrackJoinBlocks</tt>, the <tt>Block Elements</tt> (from <tt>BlockGroup</tt> and <tt>SimpleBlock</tt>)
of all the tracks <bcp14>SHOULD</bcp14> be used as if they were defined for this new virtual <tt>Track</tt>.
When two <tt>Block Elements</tt> have overlapping start or end timestamps, it's up to the underlying
system to either drop some of these frames or render them the way they overlap.
This situation <bcp14>SHOULD</bcp14> be avoided when creating such tracks as you can never be sure
of the end result on different platforms.</t>
</section>

<section anchor="overlay-track"><name>Overlay Track</name>
<t>Overlay tracks <bcp14>SHOULD</bcp14> be rendered in the same channel as the track its linked to.
When content is found in such a track, it <bcp14>SHOULD</bcp14> be played on the rendering channel
instead of the original track.</t>
</section>

<section anchor="multi-planar-and-3d-videos"><name>Multi-planar and 3D videos</name>
<t>There are two different ways to compress 3D videos: have each eye track in a separate track
and have one track have both eyes combined inside (which is more efficient, compression-wise).
Matroska supports both ways.</t>
<t>For the single track variant, there is the <tt>StereoMode Element</tt>, which defines how planes are
assembled in the track (mono or left-right combined). Odd values of StereoMode means the left
plane comes first for more convenient reading. The pixel count of the track (<tt>PixelWidth</tt>/<tt>PixelHeight</tt>)
is the raw amount of pixels, for example 3840x1080 for full HD side by side, and the <tt>DisplayWidth</tt>/<tt>DisplayHeight</tt>
in pixels is the amount of pixels for one plane (1920x1080 for that full HD stream).
Old stereo 3D were displayed using anaglyph (cyan and red colours separated).
For compatibility with such movies, there is a value of the StereoMode that corresponds to AnaGlyph.</t>
<t>There is also a &quot;packed&quot; mode (values 13 and 14) which consists of packing two frames together
in a <tt>Block</tt> using lacing. The first frame is the left eye and the other frame is the right eye
(or vice versa). The frames <bcp14>SHOULD</bcp14> be decoded in that order and are possibly dependent
on each other (P and B frames).</t>
<t>For separate tracks, Matroska needs to define exactly which track does what.
<tt>TrackOperation</tt> with <tt>TrackCombinePlanes</tt> do that. For more details look at
<xref target="track-operation"></xref> on how TrackOperation works.</t>
<t>The 3D support is still in infancy and may evolve to support more features.</t>
<t>The StereoMode used to be part of Matroska v2 but it didn't meet the requirement
for multiple tracks. There was also a bug in libmatroska prior to 0.9.0 that would save/read
it as 0x53B9 instead of 0x53B8. <tt>Matroska Readers</tt> may support these legacy files by checking
Matroska v2 or 0x53B9. The older values were 0: mono, 1: right eye, 2: left eye, 3: both eyes.</t>
</section>
</section>

<section anchor="timestamps"><name>Timestamps</name>
<t>Historically timestamps in Matroska were mistakenly called timecodes. The <tt>Timestamp Element</tt>
was called Timecode, the <tt>TimestampScale Element</tt> was called TimecodeScale, the
<tt>TrackTimestampScale Element</tt> was called TrackTimecodeScale and the
<tt>ReferenceTimestamp Element</tt> was called ReferenceTimeCode.</t>

<section anchor="timestamp-types"><name>Timestamp Types</name>

<ul>
<li>Absolute Timestamp = Block+Cluster</li>
<li>Relative Timestamp = Block</li>
<li>Scaled Timestamp = Block+Cluster</li>
<li>Raw Timestamp = (Block+Cluster)*TimestampScale*TrackTimestampScale</li>
</ul>
</section>

<section anchor="block-timestamps"><name>Block Timestamps</name>
<t>The <tt>Block Element</tt>'s timestamp <bcp14>MUST</bcp14> be a signed integer that represents the
<tt>Raw Timestamp</tt> relative to the <tt>Cluster</tt>'s <tt>Timestamp Element</tt>, multiplied by the
<tt>TimestampScale Element</tt>. See <xref target="timestampscale"></xref> for more information.</t>
<t>The <tt>Block Element</tt>'s timestamp <bcp14>MUST</bcp14> be represented by a 16bit signed integer (sint16).
The <tt>Block</tt>'s timestamp has a range of -32768 to +32767 units. When using the default value
of the <tt>TimestampScale Element</tt>, each integer represents 1ms. The maximum time span of
<tt>Block Elements</tt> in a <tt>Cluster</tt> using the default <tt>TimestampScale Element</tt> of 1ms is 65536ms.</t>
<t>If a <tt>Cluster</tt>'s <tt>Timestamp Element</tt> is set to zero, it is possible to have <tt>Block Elements</tt>
with a negative <tt>Raw Timestamp</tt>. <tt>Block Elements</tt> with a negative <tt>Raw Timestamp</tt> are not valid.</t>
</section>

<section anchor="raw-timestamp"><name>Raw Timestamp</name>
<t>The exact time of an object <bcp14>SHOULD</bcp14> be represented in nanoseconds. To find out a <tt>Block</tt>'s
<tt>Raw Timestamp</tt>, you need the <tt>Block</tt>'s <tt>Timestamp Element</tt>, the <tt>Cluster</tt>'s <tt>Timestamp Element</tt>,
and the <tt>TimestampScale Element</tt>.</t>
</section>

<section anchor="timestampscale"><name>TimestampScale</name>
<t>The <tt>TimestampScale Element</tt> is used to calculate the <tt>Raw Timestamp</tt> of a <tt>Block</tt>.
The timestamp is obtained by adding the <tt>Block</tt>'s timestamp to the <tt>Cluster</tt>'s <tt>Timestamp Element</tt>,
and then multiplying that result by the <tt>TimestampScale</tt>. The result will be the <tt>Block</tt>'s <tt>Raw Timestamp</tt>
in nanoseconds. The formula for this would look like:</t>

<artwork>(a + b) * c

a = `Block`'s Timestamp
b = `Cluster`'s Timestamp
c = `TimestampScale`
</artwork>
<t>For example, assume a <tt>Cluster</tt>'s <tt>Timestamp</tt> has a value of 564264, the <tt>Block</tt> has a <tt>Timestamp</tt>
of 1233, and the <tt>TimestampScale Element</tt> is the default of 1000000.</t>

<artwork>(1233 + 564264) * 1000000 = 565497000000
</artwork>
<t>So, the <tt>Block</tt> in this example has a specific time of 565497000000 in nanoseconds.
In milliseconds this would be 565497ms.</t>
</section>

<section anchor="timestampscale-rounding"><name>TimestampScale Rounding</name>
<t>Because the default value of <tt>TimestampScale</tt> is 1000000, which makes each integer in the
<tt>Cluster</tt> and <tt>Block</tt> <tt>Timestamp Elements</tt> equal 1ms, this is the most commonly used.
When dealing with audio, this causes inaccuracy when seeking. When the audio is combined with video,
this is not an issue. For most cases, the the synch of audio to video does not need to be more than
1ms accurate. This becomes obvious when one considers that sound will take 2-3ms to travel a single meter,
so distance from your speakers will have a greater effect on audio/visual synch than this.</t>
<t>However, when dealing with audio-only files, seeking accuracy can become critical.
For instance, when storing a whole CD in a single track, a user will want to be able to seek
to the exact sample that a song begins at. If seeking a few sample ahead or behind, a crack
or pop may result as a few odd samples are rendered. Also, when performing precise editing,
it may be very useful to have the audio accuracy down to a single sample.</t>
<t>When storing timestamps for an audio stream, the <tt>TimestampScale Element</tt> <bcp14>SHOULD</bcp14> have an accuracy
of at least that of the audio sample rate, otherwise there are rounding errors that prevent users
from knowing the precise location of a sample. Here's how a program has to round each timestamp
in order to be able to recreate the sample number accurately.</t>
<t>Let's assume that the application has an audio track with a sample rate of 44100. As written
above the <tt>TimestampScale</tt> <bcp14>MUST</bcp14> have at least the accuracy of the sample rate itself: 1000000000 / 44100 = 22675.7369614512.
This value <bcp14>MUST</bcp14> always be truncated. Otherwise the accuracy will not suffice.
So in this example the application will use 22675 for the <tt>TimestampScale</tt>.
The application could even use some lower value like 22674, which would allow it to be a
little bit imprecise about the original timestamps. But more about that in a minute.</t>
<t>Next the application wants to write sample number 52340 and calculates the timestamp. This is easy.
In order to calculate the <tt>Raw Timestamp</tt> in ns all it has to do is calculate
<tt>Raw Timestamp = round(1000000000 * sample_number / sample_rate)</tt>. Rounding at this stage
is very important! The application might skip it if it choses a slightly smaller value for
the <tt>TimestampScale</tt> factor instead of the truncated one like shown above.
Otherwise it has to round or the results won't be reversible.
For our example we get <tt>Raw Timestamp = round(1000000000 * 52340 / 44100) = round(1186848072.56236) = 1186848073</tt>.</t>
<t>The next step is to calculate the <tt>Absolute Timestamp</tt> - that is the timestamp that
will be stored in the Matroska file. Here the application has to divide the <tt>Raw Timestamp</tt>
from the previous paragraph by the <tt>TimestampScale</tt> factor and round the result:
<tt>Absolute Timestamp = round(Raw Timestamp / TimestampScale_factor)</tt>, which will result in the
following for our example: <tt>Absolute Timestamp = round(1186848073 / 22675) = round(52341.7011245866) = 52342</tt>.
This number is the one the application has to write to the file.</t>
<t>Now our file is complete, and we want to play it back with another application.
Its task is to find out which sample the first application wrote into the file.
So it starts reading the Matroska file and finds the <tt>TimestampScale</tt> factor 22675 and
the audio sample rate 44100. Later it finds a data block with the <tt>Absolute Timestamp</tt> of 52342.
But how does it get the sample number from these numbers?</t>
<t>First it has to calculate the <tt>Raw Timestamp</tt> of the block it has just read. Here's no
rounding involved, just an integer multiplication: <tt>Raw Timestamp = Absolute Timestamp * TimestampScale_factor</tt>.
In our example: <tt>Raw Timestamp = 52342 * 22675 = 1186854850</tt>.</t>
<t>The conversion from the <tt>Raw Timestamp</tt> to the sample number again requires rounding:
<tt>sample_number = round(Raw Timestamp * sample_rate / 1000000000)</tt>.
In our example: <tt>sample_number = round(1186854850 * 44100 / 1000000000) = round(52340.298885) = 52340</tt>.
This is exactly the sample number that the previous program started with.</t>
<t>Some general notes for a program:</t>

<ol>
<li>Always calculate the timestamps / sample numbers with floating point numbers of at least
64bit precision (called 'double' in most modern programming languages).
If you're calculating with integers, then make sure they're 64bit long, too.</li>
<li>Always round if you divide. Always! If you don't you'll end up with situations in which
you have a timestamp in the Matroska file that does not correspond to the sample number
that it started with. Using a slightly lower timestamp scale factor can help here in
that it removes the need for proper rounding in the conversion from sample number to <tt>Raw Timestamp</tt>.</li>
</ol>
</section>

<section anchor="tracktimestampscale"><name>TrackTimestampScale</name>
<t>The <tt>TrackTimestampScale Element</tt> is used align tracks that would otherwise be played at
different speeds. An example of this would be if you have a film that was originally recorded
at 24fps video. When playing this back through a PAL broadcasting system, it is standard to
speed up the film to 25fps to match the 25fps display speed of the PAL broadcasting standard.
However, when broadcasting the video through NTSC, it is typical to leave the film at its
original speed. If you wanted to make a single file where there was one video stream,
and an audio stream used from the PAL broadcast, as well as an audio stream used from the NTSC
broadcast, you would have the problem that the PAL audio stream would be 1/24th faster than
the NTSC audio stream, quickly leading to problems. It is possible to stretch out the PAL
audio track and re-encode it at a slower speed, however when dealing with lossy audio codecs,
this often results in a loss of audio quality and/or larger file sizes.</t>
<t>This is the type of problem that <tt>TrackTimestampScale</tt> was designed to fix. Using it,
the video can be played back at a speed that will synch with either the NTSC or the PAL
audio stream, depending on which is being used for playback.
To continue the above example:</t>

<artwork>Track 1: Video
Track 2: NTSC Audio
Track 3: PAL Audio
</artwork>
<t>Because the NTSC track is at the original speed, it will used as the default value of 1.0 for
its <tt>TrackTimestampScale</tt>. The video will also be aligned to the NTSC track with the default value of 1.0.</t>
<t>The <tt>TrackTimestampScale</tt> value to use for the PAL track would be calculated by
determining how much faster the PAL track is than the NTSC track. In this case,
because we know the video for the NTSC audio is being played back at 24fps and the video
for the PAL audio is being played back at 25fps, the calculation would be:</t>
<t>25/24 is almost 1.04166666666666666667</t>
<t>When writing a file that uses a non-default <tt>TrackTimestampScale</tt>, the values of the <tt>Block</tt>'s
timestamp are whatever they would be when normally storing the track with a default value for
the <tt>TrackTimestampScale</tt>. However, the data is interleaved a little differently.
Data <bcp14>SHOULD</bcp14> be interleaved by its Raw Timestamp, see <xref target="raw-timestamp"></xref>, in the order handed back
from the encoder. The <tt>Raw Timestamp</tt> of a <tt>Block</tt> from a track using <tt>TrackTimestampScale</tt>
is calculated using:</t>
<t><tt>(Block's Timestamp + Cluster's Timestamp) * TimestampScale * TrackTimestampScale</tt></t>
<t>So, a Block from the PAL track above that had a Scaled Timestamp, see <xref target="timestamp-types"></xref>, of 100
seconds would have a <tt>Raw Timestamp</tt> of 104.66666667 seconds, and so would be stored in that
part of the file.</t>
<t>When playing back a track using the <tt>TrackTimestampScale</tt>, if the track is being played by itself,
there is no need to scale it. From the above example, when playing the Video with the NTSC Audio,
neither are scaled. However, when playing back the Video with the PAL Audio, the timestamps
from the PAL Audio track are scaled using the <tt>TrackTimestampScale</tt>, resulting in the video
playing back in synch with the audio.</t>
<t>It would be possible for a <tt>Matroska Player</tt> to also adjust the audio's samplerate at the
same time as adjusting the timestamps if you wanted to play the two audio streams synchronously.
It would also be possible to adjust the video to match the audio's speed. However,
for playback, the selected track(s) timestamps <bcp14>SHOULD</bcp14> be adjusted if they need to be scaled.</t>
<t>While the above example deals specifically with audio tracks, this element can be used
to align video, audio, subtitles, or any other type of track contained in a Matroska file.</t>
</section>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-cellar-codec.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-cellar-tags.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8794.xml"/>
</references>
<references><name>Informative References</name>
<reference anchor="MCF" target="http://mukoli.free.fr/mcf/mcf.html">
  <front>
    <title>Media Container Format</title>
    <author></author>
    <date year="2002" month="July" day="17"></date>
  </front>
</reference>
</references>

</back>

</rfc>
