<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' []>
<rfc ipr="trust200902" category="std" docName="draft-lhomme-cellar-matroska-02">
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc private=""?>
<?rfc topblock="yes"?>
<?rfc comments="no"?>
<front>
<title abbrev="Matroska">Matroska</title>

<author initials="S." surname="Lhomme" fullname="Steve Lhomme">
<organization></organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>slhomme@matroska.org</email>
<uri></uri>
</address>
</author>
<author initials="M." surname="Bunkus" fullname="Moritz Bunkus">
<organization></organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>moritz@bunkus.org</email>
<uri></uri>
</address>
</author>
<author initials="D." surname="Rice" fullname="Dave Rice">
<organization></organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>dave@dericed.com</email>
<uri></uri>
</address>
</author>
<date year="2017" month="May" day="26"/>

<area>art</area>
<workgroup>cellar</workgroup>
<keyword></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" title="Introduction">
<t>Matroska aims to become THE standard of multimedia container formats. It was derived from a project called <eref target="http://mukoli.free.fr/mcf/mcf.html">MCF</eref>, but differentiates from it significantly because it is based on <eref target="https://github.com/Matroska-Org/ebml-specification/blob/master/specification.markdown">EBML</eref> (Extensible Binary Meta Language), 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>
<t>
<list style="symbols">
<t>It is NOT a video or audio compression format (codec)</t>
<t>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.</t>
</list>
</t>
<t>Matroska is designed with the future in mind. It incorporates features like:
</t>
<t>
<list style="symbols">
<t>Fast seeking in the file</t>
<t>Chapter entries</t>
<t>Full metadata (tags) support</t>
<t>Selectable subtitle/audio/video streams</t>
<t>Modularly expandable</t>
<t>Error resilience (can recover playback even when the stream is damaged)</t>
<t>Streamable over the internet and local networks (HTTP, CIFS, FTP, etc)</t>
<t>Menus (like DVDs have)</t>
</list>
</t>
<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" title="Status of this document">
<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. Legacy versions of the specification can be found <eref target="https://matroska.org/files/matroska.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>A more refined and detailed version of the EBML specifications is being <eref target="https://github.com/Matroska-Org/ebml-specification/blob/master/specification.markdown">worked on here</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 MAY be further additions to v4.
</t>
</section>

<section anchor="security-considerations" title="Security Considerations">
<t>Matroska inherits security considerations from EBML.
</t>
<t>Attacks on a <spanx style="verb">Matroska Reader</spanx> could include:
</t>
<t>
<list style="symbols">
<t>Storage of a arbitrary and potentially executable data within an <spanx style="verb">Attachment Element</spanx>. <spanx style="verb">Matroska Readers</spanx> that extract or use data from Matroska Attachments SHOULD check that the data adheres to expectations.</t>
<t>A <spanx style="verb">Matroska Attachment</spanx> with an inaccurate mime-type.</t>
</list>
</t>
</section>

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

<section anchor="notations-and-conventions" title="Notations and Conventions">
<t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be interpreted as described in <eref target="https://tools.ietf.org/html/rfc2119">RFC 2119</eref>.
</t>
</section>

<section anchor="basis-in-ebml" title="Basis in EBML">
<t>Matroska is a Document Type of EBML (Extensible Binary Meta Language). This specification is dependent on the <eref target="https://github.com/Matroska-Org/ebml-specification/blob/master/specification.markdown">EBML Specification</eref>. For an understanding of Matroska's EBML Schema, see in particular the sections of the EBML Specification covering <eref target="https://github.com/Matroska-Org/ebml-specification/blob/master/specification.markdown#ebml-element-types">EBML Element Types</eref>, <eref target="https://github.com/Matroska-Org/ebml-specification/blob/master/specification.markdown#ebml-schema">EBML Schema</eref>, and <eref target="https://github.com/Matroska-Org/ebml-specification/blob/master/specification.markdown#structure">EBML Structure</eref>.
</t>

<section anchor="added-constaints-on-ebml" title="Added Constaints on EBML">
<t>As an EBML Document Type, Matroska adds the following constraints to the EBML specification.
</t>
<t>
<list style="symbols">
<t>The <spanx style="verb">docType</spanx> of the <spanx style="verb">EBML Header</spanx> MUST be 'matroska'.</t>
<t>The <spanx style="verb">EBMLMaxIDLength</spanx> of the <spanx style="verb">EBML Header</spanx> MUST be <spanx style="verb">4</spanx>.</t>
<t>The <spanx style="verb">EBMLMaxSizeLength</spanx> of the <spanx style="verb">EBML Header</spanx> MUST be <spanx style="verb">8</spanx> or less.</t>
</list>
</t>
</section>

<section anchor="matroska-design" title="Matroska Design">
<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" title="Language Codes">
<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 <spanx style="verb">ISO 639-2 Language Elements</spanx> are &quot;Language Element&quot;, &quot;TagLanguage Element&quot;, and &quot;ChapLanguage Element&quot;.
</t>
<t>Starting in Matroska version 4, either <spanx style="verb">ISO 639-2</spanx> or <eref target="https://tools.ietf.org/html/bcp47">BCP 47</eref> MAY be used, although <spanx style="verb">BCP 47</spanx> is RECOMMENDED. The <spanx style="verb">BCP 47 Language Elements</spanx> are &quot;LanguageIETF Element&quot;, &quot;TagLanguageIETF Element&quot;, and &quot;ChapLanguageIETF Element&quot;. If a <spanx style="verb">BCP 47 Language Element</spanx> and an <spanx style="verb">ISO 639-2 Language Element</spanx> are used within the same <spanx style="verb">Parent Element</spanx>, then the <spanx style="verb">ISO 639-2 Lanaguage Element</spanx> MUST be ignored and precedence given to the <spanx style="verb">BCP 47 Language Element</spanx>.
</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" title="Physical Types">
<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>
<texttable>
<ttcol align="left">ChapterPhysicalEquiv</ttcol>
<ttcol align="left">Audio</ttcol>
<ttcol align="left">Video</ttcol>
<ttcol align="left">Comment</ttcol>

<c>70</c><c>SET / PACKAGE</c><c>SET / PACKAGE</c><c>the collection of different media</c>
<c>60</c><c>CD / 12&quot; / 10&quot; / 7&quot; / TAPE / MINIDISC / DAT</c><c>DVD / VHS / LASERDISC</c><c>the physical medium like a CD or a DVD</c>
<c>50</c><c>SIDE</c><c>SIDE</c><c>when the original medium (LP/DVD) has different sides</c>
<c>40</c><c>-</c><c>LAYER</c><c>another physical level on DVDs</c>
<c>30</c><c>SESSION</c><c>SESSION</c><c>as found on CDs and DVDs</c>
<c>20</c><c>TRACK</c><c>-</c><c>as found on audio CDs</c>
<c>10</c><c>INDEX</c><c>-</c><c>the first logical level of the side/medium</c>
</texttable>
</section>

<section anchor="block-structure" title="Block Structure">
<t>Size = 1 + (1-8) + 4 + (4 + (4)) octets. So from 6 to 21 octets.
</t>
<t>Bit 0 is the most significant bit.
</t>
<t>Frames using references SHOULD be stored in &quot;coding order&quot;. That means the references first and then the frames referencing them. A consequence is that timecodes MAY NOT be consecutive. But a frame with a past timecode MUST reference a frame already known, otherwise it's considered bad/void.
</t>
<t>There can be many Blocks in a BlockGroup provided they all have the same timecode. It is used with different parts of a frame with different priorities.
</t>

<section anchor="block-header" title="Block Header">
<texttable>
<ttcol align="left">Offset</ttcol>
<ttcol align="left">Player</ttcol>
<ttcol align="left">Description</ttcol>

<c>0x00+</c><c>MUST</c><c>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).</c>
<c>0x01+</c><c>MUST</c><c>Timecode (relative to Cluster timecode, signed int16)</c>
</texttable>
</section>

<section anchor="block-header-flags" title="Block Header Flags">
<texttable>
<ttcol align="left">Offset</ttcol>
<ttcol align="left">Bit</ttcol>
<ttcol align="left">Player</ttcol>
<ttcol align="left">Description</ttcol>

<c>0x03+</c><c>0-3</c><c>-</c><c>Reserved, set to 0</c>
<c>0x03+</c><c>4</c><c>-</c><c>Invisible, the codec SHOULD decode this frame but not display it</c>
<c>0x03+</c><c>5-6</c><c>MUST</c><c>Lacing</c>
<c></c><c></c><c></c><c>*   00 : no lacing</c>
<c></c><c></c><c></c><c>*   01 : Xiph lacing</c>
<c></c><c></c><c></c><c>*   11 : EBML lacing</c>
<c></c><c></c><c></c><c>*   10 : fixed-size lacing</c>
<c>0x03+</c><c>7</c><c>-</c><c>not used</c>
</texttable>
</section>

<section anchor="laced-data" title="Laced Data">
<t>When lacing bit is set.
</t>
<texttable>
<ttcol align="left">Offset</ttcol>
<ttcol align="left">Player</ttcol>
<ttcol align="left">Description</ttcol>

<c>0x00</c><c>MUST</c><c>Number of frames in the lace-1 (uint8)</c>
<c>0x01 / 0xXX</c><c>MUST*</c><c>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).</c>
</texttable>
<t>For (possibly) Laced Data
</t>
<texttable>
<ttcol align="left">Offset</ttcol>
<ttcol align="left">Player</ttcol>
<ttcol align="left">Description</ttcol>

<c>0x00</c><c>MUST</c><c>Consecutive laced frames</c>
</texttable>
</section>
</section>

<section anchor="lacing" title="Lacing">
<t>Lacing is a mechanism to save space when storing data. It is typically used for small blocks of data (refered to as frames in matroska). There are 3 types of lacing : the Xiph one inspired by what is found in the Ogg container, the EBML one which is the same with sizes coded differently and the fixed-size one where the size is not coded. As an example is better than words...
</t>
<t>Let's say you want 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, you can store them in a lace to save space. They will then be solved in the same block as follows:
</t>

<section anchor="xiph-lacing" title="Xiph lacing">
<t>
<list style="symbols">
<t>Block head (with lacing bits set to 01)</t>
<t>Lacing head: Number of frames in the lace -1, i.e. 2 (the 800 and 500 octets one)</t>
<t>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.</t>
<t>Data in frame 1</t>
<t>Data in frame 2</t>
<t>Data in frame 3</t>
</list>
</t>
<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" title="EBML lacing">
<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>
<texttable>
<ttcol align="left">Bit Representation</ttcol>
<ttcol align="left">Value</ttcol>

<c>1xxx xxxx</c><c>value -(2^6-1) to 2^6-1 (ie 0 to 2^7-2 minus 2^6-1, half of the range)</c>
<c>01xx xxxx  xxxx xxxx</c><c>value -(2^13-1) to 2^13-1</c>
<c>001x xxxx  xxxx xxxx  xxxx xxxx</c><c>value -(2^20-1) to 2^20-1</c>
<c>0001 xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx</c><c>value -(2^27-1) to 2^27-1</c>
<c>0000 1xxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx</c><c>value -(2^34-1) to 2^34-1</c>
<c>0000 01xx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx</c><c>value -(2^41-1) to 2^41-1</c>
<c>0000 001x  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx</c><c>value -(2^48-1) to 2^48-1</c>
</texttable>
<t>
<list style="symbols">
<t>Block head (with lacing bits set to 11)</t>
<t>Lacing head: Number of frames in the lace -1, i.e. 2 (the 800 and 400 octets one)</t>
<t>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.</t>
<t>Data in frame 1</t>
<t>Data in frame 2</t>
<t>Data in frame 3</t>
</list>
</t>
</section>

<section anchor="fixedsize-lacing" title="Fixed-size lacing">
<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>
<t>
<list style="symbols">
<t>Block head (with lacing bits set to 10)</t>
<t>Lacing head: Number of frames in the lace -1, i.e. 2</t>
<t>Data in frame 1</t>
<t>Data in frame 2</t>
<t>Data in frame 3</t>
</list>
</t>
</section>

<section anchor="simpleblock-structure" title="SimpleBlock Structure">
<t>The SimpleBlock is very inspired by the [Block structure](({{site.baseurl}}/index.html#block-structure). The main differences are the added Keyframe flag and Discardable flag. Otherwise everything is the same.
</t>
<t>Size = 1 + (1-8) + 4 + (4 + (4)) octets. So from 6 to 21 octets.
</t>
<t>Bit 0 is the most significant bit.
</t>
<t>Frames using references SHOULD be stored in &quot;coding order&quot;. That means the references first and then the frames referencing them. A consequence is that timecodes MAY NOT be consecutive. But a frame with a past timecode MUST reference a frame already known, otherwise it's considered bad/void.
</t>
<t>There can be many Blocks in a BlockGroup provided they all have the same timecode. It is used with different parts of a frame with different priorities.
</t>

<section anchor="simpleblock-header" title="SimpleBlock Header">
<texttable>
<ttcol align="left">Offset</ttcol>
<ttcol align="left">Player</ttcol>
<ttcol align="left">Description</ttcol>

<c>0x00+</c><c>MUST</c><c>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).</c>
<c>0x01+</c><c>MUST</c><c>Timecode (relative to Cluster timecode, signed int16)</c>
</texttable>
</section>

<section anchor="simpleblock-header-flags" title="SimpleBlock Header Flags">
<texttable>
<ttcol align="left">Offset</ttcol>
<ttcol align="left">Bit</ttcol>
<ttcol align="left">Player</ttcol>
<ttcol align="left">Description</ttcol>

<c>0x03+</c><c>0</c><c>-</c><c>Keyframe, set when the Block contains only keyframes</c>
<c>0x03+</c><c>1-3</c><c>-</c><c>Reserved, set to 0</c>
<c>0x03+</c><c>4</c><c>-</c><c>Invisible, the codec SHOULD decode this frame but not display it</c>
<c>0x03+</c><c>5-6</c><c>MUST</c><c>Lacing</c>
<c></c><c></c><c></c><c>*   00 : no lacing</c>
<c></c><c></c><c></c><c>*   01 : Xiph lacing</c>
<c></c><c></c><c></c><c>*   11 : EBML lacing</c>
<c></c><c></c><c></c><c>*   10 : fixed-size lacing</c>
<c>0x03+</c><c>7</c><c>-</c><c>Discardable, the frames of the Block can be discarded during playing if needed</c>
</texttable>
</section>
</section>

<section anchor="laced-data-1" title="Laced Data">
<t>When lacing bit is set.
</t>
<texttable>
<ttcol align="left">Offset</ttcol>
<ttcol align="left">Player</ttcol>
<ttcol align="left">Description</ttcol>

<c>0x00</c><c>MUST</c><c>Number of frames in the lace-1 (uint8)</c>
<c>0x01 / 0xXX</c><c>MUST*</c><c>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).</c>
</texttable>
<t>For (possibly) Laced Data
</t>
<texttable>
<ttcol align="left">Offset</ttcol>
<ttcol align="left">Player</ttcol>
<ttcol align="left">Description</ttcol>

<c>0x00</c><c>MUST</c><c>Consecutive laced frames</c>
</texttable>
</section>
</section>
</section>
</section>

<section anchor="matroska-structure" title="Matroska Structure">
<t>A Matroska file is composed of one or many <spanx style="verb">EBML Documents</spanx> that use the <spanx style="verb">Matroska Document Type</spanx>. Each <spanx style="verb">EBML Document</spanx> MUST start with an <spanx style="verb">EBML Header</spanx> and then the <spanx style="verb">Root Element</spanx>, which is called <spanx style="verb">Segment</spanx> in Matroska. Matroska defines several <spanx style="verb">Top Level Elements</spanx> which MAY occur within the <spanx style="verb">Segment</spanx>.
</t>
<t>As an example, a simple Matroska file consisting of a single <spanx style="verb">EBML Document</spanx> could be represented like this:
</t>
<t>
<list style="symbols">
<t>EBML Header</t>
<t>Segment</t>
</list>
</t>
<t>A more complex Matroska file consisting of an <spanx style="verb">EBML Stream</spanx>  (consisting of two <spanx style="verb">EBML Documents</spanx>) could be represented like this:
</t>
<t>
<list style="symbols">
<t>EBML Header</t>
<t>Segment</t>
<t>EBML Header</t>
<t>Segment</t>
</list>
</t>
<t>The following diagram represents a simple Matroska file, comprised of an <spanx style="verb">EBML Document</spanx> with an <spanx style="verb">EBML Header</spanx>, a <spanx style="verb">Segment Element</spanx> (the <spanx style="verb">Root Element</spanx>), and all eight Matroska <spanx style="verb">Top Level Elements</spanx>. In the following diagrams of this section, horizontal spacing expresses a parent-child relationship between Matroska Elements (e.g. the <spanx style="verb">Info Element</spanx> is contained within the <spanx style="verb">Segment Element</spanx>) whereas vertical alignment represents the storage order within the file.
</t>

<figure align="center"><artwork align="center">
+-------------+
| EBML Header |
+---------------------------+
| Segment     | SeekHead    |
|             |-------------|
|             | Info        |
|             |-------------|
|             | Tracks      |
|             |-------------|
|             | Chapters    |
|             |-------------|
|             | Cluster     |
|             |-------------|
|             | Cues        |
|             |-------------|
|             | Attachments |
|             |-------------|
|             | Tags        |
+---------------------------+
</artwork></figure>

<section anchor="matroska-top-level-elements" title="Matroska Top Level Elements">
<t>The Matroska <spanx style="verb">EBML Schema</spanx> defines eight <spanx style="verb">Top Level Elements</spanx>: <spanx style="verb">SeekHead</spanx>, <spanx style="verb">Info</spanx>, <spanx style="verb">Tracks</spanx>, <spanx style="verb">Chapters</spanx>, <spanx style="verb">Cluster</spanx>, <spanx style="verb">Cues</spanx>, <spanx style="verb">Attachments</spanx>, and <spanx style="verb">Tags</spanx>.
</t>
<t>The <spanx style="verb">SeekHead Element</spanx> (also known as <spanx style="verb">MetaSeek</spanx>) contains an index of where other <spanx style="verb">Top Level Elements</spanx> of the <spanx style="verb">Segment</spanx> are located in order to let the parser know where the other major parts of the file are. This element isn't technicaly REQUIRED, but without a <spanx style="verb">SeekHead Element</spanx> a <spanx style="verb">Matroska Parser</spanx> would have to search the entire file to find all of the other <spanx style="verb">Top Level Elements</spanx>. This is because Matroska has flexible ordering requirements; for instance, the <spanx style="verb">Chapters Element</spanx> could be stored after the <spanx style="verb">Cluster Elements</spanx>.
</t>

<figure align="center" title="Representation of a SeekHead Element.
"><artwork align="center">
+--------------------------------+
| SeekHead | Seek | SeekID       |
|          |      |--------------|
|          |      | SeekPosition |
+--------------------------------+
</artwork></figure>
<t>The <spanx style="verb">Info Element</spanx> contains vital information for identifying the whole <spanx style="verb">Segment</spanx>. This includes the title for the <spanx style="verb">Segment</spanx>, a randomly generated unique identifier so that the file can be identified around the world, and if it is part of a series of <spanx style="verb">Segments</spanx>, the unique identifier(s) of any linked <spanx style="verb">Segments</spanx>.
</t>

<figure align="center" title="Representation of a Info Element and its Child Elements.
"><artwork align="center">
+-------------------------+
| Info | SegmentUID       |
|      |------------------|
|      | SegmentFilename  |
|      |------------------|
|      | PrevUID          |
|      |------------------|
|      | PrevFilename     |
|      |------------------|
|      | NextUID          |
|      |------------------|
|      | NextFilename     |
|      |------------------|
|      | SegmentFamily    |
|      |------------------|
|      | ChapterTranslate |
|      |------------------|
|      | TimecodeScale    |
|      |------------------|
|      | Duration         |
|      |------------------|
|      | DateUTC          |
|      |------------------|
|      | Title            |
|      |------------------|
|      | MuxingApp        |
|      |------------------|
|      | WritingApp       |
|-------------------------|
</artwork></figure>
<t>The <spanx style="verb">Tracks Elements</spanx> tells us the technical details of what is in each track. For instance, is it a video, audio or subtitle track? What resolution is the video? What sample rate is the audio? The <spanx style="verb">Tracks Elements</spanx> can store the name, number, unique identifier, language, and type (audio, video, subtitles, etc) of each track. The <spanx style="verb">Tracks Element</spanx> also identifies what codec to use to decode the track and has the codec's private data for the track.
</t>

<figure align="center" title="Representation of the Tracks Element and a selection of its Descendant Elements.
"><artwork align="center">
+------------------------------------+
| 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 <spanx style="verb">Chapters Element</spanx> section lists all of the Chapters. Chapters are a way to set predefined points to jump to in video or audio.
</t>

<figure align="center" title="Representation of the Chapters Element and a selection of its Descendant Elements.
"><artwork align="center">
+----------------------------------------------+
| Chatpers | EditionEntry | EditionUID         |
|          |              |--------------------|
|          |              | EditionFlagHidden  |
|          |              |--------------------|
|          |              | EditionFlagDefault |
|          |              |--------------------|
|          |              | EditionFlagOrdered |
|          |              |----------------------------------------+
|          |              | ChapterAtom        | ChapterUID        |
|          |              |                    |-------------------|
|          |              |                    | ChapterStringUID  |
|          |              |                    |-------------------|
|          |              |                    | ChapterTimeStart  |
|          |              |                    |-------------------|
|          |              |                    | ChapterTimeEnd    |
|          |              |                    |-------------------|
|          |              |                    | ChapterFlagHidden |
|          |              |                    |----------------------------------+
|          |              |                    | ChapterDisplay    | ChapString   |
|          |              |                    |                   |--------------| 
|          |              |                    |                   | ChapLanguage | 
+---------------------------------------------------------------------------------+
</artwork></figure>
<t>The <spanx style="verb">Cluster Elements</spanx> contain all of the video frames and audio for each track. In a given Matroska file, there are usually many <spanx style="verb">Cluster Elements</spanx>. The Clusters help to break up the <spanx style="verb">SimpleBlock</spanx> or <spanx style="verb">BlockGroup Elements</spanx> and help with seeking and error protection. It is RECOMMENDED the size of each individual <spanx style="verb">Cluster Element</spanx> be limited to store no more than 5 seconds or 5 megabytes. Every Cluster contains a timecode, usually the timecode that the first Block in the Cluster SHOULD be played back, but it doesn't have to be. Then there are one or more (usually many more) <spanx style="verb">BlockGroups</spanx> or <spanx style="verb">SimpleBlocks</spanx> in each Cluster. A BlockGroup can contain a Block of data, and any information relating directly to that Block.
</t>

<figure align="center" title="Representation of a Cluster Element and its immediate Child Elements.
"><artwork align="center">
+--------------------------+
| Cluster | Timecode       |
|         |----------------|
|         | SilentTracks   |
|         |----------------|
|         | Position       |
|         |----------------|
|         | PrevSize       |
|         |----------------|
|         | SimpleBlock    |
|         |----------------|
|         | BlockGroup     |
|         |----------------|
|         | EncryptedBlock |
+--------------------------+
</artwork></figure>
<t>Below is a representation of the Block structure.
</t>
<t>
<list style="symbols">
<t>Portion of Block
<list style="symbols">
<t>Data Type
<list style="symbols">
<t>Bit Flag</t>
</list></t>
</list></t>
<t>Header
<list style="symbols">
<t>TrackNumber</t>
<t>Timecode</t>
<t>Flags</t>
<t>Gap</t>
<t>Lacing</t>
<t>Reserved</t>
</list></t>
<t>Optional
<list style="symbols">
<t>FrameSize</t>
</list></t>
<t>Data
<list style="symbols">
<t>Frame</t>
</list></t>
</list>
</t>
<t>Although the Timecode value is stored once per Cluster, another timecode is stored within the Block structure itself. The way this works is that the Timecode in the Cluster is relative to the entire <spanx style="verb">Segment</spanx>. It is usually the Timecode that the first Block in the Cluster needs to be played at. The Timecode in the Block itself is relative to the Timecode in the Cluster. For example, let's say that the Timecode in the Cluster is set to 10 seconds, and you have a Block in that Cluster that is supposed to be played 12 seconds into the clip; this means that the Timecode in the Block would be set to 2 seconds.
</t>
<t>The <spanx style="verb">ReferenceBlock</spanx> in the BlockGroup, is used instead of the basic &quot;P-frame&quot;/&quot;B-frame&quot; description. Instead of simply saying that this Block depends on the Block directly before, or directly afterwards, we put the timecode of the needed Block. And because you can have as many <spanx style="verb">ReferenceBlock Elements</spanx> as you want for a Block, it allows for some extremely complex referencing.
</t>
<t>The <spanx style="verb">Cues Element</spanx> is used to seek when playing back a file by providing a temporal index for each of the tracks. It is similar to the <spanx style="verb">SeekHead Element</spanx>, but this is used for seeking to a specific time when playing back the file. Without this it is possible to seek, but it is much more difficult because the player has to 'hunt and peck' through the file looking for the correct timecode. <spanx style="verb">Cues</spanx> contains <spanx style="verb">CuePoint Elements</spanx> which store the timecode (<spanx style="verb">CueTime</spanx>) and then a listing for the exact position in the file for each of the tracks for that timecode. The <spanx style="verb">Cues</spanx> are pretty flexible for what exactly you want to index. For instance, you can index every single timecode of every <spanx style="verb">Block</spanx> or index selectively. If you have a video file, it is RECOMMENDED to index at least the keyframes of the video track.
</t>

<figure align="center" title="Representation of a Cues Element and two levels of its Descendant Elements.
"><artwork align="center">
+-------------------------------------+
| Cues | CuePoint | CueTime           |
|      |          |-------------------|
|      |          | CueTrackPositions |
|      |------------------------------|
|      | CuePoint | CueTime           |
|      |          |-------------------|
|      |          | CueTrackPositions |
+-------------------------------------+
</artwork></figure>
<t>The <spanx style="verb">Attachments Element</spanx> 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 align="center" title="Representation of a Attachments Element.
"><artwork align="center">
+------------------------------------------------+
| Attachments | AttachedFile | FileDescription   |
|             |              |-------------------|
|             |              | FileName          |
|             |              |-------------------|
|             |              | FileMimeType      |
|             |              |-------------------|
|             |              | FileData          |
|             |              |-------------------|
|             |              | FileUID           |
|             |              |-------------------|
|             |              | FileName          |
|             |              |-------------------|
|             |              | FileReferral      |
|             |              |-------------------|
|             |              | FileUsedStartTime |
|             |              |-------------------|
|             |              | FileUsedEndTime   |
+------------------------------------------------+
</artwork></figure>
<t>The <spanx style="verb">Tags Element</spanx> contains metadata that describes the <spanx style="verb">Segment</spanx> and potentially its <spanx style="verb">Tracks</spanx>, <spanx style="verb">Chapters</spanx>, and <spanx style="verb">Attachments</spanx>. Each Track or Chapter that those tags applies to has its UID listed in the tags. The Tags contain all extra information about the file, script writer, singer, actors, directors, titles, edition, price, dates, genre, comments, etc. And it allows you to enter many of these (title, edition, comments, etc.) in different languages.
</t>

<figure align="center" title="Representation of a Tags Element and three levels of its Children Elements.
# Matroska Schema
"><artwork align="center">
+-------------------------------------------+
| Tags | Tag | Targets   | TargetTypeValue  |
|      |     |           |------------------|
|      |     |           | TargetType       |
|      |     |           |------------------|
|      |     |           | TagTrackUID      |
|      |     |           |------------------|
|      |     |           | TagEditionUID    |
|      |     |           |------------------|
|      |     |           | TagChapterUID    |
|      |     |           |------------------|
|      |     |           | TagAttachmentUID |
|      |     |------------------------------|
|      |     | SimpleTag | TagName          |
|      |     |           |------------------|
|      |     |           | TagLanguage      |
|      |     |           |------------------|
|      |     |           | TagDefault       |
|      |     |           |------------------|
|      |     |           | TagString        |
|      |     |           |------------------|
|      |     |           | TagBinary        |
|      |     |           |------------------|
|      |     |           | SimpleTag        |
+-------------------------------------------+
</artwork></figure>
<t>This specification includes an <spanx style="verb">EBML Schema</spanx> 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>
</section>

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

<c>webm</c><c>No</c><c>A boolean to express if the Matroska Element is also supported within version 2 of the <spanx style="verb">webm</spanx> specification. Please consider the <eref target="http://www.webmproject.org/docs/container/">webm specification</eref> as the authoritative on <spanx style="verb">webm</spanx>.</c>
</texttable>
</section>

<section anchor="matroska-schema" title="Matroska Schema">
<t>Here the definition of each Matroska Element is provided.
</t>
<t>% concatenate with Matroska EBML Schema converted to markdown %
</t>

<section anchor="segment-element" title="Segment Element">
<t>name: <spanx style="verb">Segment</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment)</spanx>
</t>
<t>id: <spanx style="verb">0x18538067</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>unknownsizeallowed: <spanx style="verb">1</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The Root Element that contains all other Top-Level Elements (Elements defined only at Level 1). A Matroska file is composed of 1 Segment.
</t>
</section>

<section anchor="seekhead-element" title="SeekHead Element">
<t>name: <spanx style="verb">SeekHead</spanx>
</t>
<t>path: <spanx style="verb">0*2(\Segment\SeekHead)</spanx>
</t>
<t>id: <spanx style="verb">0x114D9B74</spanx>
</t>
<t>maxOccurs: <spanx style="verb">2</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains the Segment Position of other Top-Level Elements.
</t>
</section>

<section anchor="seek-element" title="Seek Element">
<t>name: <spanx style="verb">Seek</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\SeekHead\Seek)</spanx>
</t>
<t>id: <spanx style="verb">0x4DBB</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains a single seek entry to an EBML Element.
</t>
</section>

<section anchor="seekid-element" title="SeekID Element">
<t>name: <spanx style="verb">SeekID</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\SeekHead\Seek\SeekID)</spanx>
</t>
<t>id: <spanx style="verb">0x53AB</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The binary ID corresponding to the Element name.
</t>
</section>

<section anchor="seekposition-element" title="SeekPosition Element">
<t>name: <spanx style="verb">SeekPosition</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\SeekHead\Seek\SeekPosition)</spanx>
</t>
<t>id: <spanx style="verb">0x53AC</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The Segment Position of the Element.
</t>
</section>

<section anchor="info-element" title="Info Element">
<t>name: <spanx style="verb">Info</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Info)</spanx>
</t>
<t>id: <spanx style="verb">0x1549A966</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>definition: Contains general information about the Segment.
</t>
</section>

<section anchor="segmentuid-element" title="SegmentUID Element">
<t>name: <spanx style="verb">SegmentUID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Info\SegmentUID)</spanx>
</t>
<t>id: <spanx style="verb">0x73A4</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>size: <spanx style="verb">16</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>definition: A randomly generated unique ID to identify the Segment amongst many others (128 bits).
</t>
<t>usage notes: If the Segment is a part of a Linked Segment then this Element is REQUIRED.
</t>
</section>

<section anchor="segmentfilename-element" title="SegmentFilename Element">
<t>name: <spanx style="verb">SegmentFilename</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Info\SegmentFilename)</spanx>
</t>
<t>id: <spanx style="verb">0x7384</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>definition: A filename corresponding to this Segment.
</t>
</section>

<section anchor="prevuid-element" title="PrevUID Element">
<t>name: <spanx style="verb">PrevUID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Info\PrevUID)</spanx>
</t>
<t>id: <spanx style="verb">0x3CB923</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>size: <spanx style="verb">16</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>definition: A unique ID to identify the previous Segment of a Linked Segment (128 bits).
</t>
<t>usage notes: If the Segment is a part of a Linked Segment that uses Hard Linking then either the PrevUID or the NextUID Element is REQUIRED. If a Segment contains a PrevUID but not a NextUID then it MAY be considered as the last Segment of the Linked Segment. The PrevUID MUST NOT be equal to the SegmentUID.
</t>
</section>

<section anchor="prevfilename-element" title="PrevFilename Element">
<t>name: <spanx style="verb">PrevFilename</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Info\PrevFilename)</spanx>
</t>
<t>id: <spanx style="verb">0x3C83AB</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>definition: A filename corresponding to the file of the previous Linked Segment.
</t>
<t>usage notes: Provision of the previous filename is for display convenience, but PrevUID SHOULD be considered authoritative for identifying the previous Segment in a Linked Segment.
</t>
</section>

<section anchor="nextuid-element" title="NextUID Element">
<t>name: <spanx style="verb">NextUID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Info\NextUID)</spanx>
</t>
<t>id: <spanx style="verb">0x3EB923</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>size: <spanx style="verb">16</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>definition: A unique ID to identify the next Segment of a Linked Segment (128 bits).
</t>
<t>usage notes: If the Segment is a part of a Linked Segment that uses Hard Linking then either the PrevUID or the NextUID Element is REQUIRED. If a Segment contains a NextUID but not a PrevUID then it MAY be considered as the first Segment of the Linked Segment. The NextUID MUST NOT be equal to the SegmentUID.
</t>
</section>

<section anchor="nextfilename-element" title="NextFilename Element">
<t>name: <spanx style="verb">NextFilename</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Info\NextFilename)</spanx>
</t>
<t>id: <spanx style="verb">0x3E83BB</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>definition: A filename corresponding to the file of the next Linked Segment.
</t>
<t>usage notes: Provision of the next filename is for display convenience, but NextUID SHOULD be considered authoritative for identifying the Next Segment.
</t>
</section>

<section anchor="segmentfamily-element" title="SegmentFamily Element">
<t>name: <spanx style="verb">SegmentFamily</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Info\SegmentFamily)</spanx>
</t>
<t>id: <spanx style="verb">0x4444</spanx>
</t>
<t>size: <spanx style="verb">16</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>definition: A randomly generated unique ID that all Segments of a Linked Segment MUST share (128 bits).
</t>
<t>usage notes: If the Segment is a part of a Linked Segment that uses Soft Linking then this Element is REQUIRED.
</t>
</section>

<section anchor="chaptertranslate-element" title="ChapterTranslate Element">
<t>name: <spanx style="verb">ChapterTranslate</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Info\ChapterTranslate)</spanx>
</t>
<t>id: <spanx style="verb">0x6924</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A tuple of corresponding ID used by chapter codecs to represent this Segment.
</t>
</section>

<section anchor="chaptertranslateeditionuid-element" title="ChapterTranslateEditionUID Element">
<t>name: <spanx style="verb">ChapterTranslateEditionUID</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Info\ChapterTranslate\ChapterTranslateEditionUID)</spanx>
</t>
<t>id: <spanx style="verb">0x69FC</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the Segment.
</t>
</section>

<section anchor="chaptertranslatecodec-element" title="ChapterTranslateCodec Element">
<t>name: <spanx style="verb">ChapterTranslateCodec</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Info\ChapterTranslate\ChapterTranslateCodec)</spanx>
</t>
<t>id: <spanx style="verb">0x69BF</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The chapter codec
</t>
</section>

<section anchor="chaptertranslateid-element" title="ChapterTranslateID Element">
<t>name: <spanx style="verb">ChapterTranslateID</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Info\ChapterTranslate\ChapterTranslateID)</spanx>
</t>
<t>id: <spanx style="verb">0x69A5</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The binary value used to represent this Segment in the chapter codec data. The format depends on the ChapProcessCodecID used.
</t>
</section>

<section anchor="timecodescale-element" title="TimecodeScale Element">
<t>name: <spanx style="verb">TimecodeScale</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Info\TimecodeScale)</spanx>
</t>
<t>id: <spanx style="verb">0x2AD7B1</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>default: <spanx style="verb">1000000</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Timestamp scale in nanoseconds (1.000.000 means all timestamps in the Segment are expressed in milliseconds).
</t>
</section>

<section anchor="duration-element" title="Duration Element">
<t>name: <spanx style="verb">Duration</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Info\Duration)</spanx>
</t>
<t>id: <spanx style="verb">0x4489</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">&gt; 0x0p+0</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>definition: Duration of the Segment in nanoseconds based on TimecodeScale.
</t>
</section>

<section anchor="dateutc-element" title="DateUTC Element">
<t>name: <spanx style="verb">DateUTC</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Info\DateUTC)</spanx>
</t>
<t>id: <spanx style="verb">0x4461</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">date</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The date and time that the Segment was created by the muxing application or library.
</t>
</section>

<section anchor="title-element" title="Title Element">
<t>name: <spanx style="verb">Title</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Info\Title)</spanx>
</t>
<t>id: <spanx style="verb">0x7BA9</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: General name of the Segment.
</t>
</section>

<section anchor="muxingapp-element" title="MuxingApp Element">
<t>name: <spanx style="verb">MuxingApp</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Info\MuxingApp)</spanx>
</t>
<t>id: <spanx style="verb">0x4D80</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>definition: Muxing application or library (example: &quot;libmatroska-0.4.3&quot;).
</t>
<t>usage notes: Include the full name of the application or library followed by the version number.
</t>
</section>

<section anchor="writingapp-element" title="WritingApp Element">
<t>name: <spanx style="verb">WritingApp</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Info\WritingApp)</spanx>
</t>
<t>id: <spanx style="verb">0x5741</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>definition: Writing application (example: &quot;mkvmerge-0.3.3&quot;).
</t>
<t>usage notes: Include the full name of the application followed by the version number.
</t>
</section>

<section anchor="cluster-element" title="Cluster Element">
<t>name: <spanx style="verb">Cluster</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Cluster)</spanx>
</t>
<t>id: <spanx style="verb">0x1F43B675</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>unknownsizeallowed: <spanx style="verb">1</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The Top-Level Element containing the (monolithic) Block structure.
</t>
</section>

<section anchor="timecode-element" title="Timecode Element">
<t>name: <spanx style="verb">Timecode</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Cluster\Timecode)</spanx>
</t>
<t>id: <spanx style="verb">0xE7</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Absolute timestamp of the cluster (based on TimecodeScale).
</t>
</section>

<section anchor="silenttracks-element" title="SilentTracks Element">
<t>name: <spanx style="verb">SilentTracks</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\SilentTracks)</spanx>
</t>
<t>id: <spanx style="verb">0x5854</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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.
</t>
</section>

<section anchor="silenttracknumber-element" title="SilentTrackNumber Element">
<t>name: <spanx style="verb">SilentTrackNumber</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Cluster\SilentTracks\SilentTrackNumber)</spanx>
</t>
<t>id: <spanx style="verb">0x58D7</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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.
</t>
</section>

<section anchor="position-element" title="Position Element">
<t>name: <spanx style="verb">Position</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\Position)</spanx>
</t>
<t>id: <spanx style="verb">0xA7</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The Segment Position of the Cluster in the Segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.
</t>
</section>

<section anchor="prevsize-element" title="PrevSize Element">
<t>name: <spanx style="verb">PrevSize</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\PrevSize)</spanx>
</t>
<t>id: <spanx style="verb">0xAB</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Size of the previous Cluster, in octets. Can be useful for backward playing.
</t>
</section>

<section anchor="simpleblock-element" title="SimpleBlock Element">
<t>name: <spanx style="verb">SimpleBlock</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Cluster\SimpleBlock)</spanx>
</t>
<t>id: <spanx style="verb">0xA3</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">2</spanx>
</t>
<t>documentation: Similar to Block but without all the extra information, mostly used to reduced overhead when no extra feature is needed. (see SimpleBlock Structure)
</t>
</section>

<section anchor="blockgroup-element" title="BlockGroup Element">
<t>name: <spanx style="verb">BlockGroup</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Cluster\BlockGroup)</spanx>
</t>
<t>id: <spanx style="verb">0xA0</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Basic container of information containing a single Block and information specific to that Block.
</t>
</section>

<section anchor="block-element" title="Block Element">
<t>name: <spanx style="verb">Block</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Cluster\BlockGroup\Block)</spanx>
</t>
<t>id: <spanx style="verb">0xA1</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)
</t>
</section>

<section anchor="blockvirtual-element" title="BlockVirtual Element">
<t>name: <spanx style="verb">BlockVirtual</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\BlockVirtual)</spanx>
</t>
<t>id: <spanx style="verb">0xA2</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: A Block with no data. It MUST be stored in the stream at the place the real Block would be in display order. (see Block Virtual)
</t>
</section>

<section anchor="blockadditions-element" title="BlockAdditions Element">
<t>name: <spanx style="verb">BlockAdditions</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\BlockAdditions)</spanx>
</t>
<t>id: <spanx style="verb">0x75A1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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.
</t>
</section>

<section anchor="blockmore-element" title="BlockMore Element">
<t>name: <spanx style="verb">BlockMore</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore)</spanx>
</t>
<t>id: <spanx style="verb">0xA6</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contain the BlockAdditional and some parameters.
</t>
</section>

<section anchor="blockaddid-element" title="BlockAddID Element">
<t>name: <spanx style="verb">BlockAddID</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\BlockAddID)</spanx>
</t>
<t>id: <spanx style="verb">0xEE</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>default: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: An ID to identify the BlockAdditional level.
</t>
</section>

<section anchor="blockadditional-element" title="BlockAdditional Element">
<t>name: <spanx style="verb">BlockAdditional</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\BlockAdditional)</spanx>
</t>
<t>id: <spanx style="verb">0xA5</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Interpreted by the codec as it wishes (using the BlockAddID).
</t>
</section>

<section anchor="blockduration-element" title="BlockDuration Element">
<t>name: <spanx style="verb">BlockDuration</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\BlockDuration)</spanx>
</t>
<t>id: <spanx style="verb">0x9B</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">DefaultDuration</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The duration of the Block (based on TimecodeScale). This Element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in &quot;display&quot; order (not coding order). This Element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.
</t>
</section>

<section anchor="referencepriority-element" title="ReferencePriority Element">
<t>name: <spanx style="verb">ReferencePriority</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Cluster\BlockGroup\ReferencePriority)</spanx>
</t>
<t>id: <spanx style="verb">0xFA</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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.
</t>
</section>

<section anchor="referenceblock-element" title="ReferenceBlock Element">
<t>name: <spanx style="verb">ReferenceBlock</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Cluster\BlockGroup\ReferenceBlock)</spanx>
</t>
<t>id: <spanx style="verb">0xFB</spanx>
</t>
<t>type: <spanx style="verb">integer</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to.
</t>
</section>

<section anchor="referencevirtual-element" title="ReferenceVirtual Element">
<t>name: <spanx style="verb">ReferenceVirtual</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\ReferenceVirtual)</spanx>
</t>
<t>id: <spanx style="verb">0xFD</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">integer</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: The Segment Position of the data that would otherwise be in position of the virtual block.
</t>
</section>

<section anchor="codecstate-element" title="CodecState Element">
<t>name: <spanx style="verb">CodecState</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\CodecState)</spanx>
</t>
<t>id: <spanx style="verb">0xA4</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">2</spanx>
</t>
<t>documentation: The new codec state to use. Data interpretation is private to the codec. This information SHOULD always be referenced by a seek entry.
</t>
</section>

<section anchor="discardpadding-element" title="DiscardPadding Element">
<t>name: <spanx style="verb">DiscardPadding</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\DiscardPadding)</spanx>
</t>
<t>id: <spanx style="verb">0x75A2</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">integer</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: 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 SHOULD be discarded during playback.
</t>
</section>

<section anchor="slices-element" title="Slices Element">
<t>name: <spanx style="verb">Slices</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\Slices)</spanx>
</t>
<t>id: <spanx style="verb">0x8E</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains slices description.
</t>
</section>

<section anchor="timeslice-element" title="TimeSlice Element">
<t>name: <spanx style="verb">TimeSlice</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Cluster\BlockGroup\Slices\TimeSlice)</spanx>
</t>
<t>id: <spanx style="verb">0xE8</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>maxver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains extra time information about the data contained in the Block. Being able to interpret this Element is not REQUIRED for playback.
</t>
</section>

<section anchor="lacenumber-element" title="LaceNumber Element">
<t>name: <spanx style="verb">LaceNumber</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\LaceNumber)</spanx>
</t>
<t>id: <spanx style="verb">0xCC</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>maxver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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 REQUIRED for playback.
</t>
</section>

<section anchor="framenumber-element" title="FrameNumber Element">
<t>name: <spanx style="verb">FrameNumber</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\FrameNumber)</spanx>
</t>
<t>id: <spanx style="verb">0xCD</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame).
</t>
</section>

<section anchor="blockadditionid-element" title="BlockAdditionID Element">
<t>name: <spanx style="verb">BlockAdditionID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\BlockAdditionID)</spanx>
</t>
<t>id: <spanx style="verb">0xCB</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: The ID of the BlockAdditional Element (0 is the main Block).
</t>
</section>

<section anchor="delay-element" title="Delay Element">
<t>name: <spanx style="verb">Delay</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\Delay)</spanx>
</t>
<t>id: <spanx style="verb">0xCE</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: The (scaled) delay to apply to the Element.
</t>
</section>

<section anchor="sliceduration-element" title="SliceDuration Element">
<t>name: <spanx style="verb">SliceDuration</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\SliceDuration)</spanx>
</t>
<t>id: <spanx style="verb">0xCF</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: The (scaled) duration to apply to the Element.
</t>
</section>

<section anchor="referenceframe-element" title="ReferenceFrame Element">
<t>name: <spanx style="verb">ReferenceFrame</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cluster\BlockGroup\ReferenceFrame)</spanx>
</t>
<t>id: <spanx style="verb">0xC8</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation:
      DivX trick track extensions
</t>
</section>

<section anchor="referenceoffset-element" title="ReferenceOffset Element">
<t>name: <spanx style="verb">ReferenceOffset</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceOffset)</spanx>
</t>
<t>id: <spanx style="verb">0xC9</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation:
      DivX trick track extensions
</t>
</section>

<section anchor="referencetimecode-element" title="ReferenceTimeCode Element">
<t>name: <spanx style="verb">ReferenceTimeCode</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceTimeCode)</spanx>
</t>
<t>id: <spanx style="verb">0xCA</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation:
      DivX trick track extensions
</t>
</section>

<section anchor="encryptedblock-element" title="EncryptedBlock Element">
<t>name: <spanx style="verb">EncryptedBlock</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Cluster\EncryptedBlock)</spanx>
</t>
<t>id: <spanx style="verb">0xAF</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: Similar to SimpleBlock but the data inside the Block are Transformed (encrypt and/or signed). (see EncryptedBlock Structure)
</t>
</section>

<section anchor="tracks-element" title="Tracks Element">
<t>name: <spanx style="verb">Tracks</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Tracks)</spanx>
</t>
<t>id: <spanx style="verb">0x1654AE6B</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A Top-Level Element of information with many tracks described.
</t>
</section>

<section anchor="trackentry-element" title="TrackEntry Element">
<t>name: <spanx style="verb">TrackEntry</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Tracks\TrackEntry)</spanx>
</t>
<t>id: <spanx style="verb">0xAE</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Describes a track with all Elements.
</t>
</section>

<section anchor="tracknumber-element" title="TrackNumber Element">
<t>name: <spanx style="verb">TrackNumber</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\TrackNumber)</spanx>
</t>
<t>id: <spanx style="verb">0xD7</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number).
</t>
</section>

<section anchor="trackuid-element" title="TrackUID Element">
<t>name: <spanx style="verb">TrackUID</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\TrackUID)</spanx>
</t>
<t>id: <spanx style="verb">0x73C5</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A unique ID to identify the Track. This SHOULD be kept the same when making a direct stream copy of the Track to another file.
</t>
</section>

<section anchor="tracktype-element" title="TrackType Element">
<t>name: <spanx style="verb">TrackType</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\TrackType)</spanx>
</t>
<t>id: <spanx style="verb">0x83</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">1-254</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A set of track types coded on 8 bits.
</t>
</section>

<section anchor="flagenabled-element" title="FlagEnabled Element">
<t>name: <spanx style="verb">FlagEnabled</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\FlagEnabled)</spanx>
</t>
<t>id: <spanx style="verb">0xB9</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>default: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">2</spanx>
</t>
<t>documentation: Set if the track is usable. (1 bit)
</t>
</section>

<section anchor="flagdefault-element" title="FlagDefault Element">
<t>name: <spanx style="verb">FlagDefault</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\FlagDefault)</spanx>
</t>
<t>id: <spanx style="verb">0x88</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>default: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)
</t>
</section>

<section anchor="flagforced-element" title="FlagForced Element">
<t>name: <spanx style="verb">FlagForced</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\FlagForced)</spanx>
</t>
<t>id: <spanx style="verb">0x55AA</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player SHOULD select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)
</t>
</section>

<section anchor="flaglacing-element" title="FlagLacing Element">
<t>name: <spanx style="verb">FlagLacing</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\FlagLacing)</spanx>
</t>
<t>id: <spanx style="verb">0x9C</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>default: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Set if the track MAY contain blocks using lacing. (1 bit)
</t>
</section>

<section anchor="mincache-element" title="MinCache Element">
<t>name: <spanx style="verb">MinCache</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\MinCache)</spanx>
</t>
<t>id: <spanx style="verb">0x6DE7</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The minimum number of frames a player SHOULD be able to cache during playback. If set to 0, the reference pseudo-cache system is not used.
</t>
</section>

<section anchor="maxcache-element" title="MaxCache Element">
<t>name: <spanx style="verb">MaxCache</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\MaxCache)</spanx>
</t>
<t>id: <spanx style="verb">0x6DF8</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The maximum cache size necessary to store referenced frames in and the current frame. 0 means no cache is needed.
</t>
</section>

<section anchor="defaultduration-element" title="DefaultDuration Element">
<t>name: <spanx style="verb">DefaultDuration</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\DefaultDuration)</spanx>
</t>
<t>id: <spanx style="verb">0x23E383</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one Element put into a (Simple)Block).
</t>
</section>

<section anchor="defaultdecodedfieldduration-element" title="DefaultDecodedFieldDuration Element">
<t>name: <spanx style="verb">DefaultDecodedFieldDuration</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\DefaultDecodedFieldDuration)</spanx>
</t>
<t>id: <spanx style="verb">0x234E7A</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: The period in nanoseconds (not scaled by TimcodeScale)
      between two successive fields at the output of the decoding process (see the notes)
</t>
</section>

<section anchor="tracktimecodescale-element" title="TrackTimecodeScale Element">
<t>name: <spanx style="verb">TrackTimecodeScale</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\TrackTimecodeScale)</spanx>
</t>
<t>id: <spanx style="verb">0x23314F</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">&gt; 0x0p+0</spanx>
</t>
<t>default: <spanx style="verb">0x1p+0</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>maxver: <spanx style="verb">3</spanx>
</t>
<t>documentation: 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).
</t>
</section>

<section anchor="trackoffset-element" title="TrackOffset Element">
<t>name: <spanx style="verb">TrackOffset</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\TrackOffset)</spanx>
</t>
<t>id: <spanx style="verb">0x537F</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">integer</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track.
</t>
</section>

<section anchor="maxblockadditionid-element" title="MaxBlockAdditionID Element">
<t>name: <spanx style="verb">MaxBlockAdditionID</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\MaxBlockAdditionID)</spanx>
</t>
<t>id: <spanx style="verb">0x55EE</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The maximum value of BlockAddID. A value 0 means there is no BlockAdditions for this track.
</t>
</section>

<section anchor="name-element" title="Name Element">
<t>name: <spanx style="verb">Name</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Name)</spanx>
</t>
<t>id: <spanx style="verb">0x536E</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A human-readable track name.
</t>
</section>

<section anchor="language-element" title="Language Element">
<t>name: <spanx style="verb">Language</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Language)</spanx>
</t>
<t>id: <spanx style="verb">0x22B59C</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">eng</spanx>
</t>
<t>type: <spanx style="verb">string</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Specifies the language of the track in the Matroska languages form. This Element MUST be ignored if the LanguageIETF Element is used in the same TrackEntry.
</t>
</section>

<section anchor="languageietf-element" title="LanguageIETF Element">
<t>name: <spanx style="verb">LanguageIETF</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\LanguageIETF)</spanx>
</t>
<t>id: <spanx style="verb">0x22B59D</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">string</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: 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 MUST be ignored.
</t>
</section>

<section anchor="codecid-element" title="CodecID Element">
<t>name: <spanx style="verb">CodecID</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\CodecID)</spanx>
</t>
<t>id: <spanx style="verb">0x86</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">string</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: An ID corresponding to the codec, see the codec page for more info.
</t>
</section>

<section anchor="codecprivate-element" title="CodecPrivate Element">
<t>name: <spanx style="verb">CodecPrivate</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\CodecPrivate)</spanx>
</t>
<t>id: <spanx style="verb">0x63A2</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Private data only known to the codec.
</t>
</section>

<section anchor="codecname-element" title="CodecName Element">
<t>name: <spanx style="verb">CodecName</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\CodecName)</spanx>
</t>
<t>id: <spanx style="verb">0x258688</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A human-readable string specifying the codec.
</t>
</section>

<section anchor="attachmentlink-element" title="AttachmentLink Element">
<t>name: <spanx style="verb">AttachmentLink</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\AttachmentLink)</spanx>
</t>
<t>id: <spanx style="verb">0x7446</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>maxver: <spanx style="verb">3</spanx>
</t>
<t>documentation: The UID of an attachment that is used by this codec.
</t>
</section>

<section anchor="codecsettings-element" title="CodecSettings Element">
<t>name: <spanx style="verb">CodecSettings</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\CodecSettings)</spanx>
</t>
<t>id: <spanx style="verb">0x3A9697</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: A string describing the encoding setting used.
</t>
</section>

<section anchor="codecinfourl-element" title="CodecInfoURL Element">
<t>name: <spanx style="verb">CodecInfoURL</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Tracks\TrackEntry\CodecInfoURL)</spanx>
</t>
<t>id: <spanx style="verb">0x3B4040</spanx>
</t>
<t>type: <spanx style="verb">string</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: A URL to find information about the codec used.
</t>
</section>

<section anchor="codecdownloadurl-element" title="CodecDownloadURL Element">
<t>name: <spanx style="verb">CodecDownloadURL</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Tracks\TrackEntry\CodecDownloadURL)</spanx>
</t>
<t>id: <spanx style="verb">0x26B240</spanx>
</t>
<t>type: <spanx style="verb">string</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: A URL to download about the codec used.
</t>
</section>

<section anchor="codecdecodeall-element" title="CodecDecodeAll Element">
<t>name: <spanx style="verb">CodecDecodeAll</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\CodecDecodeAll)</spanx>
</t>
<t>id: <spanx style="verb">0xAA</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>default: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">2</spanx>
</t>
<t>documentation: The codec can decode potentially damaged data (1 bit).
</t>
</section>

<section anchor="trackoverlay-element" title="TrackOverlay Element">
<t>name: <spanx style="verb">TrackOverlay</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Tracks\TrackEntry\TrackOverlay)</spanx>
</t>
<t>id: <spanx style="verb">0x6FAB</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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 SilentTracks) the overlay track SHOULD be used instead. The order of multiple TrackOverlay matters, the first one is the one that SHOULD be used. If not found it SHOULD be the second, etc.
</t>
</section>

<section anchor="codecdelay-element" title="CodecDelay Element">
<t>name: <spanx style="verb">CodecDelay</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\CodecDelay)</spanx>
</t>
<t>id: <spanx style="verb">0x56AA</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: CodecDelay is The codec-built-in delay in nanoseconds. This value MUST be subtracted from each block timestamp in order to get the actual timestamp. The value SHOULD be small so the muxing of tracks with the same actual timestamp are in the same Cluster.
</t>
</section>

<section anchor="seekpreroll-element" title="SeekPreRoll Element">
<t>name: <spanx style="verb">SeekPreRoll</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\SeekPreRoll)</spanx>
</t>
<t>id: <spanx style="verb">0x56BB</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder MUST decode before the decoded data is valid.
</t>
</section>

<section anchor="tracktranslate-element" title="TrackTranslate Element">
<t>name: <spanx style="verb">TrackTranslate</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Tracks\TrackEntry\TrackTranslate)</spanx>
</t>
<t>id: <spanx style="verb">0x6624</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The track identification for the given Chapter Codec.
</t>
</section>

<section anchor="tracktranslateeditionuid-element" title="TrackTranslateEditionUID Element">
<t>name: <spanx style="verb">TrackTranslateEditionUID</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateEditionUID)</spanx>
</t>
<t>id: <spanx style="verb">0x66FC</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the Segment.
</t>
</section>

<section anchor="tracktranslatecodec-element" title="TrackTranslateCodec Element">
<t>name: <spanx style="verb">TrackTranslateCodec</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateCodec)</spanx>
</t>
<t>id: <spanx style="verb">0x66BF</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The chapter codec.
</t>
</section>

<section anchor="tracktranslatetrackid-element" title="TrackTranslateTrackID Element">
<t>name: <spanx style="verb">TrackTranslateTrackID</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateTrackID)</spanx>
</t>
<t>id: <spanx style="verb">0x66A5</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used.
</t>
</section>

<section anchor="video-element" title="Video Element">
<t>name: <spanx style="verb">Video</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video)</spanx>
</t>
<t>id: <spanx style="verb">0xE0</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Video settings.
</t>
</section>

<section anchor="flaginterlaced-element" title="FlagInterlaced Element">
<t>name: <spanx style="verb">FlagInterlaced</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\Video\FlagInterlaced)</spanx>
</t>
<t>id: <spanx style="verb">0x9A</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-2</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">2</spanx>
</t>
<t>documentation: A flag to declare is the video is known to be progressive or interlaced and if applicable to declare details about the interlacement.
</t>
</section>

<section anchor="fieldorder-element" title="FieldOrder Element">
<t>name: <spanx style="verb">FieldOrder</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\Video\FieldOrder)</spanx>
</t>
<t>id: <spanx style="verb">0x9D</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-14</spanx>
</t>
<t>default: <spanx style="verb">2</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Declare the field ordering of the video. If FlagInterlaced is not set to 1, this Element MUST be ignored.
</t>
</section>

<section anchor="stereomode-element" title="StereoMode Element">
<t>name: <spanx style="verb">StereoMode</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\StereoMode)</spanx>
</t>
<t>id: <spanx style="verb">0x53B8</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">3</spanx>
</t>
<t>documentation: Stereo-3D video mode. There are some more details on 3D support in the Specification Notes.
</t>
</section>

<section anchor="alphamode-element" title="AlphaMode Element">
<t>name: <spanx style="verb">AlphaMode</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\AlphaMode)</spanx>
</t>
<t>id: <spanx style="verb">0x53C0</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">3</spanx>
</t>
<t>documentation: Alpha Video Mode. Presence of this Element indicates that the BlockAdditional Element could contain Alpha data.
</t>
</section>

<section anchor="oldstereomode-element" title="OldStereoMode Element">
<t>name: <spanx style="verb">OldStereoMode</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\OldStereoMode)</spanx>
</t>
<t>id: <spanx style="verb">0x53B9</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska.
</t>
</section>

<section anchor="pixelwidth-element" title="PixelWidth Element">
<t>name: <spanx style="verb">PixelWidth</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\Video\PixelWidth)</spanx>
</t>
<t>id: <spanx style="verb">0xB0</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Width of the encoded video frames in pixels.
</t>
</section>

<section anchor="pixelheight-element" title="PixelHeight Element">
<t>name: <spanx style="verb">PixelHeight</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\Video\PixelHeight)</spanx>
</t>
<t>id: <spanx style="verb">0xBA</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Height of the encoded video frames in pixels.
</t>
</section>

<section anchor="pixelcropbottom-element" title="PixelCropBottom Element">
<t>name: <spanx style="verb">PixelCropBottom</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\PixelCropBottom)</spanx>
</t>
<t>id: <spanx style="verb">0x54AA</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The number of video pixels to remove at the bottom of the image (for HDTV content).
</t>
</section>

<section anchor="pixelcroptop-element" title="PixelCropTop Element">
<t>name: <spanx style="verb">PixelCropTop</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\PixelCropTop)</spanx>
</t>
<t>id: <spanx style="verb">0x54BB</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The number of video pixels to remove at the top of the image.
</t>
</section>

<section anchor="pixelcropleft-element" title="PixelCropLeft Element">
<t>name: <spanx style="verb">PixelCropLeft</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\PixelCropLeft)</spanx>
</t>
<t>id: <spanx style="verb">0x54CC</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The number of video pixels to remove on the left of the image.
</t>
</section>

<section anchor="pixelcropright-element" title="PixelCropRight Element">
<t>name: <spanx style="verb">PixelCropRight</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\PixelCropRight)</spanx>
</t>
<t>id: <spanx style="verb">0x54DD</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The number of video pixels to remove on the right of the image.
</t>
</section>

<section anchor="displaywidth-element" title="DisplayWidth Element">
<t>name: <spanx style="verb">DisplayWidth</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\DisplayWidth)</spanx>
</t>
<t>id: <spanx style="verb">0x54B0</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>default: <spanx style="verb">PixelWidth - PixelCropLeft - PixelCropRight</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Width of the video frames to display. Applies to the video frame after cropping (PixelCrop* Elements). The default value is only valid when DisplayUnit is 0.
</t>
</section>

<section anchor="displayheight-element" title="DisplayHeight Element">
<t>name: <spanx style="verb">DisplayHeight</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\DisplayHeight)</spanx>
</t>
<t>id: <spanx style="verb">0x54BA</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>default: <spanx style="verb">PixelHeight - PixelCropTop - PixelCropBottom</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Height of the video frames to display. Applies to the video frame after cropping (PixelCrop* Elements). The default value is only valid when DisplayUnit is 0.
</t>
</section>

<section anchor="displayunit-element" title="DisplayUnit Element">
<t>name: <spanx style="verb">DisplayUnit</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\DisplayUnit)</spanx>
</t>
<t>id: <spanx style="verb">0x54B2</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: How DisplayWidth &amp; DisplayHeight are interpreted.
</t>
</section>

<section anchor="aspectratiotype-element" title="AspectRatioType Element">
<t>name: <spanx style="verb">AspectRatioType</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\AspectRatioType)</spanx>
</t>
<t>id: <spanx style="verb">0x54B3</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Specify the possible modifications to the aspect ratio.
</t>
</section>

<section anchor="colourspace-element" title="ColourSpace Element">
<t>name: <spanx style="verb">ColourSpace</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\ColourSpace)</spanx>
</t>
<t>id: <spanx style="verb">0x2EB524</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>size: <spanx style="verb">4</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Same value as in AVI (32 bits).
</t>
</section>

<section anchor="gammavalue-element" title="GammaValue Element">
<t>name: <spanx style="verb">GammaValue</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\GammaValue)</spanx>
</t>
<t>id: <spanx style="verb">0x2FB523</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">&gt; 0x0p+0</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: Gamma Value.
</t>
</section>

<section anchor="framerate-element" title="FrameRate Element">
<t>name: <spanx style="verb">FrameRate</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\FrameRate)</spanx>
</t>
<t>id: <spanx style="verb">0x2383E3</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">&gt; 0x0p+0</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: Number of frames per second. Informational only.
</t>
</section>

<section anchor="colour-element" title="Colour Element">
<t>name: <spanx style="verb">Colour</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour)</spanx>
</t>
<t>id: <spanx style="verb">0x55B0</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Settings describing the colour format.
</t>
</section>

<section anchor="matrixcoefficients-element" title="MatrixCoefficients Element">
<t>name: <spanx style="verb">MatrixCoefficients</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MatrixCoefficients)</spanx>
</t>
<t>id: <spanx style="verb">0x55B1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">2</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: The Matrix Coefficients of the video used to derive luma and chroma values from reg, green, and blue color primaries. For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2013/DCOR1.
</t>
</section>

<section anchor="bitsperchannel-element" title="BitsPerChannel Element">
<t>name: <spanx style="verb">BitsPerChannel</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\BitsPerChannel)</spanx>
</t>
<t>id: <spanx style="verb">0x55B2</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Number of decoded bits per channel. A value of 0 indicates that the BitsPerChannel is unspecified.
</t>
</section>

<section anchor="chromasubsamplinghorz-element" title="ChromaSubsamplingHorz Element">
<t>name: <spanx style="verb">ChromaSubsamplingHorz</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingHorz)</spanx>
</t>
<t>id: <spanx style="verb">0x55B3</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: 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 SHOULD be set to 1.
</t>
</section>

<section anchor="chromasubsamplingvert-element" title="ChromaSubsamplingVert Element">
<t>name: <spanx style="verb">ChromaSubsamplingVert</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingVert)</spanx>
</t>
<t>id: <spanx style="verb">0x55B4</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: 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 SHOULD be set to 1.
</t>
</section>

<section anchor="cbsubsamplinghorz-element" title="CbSubsamplingHorz Element">
<t>name: <spanx style="verb">CbSubsamplingHorz</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingHorz)</spanx>
</t>
<t>id: <spanx style="verb">0x55B5</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: 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 SHOULD be set to 1 and CbSubsamplingHorz SHOULD be set to 1.
</t>
</section>

<section anchor="cbsubsamplingvert-element" title="CbSubsamplingVert Element">
<t>name: <spanx style="verb">CbSubsamplingVert</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingVert)</spanx>
</t>
<t>id: <spanx style="verb">0x55B6</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: The amount of pixels to remove in the Cb channel for every pixel not removed vertically. This is additive with ChromaSubsamplingVert.
</t>
</section>

<section anchor="chromasitinghorz-element" title="ChromaSitingHorz Element">
<t>name: <spanx style="verb">ChromaSitingHorz</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingHorz)</spanx>
</t>
<t>id: <spanx style="verb">0x55B7</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: How chroma is subsampled horizontally.
</t>
</section>

<section anchor="chromasitingvert-element" title="ChromaSitingVert Element">
<t>name: <spanx style="verb">ChromaSitingVert</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingVert)</spanx>
</t>
<t>id: <spanx style="verb">0x55B8</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: How chroma is subsampled vertically.
</t>
</section>

<section anchor="range-element" title="Range Element">
<t>name: <spanx style="verb">Range</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\Range)</spanx>
</t>
<t>id: <spanx style="verb">0x55B9</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Clipping of the color ranges.
</t>
</section>

<section anchor="transfercharacteristics-element" title="TransferCharacteristics Element">
<t>name: <spanx style="verb">TransferCharacteristics</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\TransferCharacteristics)</spanx>
</t>
<t>id: <spanx style="verb">0x55BA</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">2</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: The transfer characteristics of the video. For clarity, the value and meanings for TransferCharacteristics 1-15 are adopted from Table 3 of ISO/IEC 23001-8:2013/DCOR1. TransferCharacteristics 16-18 are proposed values.
</t>
</section>

<section anchor="primaries-element" title="Primaries Element">
<t>name: <spanx style="verb">Primaries</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\Primaries)</spanx>
</t>
<t>id: <spanx style="verb">0x55BB</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">2</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: The colour primaries of the video. For clarity, the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23001-8:2013/DCOR1.
</t>
</section>

<section anchor="maxcll-element" title="MaxCLL Element">
<t>name: <spanx style="verb">MaxCLL</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MaxCLL)</spanx>
</t>
<t>id: <spanx style="verb">0x55BC</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Maximum brightness of a single pixel (Maximum Content Light Level) in candelas per square meter (cd/m²).
</t>
</section>

<section anchor="maxfall-element" title="MaxFALL Element">
<t>name: <spanx style="verb">MaxFALL</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MaxFALL)</spanx>
</t>
<t>id: <spanx style="verb">0x55BD</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Maximum brightness of a single full frame (Maximum Frame-Average Light Level) in candelas per square meter (cd/m²).
</t>
</section>

<section anchor="masteringmetadata-element" title="MasteringMetadata Element">
<t>name: <spanx style="verb">MasteringMetadata</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata)</spanx>
</t>
<t>id: <spanx style="verb">0x55D0</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: SMPTE 2086 mastering data.
</t>
</section>

<section anchor="primaryrchromaticityx-element" title="PrimaryRChromaticityX Element">
<t>name: <spanx style="verb">PrimaryRChromaticityX</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryRChromaticityX)</spanx>
</t>
<t>id: <spanx style="verb">0x55D1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Red X chromaticity coordinate as defined by CIE 1931.
</t>
</section>

<section anchor="primaryrchromaticityy-element" title="PrimaryRChromaticityY Element">
<t>name: <spanx style="verb">PrimaryRChromaticityY</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryRChromaticityY)</spanx>
</t>
<t>id: <spanx style="verb">0x55D2</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Red Y chromaticity coordinate as defined by CIE 1931.
</t>
</section>

<section anchor="primarygchromaticityx-element" title="PrimaryGChromaticityX Element">
<t>name: <spanx style="verb">PrimaryGChromaticityX</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryGChromaticityX)</spanx>
</t>
<t>id: <spanx style="verb">0x55D3</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Green X chromaticity coordinate as defined by CIE 1931.
</t>
</section>

<section anchor="primarygchromaticityy-element" title="PrimaryGChromaticityY Element">
<t>name: <spanx style="verb">PrimaryGChromaticityY</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryGChromaticityY)</spanx>
</t>
<t>id: <spanx style="verb">0x55D4</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Green Y chromaticity coordinate as defined by CIE 1931.
</t>
</section>

<section anchor="primarybchromaticityx-element" title="PrimaryBChromaticityX Element">
<t>name: <spanx style="verb">PrimaryBChromaticityX</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryBChromaticityX)</spanx>
</t>
<t>id: <spanx style="verb">0x55D5</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Blue X chromaticity coordinate as defined by CIE 1931.
</t>
</section>

<section anchor="primarybchromaticityy-element" title="PrimaryBChromaticityY Element">
<t>name: <spanx style="verb">PrimaryBChromaticityY</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryBChromaticityY)</spanx>
</t>
<t>id: <spanx style="verb">0x55D6</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Blue Y chromaticity coordinate as defined by CIE 1931.
</t>
</section>

<section anchor="whitepointchromaticityx-element" title="WhitePointChromaticityX Element">
<t>name: <spanx style="verb">WhitePointChromaticityX</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\WhitePointChromaticityX)</spanx>
</t>
<t>id: <spanx style="verb">0x55D7</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: White X chromaticity coordinate as defined by CIE 1931.
</t>
</section>

<section anchor="whitepointchromaticityy-element" title="WhitePointChromaticityY Element">
<t>name: <spanx style="verb">WhitePointChromaticityY</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\WhitePointChromaticityY)</spanx>
</t>
<t>id: <spanx style="verb">0x55D8</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: White Y chromaticity coordinate as defined by CIE 1931.
</t>
</section>

<section anchor="luminancemax-element" title="LuminanceMax Element">
<t>name: <spanx style="verb">LuminanceMax</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\LuminanceMax)</spanx>
</t>
<t>id: <spanx style="verb">0x55D9</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-9999.99</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Maximum luminance. Represented in candelas per square meter (cd/m²).
</t>
</section>

<section anchor="luminancemin-element" title="LuminanceMin Element">
<t>name: <spanx style="verb">LuminanceMin</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\LuminanceMin)</spanx>
</t>
<t>id: <spanx style="verb">0x55DA</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-999.9999</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Mininum luminance. Represented in candelas per square meter (cd/m²).
</t>
</section>

<section anchor="projection-element" title="Projection Element">
<t>name: <spanx style="verb">Projection</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Projection)</spanx>
</t>
<t>id: <spanx style="verb">0x7670</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Describes the video projection details. Used to render spherical and VR videos.
</t>
</section>

<section anchor="projectiontype-element" title="ProjectionType Element">
<t>name: <spanx style="verb">ProjectionType</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionType)</spanx>
</t>
<t>id: <spanx style="verb">0x7671</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-3</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Describes the projection used for this video track.
</t>
</section>

<section anchor="projectionprivate-element" title="ProjectionPrivate Element">
<t>name: <spanx style="verb">ProjectionPrivate</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPrivate)</spanx>
</t>
<t>id: <spanx style="verb">0x7672</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Private data that only applies to a specific projection.SemanticsIf ProjectionType equals 0 (Rectangular), then this element must not be present.If ProjectionType 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').If ProjectionType 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').If ProjectionType 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').Note: 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.
</t>
</section>

<section anchor="projectionposeyaw-element" title="ProjectionPoseYaw Element">
<t>name: <spanx style="verb">ProjectionPoseYaw</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPoseYaw)</spanx>
</t>
<t>id: <spanx style="verb">0x7673</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0x0p+0</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Specifies a yaw rotation to the projection.SemanticsValue represents a clockwise rotation, in degrees, around the up vector. This rotation must be applied before any ProjectionPosePitch or ProjectionPoseRoll rotations. The value of this field should be in the -180 to 180 degree range.
</t>
</section>

<section anchor="projectionposepitch-element" title="ProjectionPosePitch Element">
<t>name: <spanx style="verb">ProjectionPosePitch</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPosePitch)</spanx>
</t>
<t>id: <spanx style="verb">0x7674</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0x0p+0</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Specifies a pitch rotation to the projection.SemanticsValue represents a counter-clockwise rotation, in degrees, around the right vector. This rotation must be applied after the ProjectionPoseYaw rotation and before the ProjectionPoseRoll rotation. The value of this field should be in the -90 to 90 degree range.
</t>
</section>

<section anchor="projectionposeroll-element" title="ProjectionPoseRoll Element">
<t>name: <spanx style="verb">ProjectionPoseRoll</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPoseRoll)</spanx>
</t>
<t>id: <spanx style="verb">0x7675</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0x0p+0</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: Specifies a roll rotation to the projection.SemanticsValue represents a counter-clockwise rotation, in degrees, around the forward vector. This rotation must be applied after the ProjectionPoseYaw and ProjectionPosePitch rotations. The value of this field should be in the -180 to 180 degree range.
</t>
</section>

<section anchor="audio-element" title="Audio Element">
<t>name: <spanx style="verb">Audio</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Audio)</spanx>
</t>
<t>id: <spanx style="verb">0xE1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Audio settings.
</t>
</section>

<section anchor="samplingfrequency-element" title="SamplingFrequency Element">
<t>name: <spanx style="verb">SamplingFrequency</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\Audio\SamplingFrequency)</spanx>
</t>
<t>id: <spanx style="verb">0xB5</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">&gt; 0x0p+0</spanx>
</t>
<t>default: <spanx style="verb">0x1.f4p+12</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Sampling frequency in Hz.
</t>
</section>

<section anchor="outputsamplingfrequency-element" title="OutputSamplingFrequency Element">
<t>name: <spanx style="verb">OutputSamplingFrequency</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Audio\OutputSamplingFrequency)</spanx>
</t>
<t>id: <spanx style="verb">0x78B5</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">&gt; 0x0p+0</spanx>
</t>
<t>default: <spanx style="verb">SamplingFrequency</spanx>
</t>
<t>type: <spanx style="verb">float</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Real output sampling frequency in Hz (used for SBR techniques).
</t>
</section>

<section anchor="channels-element" title="Channels Element">
<t>name: <spanx style="verb">Channels</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\Audio\Channels)</spanx>
</t>
<t>id: <spanx style="verb">0x9F</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>default: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Numbers of channels in the track.
</t>
</section>

<section anchor="channelpositions-element" title="ChannelPositions Element">
<t>name: <spanx style="verb">ChannelPositions</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Audio\ChannelPositions)</spanx>
</t>
<t>id: <spanx style="verb">0x7D7B</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: Table of horizontal angles for each successive channel, see appendix.
</t>
</section>

<section anchor="bitdepth-element" title="BitDepth Element">
<t>name: <spanx style="verb">BitDepth</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\Audio\BitDepth)</spanx>
</t>
<t>id: <spanx style="verb">0x6264</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Bits per sample, mostly used for PCM.
</t>
</section>

<section anchor="trackoperation-element" title="TrackOperation Element">
<t>name: <spanx style="verb">TrackOperation</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\TrackOperation)</spanx>
</t>
<t>id: <spanx style="verb">0xE2</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">3</spanx>
</t>
<t>documentation: Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject.
</t>
</section>

<section anchor="trackcombineplanes-element" title="TrackCombinePlanes Element">
<t>name: <spanx style="verb">TrackCombinePlanes</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes)</spanx>
</t>
<t>id: <spanx style="verb">0xE3</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">3</spanx>
</t>
<t>documentation: Contains the list of all video plane tracks that need to be combined to create this 3D track
</t>
</section>

<section anchor="trackplane-element" title="TrackPlane Element">
<t>name: <spanx style="verb">TrackPlane</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\TrackPlane)</spanx>
</t>
<t>id: <spanx style="verb">0xE4</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">3</spanx>
</t>
<t>documentation: Contains a video plane track that need to be combined to create this 3D track
</t>
</section>

<section anchor="trackplaneuid-element" title="TrackPlaneUID Element">
<t>name: <spanx style="verb">TrackPlaneUID</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\TrackPlane\TrackPlaneUID)</spanx>
</t>
<t>id: <spanx style="verb">0xE5</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">3</spanx>
</t>
<t>documentation: The trackUID number of the track representing the plane.
</t>
</section>

<section anchor="trackplanetype-element" title="TrackPlaneType Element">
<t>name: <spanx style="verb">TrackPlaneType</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\TrackPlane\TrackPlaneType)</spanx>
</t>
<t>id: <spanx style="verb">0xE6</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">3</spanx>
</t>
<t>documentation: The kind of plane this track corresponds to.
</t>
</section>

<section anchor="trackjoinblocks-element" title="TrackJoinBlocks Element">
<t>name: <spanx style="verb">TrackJoinBlocks</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks)</spanx>
</t>
<t>id: <spanx style="verb">0xE9</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">3</spanx>
</t>
<t>documentation: Contains the list of all tracks whose Blocks need to be combined to create this virtual track
</t>
</section>

<section anchor="trackjoinuid-element" title="TrackJoinUID Element">
<t>name: <spanx style="verb">TrackJoinUID</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks\TrackJoinUID)</spanx>
</t>
<t>id: <spanx style="verb">0xED</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">3</spanx>
</t>
<t>documentation: The trackUID number of a track whose blocks are used to create this virtual track.
</t>
</section>

<section anchor="tricktrackuid-element" title="TrickTrackUID Element">
<t>name: <spanx style="verb">TrickTrackUID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\TrickTrackUID)</spanx>
</t>
<t>id: <spanx style="verb">0xC0</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation:
      DivX trick track extensions
</t>
</section>

<section anchor="tricktracksegmentuid-element" title="TrickTrackSegmentUID Element">
<t>name: <spanx style="verb">TrickTrackSegmentUID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\TrickTrackSegmentUID)</spanx>
</t>
<t>id: <spanx style="verb">0xC1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>size: <spanx style="verb">16</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation:
      DivX trick track extensions
</t>
</section>

<section anchor="tricktrackflag-element" title="TrickTrackFlag Element">
<t>name: <spanx style="verb">TrickTrackFlag</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\TrickTrackFlag)</spanx>
</t>
<t>id: <spanx style="verb">0xC6</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation:
      DivX trick track extensions
</t>
</section>

<section anchor="trickmastertrackuid-element" title="TrickMasterTrackUID Element">
<t>name: <spanx style="verb">TrickMasterTrackUID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\TrickMasterTrackUID)</spanx>
</t>
<t>id: <spanx style="verb">0xC7</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation:
      DivX trick track extensions
</t>
</section>

<section anchor="trickmastertracksegmentuid-element" title="TrickMasterTrackSegmentUID Element">
<t>name: <spanx style="verb">TrickMasterTrackSegmentUID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\TrickMasterTrackSegmentUID)</spanx>
</t>
<t>id: <spanx style="verb">0xC4</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>size: <spanx style="verb">16</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation:
      DivX trick track extensions
</t>
</section>

<section anchor="contentencodings-element" title="ContentEncodings Element">
<t>name: <spanx style="verb">ContentEncodings</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\ContentEncodings)</spanx>
</t>
<t>id: <spanx style="verb">0x6D80</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Settings for several content encoding mechanisms like compression or encryption.
</t>
</section>

<section anchor="contentencoding-element" title="ContentEncoding Element">
<t>name: <spanx style="verb">ContentEncoding</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding)</spanx>
</t>
<t>id: <spanx style="verb">0x6240</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Settings for one content encoding like compression or encryption.
</t>
</section>

<section anchor="contentencodingorder-element" title="ContentEncodingOrder Element">
<t>name: <spanx style="verb">ContentEncodingOrder</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncodingOrder)</spanx>
</t>
<t>id: <spanx style="verb">0x5031</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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 Segment.
</t>
</section>

<section anchor="contentencodingscope-element" title="ContentEncodingScope Element">
<t>name: <spanx style="verb">ContentEncodingScope</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncodingScope)</spanx>
</t>
<t>id: <spanx style="verb">0x5032</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>default: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A bit field that describes which Elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)
</t>
</section>

<section anchor="contentencodingtype-element" title="ContentEncodingType Element">
<t>name: <spanx style="verb">ContentEncodingType</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncodingType)</spanx>
</t>
<t>id: <spanx style="verb">0x5033</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption
</t>
</section>

<section anchor="contentcompression-element" title="ContentCompression Element">
<t>name: <spanx style="verb">ContentCompression</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentCompression)</spanx>
</t>
<t>id: <spanx style="verb">0x5034</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Settings describing the compression used. This Element MUST be present if the value of ContentEncodingType is 0 and absent otherwise. Each block MUST be decompressable even if no previous block is available in order not to prevent seeking.
</t>
</section>

<section anchor="contentcompalgo-element" title="ContentCompAlgo Element">
<t>name: <spanx style="verb">ContentCompAlgo</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentCompression\ContentCompAlgo)</spanx>
</t>
<t>id: <spanx style="verb">0x4254</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 1 - bzlib, 2 - lzo1x 3 - Header Stripping
</t>
</section>

<section anchor="contentcompsettings-element" title="ContentCompSettings Element">
<t>name: <spanx style="verb">ContentCompSettings</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentCompression\ContentCompSettings)</spanx>
</t>
<t>id: <spanx style="verb">0x4255</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track.
</t>
</section>

<section anchor="contentencryption-element" title="ContentEncryption Element">
<t>name: <spanx style="verb">ContentEncryption</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption)</spanx>
</t>
<t>id: <spanx style="verb">0x5035</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Settings describing the encryption used. This Element MUST be present if the value of ContentEncodingType is 1 and absent otherwise.
</t>
</section>

<section anchor="contentencalgo-element" title="ContentEncAlgo Element">
<t>name: <spanx style="verb">ContentEncAlgo</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentEncAlgo)</spanx>
</t>
<t>id: <spanx style="verb">0x47E1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES
</t>
</section>

<section anchor="contentenckeyid-element" title="ContentEncKeyID Element">
<t>name: <spanx style="verb">ContentEncKeyID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentEncKeyID)</spanx>
</t>
<t>id: <spanx style="verb">0x47E2</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: For public key algorithms this is the ID of the public key the the data was encrypted with.
</t>
</section>

<section anchor="contentsignature-element" title="ContentSignature Element">
<t>name: <spanx style="verb">ContentSignature</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentSignature)</spanx>
</t>
<t>id: <spanx style="verb">0x47E3</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A cryptographic signature of the contents.
</t>
</section>

<section anchor="contentsigkeyid-element" title="ContentSigKeyID Element">
<t>name: <spanx style="verb">ContentSigKeyID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentSigKeyID)</spanx>
</t>
<t>id: <spanx style="verb">0x47E4</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: This is the ID of the private key the data was signed with.
</t>
</section>

<section anchor="contentsigalgo-element" title="ContentSigAlgo Element">
<t>name: <spanx style="verb">ContentSigAlgo</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentSigAlgo)</spanx>
</t>
<t>id: <spanx style="verb">0x47E5</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA
</t>
</section>

<section anchor="contentsighashalgo-element" title="ContentSigHashAlgo Element">
<t>name: <spanx style="verb">ContentSigHashAlgo</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentSigHashAlgo)</spanx>
</t>
<t>id: <spanx style="verb">0x47E6</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5
</t>
</section>

<section anchor="cues-element" title="Cues Element">
<t>name: <spanx style="verb">Cues</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cues)</spanx>
</t>
<t>id: <spanx style="verb">0x1C53BB6B</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A Top-Level Element to speed seeking access. All entries are local to the Segment. This Element SHOULD be mandatory for non &quot;live&quot; streams.
</t>
</section>

<section anchor="cuepoint-element" title="CuePoint Element">
<t>name: <spanx style="verb">CuePoint</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Cues\CuePoint)</spanx>
</t>
<t>id: <spanx style="verb">0xBB</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains all information relative to a seek point in the Segment.
</t>
</section>

<section anchor="cuetime-element" title="CueTime Element">
<t>name: <spanx style="verb">CueTime</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Cues\CuePoint\CueTime)</spanx>
</t>
<t>id: <spanx style="verb">0xB3</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Absolute timestamp according to the Segment time base.
</t>
</section>

<section anchor="cuetrackpositions-element" title="CueTrackPositions Element">
<t>name: <spanx style="verb">CueTrackPositions</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Cues\CuePoint\CueTrackPositions)</spanx>
</t>
<t>id: <spanx style="verb">0xB7</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contain positions for different tracks corresponding to the timestamp.
</t>
</section>

<section anchor="cuetrack-element" title="CueTrack Element">
<t>name: <spanx style="verb">CueTrack</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueTrack)</spanx>
</t>
<t>id: <spanx style="verb">0xF7</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The track for which a position is given.
</t>
</section>

<section anchor="cueclusterposition-element" title="CueClusterPosition Element">
<t>name: <spanx style="verb">CueClusterPosition</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueClusterPosition)</spanx>
</t>
<t>id: <spanx style="verb">0xF1</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The Segment Position of the Cluster containing the associated Block.
</t>
</section>

<section anchor="cuerelativeposition-element" title="CueRelativePosition Element">
<t>name: <spanx style="verb">CueRelativePosition</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueRelativePosition)</spanx>
</t>
<t>id: <spanx style="verb">0xF0</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: The relative position of the referenced block inside the cluster with 0 being the first possible position for an Element inside that cluster.
</t>
</section>

<section anchor="cueduration-element" title="CueDuration Element">
<t>name: <spanx style="verb">CueDuration</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueDuration)</spanx>
</t>
<t>id: <spanx style="verb">0xB2</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: 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.
</t>
</section>

<section anchor="cueblocknumber-element" title="CueBlockNumber Element">
<t>name: <spanx style="verb">CueBlockNumber</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueBlockNumber)</spanx>
</t>
<t>id: <spanx style="verb">0x5378</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>default: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Number of the Block in the specified Cluster.
</t>
</section>

<section anchor="cuecodecstate-element" title="CueCodecState Element">
<t>name: <spanx style="verb">CueCodecState</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueCodecState)</spanx>
</t>
<t>id: <spanx style="verb">0xEA</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">2</spanx>
</t>
<t>documentation: The Segment Position of the Codec State corresponding to this Cue Element. 0 means that the data is taken from the initial Track Entry.
</t>
</section>

<section anchor="cuereference-element" title="CueReference Element">
<t>name: <spanx style="verb">CueReference</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Cues\CuePoint\CueTrackPositions\CueReference)</spanx>
</t>
<t>id: <spanx style="verb">0xDB</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">2</spanx>
</t>
<t>documentation: The Clusters containing the referenced Blocks.
</t>
</section>

<section anchor="cuereftime-element" title="CueRefTime Element">
<t>name: <spanx style="verb">CueRefTime</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefTime)</spanx>
</t>
<t>id: <spanx style="verb">0x96</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">2</spanx>
</t>
<t>documentation: Timestamp of the referenced Block.
</t>
</section>

<section anchor="cuerefcluster-element" title="CueRefCluster Element">
<t>name: <spanx style="verb">CueRefCluster</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefCluster)</spanx>
</t>
<t>id: <spanx style="verb">0x97</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: The Segment Position of the Cluster containing the referenced Block.
</t>
</section>

<section anchor="cuerefnumber-element" title="CueRefNumber Element">
<t>name: <spanx style="verb">CueRefNumber</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefNumber)</spanx>
</t>
<t>id: <spanx style="verb">0x535F</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>default: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: Number of the referenced Block of Track X in the specified Cluster.
</t>
</section>

<section anchor="cuerefcodecstate-element" title="CueRefCodecState Element">
<t>name: <spanx style="verb">CueRefCodecState</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefCodecState)</spanx>
</t>
<t>id: <spanx style="verb">0xEB</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: The Segment Position of the Codec State corresponding to this referenced Element. 0 means that the data is taken from the initial Track Entry.
</t>
</section>

<section anchor="attachments-element" title="Attachments Element">
<t>name: <spanx style="verb">Attachments</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Attachments)</spanx>
</t>
<t>id: <spanx style="verb">0x1941A469</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contain attached files.
</t>
</section>

<section anchor="attachedfile-element" title="AttachedFile Element">
<t>name: <spanx style="verb">AttachedFile</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Attachments\AttachedFile)</spanx>
</t>
<t>id: <spanx style="verb">0x61A7</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: An attached file.
</t>
</section>

<section anchor="filedescription-element" title="FileDescription Element">
<t>name: <spanx style="verb">FileDescription</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Attachments\AttachedFile\FileDescription)</spanx>
</t>
<t>id: <spanx style="verb">0x467E</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A human-friendly name for the attached file.
</t>
</section>

<section anchor="filename-element" title="FileName Element">
<t>name: <spanx style="verb">FileName</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Attachments\AttachedFile\FileName)</spanx>
</t>
<t>id: <spanx style="verb">0x466E</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Filename of the attached file.
</t>
</section>

<section anchor="filemimetype-element" title="FileMimeType Element">
<t>name: <spanx style="verb">FileMimeType</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Attachments\AttachedFile\FileMimeType)</spanx>
</t>
<t>id: <spanx style="verb">0x4660</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">string</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: MIME type of the file.
</t>
</section>

<section anchor="filedata-element" title="FileData Element">
<t>name: <spanx style="verb">FileData</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Attachments\AttachedFile\FileData)</spanx>
</t>
<t>id: <spanx style="verb">0x465C</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The data of the file.
</t>
</section>

<section anchor="fileuid-element" title="FileUID Element">
<t>name: <spanx style="verb">FileUID</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Attachments\AttachedFile\FileUID)</spanx>
</t>
<t>id: <spanx style="verb">0x46AE</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Unique ID representing the file, as random as possible.
</t>
</section>

<section anchor="filereferral-element" title="FileReferral Element">
<t>name: <spanx style="verb">FileReferral</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Attachments\AttachedFile\FileReferral)</spanx>
</t>
<t>id: <spanx style="verb">0x4675</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation: A binary value that a track/codec can refer to when the attachment is needed.
</t>
</section>

<section anchor="fileusedstarttime-element" title="FileUsedStartTime Element">
<t>name: <spanx style="verb">FileUsedStartTime</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Attachments\AttachedFile\FileUsedStartTime)</spanx>
</t>
<t>id: <spanx style="verb">0x4661</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation:
      DivX font extension
</t>
</section>

<section anchor="fileusedendtime-element" title="FileUsedEndTime Element">
<t>name: <spanx style="verb">FileUsedEndTime</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Attachments\AttachedFile\FileUsedEndTime)</spanx>
</t>
<t>id: <spanx style="verb">0x4662</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">0</spanx>
</t>
<t>maxver: <spanx style="verb">0</spanx>
</t>
<t>documentation:
      DivX font extension
</t>
</section>

<section anchor="chapters-element" title="Chapters Element">
<t>name: <spanx style="verb">Chapters</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Chapters)</spanx>
</t>
<t>id: <spanx style="verb">0x1043A770</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation.
</t>
</section>

<section anchor="editionentry-element" title="EditionEntry Element">
<t>name: <spanx style="verb">EditionEntry</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Chapters\EditionEntry)</spanx>
</t>
<t>id: <spanx style="verb">0x45B9</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains all information about a Segment edition.
</t>
</section>

<section anchor="editionuid-element" title="EditionUID Element">
<t>name: <spanx style="verb">EditionUID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Chapters\EditionEntry\EditionUID)</spanx>
</t>
<t>id: <spanx style="verb">0x45BC</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A unique ID to identify the edition. It's useful for tagging an edition.
</t>
</section>

<section anchor="editionflaghidden-element" title="EditionFlagHidden Element">
<t>name: <spanx style="verb">EditionFlagHidden</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Chapters\EditionEntry\EditionFlagHidden)</spanx>
</t>
<t>id: <spanx style="verb">0x45BD</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: If an edition is hidden (1), it SHOULD NOT be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)
</t>
</section>

<section anchor="editionflagdefault-element" title="EditionFlagDefault Element">
<t>name: <spanx style="verb">EditionFlagDefault</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Chapters\EditionEntry\EditionFlagDefault)</spanx>
</t>
<t>id: <spanx style="verb">0x45DB</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: If a flag is set (1) the edition SHOULD be used as the default one. (1 bit)
</t>
</section>

<section anchor="editionflagordered-element" title="EditionFlagOrdered Element">
<t>name: <spanx style="verb">EditionFlagOrdered</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Chapters\EditionEntry\EditionFlagOrdered)</spanx>
</t>
<t>id: <spanx style="verb">0x45DD</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)
</t>
</section>

<section anchor="chapteratom-element" title="ChapterAtom Element">
<t>name: <spanx style="verb">ChapterAtom</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Chapters\EditionEntry(1*(\ChapterAtom)))</spanx>
</t>
<t>id: <spanx style="verb">0xB6</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>recursive: <spanx style="verb">1</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains the atom information to use as the chapter atom (apply to all tracks).
</t>
</section>

<section anchor="chapteruid-element" title="ChapterUID Element">
<t>name: <spanx style="verb">ChapterUID</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterUID)</spanx>
</t>
<t>id: <spanx style="verb">0x73C4</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A unique ID to identify the Chapter.
</t>
</section>

<section anchor="chapterstringuid-element" title="ChapterStringUID Element">
<t>name: <spanx style="verb">ChapterStringUID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterStringUID)</spanx>
</t>
<t>id: <spanx style="verb">0x5654</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">3</spanx>
</t>
<t>documentation: A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage.
</t>
</section>

<section anchor="chaptertimestart-element" title="ChapterTimeStart Element">
<t>name: <spanx style="verb">ChapterTimeStart</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTimeStart)</spanx>
</t>
<t>id: <spanx style="verb">0x91</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Timestamp of the start of Chapter (not scaled).
</t>
</section>

<section anchor="chaptertimeend-element" title="ChapterTimeEnd Element">
<t>name: <spanx style="verb">ChapterTimeEnd</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTimeEnd)</spanx>
</t>
<t>id: <spanx style="verb">0x92</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Timestamp of the end of Chapter (timestamp excluded, not scaled).
</t>
</section>

<section anchor="chapterflaghidden-element" title="ChapterFlagHidden Element">
<t>name: <spanx style="verb">ChapterFlagHidden</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterFlagHidden)</spanx>
</t>
<t>id: <spanx style="verb">0x98</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: If a chapter is hidden (1), it SHOULD NOT be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)
</t>
</section>

<section anchor="chapterflagenabled-element" title="ChapterFlagEnabled Element">
<t>name: <spanx style="verb">ChapterFlagEnabled</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterFlagEnabled)</spanx>
</t>
<t>id: <spanx style="verb">0x4598</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>default: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Specify whether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie SHOULD skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)
</t>
</section>

<section anchor="chaptersegmentuid-element" title="ChapterSegmentUID Element">
<t>name: <spanx style="verb">ChapterSegmentUID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterSegmentUID)</spanx>
</t>
<t>id: <spanx style="verb">0x6E67</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">&gt;0</spanx>
</t>
<t>size: <spanx style="verb">16</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The SegmentUID of another Segment to play during this chapter.
</t>
<t>usage notes: ChapterSegmentUID is mandatory if ChapterSegmentEditionUID is used.
</t>
</section>

<section anchor="chaptersegmenteditionuid-element" title="ChapterSegmentEditionUID Element">
<t>name: <spanx style="verb">ChapterSegmentEditionUID</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterSegmentEditionUID)</spanx>
</t>
<t>id: <spanx style="verb">0x6EBC</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The EditionUID to play from the Segment linked in ChapterSegmentUID. If ChapterSegmentEditionUID is undeclared then no Edition of the linked Segment is used.
</t>
</section>

<section anchor="chapterphysicalequiv-element" title="ChapterPhysicalEquiv Element">
<t>name: <spanx style="verb">ChapterPhysicalEquiv</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterPhysicalEquiv)</spanx>
</t>
<t>id: <spanx style="verb">0x63C3</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Specify the physical equivalent of this ChapterAtom like &quot;DVD&quot; (60) or &quot;SIDE&quot; (50), see complete list of values.
</t>
</section>

<section anchor="chaptertrack-element" title="ChapterTrack Element">
<t>name: <spanx style="verb">ChapterTrack</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTrack)</spanx>
</t>
<t>id: <spanx style="verb">0x8F</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: List of tracks on which the chapter applies. If this Element is not present, all tracks apply
</t>
</section>

<section anchor="chaptertracknumber-element" title="ChapterTrackNumber Element">
<t>name: <spanx style="verb">ChapterTrackNumber</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTrack\ChapterTrackNumber)</spanx>
</t>
<t>id: <spanx style="verb">0x89</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">not 0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: UID of the Track to apply this chapter too. 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 SHOULD be applied to any currently used Tracks.
</t>
</section>

<section anchor="chapterdisplay-element" title="ChapterDisplay Element">
<t>name: <spanx style="verb">ChapterDisplay</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay)</spanx>
</t>
<t>id: <spanx style="verb">0x80</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains all possible strings to use for the chapter display.
</t>
</section>

<section anchor="chapstring-element" title="ChapString Element">
<t>name: <spanx style="verb">ChapString</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\ChapString)</spanx>
</t>
<t>id: <spanx style="verb">0x85</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains the string to use as the chapter atom.
</t>
</section>

<section anchor="chaplanguage-element" title="ChapLanguage Element">
<t>name: <spanx style="verb">ChapLanguage</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\ChapLanguage)</spanx>
</t>
<t>id: <spanx style="verb">0x437C</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">eng</spanx>
</t>
<t>type: <spanx style="verb">string</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The languages corresponding to the string, in the bibliographic ISO-639-2 form. This Element MUST be ignored if the ChapLanguageIETF Element is used within the same ChapterDisplay Element.
</t>
</section>

<section anchor="chaplanguageietf-element" title="ChapLanguageIETF Element">
<t>name: <spanx style="verb">ChapLanguageIETF</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\ChapLanguageIETF)</spanx>
</t>
<t>id: <spanx style="verb">0x437D</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">string</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: 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 MUST be ignored.
</t>
</section>

<section anchor="chapcountry-element" title="ChapCountry Element">
<t>name: <spanx style="verb">ChapCountry</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\ChapCountry)</spanx>
</t>
<t>id: <spanx style="verb">0x437E</spanx>
</t>
<t>type: <spanx style="verb">string</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The countries corresponding to the string, same 2 octets as in Internet domains. This Element MUST be ignored if the ChapLanguageIETF Element is used within the same ChapterDisplay Element.
</t>
</section>

<section anchor="chapprocess-element" title="ChapProcess Element">
<t>name: <spanx style="verb">ChapProcess</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess)</spanx>
</t>
<t>id: <spanx style="verb">0x6944</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains all the commands associated to the Atom.
</t>
</section>

<section anchor="chapprocesscodecid-element" title="ChapProcessCodecID Element">
<t>name: <spanx style="verb">ChapProcessCodecID</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\ChapProcessCodecID)</spanx>
</t>
<t>id: <spanx style="verb">0x6955</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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. More codec IDs can be added later.
</t>
</section>

<section anchor="chapprocessprivate-element" title="ChapProcessPrivate Element">
<t>name: <spanx style="verb">ChapProcessPrivate</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\ChapProcessPrivate)</spanx>
</t>
<t>id: <spanx style="verb">0x450D</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the &quot;DVD level&quot; equivalent.
</t>
</section>

<section anchor="chapprocesscommand-element" title="ChapProcessCommand Element">
<t>name: <spanx style="verb">ChapProcessCommand</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\ChapProcessCommand)</spanx>
</t>
<t>id: <spanx style="verb">0x6911</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains all the commands associated to the Atom.
</t>
</section>

<section anchor="chapprocesstime-element" title="ChapProcessTime Element">
<t>name: <spanx style="verb">ChapProcessTime</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\ChapProcessCommand\ChapProcessTime)</spanx>
</t>
<t>id: <spanx style="verb">0x6922</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Defines when the process command SHOULD be handled
</t>
</section>

<section anchor="chapprocessdata-element" title="ChapProcessData Element">
<t>name: <spanx style="verb">ChapProcessData</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\ChapProcessCommand\ChapProcessData)</spanx>
</t>
<t>id: <spanx style="verb">0x6933</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains the command information. The data SHOULD be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands.
</t>
</section>

<section anchor="tags-element" title="Tags Element">
<t>name: <spanx style="verb">Tags</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Tags)</spanx>
</t>
<t>id: <spanx style="verb">0x1254C367</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Element containing metadata describing Tracks, Editions, Chapters, Attachments, or the Segment as a whole. A list of valid tags can be found here.
</t>
</section>

<section anchor="tag-element" title="Tag Element">
<t>name: <spanx style="verb">Tag</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Tags\Tag)</spanx>
</t>
<t>id: <spanx style="verb">0x7373</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A single metadata descriptor.
</t>
</section>

<section anchor="targets-element" title="Targets Element">
<t>name: <spanx style="verb">Targets</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tags\Tag\Targets)</spanx>
</t>
<t>id: <spanx style="verb">0x63C0</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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.
</t>
</section>

<section anchor="targettypevalue-element" title="TargetTypeValue Element">
<t>name: <spanx style="verb">TargetTypeValue</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tags\Tag\Targets\TargetTypeValue)</spanx>
</t>
<t>id: <spanx style="verb">0x68CA</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">50</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A number to indicate the logical level of the target.
</t>
</section>

<section anchor="targettype-element" title="TargetType Element">
<t>name: <spanx style="verb">TargetType</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tags\Tag\Targets\TargetType)</spanx>
</t>
<t>id: <spanx style="verb">0x63CA</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">string</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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 TargetType).
</t>
</section>

<section anchor="tagtrackuid-element" title="TagTrackUID Element">
<t>name: <spanx style="verb">TagTrackUID</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Tags\Tag\Targets\TagTrackUID)</spanx>
</t>
<t>id: <spanx style="verb">0x63C5</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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.
</t>
</section>

<section anchor="tageditionuid-element" title="TagEditionUID Element">
<t>name: <spanx style="verb">TagEditionUID</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Tags\Tag\Targets\TagEditionUID)</spanx>
</t>
<t>id: <spanx style="verb">0x63C9</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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.
</t>
</section>

<section anchor="tagchapteruid-element" title="TagChapterUID Element">
<t>name: <spanx style="verb">TagChapterUID</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Tags\Tag\Targets\TagChapterUID)</spanx>
</t>
<t>id: <spanx style="verb">0x63C4</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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.
</t>
</section>

<section anchor="tagattachmentuid-element" title="TagAttachmentUID Element">
<t>name: <spanx style="verb">TagAttachmentUID</spanx>
</t>
<t>path: <spanx style="verb">0*(\Segment\Tags\Tag\Targets\TagAttachmentUID)</spanx>
</t>
<t>id: <spanx style="verb">0x63C6</spanx>
</t>
<t>default: <spanx style="verb">0</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: 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.
</t>
</section>

<section anchor="simpletag-element" title="SimpleTag Element">
<t>name: <spanx style="verb">SimpleTag</spanx>
</t>
<t>path: <spanx style="verb">1*(\Segment\Tags\Tag(1*(\SimpleTag)))</spanx>
</t>
<t>id: <spanx style="verb">0x67C8</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">master</spanx>
</t>
<t>recursive: <spanx style="verb">1</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Contains general information about the target.
</t>
</section>

<section anchor="tagname-element" title="TagName Element">
<t>name: <spanx style="verb">TagName</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tags\Tag\SimpleTag\TagName)</spanx>
</t>
<t>id: <spanx style="verb">0x45A3</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The name of the Tag that is going to be stored.
</t>
</section>

<section anchor="taglanguage-element" title="TagLanguage Element">
<t>name: <spanx style="verb">TagLanguage</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tags\Tag\SimpleTag\TagLanguage)</spanx>
</t>
<t>id: <spanx style="verb">0x447A</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>default: <spanx style="verb">und</spanx>
</t>
<t>type: <spanx style="verb">string</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: Specifies the language of the tag specified, in the Matroska languages form. This Element MUST be ignored if the TagLanguageIETF Element is used within the same SimpleTag Element.
</t>
</section>

<section anchor="taglanguageietf-element" title="TagLanguageIETF Element">
<t>name: <spanx style="verb">TagLanguageIETF</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tags\Tag\SimpleTag\TagLanguageIETF)</spanx>
</t>
<t>id: <spanx style="verb">0x447B</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">string</spanx>
</t>
<t>minver: <spanx style="verb">4</spanx>
</t>
<t>documentation: 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 MUST be ignored.
</t>
</section>

<section anchor="tagdefault-element" title="TagDefault Element">
<t>name: <spanx style="verb">TagDefault</spanx>
</t>
<t>path: <spanx style="verb">1*1(\Segment\Tags\Tag\SimpleTag\TagDefault)</spanx>
</t>
<t>id: <spanx style="verb">0x4484</spanx>
</t>
<t>minOccurs: <spanx style="verb">1</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>range: <spanx style="verb">0-1</spanx>
</t>
<t>default: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">uinteger</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: A boolean value to indicate if this is the default/original language to use for the given tag.
</t>
</section>

<section anchor="tagstring-element" title="TagString Element">
<t>name: <spanx style="verb">TagString</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tags\Tag\SimpleTag\TagString)</spanx>
</t>
<t>id: <spanx style="verb">0x4487</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">utf-8</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The value of the Tag.
</t>
</section>

<section anchor="tagbinary-element" title="TagBinary Element">
<t>name: <spanx style="verb">TagBinary</spanx>
</t>
<t>path: <spanx style="verb">0*1(\Segment\Tags\Tag\SimpleTag\TagBinary)</spanx>
</t>
<t>id: <spanx style="verb">0x4485</spanx>
</t>
<t>maxOccurs: <spanx style="verb">1</spanx>
</t>
<t>type: <spanx style="verb">binary</spanx>
</t>
<t>minver: <spanx style="verb">1</spanx>
</t>
<t>documentation: The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString.
</t>
<t>If you intend to implement a Matroska player, make sure you can handle all the files in <eref target="http://www.matroska.org/downloads/test_w1.html">our test suite</eref>, or at least the features presented there, not necessarily the same codecs.
</t>
</section>
</section>
</section>

<section anchor="beginning-of-file" title="Beginning of File">
<t>An EBML file always starts with 0x1A. The 0x1A makes the DOS command &quot;type&quot; ends display. That way you can include ASCII text before the EBML data and it can be displayed. The EBML parser is safe from false-alarm with these ASCII only codes.
</t>
<t>Next the EBML header is stored. This allows the the parser to know what type of EBML file it is parsing.
</t>
</section>

<section anchor="block-timecodes" title="Block Timecodes">
<t>The Block's timecode is signed integer that represents the Raw Timecode relative to the <eref target="{{site.baseurl}}/index.html#Cluster">Cluster's</eref> <eref target="{{site.baseurl}}/index.html#Timecode">Timecode</eref>, multiplied by the TimecodeScale (see the <eref target="{{site.baseurl}}/notes.html#TimecodeScale">TimecodeScale notes</eref>).
</t>
<t>The Block's timecode is represented by a 16bit signed integer (sint16). This means that the Block's timecode has a range of -32768 to +32767 units. When using the default value of TimecodeScale, each integer represents 1ms. So, the maximum time span of Blocks in a Cluster using the default TimecodeScale of 1ms is 65536ms.
</t>
<t>If a <eref target="{{site.baseurl}}/index.html#Cluster">Cluster's</eref> <eref target="{{site.baseurl}}/index.html#Timecode">Timecode</eref> is set to zero, it is possible to have Blocks with a negative Raw Timecode. Blocks with a negative Raw Timecode are not valid.
</t>
</section>

<section anchor="default-decoded-field-duration" title="Default decoded field duration">
<t>The <spanx style="verb">DefaultDecodedFieldDuration</spanx> Element 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.
</t>
<t>If the video sequence is signaled as interlaced, then the period between two successive fields at the output of the decoding process equals DefaultDecodedFieldDuration.
</t>
<t>For video sequences signaled as progressive it is twice the value of DefaultDecodedFieldDuration.
</t>
<t>These values are valid at the end of the decoding process before post-processing like deinterlacing or inverse telecine is applied.
</t>
<t>Examples:
</t>
<t>
<list style="symbols">
<t>Blu-ray movie: 1000000000ns/(48/1.001) = 20854167ns</t>
<t>PAL broadcast/DVD: 1000000000ns/(50/1.000) = 20000000ns</t>
<t>N/ATSC broadcast: 1000000000ns/(60/1.001) = 16683333ns</t>
<t>hard-telecined DVD: 1000000000ns/(60/1.001) = 16683333ns (60 encoded interlaced fields per second)</t>
<t>soft-telecined DVD: 1000000000ns/(60/1.001) = 16683333ns (48 encoded interlaced fields per second, with &quot;repeat_first_field = 1&quot;)</t>
</list>
</t>
</section>

<section anchor="default-values" title="Default Values">
<t>The default value of an Element is assumed when not present in the data stream. It is assumed only in the scope of its Parent Element (for example <spanx style="verb">Language</spanx> in the scope of the <spanx style="verb">Track</spanx> element). If the <spanx style="verb">Parent Element</spanx> is not present or assumed, then the Element cannot be assumed.
</t>
</section>

<section anchor="drm" title="DRM">
<t>Digital Rights Management. See <eref target="{{site.baseurl}}/notes.html#Encryption">Encryption</eref>.
</t>
</section>

<section anchor="encryption" title="Encryption">
<t>Encryption in Matroska is designed in a very generic style that allows people to implement whatever form of encryption is best for them. It is easily possible to use the encryption framework in Matroska as a type of DRM.
</t>
<t>Because the encryption occurs within the Block, 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 ever decrypting them. This means that the data is more useful, without having to expose it, or go through the intensive process of decrypting.
</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 <spanx style="verb">ContentEncodings</spanx> Master-element under the <spanx style="verb">ContentEncryption</spanx> Element.
</t>
</section>

<section anchor="image-cropping" title="Image cropping">
<t>Thanks to the PixelCropXXX elements, it's possible to crop the image before being resized. That means the image size follows this path:
</t>
<t>PixelXXX (size of the coded image) -&gt; PixelCropXXX (size of the image to keep) -&gt; DisplayXXX (resized cropped image)
</t>
</section>

<section anchor="matroska-version-indicators" title="Matroska version indicators">
<t>The EBML Header each Matroska file starts with contains two version number fields that inform a reading application about what to expect. These are <spanx style="verb">DocTypeVersion</spanx> and <spanx style="verb">DocTypeReadVersion</spanx>.
</t>
<t><spanx style="verb">DocTypeVersion</spanx> MUST contain the highest Matroska version number of any Element present in the Matroska file. For example, a file using the SimpleBlock Element MUST have a <spanx style="verb">DocTypeVersion</spanx> of at least 2 while a file containing <spanx style="verb">CueRelativePosition</spanx> Elements MUST have a <spanx style="verb">DocTypeVersion</spanx> of at least 4.
</t>
<t>The <spanx style="verb">DocTypeReadVersion</spanx> MUST contain the minimum version number a reading application MUST at least support properly in order to play the file back (optionally with a reduced feature set). For example, if a file contains only Elements of version 2 or lower except for <spanx style="verb">CueRelativePosition</spanx> (which is a version 4 Matroska Element) then <spanx style="verb">DocTypeReadVersion</spanx> SHOULD still be set to 2 and not 4 because evaluating <spanx style="verb">CueRelativePosition</spanx> is not REQUIRED for standard playback -- it only makes seeking more precise if used.
</t>
<t><spanx style="verb">DocTypeVersion</spanx> MUST always be equal to or greater than <spanx style="verb">DocTypeReadVersion</spanx>.
</t>
<t>A reading application supporting Matroska version <spanx style="verb">V</spanx> MUST NOT refuse to read an application with <spanx style="verb">DocReadTypeVersion</spanx> equal to or lower than <spanx style="verb">V</spanx> even if <spanx style="verb">DocTypeVersion</spanx> is greater than <spanx style="verb">V</spanx>. See also the note about <eref target="{{site.baseurl}}/notes.html#unknown-elements">Unknown Elements</eref>.
</t>
</section>

<section anchor="mime-types" title="Mime Types">
<t>There is no IETF endorsed MIME type for Matroska files. But you can use the ones we have defined on our web server:
</t>
<t>
<list style="symbols">
<t>.mka : Matroska audio <spanx style="verb">audio/x-matroska</spanx></t>
<t>.mkv : Matroska video <spanx style="verb">video/x-matroska</spanx></t>
<t>.mk3d : Matroska 3D video <spanx style="verb">video/x-matroska-3d</spanx></t>
</list>
</t>
</section>

<section anchor="octet" title="Octet">
<t>An Octet refers to a byte made of 8 bits.
</t>
</section>

<section anchor="overlay-track" title="Overlay Track">
<t>Overlay tracks SHOULD be rendered in the same 'channel' as the track it's linked to. When content is found in such a track it is played on the rendering channel instead of the original track.
</t>
</section>

<section anchor="segment-position" title="Segment Position">
<t>The <spanx style="verb">Segment Position</spanx> of an <spanx style="verb">Element</spanx> refers to the position of the first octet of the <spanx style="verb">Element ID</spanx> of that <spanx style="verb">Element</spanx>, measured in octets, from the beginning of the <spanx style="verb">Element Data</spanx> section of the containing <spanx style="verb">Segment Element</spanx>. In other words, the <spanx style="verb">Segment Position</spanx> of an <spanx style="verb">Element</spanx> is the distance in octets from the beginning of its containing <spanx style="verb">Segment Element</spanx> minus the size of the <spanx style="verb">Element ID</spanx> and <spanx style="verb">Element Data Size</spanx> of that <spanx style="verb">Segment Element</spanx>. The <spanx style="verb">Segment Position</spanx> of the first <spanx style="verb">Child Element</spanx> of the <spanx style="verb">Segment Element</spanx> is 0. An <spanx style="verb">Element</spanx> which is not stored within a <spanx style="verb">Segment Element</spanx>, such as the <spanx style="verb">Elements</spanx> of the <spanx style="verb">EBML Header</spanx>, do not have a <spanx style="verb">Segment Position</spanx>.
</t>

<section anchor="segment-position-exception" title="Segment Position Exception">
<t><spanx style="verb">Elements</spanx> that are defined to store a <spanx style="verb">Segment Position</spanx> MAY define reserved values to indicate a special meaning.
</t>
</section>

<section anchor="example-of-segment-position" title="Example of Segment Position">
<t>This table presents an example of <spanx style="verb">Segment Position</spanx> by showing a hexadecimal representation of a very small Matroska file with labels to show the offsets in octets. The file contains a <spanx style="verb">Segment Element</spanx> with an <spanx style="verb">Element ID</spanx> of <spanx style="verb">0x18538067</spanx> and a <spanx style="verb">MuxingApp Element</spanx> with an <spanx style="verb">Element ID</spanx> of <spanx style="verb">0x4D80</spanx>.
</t>

<figure align="center"><artwork align="center">
     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></figure>
<t>In the above example, the <spanx style="verb">Element ID</spanx> of the <spanx style="verb">Segment Element</spanx> is stored at offset 16, the <spanx style="verb">Element Data Size</spanx> of the <spanx style="verb">Segment Element</spanx> is stored at offset 20, and the <spanx style="verb">Element Data</spanx> of the <spanx style="verb">Segment Element</spanx> is stored at offset 21.
</t>
<t>The <spanx style="verb">MuxingApp Element</spanx> is stored at offset 26. Since the <spanx style="verb">Segment Position</spanx> of an <spanx style="verb">Element</spanx> is calculated by subtracting the position of the <spanx style="verb">Element Data</spanx> of the containing <spanx style="verb">Segment Element</spanx> from the position of that <spanx style="verb">Element</spanx>, the <spanx style="verb">Segment Position</spanx> of <spanx style="verb">MuxingApp Element</spanx> in the above example is <spanx style="verb">26 - 21</spanx> or <spanx style="verb">5</spanx>.
</t>
</section>
</section>

<section anchor="raw-timecode" title="Raw Timecode">
<t>The exact time of an object represented in nanoseconds. To find out a Block's Raw Timecode, you need the Block's timecode, the <eref target="{{site.baseurl}}/index.html#Cluster">Cluster's</eref> <eref target="{{site.baseurl}}/index.html#Timecode">Timecode</eref>, and the TimecodeScale. For calculation, please see the see the TimecodeScale notes.
</t>
</section>

<section anchor="linked-segments" title="Linked Segments">
<t>Matroska provides several methods to link two or many Segments together to create a Linked Segment. A Linked Segment is a set of multiple Segments related together into a single presentation by using Hard Linking, Soft Linking, or Medium Linking. All Segments within a Linked Segment MUST utilize the same track numbers and timescale. All Segments within a Linked Segment MUST be stored within the same directory. All Segments within a Linked Segment MUST store a <spanx style="verb">SegmentUID</spanx>.
</t>

<section anchor="hard-linking" title="Hard Linking">
<t>Hard Linking (also called splitting) is the process of creating a Linked Segment by relating multiple Segments using the <spanx style="verb">PrevUID</spanx> and <spanx style="verb">NextUID</spanx> Elements. Within a Linked Segment the timestamps of each Segment MUST follow consecutively in linking order. With Hard Linking, the chapters of any Segment within the Linked Segment MUST only reference the current Segment. With Hard Linking, the <spanx style="verb">NextUID</spanx> and <spanx style="verb">PrevUID</spanx> MUST reference the respective <spanx style="verb">SegmentUID</spanx> values of the next and previous Segments. The first Segment of a Linked Segment MUST have a <spanx style="verb">NextUID</spanx> Element and MUST NOT have a <spanx style="verb">PrevUID</spanx> Element. The last Segment of a Linked Segment MUST have a <spanx style="verb">PrevUID</spanx> Element and MUST NOT have a <spanx style="verb">NextUID</spanx> Element. The middle Segments of a Linked Segment MUST have both a <spanx style="verb">NextUID</spanx> Element and a <spanx style="verb">PrevUID</spanx> Element.
</t>
<t>As an example four Segments MAY be Hard Linked as a Linked Segment through cross-referencing each other with <spanx style="verb">SegmentUID</spanx>, <spanx style="verb">PrevUID</spanx>, and <spanx style="verb">NextUID</spanx> as in this table.
</t>
<texttable>
<ttcol align="left">file name</ttcol>
<ttcol align="left">SegmentUID</ttcol>
<ttcol align="left">PrevUID</ttcol>
<ttcol align="left">NextUID</ttcol>

<c><spanx style="verb">start.mkv</spanx></c><c><spanx style="verb">71000c23cd31099853fbc94dd984a5dd</spanx></c><c>n/a</c><c><spanx style="verb">a77b3598941cb803eac0fcdafe44fac9</spanx></c>
<c><spanx style="verb">middle.mkv</spanx></c><c><spanx style="verb">a77b3598941cb803eac0fcdafe44fac9</spanx></c><c><spanx style="verb">71000c23cd31099853fbc94dd984a5dd</spanx></c><c><spanx style="verb">6c92285fa6d3e827b198d120ea3ac674</spanx></c>
<c><spanx style="verb">end.mkv</spanx></c><c><spanx style="verb">6c92285fa6d3e827b198d120ea3ac674</spanx></c><c><spanx style="verb">a77b3598941cb803eac0fcdafe44fac9</spanx></c><c>n/a</c>
</texttable>
</section>

<section anchor="soft-linking" title="Soft Linking">
<t>Soft Linking is used by codec chapters. They can reference another Segment and jump to that Segment. The way the Segments are described are internal to the chapter codec and unknown to the Matroska level. But there are Elements within the <spanx style="verb">Info</spanx> Element (such as <spanx style="verb">ChapterTranslate</spanx>) that can translate a value representing a Segment in the chapter codec and to the current <spanx style="verb">SegmentUID</spanx>. All Segments that could be used in a Linked Segment in this way SHOULD be marked as members of the same family via the SegmentFamily Element, so that the player can quickly switch from one to the other.
</t>
</section>

<section anchor="medium-linking" title="Medium Linking">
<t>Medium Linking creates relationships between Segments using Ordered Chapters and the <spanx style="verb">ChapterSegmentUID</spanx> Element. A Segment Edition with Ordered Chapters MAY contain Chapters that reference timestamp ranges from other Segments. The Segment referenced by the Ordered Chapter via the <spanx style="verb">ChapterSegmentUID</spanx> Element SHOULD be played as part of a Linked Segment. The timestamps of Segment content referenced by Ordered Chapters MUST be adjusted according to the cumulative duration of the the previous Ordered Chapters.
</t>
<t>As an example a file named <spanx style="verb">intro.mkv</spanx> could have a <spanx style="verb">SegmentUID</spanx> of <spanx style="verb">0xb16a58609fc7e60653a60c984fc11ead</spanx>. Another file called <spanx style="verb">program.mkv</spanx> could use a Chapter Edition that contains two Ordered Chapters. The first chapter references the Segment of <spanx style="verb">intro.mkv</spanx> with the use of a <spanx style="verb">ChapterSegmentUID</spanx>, <spanx style="verb">ChapterSegmentEditionUID</spanx>, <spanx style="verb">ChapterTimeStart</spanx> and optionally a <spanx style="verb">ChapterTimeEnd</spanx> element. The second chapter references content within the Segment of <spanx style="verb">program.mkv</spanx>. A player SHOULD recognize the Linked Segment created by the use of <spanx style="verb">ChapterSegmentUID</spanx> in an enabled Edition and present the reference content of the two Segments together.
</t>
</section>
</section>

<section anchor="timecode-types" title="Timecode Types">
<t>
<list style="symbols">
<t>Absolute Timecode = Block+Cluster</t>
<t>Relative Timecode = Block</t>
<t>Scaled Timecode = Block+Cluster</t>
<t>Raw Timecode = (Block+Cluster)<spanx style="emph">TimecodeScale</spanx>TrackTimecodeScale</t>
</list>
</t>
</section>

<section anchor="timecodescale" title="TimecodeScale">
<t>The <eref target="{{site.baseurl}}/index.html#TimecodeScale">TimecodeScale</eref> is used to calculate the Raw Timecode of a Block. The timecode is obtained by adding the Block's timecode to the <eref target="{{site.baseurl}}/index.html#Cluster">Cluster's</eref> <eref target="{{site.baseurl}}/index.html#Timecode">Timecode</eref>, and then multiplying that result by the TimecodeScale. The result will be the Block's Raw Timecode in nanoseconds. The formula for this would look like:
</t>

<figure align="center"><artwork align="center">
(a + b) * c

a = [Block's Timecode]({{site.baseurl}}/index.html#block-header)
b = [Cluster's](#cluster) [Timecode](#timecode)
c = [TimeCodeScale]({{site.baseurl}}/index.html#TimeCodeScale)
</artwork></figure>
<t>An example of this is, assume a <eref target="{{site.baseurl}}/index.html#Cluster">Cluster's</eref> <eref target="{{site.baseurl}}/index.html#Timecode">Timecode</eref> has a value of 564264, the Block has a Timecode of 1233, and the timecodescale is the default of 1000000.
</t>

<figure align="center"><artwork align="center">
(1233 + 564264) * 1000000 = 565497000000
</artwork></figure>
<t>So, the Block in this example has a specific time of 565497000000 in nanoseconds. In milliseconds this would be 565497ms.
</t>
</section>

<section anchor="timecodescale-rounding" title="TimecodeScale Rounding">
<t>Because the default value of TimecodeScale is 1000000, which makes each integer in the Cluster and Block timecodes equal 1ms, this is the most commonly used. When dealing with audio, this causes inaccuracy with where you are seeking to. 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, you want to be able to seek to the exact sample that a song begins at. If you seek a few sample ahead or behind then 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>It is usually true that when storing timecodes for an audio stream, the TimecodeScale MUST have an accuracy of at least that of the audio samplerate, otherwise there are rounding errors that prevent you from knowing the precise location of a sample. Here's how a program has to round each timecode 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 TimecodeScale MUST have at least the accuracy of the sample rate itself: 1000000000 / 44100 = 22675.7369614512. This value MUST always be truncated. Otherwise the accuracy will not suffice. So in this example the application will use 22675 for the TimecodeScale. The application could even use some lower value like 22674 which would allow it to be a little bit imprecise about the original timecodes. But more about that in a minute.
</t>
<t>Next the application wants to write sample number 52340 and calculates the timecode. This is easy. In order to calculate the Raw Timecode in ns all it has to do is calculate <spanx style="verb">RawTimecode = round(1000000000 * sample_number / sample_rate)</spanx>. Rounding at this stage is very important! The application might skip it if it choses a slightly smaller value for the TimecodeScale 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 <spanx style="verb">RawTimecode = round(1000000000 * 52340 / 44100) = round(1186848072.56236) = 1186848073</spanx>.
</t>
<t>The next step is to calculate the Absolute Timecode - that is the timecode that will be stored in the Matroska file. Here the application has to divide the Raw Timecode from the previous paragraph by the TimecodeScale factor and round the result: <spanx style="verb">AbsoluteTimecode = round(RawTimecode / TimecodeScale_facotr)</spanx> which will result in the following for our example: <spanx style="verb">AbsoluteTimecode = round(1186848073 / 22675) = round(52341.7011245866) = 52342</spanx>. 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 TimecodeScale factor 22675 and the audio sample rate 44100. Later it finds a data block with the Absolute Timecode of 52342. But how does it get the sample number from these numbers?
</t>
<t>First it has to calculate the Raw Timecode of the block it has just read. Here's no rounding involved, just an integer multiplication: <spanx style="verb">RawTimecode = AbsoluteTimecode * TimecodeScale_factor</spanx>. In our example: <spanx style="verb">RawTimecode = 52342 * 22675 = 1186854850</spanx>.
</t>
<t>The conversion from the RawTimecode to the sample number again requires rounding: <spanx style="verb">sample_number = round(RawTimecode * sample_rate / 1000000000)</spanx>. In our example: <spanx style="verb">sample_number = round(1186854850 * 44100 / 1000000000) = round(52340.298885) = 52340</spanx>. This is exactly the sample number that the previous program started with.
</t>
<t>Some general notes for a program:
</t>
<t>
<list style="numbers">
<t>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.</t>
<t>Always round if you divide. Always! If you don't you'll end up with situations in which you have a timecode in the Matroska file that does not correspond to the sample number that it started with. Using a slightly lower timecode scale factor can help here in that it removes the need for proper rounding in the conversion from sample number to Raw Timecode.</t>
</list>
</t>
</section>

<section anchor="track-flags" title="Track Flags">

<section anchor="default-flag" title="Default flag">
<t>The &quot;default track&quot; flag is a hint for the playback application and SHOULD always be changeable by the user. If the user wants to see or hear a track of a certain kind (audio, video, subtitles) and she hasn't chosen a specific track then the player SHOULD 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 SHOULD be chosen.
</t>
<t>Only one track of a kind MAY 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" title="Forced flag">
<t>The &quot;forced&quot; flag tells the playback application that it MUST 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 player SHOULD determined 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 for example).
</t>
</section>
</section>

<section anchor="tracktimecodescale" title="TrackTimecodeScale">
<t>The <eref target="{{site.baseurl}}/index.html#TrackTimeCodeScale">TrackTimecodeScale</eref> 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 TrackTimecodeScale 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>

<figure align="center"><artwork align="center">
Track 1: Video
Track 2: NTSC Audio
Track 3: PAL Audio
</artwork></figure>
<t>Because the NTSC track is at the original speed, it will used as the default value of 1.0 for its TrackTimecodeScale. The video will also be aligned to the NTSC track with the default value of 1.0.
</t>
<t>The TrackTimecodeScale 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>

<figure align="center"><artwork align="center">
(25 / 24) = ~ 1.04166666666666666667
</artwork></figure>
<t>When writing a file that uses a non-default TrackTimecodeScale, the values of the Block's timecode are whatever they would be when normally storing the track with a default value for the TrackTimecodeScale. However, the data is interleaved a little differently. Data SHOULD be interleaved by its <eref target="{{site.baseurl}}/notes.html#raw-timecode">Raw Timecode</eref> in the order handed back from the encoder. The Raw Timecode of a Block from a track using TrackTimecodeScale is calculated using:
</t>
<t><spanx style="verb">(Block's Timecode + Cluster's Timecode) * TimecodeScale * TrackTimecodeScale</spanx>
</t>
<t>So, a Block from the PAL track above that had a <eref target="{{site.baseurl}}/notes.html#timecode-types">Scaled Timecode</eref> of 100 seconds would have a Raw Timecode of 104.66666667 seconds, and so would be stored in that part of the file.
</t>
<t>When playing back a track using the TrackTimecodeScale, 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 timecodes from the PAL Audio track are scaled using the TrackTimecodeScale, resulting in the video playing back in synch with the audio.
</t>
<t>It would be possible for a player to also adjust the audio's samplerate at the same time as adjusting the timecodes 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) timecodes SHOULD 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 anchor="unknown-elements" title="Unknown elements">
<t>Matroska is based upon the principal 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 <eref target="{{site.baseurl}}/notes.html#matroska-version-indicators-doctypeversion-and-doctypereadversion">version indicators</eref> 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 Elements from a higher specification version number while signalling that a reading application MUST only support a lower version number properly in order to play it back (possibly with a reduced feature set). This implies that a reading application supporting at least Matroska version V reading a file whose DocTypeReadVersion field is equal to or lower than V MUST skip Matroska/EBML Elements it encounters but which it does not know about if that unknown element fits into the size constraints set by the current parent element.
</t>
</section>

<section anchor="multiplanar-and-3d-videos" title="Multi-planar and 3D videos">
<t>There are 2 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 <eref target="{{site.baseurl}}/index.html#StereoMode">StereoMode</eref> Element 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 (PixelWidth/PixelHeight) is the raw amount of pixels (for example 3840x1080 for full HD side by side) and the DisplayWidth/Height 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 2 frames together in a Block using lacing. The first frame is the left eye and the other frame is the right eye (or vice versa). The frames SHOULD 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. <eref target="{{site.baseurl}}/index.html#TrackOperation">TrackOperation</eref> with <eref target="{{site.baseurl}}/index.html#TrackCombinePlanes">TrackCombinePlanes</eref> do that. For more details look at <eref target="{{site.baseurl}}/notes.html#track-operation">how TrackOperation works</eref>.
</t>
<t>The 3D support is still in infancy and may evolve to support more features.
</t>
<t>The <eref target="{{site.baseurl}}/index.html#StereoMode">StereoMode</eref> 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. Readers may support these legacy files by checking Matroska v2 or 0x53B9. The olders values were 0: mono, 1: right eye, 2: left eye, 3: both eyes.
</t>
</section>

<section anchor="track-operation" title="Track Operation">
<t><eref target="{{site.baseurl}}/index.html#TrackOperation">TrackOperation</eref> allows combining multiple tracks to make a virtual one. It uses 2 separate system to combine tracks. One to create a 3D &quot;composition&quot; (left/right/background planes) and one to simplify join 2 tracks together to make a single track.
</t>
<t>A track created with TrackOperation 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 Cues corresponding to such a virtual track SHOULD be the sum of the Cues elements for each of the tracks it's composed of (when the Cues are defined per track).
</t>
<t>In the case of TrackJoinBlocks, the Blocks (from BlockGroup and SimpleBlock) of all the tracks SHOULD be used as if they were defined for this new virtual Track. When 2 Blocks have overlapping start or end timecodes, it's up to the underlying system to either drop some of these frames or render them the way they overlap. In the end this situation SHOULD be avoided when creating such tracks as you can never be sure of the end result on different platforms.
</t>
</section>

<section anchor="matroska-element-ordering-guidelines" title="Matroska Element Ordering Guidelines">
<t>Except for the EBML Header and the CRC-32 Element, the EBML specification does not require any particular storage order for Elements. The Matroska specification however defines mandates and recommendations for ordering certain Elements 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="toplevel-elements" title="Top-Level Elements">
<t>A valid Matroska file requires only one Top-Level Element, the <spanx style="verb">Info</spanx> Element; however, to be playable Matroska MUST also contain at least one <spanx style="verb">Tracks</spanx> and <spanx style="verb">Cluster</spanx> Element. The first <spanx style="verb">Info</spanx> Element and the first <spanx style="verb">Tracks</spanx> Element MUST either be stored before the first <spanx style="verb">Cluster</spanx> Element or both be referenced by a <spanx style="verb">SeekHead</spanx> Element which occurs before the first <spanx style="verb">Cluster</spanx> Element.
</t>
<t>After a Matroska file has been created it could still be edited. For example chapters, tags or attachments can be added. When new Top-Level Elements are added to a Matroska file the <spanx style="verb">SeekHead</spanx> Element(s) MUST be updated so that the <spanx style="verb">SeekHead</spanx> Element(s) itemize the identity and position of all Top-Level Elements. Editing, removing, or adding Elements to a Matroska file often requires that some existing Elements be voided or extended; therefore, it is RECOMMENDED to use Void Elements as padding in between Top-Level Elements.
</t>
</section>

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

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

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

<section anchor="info" title="Info">
<t>The first <spanx style="verb">Info</spanx> Element SHOULD occur before the first <spanx style="verb">Tracks</spanx> and first <spanx style="verb">Cluster</spanx> Element.
</t>
</section>

<section anchor="chapters" title="Chapters">
<t>The <spanx style="verb">Chapters</spanx> Element SHOULD be placed before the <spanx style="verb">Cluster</spanx> Element(s). The <spanx style="verb">Chapters</spanx> Element can be used during playback even if the user doesn't need to seek. It immediately gives the user information of what section is being read and what other sections are available. In the case of Ordered Chapters it RECOMMENDED to evaluate the logical linking even before starting playing anything. The <spanx style="verb">Chapters</spanx> Element SHOULD be placed before the first <spanx style="verb">Tracks</spanx> Element and after the first <spanx style="verb">Info</spanx> Element.
</t>
</section>

<section anchor="attachments" title="Attachments">
<t>The <spanx style="verb">Attachments</spanx> Element is not meant to use by default when playing the file, but could contain the cover art and/or fonts. Cover art is useful even before the file is played and fonts could be needed before playback starts for initialization of subtitles that could use them. The <spanx style="verb">Attachments</spanx> Element MAY be placed before the first <spanx style="verb">Cluster</spanx> Element; however if the <spanx style="verb">Attachments</spanx> Element is likely to be edited, then it SHOULD be placed after the last <spanx style="verb">Cluster</spanx> Element.
</t>
</section>

<section anchor="tags" title="Tags">
<t>The <spanx style="verb">Tags</spanx> Element is the one that is most subject to changes after the file was originally created. So for easier editing the <spanx style="verb">Tags</spanx> Element SHOULD be placed at the end of the <spanx style="verb">Segment</spanx> Element, even after the <spanx style="verb">Attachments</spanx> Element. On the other hand, it is inconvenient to have to seek in the <spanx style="verb">Segment</spanx> for tags especially for network streams. So it's better if the <spanx style="verb">Tags</spanx> Element(s) are found early in the stream. When editing the <spanx style="verb">Tags</spanx> Element(s), the original <spanx style="verb">Tags</spanx> Element at the beginning can be <eref target="{{site.baseurl}}/index.html#Void">voided</eref> and a new one <eref target="{{site.baseurl}}/order_guidelines.html#tags-end">written right at the end</eref> of the <spanx style="verb">Segment</spanx> Element. The file size will only marginally change.
</t>
</section>

<section anchor="optimum-layout-from-a-muxer" title="Optimum layout from a muxer">
<t>
<list style="symbols">
<t>SeekHead</t>
<t>Info</t>
<t>Tracks</t>
<t>Chapters</t>
<t>Attachments</t>
<t>Tags</t>
<t>Clusters</t>
<t>Cues</t>
</list>
</t>
</section>

<section anchor="optimum-layout-after-editing-tags" title="Optimum layout after editing tags">
<t>
<list style="symbols">
<t>SeekHead</t>
<t>Info</t>
<t>Tracks</t>
<t>Chapters</t>
<t>Attachments</t>
<t>Void</t>
<t>Clusters</t>
<t>Cues</t>
<t>Tags</t>
</list>
</t>
</section>

<section anchor="optimum-layout-with-cues-at-the-front" title="Optimum layout with Cues at the front">
<t>
<list style="symbols">
<t>SeekHead</t>
<t>Info</t>
<t>Tracks</t>
<t>Chapters</t>
<t>Attachments</t>
<t>Tags</t>
<t>Cues</t>
<t>Clusters</t>
</list>
</t>
</section>

<section anchor="cluster-timecode" title="Cluster Timecode">
<t>As each <spanx style="verb">BlockGroup</spanx> and <spanx style="verb">SimpleBlock</spanx> of a <spanx style="verb">Cluster</spanx> Element needs the Cluster <spanx style="verb">Timecode</spanx>, the <spanx style="verb">Timecode</spanx> Element MUST occur as the first Child Element within the <spanx style="verb">Cluster</spanx> Element.
</t>
</section>
</section>

<section anchor="codec-mappings" title="Codec Mappings">
<t>A <spanx style="verb">Codec Mapping</spanx> is a set of attributes to identify, name, and contextualise the format and characteristics of encoded data that can be contained within Matroska Clusters.
</t>
<t>Each TrackEntry used within Matroska MUST reference a defined <spanx style="verb">Codec Mapping</spanx> using the <spanx style="verb">Codec ID</spanx> to identify and describe the format of the encoded data in its associated Clusters. This <spanx style="verb">Codec ID</spanx> is a unique registered identifier that represents the encoding stored within the Track. Certain encodings MAY also require some form of codec initialisation in order to provide its decoder with context and technical metadata.
</t>
<t>The intention behind this list is not to list all existing audio and video codecs, but rather to list those codecs that are currently supported in Matroska and therefore need a well defined <spanx style="verb">Codec ID</spanx> so that all developers supporting Matroska will use the same <spanx style="verb">Codec ID</spanx>. If you feel we missed support for a very important codec, please tell us on our development mailing list (cellar at ietf.org).
</t>

<section anchor="defining-matroska-codec-support" title="Defining Matroska Codec Support">
<t>Support for a codec is defined in Matroska with the following values.
</t>

<section anchor="codec-id" title="Codec ID">
<t>Each codec supported for storage in Matroska MUST have a unique <spanx style="verb">Codec ID</spanx>. Each <spanx style="verb">Codec ID</spanx> MUST be prefixed with the string from the following table according to the associated type of the codec. All characters of a <spanx style="verb">Codec ID Prefix</spanx> MUST be capital letters (A-Z) except for the last character of a <spanx style="verb">Codec ID Prefix</spanx> which MUST be an underscore (&quot;_&quot;).
</t>
<t>Codec Type | Codec ID Prefix
Video      | &quot;V_&quot;
Audio      | &quot;A_&quot;
Subtitle   | &quot;S_&quot;
Button     | &quot;B_&quot;
</t>
<t>Each <spanx style="verb">Codec ID</spanx> MUST include a <spanx style="verb">Major Codec ID</spanx> immediately following the <spanx style="verb">Codec ID Prefix</spanx>. A <spanx style="verb">Major Codec ID</spanx> MAY be followed by an OPTIONAL <spanx style="verb">Codec ID Suffix</spanx> to communicate a refinement of the <spanx style="verb">Major Codec ID</spanx>. If a <spanx style="verb">Codec ID Suffix</spanx> is used, then the <spanx style="verb">Codec ID</spanx> MUST include a forward slash (&quot;/&quot;) as a separator between the <spanx style="verb">Major Codec ID</spanx> and the <spanx style="verb">Codec ID Suffix</spanx>. The <spanx style="verb">Major Codec ID</spanx> MUST be composed of only capital letters (A-Z) and numbers (0-9). The <spanx style="verb">Codec ID Suffix</spanx> MUST be composed of only capital letters (A-Z), numbers (0-9), underscore (&quot;_&quot;), and forward slash (&quot;/&quot;).
</t>
<t>The following table provides examples of valid <spanx style="verb">Codec IDs</spanx> and their components:
</t>
<t>Codec ID Prefix | Major Codec ID | Separator | Codec ID Suffix | Codec ID
A_              | AAC            | /         | MPEG2/LC/SBR    | A<spanx style="emph">AAC/MPEG2/LC/SBR
V</spanx>              | V_MPEG4        | /         | ISO/ASP         | V<spanx style="emph">MPEG4/ISO/ASP
V</spanx>              | MPEG1          |           |                 | V_MPEG1
</t>
</section>

<section anchor="codec-name" title="Codec Name">
<t>Each encoding supported for storage in Matroska MUST have a Codec Name. The Codec Name provides a readable label for the encoding.
</t>
</section>

<section anchor="description" title="Description">
<t>An optional description for the encoding. This value is only intended for human consumption.
</t>
</section>

<section anchor="initialisation" title="Initialisation">
<t>Each encoding supported for storage in Matroska MUST have a defined Initialisation. The Initialisation MUST describe the storage of data necessary to initialise the decoder, which MUST be stored within the <spanx style="verb">CodecPrivate Element</spanx>. When the Initialisation is updated within a track then that updated Initialisation data MUST be written into the <spanx style="verb">CodecState Element</spanx> of the first <spanx style="verb">Cluster</spanx> to require it. If the encoding does not require any form of Initialisation then <spanx style="verb">none</spanx> MUST be used to define the Initialisation and the <spanx style="verb">CodecPrivate Element</spanx> SHOULD NOT be written and MUST be ignored. Data that is defined Initialisation to be stored in the <spanx style="verb">CodecPrivate Element</spanx> is known as <spanx style="verb">Private Data</spanx>.
</t>
</section>

<section anchor="citation" title="Citation">
<t>Documentation of the associated normative and informative references for the codec is RECOMMENDED.
</t>
</section>

<section anchor="deprecation-date" title="Deprecation Date">
<t>A timestamp, expressed in <xref target="RFC3339"/> that notes when support for the <spanx style="verb">Codec Mapping</spanx> within Matroska was deprecated. If a <spanx style="verb">Codec Mapping</spanx> is defined with a <spanx style="verb">Deprecation Date</spanx>, then it is RECOMMENDED that Matroska writers SHOULD NOT use the <spanx style="verb">Codec Mapping</spanx> after the <spanx style="verb">Deprecation Date</spanx>.
</t>
</section>

<section anchor="superseded-by" title="Superseded By">
<t>A <spanx style="verb">Codec Mapping</spanx> MAY only be defined with a <spanx style="verb">Superseded By</spanx> value, if it has an expressed <spanx style="verb">Deprecation Date</spanx>. If used, the <spanx style="verb">Superseded By</spanx> value MUST store the <spanx style="verb">Codec ID</spanx> of another <spanx style="verb">Codec Mapping</spanx> that has superseded the <spanx style="verb">Codec Mapping</spanx>.
</t>
</section>
</section>

<section anchor="video-codec-mappings" title="Video Codec Mappings">

<section anchor="vmsvfwfourcc" title="V_MS/VFW/FOURCC">
<t>Codec ID: <spanx style="verb">V_MS/VFW/FOURCC</spanx>
</t>
<t>Codec Name: Microsoft (TM) Video Codec Manager (VCM)
</t>
<t>Description: The private data contains the VCM structure BITMAPINFOHEADER including the extra private bytes, as <eref target="https://msdn.microsoft.com/en-us/library/windows/desktop/dd318229(v=vs.85).aspx">defined by Microsoft</eref>. The data are stored in little endian format (like on IA32 machines). Where is the Huffman table stored in HuffYUV, not AVISTREAMINFO ??? And the FourCC, not in AVISTREAMINFO.fccHandler ???
</t>
<t>Initialisation: <spanx style="verb">Private Data</spanx> contains the VCM structure BITMAPINFOHEADER including the extra private bytes, as defined by Microsoft in <eref target="https://msdn.microsoft.com/en-us/library/windows/desktop/dd183376(v=vs.85).aspx"/>.
</t>
<t>Citation: <eref target="https://msdn.microsoft.com/en-us/library/windows/desktop/dd183376(v=vs.85).aspx"/>
</t>
</section>

<section anchor="vuncompressed" title="V_UNCOMPRESSED">
<t>Codec ID: V_UNCOMPRESSED
</t>
<t>Codec Name: Video, raw uncompressed video frames
</t>
<t>Description: All details about the used colour specs and bit depth are to be put/read from the KaxCodecColourSpace elements.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="vmpeg4isosp" title="V_MPEG4/ISO/SP">
<t>Codec ID: V_MPEG4/ISO/SP
</t>
<t>Codec Name: MPEG4 ISO simple profile (DivX4)
</t>
<t>Description: Stream was created via improved codec API (UCI) or even transmuxed from AVI (no b-frames in Simple Profile), frame order is coding order.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="vmpeg4isoasp" title="V_MPEG4/ISO/ASP">
<t>Codec ID: V_MPEG4/ISO/ASP
</t>
<t>Codec Name: MPEG4 ISO advanced simple profile (DivX5, XviD, FFMPEG)
</t>
<t>Description: Stream was created via improved codec API (UCI) or transmuxed from MP4, not simply transmuxed from AVI. Note there are differences how b-frames are handled in these native streams, when being compared to a VfW created stream, as here there are <spanx style="verb">no</spanx> dummy frames inserted, the frame order is exactly the same as the coding order, same as in MP4 streams.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="vmpeg4isoap" title="V_MPEG4/ISO/AP">
<t>Codec ID: V_MPEG4/ISO/AP
</t>
<t>Codec Name: MPEG4 ISO advanced profile
</t>
<t>Description: Stream was created via improved codec API (UCI) or transmuxed from MP4, not simply transmuxed from AVI. Note there are differences how b-frames are handled in these native streams, when being compared to a VfW created stream, as here there are <spanx style="verb">no</spanx> dummy frames inserted, the frame order is exactly the same as the coding order, same as in MP4 streams.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="vmpeg4msv3" title="V_MPEG4/MS/V3">
<t>Codec ID: V_MPEG4/MS/V3
</t>
<t>Codec Name: Microsoft (TM) MPEG4 V3
</t>
<t>Description: Microsoft (TM) MPEG4 V3 and derivates, means DivX3, Angelpotion, SMR, etc.; stream was created using VfW codec or transmuxed from AVI; note that V1/V2 are covered in VfW compatibility mode.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="vmpeg1" title="V_MPEG1">
<t>Codec ID: V_MPEG1
</t>
<t>Codec Name: MPEG 1
</t>
<t>Description: The Matroska video stream will contain a demuxed Elementary Stream (ES), where block boundaries are still to be defined. Its RECOMMENDED to use MPEG2MKV.exe for creating those files, and to compare the results with self-made implementations
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="vmpeg2" title="V_MPEG2">
<t>Codec ID: V_MPEG2
</t>
<t>Codec Name: MPEG 2
</t>
<t>Description: The Matroska video stream will contain a demuxed Elementary Stream (ES), where block boundaries are still to be defined. Its RECOMMENDED to use MPEG2MKV.exe for creating those files, and to compare the results with self-made implementations
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="vrealrv10" title="V_REAL/RV10">
<t>Codec ID: V_REAL/RV10
</t>
<t>Codec Name: RealVideo 1.0 aka RealVideo 5
</t>
<t>Description: Individual slices from the Real container are combined into a single frame.
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains a <spanx style="verb">real_video_props_t</spanx> structure in Big Endian byte order as found in <eref target="https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/librmff.h">librmff</eref>.
</t>
</section>

<section anchor="vrealrv20" title="V_REAL/RV20">
<t>Codec ID: V_REAL/RV20
</t>
<t>Codec Name: RealVideo G2 and RealVideo G2+SVT
</t>
<t>Description: Individual slices from the Real container are combined into a single frame.
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains a <spanx style="verb">real_video_props_t</spanx> structure in Big Endian byte order as found in <eref target="https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/librmff.h">librmff</eref>.
</t>
</section>

<section anchor="vrealrv30" title="V_REAL/RV30">
<t>Codec ID: V_REAL/RV30
</t>
<t>Codec Name: RealVideo 8
</t>
<t>Description: Individual slices from the Real container are combined into a single frame.
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains a <spanx style="verb">real_video_props_t</spanx> structure in Big Endian byte order as found in <eref target="https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/librmff.h">librmff</eref>.
</t>
</section>

<section anchor="vrealrv40" title="V_REAL/RV40">
<t>Codec ID: V_REAL/RV40
</t>
<t>Codec Name: rv40 : RealVideo 9
</t>
<t>Description: Individual slices from the Real container are combined into a single frame.
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains a <spanx style="verb">real_video_props_t</spanx> structure in Big Endian byte order as found in <eref target="https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/librmff.h">librmff</eref>.
</t>
</section>

<section anchor="vquicktime" title="V_QUICKTIME">
<t>Codec ID: V_QUICKTIME
</t>
<t>Codec Name: Video taken from QuickTime(TM) files
</t>
<t>Description: Several codecs as stored in QuickTime, e.g. Sorenson or Cinepak.
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains all additional data that is stored in the 'stsd' (sample description) atom in the QuickTime file <spanx style="strong">after</spanx> the mandatory video descriptor structure (starting with the size and FourCC fields). For an explanation of the QuickTime file format read <eref target="https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFPreface/qtffPreface.html">QuickTime File Format Specification</eref>.
</t>
</section>

<section anchor="vtheora" title="V_THEORA">
<t>Codec ID: V_THEORA
</t>
<t>Codec Name: Theora
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains the first three Theora packets in order. The lengths of the packets precedes them. The actual layout is:
</t>
<t>
<list style="symbols">
<t>Byte 1: number of distinct packets '<spanx style="verb">#p</spanx>' minus one inside the CodecPrivate block. This MUST be '2' for current (as of 2016-07-08) Theora headers.</t>
<t>Bytes 2..n: lengths of the first '<spanx style="verb">#p</spanx>' packets, coded in <eref target="{{site.baseurl}}/index.html#lacing">Xiph-style lacing</eref>. The length of the last packet is the length of the CodecPrivate block minus the lengths coded in these bytes minus one.</t>
<t>Bytes n+1..: The Theora identification header, followed by the commend header followed by the codec setup header. Those are described in the <eref target="http://www.theora.org/doc/Theora.pdf">Theora specs</eref>.</t>
</list>
</t>
</section>

<section anchor="vprores" title="V_PRORES">
<t>Codec ID: V_PRORES
</t>
<t>Codec Name: Apple ProRes
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains the fourcc as found in MP4 movies:
</t>
<t>
<list style="symbols">
<t>apch: ProRes 422 High Quality</t>
<t>apcn: ProRes 422 Standard Definition</t>
<t>apcs: ProRes 422 LT</t>
<t>apco: ProRes 422 Proxy</t>
<t>ap4h: ProRes 4444</t>
</list>
</t>
<t><eref target="http://wiki.multimedia.cx/index.php?title=Apple_ProRes#Frame_layout">this page for more technical details on ProRes</eref>
</t>
</section>

<section anchor="vvp8" title="V_VP8">
<t>Codec ID: V_VP8
</t>
<t>Codec Name: VP8 Codec format
</t>
<t>Description: VP8 is an open and royalty free video compression format developed by Google and created by On2 Technologies as a successor to VP7. <xref target="RFC6386"/>
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="vvp9" title="V_VP9">
<t>Codec ID: V_VP9
</t>
<t>Codec Name: VP9 Codec format
</t>
<t>Description: VP9 is an open and royalty free video compression format developed by Google as a successor to VP8. <eref target="https://www.webmproject.org/vp9/">Draft VP9 Bitstream and Decoding Process Specification</eref>
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="vffv1" title="V_FFV1">
<t>Codec ID: V_FFV1
</t>
<t>Codec Name: FF Video Codec 1
</t>
<t>Description: FFV1 is a lossless intra-frame video encoding format designed to efficiently compress video data in a variety of pixel formats. Compared to uncompressed video, FFV1 offers storage compression, frame fixity, and self-description, which makes FFV1 useful as a preservation or intermediate video format. <eref target="https://datatracker.ietf.org/doc/draft-niedermayer-cellar-ffv1/">Draft FFV1 Specification</eref>
</t>
<t>Initialisation: For FFV1 versions 0 or 1, <spanx style="verb">Private Data</spanx> SHOULD NOT be written. For FFV1 version 3 or greater, the <spanx style="verb">Private Data</spanx> MUST contain the FFV1 Configuration Record structure, as defined in <eref target="https://tools.ietf.org/html/draft-niedermayer-cellar-ffv1-01#section-4.1"/>, and no other data.
</t>
</section>
</section>

<section anchor="audio-codec-mappings" title="Audio Codec Mappings">

<section anchor="ampegl3" title="A_MPEG/L3">
<t>Codec ID: A_MPEG/L3
</t>
<t>Codec Name: MPEG Audio 1, 2, 2.5 Layer III
</t>
<t>Description: The data contain everything needed for playback in the MPEG Audio header of each frame. Corresponding ACM wFormatTag : 0x0055
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="ampegl2" title="A_MPEG/L2">
<t>Codec ID: A_MPEG/L2
</t>
<t>Codec Name: MPEG Audio 1, 2 Layer II
</t>
<t>Description: The data contain everything needed for playback in the MPEG Audio header of each frame. Corresponding ACM wFormatTag : 0x0050
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="ampegl1" title="A_MPEG/L1">
<t>Codec ID: A_MPEG/L1
</t>
<t>Codec Name: MPEG Audio 1, 2 Layer I
</t>
<t>Description: The data contain everything needed for playback in the MPEG Audio header of each frame. Corresponding ACM wFormatTag : 0x0050
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="apcmintbig" title="A_PCM/INT/BIG">
<t>Codec ID: A_PCM/INT/BIG
</t>
<t>Codec Name: PCM Integer Big Endian
</t>
<t>Description: The bitdepth has to be read and set from KaxAudioBitDepth element. Corresponding ACM wFormatTag : ???
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="apcmintlit" title="A_PCM/INT/LIT">
<t>Codec ID: A_PCM/INT/LIT
</t>
<t>Codec Name: PCM Integer Little Endian
</t>
<t>Description: The bitdepth has to be read and set from KaxAudioBitDepth element. Corresponding ACM wFormatTag : 0x0001
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="apcmfloatieee" title="A_PCM/FLOAT/IEEE">
<t>Codec ID: A_PCM/FLOAT/IEEE
</t>
<t>Codec Name: Floating Point, IEEE compatible
</t>
<t>Description: The bitdepth has to be read and set from KaxAudioBitDepth element (32 bit in most cases). The float are stored in little endian order (most common float format). Corresponding ACM wFormatTag : 0x0003
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="ampc" title="A_MPC">
<t>Codec ID: A_MPC
</t>
<t>Codec Name: MPC (musepack) SV8
</t>
<t>Description: The main developer for musepack has requested that we wait until the SV8 framing has been fully defined for musepack before defining how to store it in Matroska.
</t>
</section>

<section anchor="aac3" title="A_AC3">
<t>Codec ID: A_AC3
</t>
<t>Codec Name: (Dolby™) AC3
</t>
<t>Description: BSID &lt;= 8 !! The private data is void ??? Corresponding ACM wFormatTag : 0x2000 ; channel number have to be read from the corresponding audio element
</t>
</section>

<section anchor="aac3bsid9" title="A_AC3/BSID9">
<t>Codec ID: A_AC3/BSID9
</t>
<t>Codec Name: (Dolby™) AC3
</t>
<t>Description: The ac3 frame header has, similar to the mpeg-audio header a version field. Normal ac3 is defined as bitstream id 8 (5 Bits, numbers are 0-15). Everything below 8 is still compatible with all decoders that handle 8 correctly. Everything higher are additions that break decoder compatibility.
For the samplerates 24kHz (00); 22,05kHz (01) and 16kHz (10) the BSID is 9
For the samplerates 12kHz (00); 11,025kHz (01) and 8kHz (10) the BSID is 10
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="aac3bsid10" title="A_AC3/BSID10">
<t>Codec ID: A_AC3/BSID10
</t>
<t>Codec Name: (Dolby™) AC3
</t>
<t>Description: The ac3 frame header has, similar to the mpeg-audio header a version field. Normal ac3 is defined as bitstream id 8 (5 Bits, numbers are 0-15). Everything below 8 is still compatible with all decoders that handle 8 correctly. Everything higher are additions that break decoder compatibility.
For the samplerates 24kHz (00); 22,05kHz (01) and 16kHz (10) the BSID is 9
For the samplerates 12kHz (00); 11,025kHz (01) and 8kHz (10) the BSID is 10
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="aalac" title="A_ALAC">
<t>Codec ID: A_ALAC
</t>
<t>Codec Name: ALAC (Apple Lossless Audio Codec)
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains ALAC's magic cookie (both the codec specific configuration as well as the optional channel layout information). Its format is described in <eref target="http://alac.macosforge.org/trac/browser/trunk/ALACMagicCookieDescription.txt">ALAC's official source code</eref>.
</t>
</section>

<section anchor="adts" title="A_DTS">
<t>Codec ID: A_DTS
</t>
<t>Codec Name: Digital Theatre System
</t>
<t>Description: Supports DTS, DTS-ES, DTS-96/26, DTS-HD High Resolution Audio and DTS-HD Master Audio. The private data is void. Corresponding ACM wFormatTag : 0x2001
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="adtsexpress" title="A_DTS/EXPRESS">
<t>Codec ID: A_DTS/EXPRESS
</t>
<t>Codec Name: Digital Theatre System Express
</t>
<t>Description: DTS Express (a.k.a. LBR) audio streams. The private data is void. Corresponding ACM wFormatTag : 0x2001
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="adtslossless" title="A_DTS/LOSSLESS">
<t>Codec ID: A_DTS/LOSSLESS
</t>
<t>Codec Name: Digital Theatre System Lossless
</t>
<t>Description: DTS Lossless audio that does not have a core substream. The private data is void. Corresponding ACM wFormatTag : 0x2001
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="avorbis" title="A_VORBIS">
<t>Codec ID: A_VORBIS
</t>
<t>Codec Name: Vorbis
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains the first three Vorbis packet in order. The lengths of the packets precedes them. The actual layout is:
- Byte 1: number of distinct packets '<spanx style="verb">#p</spanx>' minus one inside the CodecPrivate block. This MUST be '2' for current (as of 2016-07-08) Vorbis headers.
- Bytes 2..n: lengths of the first '<spanx style="verb">#p</spanx>' packets, coded in <eref target="{{site.baseurl}}/index.html#lacing">Xiph-style lacing</eref>. The length of the last packet is the length of the CodecPrivate block minus the lengths coded in these bytes minus one.
- Bytes n+1..: The <eref target="https://xiph.org/vorbis/doc/Vorbis_I_spec.html">Vorbis identification header</eref>, followed by the <eref target="https://xiph.org/vorbis/doc/v-comment.html">Vorbis comment header</eref> followed by the <eref target="https://xiph.org/vorbis/doc/Vorbis_I_spec.html">codec setup header</eref>.
</t>
</section>

<section anchor="aflac" title="A_FLAC">
<t>Codec ID: A_FLAC
</t>
<t>Codec Name: <eref target="http://flac.sourceforge.net/">FLAC (Free Lossless Audio Codec)</eref>
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains all the header/metadata packets before the first data packet. These include the first header packet containing only the word <spanx style="verb">fLaC</spanx> as well as all metadata packets.
</t>
</section>

<section anchor="areal144" title="A_REAL/14_4">
<t>Codec ID: A_REAL/14_4
</t>
<t>Codec Name: Real Audio 1
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains either the &quot;real_audio_v4_props_t&quot; or the &quot;real_audio_v5_props_t&quot; structure (differentiated by their &quot;version&quot; field; Big Endian byte order) as found in <eref target="https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/librmff.h">librmff</eref>.
</t>
</section>

<section anchor="areal288" title="A_REAL/28_8">
<t>Codec ID: A_REAL/28_8
</t>
<t>Codec Name: Real Audio 2
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains either the &quot;real_audio_v4_props_t&quot; or the &quot;real_audio_v5_props_t&quot; structure (differentiated by their &quot;version&quot; field; Big Endian byte order) as found in <eref target="https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/librmff.h">librmff</eref>.
</t>
</section>

<section anchor="arealcook" title="A_REAL/COOK">
<t>Codec ID: A_REAL/COOK
</t>
<t>Codec Name: Real Audio Cook Codec (codename: Gecko)
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains either the &quot;real_audio_v4_props_t&quot; or the &quot;real_audio_v5_props_t&quot; structure (differentiated by their &quot;version&quot; field; Big Endian byte order) as found in <eref target="https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/librmff.h">librmff</eref>.
</t>
</section>

<section anchor="arealsipr" title="A_REAL/SIPR">
<t>Codec ID: A_REAL/SIPR
</t>
<t>Codec Name: Sipro Voice Codec
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains either the &quot;real_audio_v4_props_t&quot; or the &quot;real_audio_v5_props_t&quot; structure (differentiated by their &quot;version&quot; field; Big Endian byte order) as found in <eref target="https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/librmff.h">librmff</eref>.
</t>
</section>

<section anchor="arealralf" title="A_REAL/RALF">
<t>Codec ID: A_REAL/RALF
</t>
<t>Codec Name: Real Audio Lossless Format
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains either the &quot;real_audio_v4_props_t&quot; or the &quot;real_audio_v5_props_t&quot; structure (differentiated by their &quot;version&quot; field; Big Endian byte order) as found in <eref target="https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/librmff.h">librmff</eref>.
</t>
</section>

<section anchor="arealatrc" title="A_REAL/ATRC">
<t>Codec ID: A_REAL/ATRC
</t>
<t>Codec Name: Sony Atrac3 Codec
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains either the &quot;real_audio_v4_props_t&quot; or the &quot;real_audio_v5_props_t&quot; structure (differentiated by their &quot;version&quot; field; Big Endian byte order) as found in <eref target="https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/librmff.h">librmff</eref>.
</t>
</section>

<section anchor="amsacm" title="A_MS/ACM">
<t>Codec ID: A_MS/ACM
</t>
<t>Codec Name: Microsoft(TM) Audio Codec Manager (ACM)
</t>
<t>Description: The data are stored in little endian format (like on IA32 machines).
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains the ACM structure WAVEFORMATEX including the extra private bytes, as <eref target="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/mmstr_625u.asp">defined by Microsoft</eref>.
</t>
</section>

<section anchor="aaacmpeg2main" title="A_AAC/MPEG2/MAIN">
<t>Codec ID: A_AAC/MPEG2/MAIN
</t>
<t>Codec Name: MPEG2 Main Profile
</t>
<t>Description: Channel number and sample rate have to be read from the corresponding audio element. Audio stream is stripped from ADTS headers and normal Matroska frame based muxing scheme is applied. AAC audio always uses wFormatTag 0xFF.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="aaacmpeg2lc" title="A_AAC/MPEG2/LC">
<t>Codec ID: A_AAC/MPEG2/LC
</t>
<t>Codec Name: Low Complexity
</t>
<t>Description: Channel number and sample rate have to be read from the corresponding audio element. Audio stream is stripped from ADTS headers and normal Matroska frame based muxing scheme is applied. AAC audio always uses wFormatTag 0xFF.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="aaacmpeg2lcsbr" title="A_AAC/MPEG2/LC/SBR">
<t>Codec ID: A_AAC/MPEG2/LC/SBR
</t>
<t>Codec Name: Low Complexity with Spectral Band Replication
</t>
<t>Description: Channel number and sample rate have to be read from the corresponding audio element. Audio stream is stripped from ADTS headers and normal Matroska frame based muxing scheme is applied. AAC audio always uses wFormatTag 0xFF.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="aaacmpeg2ssr" title="A_AAC/MPEG2/SSR">
<t>Codec ID: A_AAC/MPEG2/SSR
</t>
<t>Codec Name: Scalable Sampling Rate
</t>
<t>Description: Channel number and sample rate have to be read from the corresponding audio element. Audio stream is stripped from ADTS headers and normal Matroska frame based muxing scheme is applied. AAC audio always uses wFormatTag 0xFF.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="aaacmpeg4main" title="A_AAC/MPEG4/MAIN">
<t>Codec ID: A_AAC/MPEG4/MAIN
</t>
<t>Codec Name: MPEG4 Main Profile
</t>
<t>Description: Channel number and sample rate have to be read from the corresponding audio element. Audio stream is stripped from ADTS headers and normal Matroska frame based muxing scheme is applied. AAC audio always uses wFormatTag 0xFF.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="aaacmpeg4lc" title="A_AAC/MPEG4/LC">
<t>Codec ID: A_AAC/MPEG4/LC
</t>
<t>Codec Name: Low Complexity
</t>
<t>Description: Channel number and sample rate have to be read from the corresponding audio element. Audio stream is stripped from ADTS headers and normal Matroska frame based muxing scheme is applied. AAC audio always uses wFormatTag 0xFF.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="aaacmpeg4lcsbr" title="A_AAC/MPEG4/LC/SBR">
<t>Codec ID: A_AAC/MPEG4/LC/SBR
</t>
<t>Codec Name: Low Complexity with Spectral Band Replication
</t>
<t>Description: Channel number and sample rate have to be read from the corresponding audio element. Audio stream is stripped from ADTS headers and normal Matroska frame based muxing scheme is applied. AAC audio always uses wFormatTag 0xFF.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="aaacmpeg4ssr" title="A_AAC/MPEG4/SSR">
<t>Codec ID: A_AAC/MPEG4/SSR
</t>
<t>Codec Name: Scalable Sampling Rate
</t>
<t>Description: Channel number and sample rate have to be read from the corresponding audio element. Audio stream is stripped from ADTS headers and normal Matroska frame based muxing scheme is applied. AAC audio always uses wFormatTag 0xFF.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="aaacmpeg4ltp" title="A_AAC/MPEG4/LTP">
<t>Codec ID: A_AAC/MPEG4/LTP
</t>
<t>Codec Name: Long Term Prediction
</t>
<t>Description: Channel number and sample rate have to be read from the corresponding audio element. Audio stream is stripped from ADTS headers and normal Matroska frame based muxing scheme is applied. AAC audio always uses wFormatTag 0xFF.
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="aquicktime" title="A_QUICKTIME">
<t>Codec ID: A_QUICKTIME
</t>
<t>Codec Name: Audio taken from QuickTime(TM) files
</t>
<t>Description: Several codecs as stored in QuickTime, e.g. QDesign Music v1 or v2.
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains all additional data that is stored in the 'stsd' (sample description) atom in the QuickTime file <spanx style="strong">after</spanx> the mandatory sound descriptor structure (starting with the size and FourCC fields). For an explanation of the QuickTime file format read <eref target="https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFPreface/qtffPreface.html">QuickTime File Format Specification</eref>.
</t>
</section>

<section anchor="aquicktimeqdmc" title="A_QUICKTIME/QDMC">
<t>Codec ID: A_QUICKTIME/QDMC
</t>
<t>Codec Name: QDesign Music
</t>
<t>Description:
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains all additional data that is stored in the 'stsd' (sample description) atom in the QuickTime file <spanx style="strong">after</spanx> the mandatory sound descriptor structure (starting with the size and FourCC fields). For an explanation of the QuickTime file format read <eref target="https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFPreface/qtffPreface.html">QuickTime File Format Specification</eref>.
</t>
<t>Superseded By: A_QUICKTIME
</t>
</section>

<section anchor="aquicktimeqdm2" title="A_QUICKTIME/QDM2">
<t>Codec ID: A_QUICKTIME/QDM2
</t>
<t>Codec Name: QDesign Music v2
</t>
<t>Description:
</t>
<t>Initialisation: The <spanx style="verb">Private Data</spanx> contains all additional data that is stored in the 'stsd' (sample description) atom in the QuickTime file <spanx style="strong">after</spanx> the mandatory sound descriptor structure (starting with the size and FourCC fields). For an explanation of the QuickTime file format read <eref target="https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFPreface/qtffPreface.html">QuickTime File Format Specification</eref>.
</t>
<t>Superseded By: A_QUICKTIME
</t>
</section>

<section anchor="atta1" title="A_TTA1">
<t>Codec ID: A_TTA1
</t>
<t>Codec Name: <eref target="http://tausoft.org/">The True Audio</eref> lossless audio compressor
</t>
<t>Description: <eref target="http://tausoft.org/wiki/True_Audio_Codec_Format">TTA format description</eref>
Each frame is kept intact, including the CRC32. The header and seektable are dropped. SamplingFrequency, Channels and BitDepth are used in the TrackEntry. wFormatTag = 0x77A1
</t>
<t>Initialisation: none
</t>
</section>

<section anchor="awavpack4" title="A_WAVPACK4">
<t>Codec ID: A_WAVPACK4
</t>
<t>Codec Name: <eref target="http://www.wavpack.com/">WavPack</eref> lossless audio compressor
</t>
<t>Description: The Wavpack packets consist of a stripped header followed by the frame data. For multi-track (&gt; 2 tracks) a frame consists of many packets. For hybrid files (lossy part + correction part), the correction part is stored in an additional block (level 1). For more details, check the <eref target="wavpack.html">WavPack muxing description</eref>.
</t>
<t>Initialisation: none
</t>
</section>
</section>

<section anchor="subtitle-codec-mappings" title="Subtitle Codec Mappings">

<section anchor="stextutf8" title="S_TEXT/UTF8">
<t>Codec ID: S_TEXT/UTF8
</t>
<t>Codec Name: UTF-8 Plain Text
</t>
<t>Description: Basic text subtitles. For more information, please look at the <eref target="{{site.baseurl}}/subtitles.html">Subtitle specifications</eref>.
</t>
</section>

<section anchor="stextssa" title="S_TEXT/SSA">
<t>Codec ID: S_TEXT/SSA
</t>
<t>Codec Name: Subtitles Format
</t>
<t>Description: The [Script Info] and [V4 Styles] sections are stored in the codecprivate. Each event is stored in its own Block. For more information, please read the <eref target="{{site.baseurl}}/subtitles.html">specs for SSA/ASS</eref>.
</t>
</section>

<section anchor="stextass" title="S_TEXT/ASS">
<t>Codec ID: S_TEXT/ASS
</t>
<t>Codec Name: Advanced Subtitles Format
</t>
<t>Description: The [Script Info] and [V4 Styles] sections are stored in the codecprivate. Each event is stored in its own Block. For more information, please read the <eref target="{{site.baseurl}}/subtitles.html">specs for SSA/ASS</eref>.
</t>
</section>

<section anchor="stextusf" title="S_TEXT/USF">
<t>Codec ID: S_TEXT/USF
</t>
<t>Codec Name: Universal Subtitle Format
</t>
<t>Description: This is mostly defined, but not typed out yet. It will first be available on the <eref target="{{site.baseurl}}/subtitles.html">USF specs page</eref>.
</t>
</section>

<section anchor="stextwebvtt" title="S_TEXT/WEBVTT">
<t>Codec ID: S_TEXT/WEBVTT
</t>
<t>Codec Name: Web Video Text Tracks Format (WebVTT)
</t>
<t>Description: Advanced text subtitles. For more information about the storage please look at the <eref target="{{site.baseurl}}/subtitles.html">WebVTT in Matroska specifications</eref>.
</t>
</section>

<section anchor="simagebmp" title="S_IMAGE/BMP">
<t>Codec ID: S_IMAGE/BMP
</t>
<t>Codec Name: Bitmap
</t>
<t>Description: Basic image based subtitle format; The subtitles are stored as images, like in the DVD. The timestamp in the block header of Matroska indicates the start display time, the duration is set with the Duration element. The full data for the subtitle bitmap is stored in the Block's data section.
</t>
</section>

<section anchor="sdvbsub" title="S_DVBSUB">
<t>Codec ID: S_DVBSUB
</t>
<t>Codec Name: Digital Video Broadcasting (DVB) subtitles
</t>
<t>Description: This is the graphical subtitle format used in the Digital Video Broadcasting standard. For more information about the storage please look at the <eref target="{{site.baseurl}}/subtitles.html">Digital Video Broadcasting (DVB) subtitles in Matroska specifications</eref>.
</t>
</section>

<section anchor="svobsub" title="S_VOBSUB">
<t>Codec ID: S_VOBSUB
</t>
<t>Codec Name: VobSub subtitles
</t>
<t>Description: The same subtitle format used on DVDs. Supported is only format version 7 and newer. VobSubs consist of two files, the .idx containing information, and the .sub, containing the actual data. The .idx file is stripped of all empty lines, of all comments and of lines beginning with <spanx style="verb">alt:</spanx> or <spanx style="verb">langidx:</spanx>. The line beginning with <spanx style="verb">id:</spanx> SHOULD be transformed into the appropriate Matroska track language element and is discarded. All remaining lines but the ones containing timestamps and file positions are put into the <spanx style="verb">CodecPrivate</spanx> element.
</t>
<t>For each line containing the timestamp and file position data is read from the appropriate position in the .sub file. This data consists of a MPEG program stream which in turn contains SPU packets. The MPEG program stream data is discarded, and each SPU packet is put into one Matroska frame.
</t>
</section>

<section anchor="shdmvpgs" title="S_HDMV/PGS">
<t>Codec ID: S_HDMV/PGS
</t>
<t>Codec Name: HDMV presentation graphics subtitles (PGS)
</t>
<t>Description: This is the graphical subtitle format used on Blu-rays. For more information about the storage please look at the <eref target="{{site.baseurl}}/subtitles.html">HDMV presentation graphics subtitles in Matroska specifications</eref>.
</t>
</section>

<section anchor="shdmvtextst" title="S_HDMV/TEXTST">
<t>Codec ID: S_HDMV/TEXTST
</t>
<t>Codec Name: HDMV text subtitles
</t>
<t>Description: This is the textual subtitle format used on Blu-rays. For more information about the storage please look at the <eref target="{{site.baseurl}}/subtitles.html">HDMV text subtitles in Matroska specifications</eref>.
</t>
</section>

<section anchor="skate" title="S_KATE">
<t>Codec ID: S_KATE
</t>
<t>Codec Name: Karaoke And Text Encapsulation
</t>
<t>Description: A subtitle format developed for ogg. The mapping for Matroska is described on the <eref target="http://wiki.xiph.org/index.php/OggKate#Matroska_mapping">Xiph wiki</eref>. As for Theora and Vorbis, Kate headers are stored in the private data as xiph-laced packets.
</t>
</section>
</section>

<section anchor="button-codec-mappings" title="Button Codec Mappings">

<section anchor="bvobbtn" title="B_VOBBTN">
<t>Codec ID: B_VOBBTN
</t>
<t>Codec Name: VobBtn Buttons
</t>
<t>Description: Based on <eref target="http://dvd.sourceforge.net/dvdinfo/pci_pkt.html">MPEG/VOB PCI packets</eref>. The file contains a header consisting of the string &quot;butonDVD&quot; followed by the width and height in pixels (16 bits integer each) and 4 reserved bytes. The rest is full <eref target="http://dvd.sourceforge.net/dvdinfo/pci_pkt.html">PCI packets</eref>.
#Chapters
</t>
</section>
</section>

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

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

<section anchor="edition-flags" title="Edition Flags">
<t>Three <spanx style="verb">Edition Flags</spanx> are defined to describe the bevahior of the <spanx style="verb">EditionEntry Element</spanx>: <spanx style="verb">EditionFlagHidden</spanx>, <spanx style="verb">EditionFlagDefault</spanx> and <spanx style="verb">EditionFlagOrdered</spanx>.
</t>
<t>The <spanx style="verb">EditionFlagHidden</spanx> Flag behaves similarly to the <spanx style="verb">ChapterFlagHidden</spanx> Flag: if <spanx style="verb">EditionFlagHidden</spanx> is set to <spanx style="verb">true</spanx> then its <spanx style="verb">Child ChapterAtoms Elements</spanx> MUST also be interpretted as if their <spanx style="verb">ChapterFlagHidden</spanx> is also set to <spanx style="verb">true</spanx>, regardless of their own <spanx style="verb">ChapterFlagHidden</spanx> flags. If the <spanx style="verb">EditionFlagHidden</spanx> is toggled by a <spanx style="verb">Control Track</spanx> to <spanx style="verb">false</spanx> then the <spanx style="verb">ChapterFlagHidden</spanx> Flags of the <spanx style="verb">Child ChapterAtoms Elements</spanx> SHALL determine if the <spanx style="verb">ChapterAtom</spanx> is hidden or not.
</t>
</section>
</section>

<section anchor="menu-features" title="Menu features">
<t>The menu features are handled like a <spanx style="emph">chapter codec</spanx>. 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 ChapProcessCodecID parameter. For now only 2 values are supported : 0 matroska script, 1 menu borrowed from the DVD. The 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" title="Matroska Script (0)">
<t>This is the case when <eref target="{{site.baseurl}}/index.html#ChapProcessCodecID">ChapProcessCodecID</eref> = 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 <spanx style="verb">GotoAndPlay( ChapterUID );</spanx>. As the same suggests, it means that when this command is encountered, the playback SHOULD jump to the Chapter specified by the UID and play it.
</t>
</section>

<section anchor="dvd-menu-1" title="DVD menu (1)">
<t>This is the case when <eref target="{{site.baseurl}}/index.html#ChapProcessCodecID">ChapProcessCodecID</eref> = 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>
<t>ChapProcessPrivate | DVD Name | Hierarchy                                           | Commands Possible | Comment
0x30               | SS       | DVD domain                                          | -                 | First Play, Video Manager, Video Title
0x2A               | LU       | Language Unit                                       | -                 | Contains only PGCs
0x28               | TT       | Title                                               | -                 | Contains only PGCs
0x20               | PGC      | Program Group Chain (PGC)                           | *                 |
0x18               | PG       | Program 1 / Program 2 / Program 3                   | -                 |
0x10               | PTT      | Part Of Title 1 / Part Of Title 2                   | -                 | Equivalent to the chapters on the sleeve.
0x08               | CN       | Cell 1 / Cell 2 / Cell 3 / Cell 4 / Cell 5 / Cell 6 | -                 |
</t>
<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 <eref target="{{site.baseurl}}/index.html#ChapterTranslateID">ChapterTranslateID</eref> element found in the Segment Info. This field uses 2 octets as follows:
</t>
<t>
<list style="numbers">
<t>Domain Type: 0 for VMG, the domain number for VTS and VTSM</t>
<t>Domain Value: 0 for VMG and VTSM, 1 for the VTS source.</t>
</list>
</t>
<t>For instance, the menu part from VTS_01_0.VOB would be coded [1,0] and the content part from VTS_02_3.VOB would be [2,1]. The VMG is always [0,0]
</t>
<t>The following octets of ChapProcessPrivate are as follows:
</t>
<t>Octet 1 | DVD Name | Following Octets
0x30    | SS       | Domain name code (1: 0x00= First play, 0xC0= VMG, 0x40= VTSM, 0x80= VTS) + VTS(M) number (2)
0x2A    | LU       | Language code (2) + Language extension (1)
0x28    | TT       | global Title number (2) + corresponding TTN of the VTS (1)
0x20    | PGC      | PGC number (2) + Playback Type (1) + Disabled User Operations (4)
0x18    | PG       | Program number (2)
0x10    | PTT      | PTT-chapter number (1)
0x08    | CN       | Cell number [VOB ID(2)][Cell ID(1)][Angle Num(1)]
</t>
<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>
<t>
<list style="symbols">
<t>0x00: entry only/basic PGC</t>
<t>0x82: Title+Entry Menu (only found in the Video Manager domain)</t>
<t>0x83: Root Menu (only found in the VTSM domain)</t>
<t>0x84: Subpicture Menu (only found in the VTSM domain)</t>
<t>0x85: Audio Menu (only found in the VTSM domain)</t>
<t>0x86: Angle Menu (only found in the VTSM domain)</t>
<t>0x87: Chapter Menu (only found in the VTSM domain)</t>
</list>
</t>
<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 SHOULD 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 preceeding 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" title="Example 1 : basic chaptering">
<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>
<t>
<list style="symbols">
<t>00000ms - 05000ms : Intro</t>
<t>05000ms - 25000ms : Before the crime</t>
<t>25000ms - 27500ms : The crime</t>
<t>27500ms - 38000ms : The killer arrested</t>
<t>38000ms - 43000ms : Credits</t>
</list>
</t>
<t>This would translate in the following matroska form :
</t>

<figure align="center"><artwork align="center" 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;
</artwork></figure>
</section>

<section anchor="example-2--nested-chapters" title="Example 2 : nested chapters">
<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" title="The Micronauts &quot;Bleep To Bleep&quot;">
<t>
<list style="symbols">
<t>00:00 - 12:28 : Baby Wants To Bleep/Rock
<list style="symbols">
<t>00:00 - 04:38 : Baby wants to bleep (pt.1)</t>
<t>04:38 - 07:12 : Baby wants to rock</t>
<t>07:12 - 10:33 : Baby wants to bleep (pt.2)</t>
<t>10:33 - 12:28 : Baby wants to bleep (pt.3)</t>
</list></t>
<t>12:30 - 19:38 : Bleeper_O+2</t>
<t>19:40 - 22:20 : Baby wants to bleep (pt.4)</t>
<t>22:22 - 25:18 : Bleep to bleep</t>
<t>25:20 - 33:35 : Baby wants to bleep (k)</t>
<t>33:37 - 44:28 : Bleeper</t>
</list>
</t>

<figure align="center"><artwork align="center" 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;
</artwork></figure>
</section>
</section>
</section>

<section anchor="subtitles" title="Subtitles">
<t>Because Matroska is a general container format, we try to avoid specifying the formats to store in it. This type of work is really outside of the scope of a container-only format. However, because the use of subtitles in A/V containers has been so limited (with the exception of DVD) we are taking the time to specify how to store some of the more common subtitle formats in Matroska. This is being done to help facilitate their growth. Otherwise, incompatabilities could prevent the standardization and use of subtitle storage.
</t>
<t>This page is not meant to be a complete listing of all subtitle formats that will be used in Matroska, it is only meant to be a guide for the more common, current formats. It is possible that we will add future formats to this page as they are created, but it is not likely as any other new subtitle format designer would likely have their own specifications. Any specification listed here SHOULD be strictly adhered to or it SHOULD NOT use the corresponding Codec ID.
</t>
<t>Here is a list of pointers for storing subtitles in Matroska:
</t>
<t>
<list style="symbols">
<t>Any Matroska file containing only subtitles SHOULD use the extension &quot;.mks&quot;.</t>
<t>As a general rule of thumb for all codecs, information that is global to an entire stream SHOULD be stored in the CodecPrivate element.</t>
<t>Start and stop timecodes that are used in a timecodes native storage format SHOULD be removed when being placed in Matroska as they could interfere if the file is edited afterwards. Instead, the Blocks timecode and Duration SHOULD be used to say when the timecode is displayed.</t>
<t>Because a &quot;subtitle&quot; stream is actually just an overlay stream, anything with a transparency layer could be use, including video.</t>
</list>
</t>
</section>

<section anchor="images-subtitles" title="Images Subtitles">
<t>The first image format that is a goal to import into Matroska is the VobSub subtitle format. This subtitle type is generated by exporting the subtitles from a DVD.
</t>
<t>The requirement for muxing VobSub into Matroska is v7 subtitles (see first line of the .IDX file). If the version is smaller, you must remux them using the SubResync utility from VobSub 2.23 (or MPC) into v7 format. Generally any newly created subs will be in v7 format.
</t>
<t>The .IFO file will not be used at all.
</t>
<t>If there is more than one subtitle stream in the VobSub set, each stream will need to be seperated into seperate tracks for storage in Matroska. E.g. the VobSub file contains streams for both English and German subtitles. Then the resulting Matroska file SHOULD contain two tracks. That way the language information can be 'dropped' and mapped to Matroska's language tags.
</t>
<t>The .IDX file is reformatted (see below) and placed in the CodecPrivate.
</t>
<t>Each .BMP will be stored in its own Block. The Timestamp with be stored in the Blocks Timecode and the duration will be stored in the Default Duration.
</t>
<t>Here is an example .IDX file:
</t>

<figure align="center"><artwork align="center">
  # VobSub index file, v7 (do not modify this line!)
  #
  # To repair desyncronization, you can insert gaps this way:
  # (it usually happens after vob id changes)
  #
  # delay: [sign]hh:mm:ss:ms
  #
  # Where:
  # [sign]: +, - (optional)
  # hh: hours (0 &lt;= hh)
  # mm/ss: minutes/seconds (0 &lt;= mm/ss &lt;= 59)
  # ms: milliseconds (0 &lt;= ms &lt;= 999)
  #
  # Note: You can't position a sub before the previous with a negative
  # value.
  #
  # You can also modify timestamps or delete a few subs you don't like.
  # Just make sure they stay in increasing order.

  # Settings

  # Original frame size
  size: 720x480

  # Origin, relative to the upper-left corner, can be overloaded by
  # aligment
  org: 0, 0

  # Image scaling (hor,ver), origin is at the upper-left corner or at
  # the alignment coord (x, y)
  scale: 100%, 100%

  # Alpha blending
  alpha: 100%

  # Smoothing for very blocky images (use OLD for no filtering)
  smooth: OFF

  # In millisecs
  fadein/out: 50, 50

  # Force subtitle placement relative to (org.x, org.y)
  align: OFF at LEFT TOP

  # For correcting non-progressive desync. (in millisecs or hh:mm:ss:ms)
  # Note: Not effective in DirectVobSub, use "delay: ... " instead.
  time offset: 0

  # ON: displays only forced subtitles, OFF: shows everything
  forced subs: OFF

  # The original palette of the DVD
  palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, \
  b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, fdfdfd

  # Custom colors (transp idxs and the four colors)
  custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \
  000000

  # Language index in use
  langidx: 0

  # English
  id: en, index: 0
  # Decomment next line to activate alternative name in DirectVobSub /
  # Windows Media Player 6.x
  # alt: English
  # Vob/Cell ID: 1, 1 (PTS: 0)
  timestamp: 00:00:01:101, filepos: 000000000
  timestamp: 00:00:08:708, filepos: 000001000
</artwork></figure>
<t>First, lines beginning with &quot;#&quot; are removed. These are comments to make text file editing easier, and as this is not a text file, they aren't needed.
</t>
<t>Next remove the &quot;langidx&quot; and &quot;id&quot; lines. These are used to differenciate the subtitle streams and define the language. As the streams will be stored seperately anyway, there is no need to differenciate them here. Also, the language setting will be stored in the Matroska tags, so there is no need to store it here.
</t>
<t>Finally, the &quot;timestamp&quot; will be used to set the Block's timecode. Once it is set there, there is no need for it to be stored here. Also, as it may interfere if the file is edited, it SHOULD NOT be stored here.
</t>
<t>Once all of these items are removed, the data to store in the CodecPrivate SHOULD look like this:
</t>

<figure align="center"><artwork align="center">
  size: 720x480
  org: 0, 0
  scale: 100%, 100%
  alpha: 100%
  smooth: OFF
  fadein/out: 50, 50
  align: OFF at LEFT TOP
  time offset: 0
  forced subs: OFF
  palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, \
  b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, fdfdfd
  custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \
  000000
</artwork></figure>
<t>There SHOULD also be two Blocks containing one image each with the timecodes &quot;00:00:01:101&quot; and &quot;00:00:08:708&quot;.
</t>
</section>

<section anchor="srt-subtitles" title="SRT Subtitles">
<t>SRT is perhaps the most basic of all subtitle formats.
</t>
<t>It consists of four parts, all in text..
</t>
<t>1. A number indicating which subtitle it is in the sequence.
2. The time that the subtitle appears on the screen, and then disappears.
3. The subtitle itself.
4. A blank line indicating the start of a new subtitle.
</t>
<t>When placing SRT in Matroska, part 3 is converted to UTF-8 (S_TEXT/UTF8) and placed in the data portion of the Block. Part 2 is used to set the timecode of the Block, and BlockDuration element. Nothing else is used.
</t>
<t>Here is an example SRT file:
</t>

<figure align="center"><artwork align="center">
1
00:02:17,440 --&gt; 00:02:20,375
Senator, we're making
our final approach into Coruscant.

2
00:02:20,476 --&gt; 00:02:22,501
Very good, Lieutenant.
</artwork></figure>
<t>In this example, the text &quot;Senator, we're making our final approach into Coruscant.&quot; would be converted into UTF-8 and placed in the Block. The timecode of the block would be set to &quot;00:02:17,440&quot;. And the BlockDuration element would be set to &quot;00:00:02,935&quot;.
</t>
<t>The same is repeated for the next subtitle.
</t>
<t>Because there are no general settings for SRT, the CodecPrivate is left blank.
</t>
</section>

<section anchor="ssaass-subtitles" title="SSA/ASS Subtitles">
<t>SSA stands for Sub Station Alpha. It's the file format used by the popular subtitle editor, <eref target="http://wiki.multimedia.cx/index.php?title=SubStation_Alpha">SubStation Alpha</eref>. This format is widely used by fansubbers.
</t>
<t>It allows you to do some advanced display features, like positioning, karaoke, style managements...
</t>
<t>For detailed information on SSA/ASS, see the <eref target="http://moodub.free.fr/video/ass-specs.doc">SSA specs</eref>. It includes an SSA specs description and the avanced features added by ASS format (standing for Advanced SSA). Because SSA and ASS are so similar, they are treated the same here.
</t>
<t>Like SRT, this format is text based with a particular syntax.
</t>
<t>A file consists of 4 or 5 parts, declared ala INI file (but it's not an INI !)
</t>
<t>The first, &quot;[Script Info]&quot; contains some information about the subtitle file, such as it's title, who created it, type of script and a very important one : &quot;PlayResY&quot;. Be carefull of this value, everything in your script (font size, positioning) is scaled by it. Sub Station Alpha uses your desktops Y resolution to write this value, so if a friend with a large monitor and a high screen resolution gives you an edited script, you can mess everything up by saving the script in SSA with your low-cost monitor.
</t>
<t>The second, &quot;[V4 Styles]&quot;, is a list of style definitions. A style describe how will look a text on the screen. It defines font, font size, primary/.../outile colour, position, aligment etc ...
</t>
<t>For example this :
</t>

<figure align="center"><artwork align="center">
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0
</artwork></figure>
<t>The third, &quot;[Events]&quot;, is the list of text you want to display at the right timing. You can specify some attribute here. Like the style to use for this event (MUST be defined in the list), the position of the text (Left, Right, Vertical Margin), an effect. Name is mostly used by translator to know who said this sentence. Timing is in h:mm:ss.cc (centisec).
</t>

<figure align="center"><artwork align="center">
Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ?
Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf main,autre,0000,0000,0000,,Toujours rien.
</artwork></figure>
<t>&quot;[Pictures]&quot; or &quot;[Fonts]&quot; part can be found in some SSA file, they contains UUE-encoded pictures/font but those features are only used by Sub Station Alpha, i.e. no filter (Vobsub/Avery Lee Subtiler filter) use them.
</t>
<t>Now, how are they stored in Matroska ?
</t>
<t>
<list style="symbols">
<t>All text is converted to UTF-8*   All the headers are stored in CodecPrivate ( Script Info and the Styles list)*   Start &amp; End field are used to set TimeStamp and the BlockDuration element. the data stored is :*   Events are stored in the Block in this order: ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text (Layer comes from ASS specs ... it's empty for SSA.) &quot;ReadOrder field is needed for the decoder to be able to reorder the streamed samples as they were placed originally in the file.&quot;</t>
</list>
</t>
<t>Here is an example of an SSA file.
</t>

<figure align="center"><artwork align="center">
[Script Info]
; This is a Sub Station Alpha v4 script.
; For Sub Station Alpha info and downloads,
; go to [http://www.eswat.demon.co.uk/](http://www.eswat.demon.co.uk/)
; or email [kotus@eswat.demon.co.uk](mailto:kotus@eswat.demon.co.uk)
Title: Wolf's rain 2
Original Script: Anime-spirit Ishin-francais
Original Translation: Coolman
Original Editing: Spikewolfwood
Original Timing: Lord_alucard
Original Script Checking: Spikewolfwood
ScriptType: v4.00
Collisions: Normal
PlayResY: 1024
PlayDepth: 0
Wav: 0, 128697,D:\Alex\Anime\- Fansub -\- TAFF -\Wolf's Rain\WR_-_02_Wav.wav
Wav: 0, 120692,H:\team truc\WR_-_02.wav
Wav: 0, 116504,E:\sub\wolf's_rain\WOLF'S RAIN 02.wav
LastWav: 3
Timer: 100,0000

[V4 Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
Style: Default,Arial,20,65535,65535,65535,-2147483640,-1,0,1,3,0,2,30,30,30,0,0
Style: Titre_episode,Akbar,140,15724527,65535,65535,986895,-1,0,1,1,0,3,30,30,30,0,0
Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0

[Events]
Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ?
Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf main,autre,0000,0000,0000,,Toujours rien.
</artwork></figure>
<t>Here is what would be placed into the CodecPrivate element.
</t>

<figure align="center"><artwork align="center">
[Script Info]
; This is a Sub Station Alpha v4 script.
; For Sub Station Alpha info and downloads,
; go to [http://www.eswat.demon.co.uk/](http://www.eswat.demon.co.uk/)
; or email [kotus@eswat.demon.co.uk](mailto:kotus@eswat.demon.co.uk)
Title: Wolf's rain 2
Original Script: Anime-spirit Ishin-francais
Original Translation: Coolman
Original Editing: Spikewolfwood
Original Timing: Lord_alucard
Original Script Checking: Spikewolfwood
ScriptType: v4.00
Collisions: Normal
PlayResY: 1024
PlayDepth: 0
Wav: 0, 128697,D:\Alex\Anime\- Fansub -\- TAFF -\Wolf's Rain\WR_-_02_Wav.wav
Wav: 0, 120692,H:\team truc\WR_-_02.wav
Wav: 0, 116504,E:\sub\wolf's_rain\WOLF'S RAIN 02.wav
LastWav: 3
Timer: 100,0000

[V4 Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
Style: Default,Arial,20,65535,65535,65535,-2147483640,-1,0,1,3,0,2,30,30,30,0,0
Style: Titre_episode,Akbar,140,15724527,65535,65535,986895,-1,0,1,1,0,3,30,30,30,0,0
Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0
</artwork></figure>
<t>And here are the two blocks that would be generated.
</t>
<t>Block's timecode: 00:02:40.650
BlockDuration: 00:00:01.140
</t>

<figure align="center"><artwork align="center">
1,,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ?
</artwork></figure>
<t>Block's timecode: 00:02:42.420
BlockDuration: 00:00:01.730
</t>

<figure align="center"><artwork align="center">
2,,Wolf main,autre,0000,0000,0000,,Toujours rien.
</artwork></figure>
</section>

<section anchor="usf-subtitles" title="USF Subtitles">
<t>Under construction
</t>
</section>

<section anchor="webvtt" title="WebVTT">
<t>The &quot;Web Video Text Tracks Format&quot; (short: WebVTT) is developed by the <eref target="https://www.w3.org/">World Wide Web Consortium (W3C)</eref>. Its specifications are <eref target="https://w3c.github.io/webvtt/">freely available</eref>.
</t>
<t>The guiding principles for the storage of WebVTT in Matroska are:
</t>
<t>
<list style="symbols">
<t>Consistency: store data in a similar way to other subtitle codecs</t>
<t>Simplicity: making decoding and remuxing as easy as possible for existing infrastructures</t>
<t>Completeness: keeping as much data as possible from the original WebVTT file</t>
</list>
</t>

<section anchor="storage-of-webvtt-in-matroska" title="Storage of WebVTT in Matroska">

<section anchor="codecid-codec-identification" title="CodecID: codec identification">
<t>The CodecID to use is S_TEXT/WEBVTT.
</t>
</section>

<section anchor="codecprivate-storage-of-gloal-webvtt-blocks" title="CodecPrivate: storage of gloal WebVTT blocks">
<t>This element contains all global blocks before the first subtitle entry. This starts at the &quot;WEBVTT&quot; file identification marker but excludes the optional byte order mark.
</t>
</section>

<section anchor="storage-of-nonglobal-webvtt-blocks" title="Storage of non-global WebVTT blocks">
<t>Non-global WebVTT blocks (e.g. &quot;NOTE&quot;) before a WebVTT Cue Text are stored in Matroska's BlockAddition element together with the Matroska Block containing the WebVTT Cue Text these blocks precede (see below for the actual format).
</t>
</section>

<section anchor="storage-of-cues-in-matroska-blocks" title="Storage of Cues in Matroska blocks">
<t>Each WebVTT Cue Text is stored directly in the Matroska Block.
</t>
<t>A muxer MUST change all WebVTT Cue Timestamps present within the Cue Text to be relative to the Matroska Block's timestamp.
</t>
<t>The Cue's start timestamp is used as the Matroska Block's timestamp.
</t>
<t>The difference between the Cue's end timestamp and its start timestamp is used as the Matroska Block's duration.
</t>
</section>

<section anchor="blockadditions-storing-nonglobal-webvtt-blocks-cue-settings-lists-and-cue-identifiers" title="BlockAdditions: storing non-global WebVTT blocks, Cue Settings Lists and Cue identifiers">
<t>Each Matroska Block may be accompanied by one BlockAdditions element. Its format is as follows:
</t>
<t>
<list style="numbers">
<t>The first line contains the WebVTT Cue Text's optional Cue Settings List followed by one line feed character (U+0x000a). The Cue Settings List may be empty in which case the line consists of the line feed character only.</t>
<t>The second line contains the WebVTT Cue Text's optional Cue Identifier followed by one line feed character (U+0x000a). The line may be empty indicating that there was no Cue Identifier in the source file in which case the line consists of the line feed character only.</t>
<t>The third and all following lines contain all WebVTT Comment Blocks that precede the current WebVTT Cue Block. These may be absent.</t>
</list>
</t>
<t>If there is no Matroska BlockAddition element stored together with the Matroska Block then all three components (Cue Settings List, Cue Identifier, Cue Comments) MUST be assumed to be absent.
</t>
</section>
</section>

<section anchor="examples-of-transformation" title="Examples of transformation">
<t>Here's an example how a WebVTT is transformed.
</t>

<section anchor="example-webvtt-file" title="Example WebVTT file">
<t>Let's take the following example file:
</t>

<figure align="center"><artwork align="center">
WEBVTT with text after the signature

STYLE
::cue {
  background-image: linear-gradient(to bottom, dimgray, lightgray);
  color: papayawhip;
}
/* Style blocks cannot use blank lines nor "dash dash greater than" */

NOTE comment blocks can be used between style blocks.

STYLE
::cue(b) {
  color: peachpuff;
}

REGION
id:bill
width:40%
lines:3
regionanchor:0%,100%
viewportanchor:10%,90%
scroll:up

NOTE
Notes always span a whole block and can cover multiple
lines. Like this one.
An empty line ends the block.

hello
00:00:00.000 --&gt; 00:00:10.000
Example entry 1: Hello &lt;b&gt;world&lt;/b&gt;.

NOTE style blocks cannot appear after the first cue.

00:00:25.000 --&gt; 00:00:35.000
Example entry 2: Another entry.
This one has multiple lines.

00:01:03.000 --&gt; 00:01:06.500 position:90% align:right size:35%
Example entry 3: That stuff to the right of the timestamps are cue settings.

00:03:10.000 --&gt; 00:03:20.000
Example entry 4: Entries can even include timestamps.
For example:&lt;00:03:15.000&gt;This becomes visible five seconds
after the first part.
</artwork></figure>
</section>

<section anchor="codecprivate" title="CodecPrivate">
<t>The resulting CodecPrivate element will look like this:
</t>

<figure align="center"><artwork align="center">
WEBVTT with text after the signature

STYLE
::cue {
  background-image: linear-gradient(to bottom, dimgray, lightgray);
  color: papayawhip;
}
/* Style blocks cannot use blank lines nor "dash dash greater than" */

NOTE comment blocks can be used between style blocks.

STYLE
::cue(b) {
  color: peachpuff;
}

REGION
id:bill
width:40%
lines:3
regionanchor:0%,100%
viewportanchor:10%,90%
scroll:up

NOTE
Notes always span a whole block and can cover multiple
lines. Like this one.
An empty line ends the block.
</artwork></figure>
</section>

<section anchor="storage-of-cue-1" title="Storage of Cue 1">
<t>Example Cue 1: timestamp 00:00:00.000, duration 00:00:10.000, Block's content:
</t>

<figure align="center"><artwork align="center">
Example entry 1: Hello &lt;b&gt;world&lt;/b&gt;.
</artwork></figure>
<t>BlockAddition's content starts with one empty line as there's no Cue Settings List:
</t>

<figure align="center"><artwork align="center">

hello
</artwork></figure>
</section>

<section anchor="storage-of-cue-2" title="Storage of Cue 2">
<t>Example Cue 2: timestamp 00:00:25.000, duration 00:00:10.000, Block's content:
</t>

<figure align="center"><artwork align="center">
Example entry 2: Another entry.
This one has multiple lines.
</artwork></figure>
<t>BlockAddition's content starts with two empty lines as there's neither a Cue Settings List nor a Cue Identifier:
</t>

<figure align="center"><artwork align="center">

NOTE style blocks cannot appear after the first cue.
</artwork></figure>
</section>

<section anchor="storage-of-cue-3" title="Storage of Cue 3">
<t>Example Cue 3: timestamp 00:01:03.000, duration 00:00:03.500, Block's content:
</t>

<figure align="center"><artwork align="center">
Example entry 3: That stuff to the right of the timestamps are cue settings.
</artwork></figure>
<t>BlockAddition's content ends with an empty line as there's no Cue Identifier and there were no WebVTT Comment blocks:
</t>

<figure align="center"><artwork align="center">
position:90% align:right size:35%

</artwork></figure>
</section>

<section anchor="storage-of-cue-4" title="Storage of Cue 4">
<t>Example Cue 4: timestamp 00:03:10.000, duration 00:00:10.000, Block's content:
</t>
<t>Example entry 4: Entries can even include timestamps. For example:<eref target="00:00:05.000"/>This becomes visible five seconds after the first part.
</t>
<t>This Block does not need a BlockAddition as the Cue did not contain an Identifier, nor a Settings List, and it wasn't preceded by Comment blocks.
</t>
</section>
</section>

<section anchor="storage-of-webvtt-in-matroska-vs-webm" title="Storage of WebVTT in Matroska vs. WebM">
<t>Note: the storage of WebVTT in Matroska is not the same as the design document for storage of WebVTT in WebM. There are several reasons for this including but not limited to: the WebM document is old (from February 2012) and was based on an earlier draft of WebVTT and ignores several parts that were added to WebVTT later; WebM does still <eref target="http://www.webmproject.org/docs/container/">not support subtitles at all</eref>; the proposal suggests splitting the information across multiple tracks making demuxer's and remuxer's life very difficult.
</t>
</section>
</section>

<section anchor="hdmv-presentation-graphics-subtitles" title="HDMV presentation graphics subtitles">
<t>The specifications for the HDMV presentation graphics subtitle format (short: HDMV PGS) can be found in the document &quot;Blu-ray Disc Read-Only Format; Part 3 — Audio Visual Basic Specifications&quot; in section 9.14 &quot;HDMV graphics streams&quot;.
</t>

<section anchor="storage-of-hdmv-presentation-graphics-subtitles" title="Storage of HDMV presentation graphics subtitles">

<section anchor="codecid--codecprivate-codec-identification" title="CodecID &amp; CodecPrivate: codec identification">
<t>The CodecID to use is <spanx style="verb">S_HDMV/PGS</spanx>. A CodecPrivate element is not used.
</t>
</section>

<section anchor="storage-of-hdmv-pgs-segments-in-matroska-blocks" title="Storage of HDMV PGS Segments in Matroska Blocks">
<t>Each HDMV PGS Segment (short: Segment) will be stored in a Matroska Block. A Segment is the data structure described in section 9.14.2.1 &quot;Segment coding structure and parameters&quot; of the Blu-ray specifications.
</t>
<t>Each Segment contains a presentation timestamp. This timestamp will be used as the timestamp for the Matroska Block.
</t>
<t>A Segment is normally shown until a subsequent Segment is encountered. Therefore the Matroska Block MAY have no Duration. In that case a player MUST display a Segment within a Matroska Block until the next Segment is encountered.
</t>
<t>A muxer MAY use a Duration, e.g. by calculating the distance between two subsequent Segments. If a Matroska Block has a Duration, a player MUST display that Segment only for the duration of the Block's Duration.
</t>
</section>
</section>
</section>

<section anchor="hdmv-text-subtitles" title="HDMV text subtitles">
<t>The specifications for the HDMV text subtitle format (short: HDMV TextST) can be found in the document &quot;Blu-ray Disc Read-Only Format; Part 3 — Audio Visual Basic Specifications&quot; in section 9.15 &quot;HDMV text subtitle streams&quot;.
</t>

<section anchor="storage-of-hdmv-text-subtitles" title="Storage of HDMV text subtitles">

<section anchor="codecid--codecprivate-codec-identification-1" title="CodecID &amp; CodecPrivate: codec identification">
<t>The CodecID to use is <spanx style="verb">S_HDMV/TEXTST</spanx>.
</t>
<t>A CodecPrivate Element is required. It MUST contain the stream's Dialog Style Segment as described in section 9.15.4.2 &quot;Dialog Style Segment&quot; of the Blu-ray specifications.
</t>
</section>

<section anchor="storage-of-hdmv-textst-dialog-presentation-segments-in-matroska-blocks" title="Storage of HDMV TextST Dialog Presentation Segments in Matroska Blocks">
<t>Each HDMV Dialog Presentation Segment (short: Segment) will be stored in a Matroska Block. A Segment is the data structure described in section 9.15.4.3 &quot;Dialog presentation segment&quot; of the Blu-ray specifications.
</t>
<t>Each Segment contains a start and an end presentation timestamp (short: start PTS &amp; end PTS). The start PTS will be used as the timestamp for the Matroska Block. The Matroska Block MUST have a Duration, and that Duration is the difference between the end PTS and the start PTS.
</t>
<t>A player MUST use the Matroska Block's timestamp and Duration instead of the Segment's start and end PTS for determining when and how long to show the Segment.
</t>
</section>

<section anchor="character-set" title="Character set">
<t>When TextST subtitles are stored inside Matroska, the only allowed character set is UTF-8.
</t>
<t>Each HDMV text subtitle stream in a Blu-ray can use one of a handful of character sets. This information is not stored in the MPEG2 Transport Stream itself but in the accompanying Clip Information file.
</t>
<t>Therefore a muxer MUST parse the accompanying Clip Information file. If the information indicates a character set other than UTF-8, it MUST re-encode all text Dialog Presentation Segments from the indicated character set to UTF-8 prior to storing them in Matroska.
</t>
</section>
</section>
</section>

<section anchor="digital-video-broadcasting-dvb-subtitles" title="Digital Video Broadcasting (DVB) subtitles">
<t>The specifications for the Digital Video Broadcasting subtitle bitstream format (short: DVB subtitles) can be found in the document &quot;ETSI EN 300 743 - Digital Video Broadcasting (DVB); Subtitling systems&quot;. The storage of DVB subtitles in MPEG transport streams is specified in the document &quot;ETSI EN 300 468 - Digital Video Broadcasting (DVB); Specification for Service Information (SI) in DVB systems&quot;.
</t>

<section anchor="storage-of-dvb-subtitles" title="Storage of DVB subtitles">

<section anchor="codecid" title="CodecID">
<t>The CodecID to use is <spanx style="verb">S_DVBSUB</spanx>.
</t>
</section>

<section anchor="codecprivate-1" title="CodecPrivate">
<t>The CodecPrivate element is five bytes long and has the following structure:
</t>
<t>
<list style="symbols">
<t>2 bytes: composition page ID (bit string, left bit first)</t>
<t>2 bytes: ancillary page ID (bit string, left bit first)</t>
<t>1 byte: subtitling type (bit string, left bit first)</t>
</list>
</t>
<t>The semantics of these bytes are the same as the ones described in section 6.2.41 &quot;Subtitling descriptor&quot; of ETSI EN 300 468.
</t>
</section>

<section anchor="storage-of-dvb-subtitles-in-matroska-blocks" title="Storage of DVB subtitles in Matroska Blocks">
<t>Each Matroska Block consists of one or more DVB Subtitle Segments as described in segment 7.2 &quot;Syntax and semantics of the subtitling segment&quot; of ETSI EN 300 743.
</t>
<t>Each Matroska Block SHOULD have a Duration indicating how long the DVB Subtitle Segments in that Block SHOULD be displayed.
</t>
</section>
</section>
</section>

<section anchor="tagging" title="Tagging">
<t>When a Tag is nested within another Tag, the nested Tag becomes an attribute of the base tag. For instance, if you wanted to store the dates that a singer used certain addresses for, that singer being the lead singer for a track that included multiple bands simultaneously, then your tag tree would look something like this:
</t>
<t>
<list style="symbols">
<t>Targets
<list style="symbols">
<t>TrackUID</t>
</list></t>
<t>BAND
<list style="symbols">
<t>LEADPERFORMER</t>
<t>ADDRESS
<list style="symbols">
<t>DATE</t>
<t>DATEEND</t>
</list></t>
<t>ADDRESS
<list style="symbols">
<t>DATE</t>
</list></t>
</list></t>
</list>
</t>
<t>In this way, it becomes possible to store any Tag as attributes of another tag.
</t>
<t>Multiple items SHOULD never be stored as a list in a single TagString. If there is more than one tag of a certain type to be stored, then more than one SimpleTag SHOULD be used.
</t>
<t>For authoring Tags outside of EBML, the <eref target="http://www.matroska.org/files/tags/matroskatags.dtd">following XML syntax is proposed</eref> <eref target="http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge.html#mkvmerge.tags">used in mkvmerge</eref>. Binary data SHOULD be stored using BASE64 encoding if it is being stored at authoring time.
</t>

<section anchor="why-official-tags-matter" title="Why official tags matter">
<t>There is a debate between people who think all tags SHOULD be free and those who think all tags SHOULD be strict. If you look at this page you will realise we are in between.
</t>
<t>Advanced-users application might let you put any tag in your file. But for the rest of the applications, they usually give you a basic list of tags you can use. Both have their needs. But it's usually a bad idea to use custom/exotic tags because you will probably be the only person to use this information even though everyone else could benefit from it. So hopefully when someone wants to put information in one's file, they will find an official one that fit them and hopefully use it ! If it's not in the list, this person can contact us any time for addition of such a missing tag. But it doesn't mean it will be accepted... Matroska files are not meant the become a whole database of people who made costumes for a film. A website would be better for that... It's hard to define what SHOULD be in and what doesn't make sense in a file. So we'll treat each request carefully.
</t>
<t>We also need an official list simply for developers to be able to display relevant information in their own design (if they choose to support a list of meta-information they SHOULD know which tag has the wanted meaning so that other apps could understand the same meaning).
</t>
</section>

<section anchor="tag-translations" title="Tag translations">
<t>To be able to save tags from other systems to Matroska we need to translate them to our system. There is a translation table <eref target="othertagsystems/comparetable.html">on our site</eref>.
</t>
</section>

<section anchor="tag-formatting" title="Tag Formatting">
<t>
<list style="symbols">
<t>The TagName SHOULD always be written in all capital letters and contain no space.</t>
<t>The fields with dates SHOULD have the following format: YYYY-MM-DD hh:mm:ss.mss YYYY = Year, MM = Month, DD = Days, HH = Hours, mm = Minutes, ss = Seconds, mss = Milliseconds. To store less accuracy, you remove items starting from the right. To store only the year, you would use, &quot;2004&quot;. To store a specific day such as May 1st, 2003, you would use &quot;2003-05-01&quot;.</t>
<t>Fields that require a Float SHOULD use the &quot;.&quot; mark instead of the &quot;,&quot; mark. To display it differently for another local, applications SHOULD support auto replacement on display. Also, a thousandths separator SHOULD NOT be used.</t>
<t>For currency amounts, there SHOULD only be a numeric value in the Tag. Only numbers, no letters or symbols other than &quot;.&quot;. For instance, you would store &quot;15.59&quot; instead of &quot;$15.59USD&quot;.</t>
</list>
</t>
</section>

<section anchor="target-types" title="Target types">
<t>The TargetType element allows tagging of different parts that are inside or outside a given file. For example in an audio file with one song you could have information about the album it comes from and even the CD set even if it's not found in the file.
</t>
<t>For application to know what kind of information (like TITLE) relates to a certain level (CD title or track title), we also need a set of official TargetType names. For now audio and video will have different values &amp; names. That also means the same tag name can have different meanings depending on where it is (otherwise we would end up with 15 TITLE_ tags).
</t>
<t>TargetTypeValue | Audio strings                   | Video strings             | Comment
70              | COLLECTION                      | COLLECTION                | the high hierarchy consisting of many different lower items
60              | EDITION / ISSUE / VOLUME / OPUS | SEASON / SEQUEL / VOLUME  | a list of lower levels grouped together
50              | ALBUM / OPERA / CONCERT         | MOVIE / EPISODE / CONCERT | the most common grouping level of music and video (equals to an episode for TV series)
40              | PART / SESSION                  | PART / SESSION            | when an album or episode has different logical parts
30              | TRACK / SONG                    | CHAPTER                   | the common parts of an album or a movie
20              | SUBTRACK / PART / MOVEMENT      | SCENE                     | corresponds to parts of a track for audio (like a movement)
10              | -                               | SHOT                      | the lowest hierarchy found in music or movies
</t>
<t>An upper level value tag applies to the lower level. That means if a CD has the same artist for all tracks, you just need to set the ARTIST tag at level 50 (ALBUM) and not to each TRACK (but you can). That also means that if some parts of the CD have no known ARTIST the value MUST be set to nothing (a void string &quot;&quot;).
</t>
<t>When a level doesn't exist it MUST NOT be specified in the files, so that the TOTAL_PARTS and PART_NUMBER elements match the same levels.
</t>
<t>Here is an example of how these <spanx style="verb">organizational</spanx> tags work: If you set 10 TOTAL_PARTS to the ALBUM level (40) it means the album contains 10 lower parts. The lower part in question is the first lower level that is specified in the file. So if it's TRACK (30) then that means it contains 10 tracks. If it's MOVEMENT (20) that means it's 10 movements, etc.
</t>
</section>

<section anchor="official-tags" title="Official tags">
<t>The following is a complete list of the supported Matroska Tags. While it is possible to use Tag names that are not listed below, this is not recommended as compatibility will be compromised. If you find that there is a Tag missing that you would like to use, then please contact the Matroska team for its inclusion in the specifications before the format reaches 1.0.
</t>
</section>

<section anchor="nesting-information" title="Nesting Information">
<t>Nesting Information tags are intended to contain other tags.
</t>
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>ORIGINAL</c><c>-</c><c>A special tag that is meant to have other tags inside (using nested tags) to describe the original work of art that this item is based on. All tags in this list can be used &quot;under&quot; the ORIGINAL tag like LYRICIST, PERFORMER, etc.</c>
<c>SAMPLE</c><c>-</c><c>A tag that contains other tags to describe a sample used in the targeted item taken from another work of art. All tags in this list can be used &quot;under&quot; the SAMPLE tag like TITLE, ARTIST, DATE_RELEASED, etc.</c>
<c>COUNTRY</c><c>UTF-8</c><c>The name of the country (<eref target="http://lcweb.loc.gov/standards/iso639-2/englangn.html#two">biblio ISO-639-2</eref>) that is meant to have other tags inside (using nested tags) to country specific information about the item. All tags in this list can be used &quot;under&quot; the COUNTRY_SPECIFIC tag like LABEL, PUBLISH_RATING, etc.</c>
</texttable>
</section>

<section anchor="organization-information" title="Organization Information">
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>TOTAL_PARTS</c><c>UTF-8</c><c>Total number of parts defined at the first lower level. (e.g. if TargetType is ALBUM, the total number of tracks of an audio CD)</c>
<c>PART_NUMBER</c><c>UTF-8</c><c>Number of the current part of the current level. (e.g. if TargetType is TRACK, the track number of an audio CD)</c>
<c>PART_OFFSET</c><c>UTF-8</c><c>A number to add to PART_NUMBER when the parts at that level don't start at 1. (e.g. if TargetType is TRACK, the track number of the second audio CD)</c>
</texttable>
</section>

<section anchor="titles" title="Titles">
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>TITLE</c><c>UTF-8</c><c>The title of this item. For example, for music you might label this &quot;Canon in D&quot;, or for video's audio track you might use &quot;English 5.1&quot; This is akin to the TIT2 tag in ID3.</c>
<c>SUBTITLE</c><c>UTF-8</c><c>Sub Title of the entity.</c>
</texttable>
</section>

<section anchor="nested-information" title="Nested Information">
<t>Nested Information includes tags contained in other tags.
</t>
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>URL</c><c>UTF-8</c><c>URL corresponding to the tag it's included in.</c>
<c>SORT_WITH</c><c>UTF-8</c><c>A child element to indicate what alternative value the parent tag can have to be sorted, for example &quot;Pet Shop Boys&quot; instead of &quot;The Pet Shop Boys&quot;. Or &quot;Marley Bob&quot; and &quot;Marley Ziggy&quot; (no comma needed).</c>
<c>INSTRUMENTS</c><c>UTF-8</c><c>The instruments that are being used/played, separated by a comma. It SHOULD be a child of the following tags: ARTIST, LEAD_PERFORMER or ACCOMPANIMENT.</c>
<c>EMAIL</c><c>UTF-8</c><c>Email corresponding to the tag it's included in.</c>
<c>ADDRESS</c><c>UTF-8</c><c>The physical address of the entity. The address SHOULD include a country code. It can be useful for a recording label.</c>
<c>FAX</c><c>UTF-8</c><c>The fax number corresponding to the tag it's included in. It can be useful for a recording label.</c>
<c>PHONE</c><c>UTF-8</c><c>The phone number corresponding to the tag it's included in. It can be useful for a recording label.</c>
</texttable>
</section>

<section anchor="entities" title="Entities">
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>ARTIST</c><c>UTF-8</c><c>A person or band/collective generally considered responsible for the work. This is akin to the <eref target="http://id3.org/id3v2.3.0#TPE1">TPE1 tag in ID3</eref>.</c>
<c>LEAD_PERFORMER</c><c>UTF-8</c><c>Lead Performer/Soloist(s). This can sometimes be the same as ARTIST.</c>
<c>ACCOMPANIMENT</c><c>UTF-8</c><c>Band/orchestra/accompaniment/musician. This is akin to the <eref target="http://id3.org/id3v2.3.0#TPE2">TPE2 tag in ID3</eref>.</c>
<c>COMPOSER</c><c>UTF-8</c><c>The name of the composer of this item. This is akin to the <eref target="http://id3.org/id3v2.3.0#TCOM">TCOM tag in ID3</eref>.</c>
<c>ARRANGER</c><c>UTF-8</c><c>The person who arranged the piece, e.g., Ravel.</c>
<c>LYRICS</c><c>UTF-8</c><c>The lyrics corresponding to a song (in case audio synchronization is not known or as a doublon to a subtitle track). Editing this value when subtitles are found SHOULD also result in editing the subtitle track for more consistency.</c>
<c>LYRICIST</c><c>UTF-8</c><c>The person who wrote the lyrics for a musical item. This is akin to the <eref target="http://id3.org/id3v2.3.0#TEXT">TEXT</eref> tag in ID3.</c>
<c>CONDUCTOR</c><c>UTF-8</c><c>Conductor/performer refinement. This is akin to the <eref target="http://id3.org/id3v2.3.0#TPE3">TPE3</eref>.</c>
<c>DIRECTOR</c><c>UTF-8</c><c>This is akin to the <eref target="http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html">IART tag in RIFF</eref>.</c>
<c>ASSISTANT_DIRECTOR</c><c>UTF-8</c><c>The name of the assistant director.</c>
<c>DIRECTOR_OF_PHOTOGRAPHY</c><c>UTF-8</c><c>The name of the director of photography, also known as cinematographer. This is akin to the ICNM tag in Extended RIFF.</c>
<c>SOUND_ENGINEER</c><c>UTF-8</c><c>The name of the sound engineer or sound recordist.</c>
<c>ART_DIRECTOR</c><c>UTF-8</c><c>The person who oversees the artists and craftspeople who build the sets.</c>
<c>PRODUCTION_DESIGNER</c><c>UTF-8</c><c>Artist responsible for designing the overall visual appearance of a movie.</c>
<c>CHOREGRAPHER</c><c>UTF-8</c><c>The name of the choregrapher</c>
<c>COSTUME_DESIGNER</c><c>UTF-8</c><c>The name of the costume designer</c>
<c>ACTOR</c><c>UTF-8</c><c>An actor or actress playing a role in this movie. This is the person's real name, not the character's name the person is playing.</c>
<c>CHARACTER</c><c>UTF-8</c><c>The name of the character an actor or actress plays in this movie. This SHOULD be a sub-tag of an <spanx style="verb">ACTOR</spanx> tag in order not to cause ambiguities.</c>
<c>WRITTEN_BY</c><c>UTF-8</c><c>The author of the story or script (used for movies and TV shows).</c>
<c>SCREENPLAY_BY</c><c>UTF-8</c><c>The author of the screenplay or scenario (used for movies and TV shows).</c>
<c>EDITED_BY</c><c>UTF-8</c><c>This is akin to the IEDT tag in Extended RIFF.</c>
<c>PRODUCER</c><c>UTF-8</c><c>Produced by. This is akin to the IPRO tag in Extended RIFF.</c>
<c>COPRODUCER</c><c>UTF-8</c><c>The name of a co-producer.</c>
<c>EXECUTIVE_PRODUCER</c><c>UTF-8</c><c>The name of an executive producer.</c>
<c>DISTRIBUTED_BY</c><c>UTF-8</c><c>This is akin to the IDST tag in Extended RIFF.</c>
<c>MASTERED_BY</c><c>UTF-8</c><c>The engineer who mastered the content for a physical medium or for digital distribution.</c>
<c>ENCODED_BY</c><c>UTF-8</c><c>This is akin to the <eref target="http://id3.org/id3v2.3.0#TENC">TENC tag</eref> in ID3.</c>
<c>MIXED_BY</c><c>UTF-8</c><c>DJ mix by the artist specified</c>
<c>REMIXED_BY</c><c>UTF-8</c><c>Interpreted, remixed, or otherwise modified by. This is akin to the <eref target="http://id3.org/id3v2.3.0#TPE4">TPE4 tag in ID3</eref>.</c>
<c>PRODUCTION_STUDIO</c><c>UTF-8</c><c>This is akin to the ISTD tag in Extended RIFF.</c>
<c>THANKS_TO</c><c>UTF-8</c><c>A very general tag for everyone else that wants to be listed.</c>
<c>PUBLISHER</c><c>UTF-8</c><c>This is akin to the <eref target="http://id3.org/id3v2.3.0#TPUB">TPUB tag in ID3</eref>.</c>
<c>LABEL</c><c>UTF-8</c><c>The record label or imprint on the disc.</c>
</texttable>
</section>

<section anchor="search-and-classification" title="Search and Classification">
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>GENRE</c><c>UTF-8</c><c>The main genre (classical, ambient-house, synthpop, sci-fi, drama, etc). The format follows the infamous TCON tag in ID3.</c>
<c>MOOD</c><c>UTF-8</c><c>Intended to reflect the mood of the item with a few keywords, e.g. &quot;Romantic&quot;, &quot;Sad&quot; or &quot;Uplifting&quot;. The format follows that of the TMOO tag in ID3.</c>
<c>ORIGINAL_MEDIA_TYPE</c><c>UTF-8</c><c>Describes the original type of the media, such as, &quot;DVD&quot;, &quot;CD&quot;, &quot;computer image,&quot; &quot;drawing,&quot; &quot;lithograph,&quot; and so forth. This is akin to the <eref target="http://id3.org/id3v2.3.0#TMED">TMED tag in ID3</eref>.</c>
<c>CONTENT_TYPE</c><c>UTF-8</c><c>The type of the item. e.g. Documentary, Feature Film, Cartoon, Music Video, Music, Sound FX, ...</c>
<c>SUBJECT</c><c>UTF-8</c><c>Describes the topic of the file, such as &quot;Aerial view of Seattle.&quot;</c>
<c>DESCRIPTION</c><c>UTF-8</c><c>A short description of the content, such as &quot;Two birds flying.&quot;</c>
<c>KEYWORDS</c><c>UTF-8</c><c>Keywords to the item separated by a comma, used for searching.</c>
<c>SUMMARY</c><c>UTF-8</c><c>A plot outline or a summary of the story.</c>
<c>SYNOPSIS</c><c>UTF-8</c><c>A description of the story line of the item.</c>
<c>INITIAL_KEY</c><c>UTF-8</c><c>The initial key that a musical track starts in. The format is identical to ID3.</c>
<c>PERIOD</c><c>UTF-8</c><c>Describes the period that the piece is from or about. For example, &quot;Renaissance&quot;.</c>
<c>LAW_RATING</c><c>UTF-8</c><c>Depending on the <spanx style="verb">COUNTRY</spanx> it's the format of the rating of a movie (P, R, X in the USA, an age in other countries or a URI defining a logo).</c>
<c>ICRA</c><c>binary</c><c>The <eref target="http://www.icra.org/">ICRA</eref> content rating for parental control. (Previously RSACi)</c>
</texttable>
</section>

<section anchor="temporal-information" title="Temporal Information">
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>DATE_RELEASED</c><c>UTF-8</c><c>The time that the item was originally released. This is akin to the TDRL tag in ID3.</c>
<c>DATE_RECORDED</c><c>UTF-8</c><c>The time that the recording began. This is akin to the TDRC tag in ID3.</c>
<c>DATE_ENCODED</c><c>UTF-8</c><c>The time that the encoding of this item was completed began. This is akin to the TDEN tag in ID3.</c>
<c>DATE_TAGGED</c><c>UTF-8</c><c>The time that the tags were done for this item. This is akin to the TDTG tag in ID3.</c>
<c>DATE_DIGITIZED</c><c>UTF-8</c><c>The time that the item was transferred to a digital medium. This is akin to the IDIT tag in RIFF.</c>
<c>DATE_WRITTEN</c><c>UTF-8</c><c>The time that the writing of the music/script began.</c>
<c>DATE_PURCHASED</c><c>UTF-8</c><c>Information on when the file was purchased (see also <xref target="commercial"/>).</c>
</texttable>
</section>

<section anchor="spacial-information" title="Spacial Information">
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>RECORDING_LOCATION</c><c>UTF-8</c><c>The location where the item was recorded. The countries corresponding to the string, same 2 octets as in <eref target="http://www.iana.org/cctld/cctld-whois.htm">Internet domains</eref>, or possibly <eref target="http://www.iso.org/iso/country_codes">ISO-3166</eref>. This code is followed by a comma, then more detailed information such as state/province, another comma, and then city. For example, &quot;US, Texas, Austin&quot;. This will allow for easy sorting. It is okay to only store the country, or the country and the state/province. More detailed information can be added after the city through the use of additional commas. In cases where the province/state is unknown, but you want to store the city, simply leave a space between the two commas. For example, &quot;US, , Austin&quot;.</c>
<c>COMPOSITION_LOCATION</c><c>UTF-8</c><c>Location that the item was originally designed/written. The countries corresponding to the string, same 2 octets as in <eref target="http://www.iana.org/cctld/cctld-whois.htm">Internet domains</eref>, or possibly <eref target="http://www.iso.org/iso/country_codes">ISO-3166</eref>. This code is followed by a comma, then more detailed information such as state/province, another comma, and then city. For example, &quot;US, Texas, Austin&quot;. This will allow for easy sorting. It is okay to only store the country, or the country and the state/province. More detailed information can be added after the city through the use of additional commas. In cases where the province/state is unknown, but you want to store the city, simply leave a space between the two commas. For example, &quot;US, , Austin&quot;.</c>
<c>COMPOSER_NATIONALITY</c><c>UTF-8</c><c>Nationality of the main composer of the item, mostly for classical music. The countries corresponding to the string, same 2 octets as in <eref target="http://www.iana.org/cctld/cctld-whois.htm">Internet domains</eref>, or possibly <eref target="http://www.iso.org/iso/country_codes">ISO-3166</eref>.</c>
</texttable>
</section>

<section anchor="personal" title="Personal">
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>COMMENT</c><c>UTF-8</c><c>Any comment related to the content.</c>
<c>PLAY_COUNTER</c><c>UTF-8</c><c>The number of time the item has been played.</c>
<c>RATING</c><c>UTF-8</c><c>A numeric value defining how much a person likes the song/movie. The number is between 0 and 5 with decimal values possible (e.g. 2.7), 5(.0) being the highest possible rating. Other rating systems with different ranges will have to be scaled.</c>
</texttable>
</section>

<section anchor="technical-information" title="Technical Information">
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>ENCODER</c><c>UTF-8</c><c>The software or hardware used to encode this item. (&quot;LAME&quot; or &quot;XviD&quot;)</c>
<c>ENCODER_SETTINGS</c><c>UTF-8</c><c>A list of the settings used for encoding this item. No specific format.</c>
<c>BPS</c><c>UTF-8</c><c>The average bits per second of the specified item. This is only the data in the Blocks, and excludes headers and any container overhead.</c>
<c>FPS</c><c>UTF-8</c><c>The average frames per second of the specified item. This is typically the average number of Blocks per second. In the event that lacing is used, each laced chunk is to be counted as a separate frame.</c>
<c>BPM</c><c>UTF-8</c><c>Average number of beats per minute in the complete target (e.g. a chapter). Usually a decimal number.</c>
<c>MEASURE</c><c>UTF-8</c><c>In music, a measure is a unit of time in Western music like &quot;4/4&quot;. It represents a regular grouping of beats, a meter, as indicated in musical notation by the time signature.. The majority of the contemporary rock and pop music you hear on the radio these days is written in the 4/4 time signature.</c>
<c>TUNING</c><c>UTF-8</c><c>It is saved as a frequency in hertz to allow near-perfect tuning of instruments to the same tone as the musical piece (e.g. &quot;441.34&quot; in Hertz). The default value is 440.0 Hz.</c>
<c>REPLAYGAIN_GAIN</c><c>binary</c><c>The gain to apply to reach 89dB SPL on playback. This is based on the <eref target="http://www.replaygain.org/">Replay Gain standard</eref>. Note that ReplayGain information can be found at all TargetType levels (track, album, etc).</c>
<c>REPLAYGAIN_PEAK</c><c>binary</c><c>The maximum absolute peak value of the item. This is based on the <eref target="http://www.replaygain.org/">Replay Gain standard</eref>.</c>
</texttable>
</section>

<section anchor="identifiers" title="Identifiers">
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>ISRC</c><c>UTF-8</c><c>The <eref target="http://www.ifpi.org/isrc/isrc_handbook.html#Heading198">International Standard Recording Code</eref>, excluding the &quot;ISRC&quot; prefix and including hyphens.</c>
<c>MCDI</c><c>binary</c><c>This is a binary dump of the TOC of the CDROM that this item was taken from. This holds the same information as the MCDI in ID3.</c>
<c>ISBN</c><c>UTF-8</c><c><eref target="http://www.isbn-international.org/">International Standard Book Number</eref></c>
<c>BARCODE</c><c>UTF-8</c><c><eref target="http://www.ean-int.org/">EAN-13</eref> (European Article Numbering) or <eref target="http://www.uc-council.org/">UPC-A</eref> (Universal Product Code) bar code identifier</c>
<c>CATALOG_NUMBER</c><c>UTF-8</c><c>A label-specific string used to identify the release (TIC 01 for example).</c>
<c>LABEL_CODE</c><c>UTF-8</c><c>A 4-digit or 5-digit number to identify the record label, typically printed as (LC) xxxx or (LC) 0xxxx on CDs medias or covers (only the number is stored).</c>
<c>LCCN</c><c>UTF-8</c><c><eref target="http://www.loc.gov/marc/lccn.html">Library of Congress Control Number</eref></c>
</texttable>
</section>

<section anchor="commercial" title="Commercial">
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>PURCHASE_ITEM</c><c>UTF-8</c><c>URL to purchase this file. This is akin to the WPAY tag in ID3.</c>
<c>PURCHASE_INFO</c><c>UTF-8</c><c>Information on where to purchase this album. This is akin to the WCOM tag in ID3.</c>
<c>PURCHASE_OWNER</c><c>UTF-8</c><c>Information on the person who purchased the file. This is akin to the <eref target="http://id3.org/id3v2.3.0#TOWN">TOWN tag in ID3</eref>.</c>
<c>PURCHASE_PRICE</c><c>UTF-8</c><c>The amount paid for entity. There SHOULD only be a numeric value in here. Only numbers, no letters or symbols other than &quot;.&quot;. For instance, you would store &quot;15.59&quot; instead of &quot;$15.59USD&quot;.</c>
<c>PURCHASE_CURRENCY</c><c>UTF-8</c><c>The currency type used to pay for the entity. Use <eref target="http://www.xe.com/iso4217.htm">ISO-4217</eref> for the 3 letter currency code.</c>
</texttable>
</section>

<section anchor="legal" title="Legal">
<texttable>
<ttcol align="left">Tag Name</ttcol>
<ttcol align="left">Type</ttcol>
<ttcol align="left">Description</ttcol>

<c>COPYRIGHT</c><c>UTF-8</c><c>The copyright information as per the copyright holder. This is akin to the TCOP tag in ID3.</c>
<c>PRODUCTION_COPYRIGHT</c><c>UTF-8</c><c>The copyright information as per the production copyright holder. This is akin to the TPRO tag in ID3.</c>
<c>LICENSE</c><c>UTF-8</c><c>The license applied to the content (like Creative Commons variants).</c>
<c>TERMS_OF_USE</c><c>UTF-8</c><c>The terms of use for this item. This is akin to the USER tag in ID3.</c>
</texttable>
</section>

<section anchor="notes" title="Notes">
<t>
<list style="symbols">
<t>In the Target list, a logical OR is applied on all tracks, a logical OR is applied on all chapters. Then a logical AND is applied between the Tracks list and the Chapters list to know if an element belongs to this Target.</t>
</list>
</t>
</section>
</section>

<section anchor="attachments-1" title="Attachments">

<section anchor="introduction-1" title="Introduction">
<t>Matroska supports storage of related files and data in the Attachments Top-Level Element. Attachments 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 ancilliary files related to the Segment.
</t>
<t><spanx style="verb">Matroska Readers</spanx> MUST NOT execute files stored as Attachments.
</t>
</section>

<section anchor="cover-art" title="Cover Art">
<t>This section defines a set of guidelines for the storage of cover art in Matroska files. A <spanx style="verb">Matroska Reader</spanx> MAY use embedded cover art to display a representation still-image depiction of the multimedia contents of the Matroska file.
</t>
<t>Cover art SHOULD only use the JPEG and PNG picture formats.
</t>
<t>There can be 2 different covers for a movie/album. A portrait one (like a DVD case) and a landscape one (like a banner ad for example, looking better on a wide screen).
</t>
<t>There can be 2 versions of the same cover, the <spanx style="verb">normal cover</spanx> and the <spanx style="verb">small cover</spanx>. The dimension of the <spanx style="verb">normal cover</spanx> SHOULD be 600 on the smallest side (for example, 960x600 for landscape, 600x800 for portrait, or 600x600 for square). The dimension of the <spanx style="verb">small cover</spanx> SHOULD be 120 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 <spanx style="verb">FileName Element</spanx>. The default filename of the <spanx style="verb">normal cover</spanx> in square or portrait mode is <spanx style="verb">cover.(jpg|png)</spanx>. When stored, the <spanx style="verb">normal cover</spanx> SHOULD be the first Attachment in storage order. The <spanx style="verb">small cover</spanx> SHOULD be prefixed with &quot;small_&quot;, such as <spanx style="verb">small_cover.(jpg|png)</spanx>. The landscape variant SHOULD be suffixed with &quot;_land&quot;, such as <spanx style="verb">cover_land.(jpg|png)</spanx>. The filenames are case sensitive and SHOULD all be lower case.
</t>
<t>The following table provides examples of file names for cover art in Attachments.
</t>
<t>FileName             | Image Orientation  | Pixel Length of Smallest Side
cover.jpg            | Portrait or square | 600
small_cover.png      | Portrait or square | 120
cover_land.png       | Landscape          | 600
small_cover_land.jpg | Landscape          | 120
</t>
</section>

<section anchor="font-files" title="Font files">
</section>
</section>

<section anchor="cues" title="Cues">

<section anchor="introduction-2" title="Introduction">
<t>The <spanx style="verb">Cues Element</spanx> provides an index of certain <spanx style="verb">Cluster Elements</spanx> to allow for optimized seeking to absolute timestamps within the <spanx style="verb">Segment</spanx>. The <spanx style="verb">Cues Element</spanx> contains one or many <spanx style="verb">CuePoint Elements</spanx> which each MUST reference an absolute timestamp (via the <spanx style="verb">CueTime Element</spanx>), a <spanx style="verb">Track</spanx> (via the <spanx style="verb">CueTrack Element</spanx>), and a <spanx style="verb">Segment Position</spanx> (via the <spanx style="verb">CueClusterPosition Element</spanx>). Additional non-mandated Elements are part of the <spanx style="verb">CuePoint Element</spanx> such as <spanx style="verb">CueDuration</spanx>, <spanx style="verb">CueRelativePosition</spanx>, <spanx style="verb">CueCodecState</spanx> and others which provide any potential Matroska reader with additional information to use in the optimization of seeking performance.
</t>
</section>

<section anchor="recommendations" title="Recommendations">
<t>The following recommendations are provided to optimize Matroska performance.
</t>
<t>
<list style="symbols">
<t>Unless Matroska is used as a live stream, it SHOULD contain a <spanx style="verb">Cues Element</spanx>.</t>
<t>For each video track, each keyframe SHOULD be referenced by a <spanx style="verb">CuePoint Element</spanx>.</t>
<t>It is RECOMMENDED to not reference non-keyframes of video tracks in <spanx style="verb">Cues</spanx> unless it references a <spanx style="verb">Cluster Element</spanx> which contains a <spanx style="verb">CodecState Element</spanx> but no keyframes.</t>
<t>For each subtitle track present, each subtitle frame SHOULD be referenced by a <spanx style="verb">CuePoint Element</spanx> with a <spanx style="verb">CueDuration Element</spanx>.</t>
<t>Audio tracks SHOULD only be referenced in <spanx style="verb">CuePoint Elements</spanx> if no video track is present. In this case <spanx style="verb">CuePoint Elements</spanx> SHOULD reference audio keyframes at most once every 500 milliseconds.</t>
<t>If the referenced frame is not stored within the first <spanx style="verb">SimpleBlock</spanx> or first <spanx style="verb">BlockGroup</spanx> within its <spanx style="verb">Cluster Element</spanx>, then the <spanx style="verb">CueRelativePosition Element</spanx> SHOULD be written to reference where in the <spanx style="verb">Cluster</spanx> the reference frame is stored.</t>
<t>If a <spanx style="verb">CuePoint Element</spanx> references <spanx style="verb">Cluster Element</spanx> that includes a <spanx style="verb">CodecState Element</spanx>, then that <spanx style="verb">CuePoint Element</spanx> MUST use a <spanx style="verb">CueCodecState Element</spanx>.</t>
<t><spanx style="verb">CuePoint Elements</spanx> SHOULD be numerically sorted in storage order by the value of the <spanx style="verb">CueTime Element</spanx>.</t>
</list>
</t>
</section>
</section>

<section anchor="matroska-streaming" title="Matroska Streaming">
<t>There exist multiple ways to stream content. The term streaming itself is very vague. It means reading a file stored on a server. But the server could be very distant or very close. The transport system and the protocol used for streaming makes the whole difference.
</t>
<t>In the case of Matroska, there are mostly 2 different kinds of stream: file access and live streaming.
</t>
</section>

<section anchor="file-access" title="File Access">
<t>File access can simply be reading a file located on your computer, but also accessing it from an HTTP (web) server or CIFS (windows share) server. All these protocols are usually safe from reading errors and seeking in the stream is possible. On other hand when the file is stored far away or on a slow server, seeking can be an expensive operation and SHOULD be avoided. That's why we set a <eref target="{{site.baseurl}}/index.html">few guidelines</eref> that, when followed, help reduce the number of seeking for regular playback and also have the playback start quickly without a lot of data needed to read first (like the Cues (index), Attachments or Meta Seek of all the Clusters).
</t>
<t>Matroska having a small overhead, it is well suited for storing music/videos on file servers without having a big impact on the bandwidth used. It doesn't require to load the index before playing (the index can be loaded only when seeking is requested the first time), so playback can start very quickly too.
</t>
</section>

<section anchor="live-streaming" title="Live Streaming">
<t>Live streaming is the equivalent of TV broadcasting on the internet. There are 2 families of servers for that. The RTP/RTSP ones and the HTTP servers. Matroska is not meant to be used over RTP. RTP already has timing and channel mechanisms that would wasted if doubled in Matroska. On the other hand live streaming of Matroska over HTTP (or any other plain protocol based on TCP) is very possible.
</t>
<t>A live Matroska stream is different than a file, because it may have no known end (only when the client disconnects). For that the Segment MUST use the &quot;unknown&quot; size (all 1s in the size). The other option would be to concatenate Segments with known sizes one after the other. This solution allows a change of codec/resolution between each segment which can be useful in some cases (switch between 4:3 and 16:9 in some TV programs for example).
</t>
<t>The Segment(s) being continuous, certain elements like Meta Seek, Cues, Chapters, Attachments MUST NOT be used in this context.
</t>
<t>On the player side, it is possible to detect that a stream is not seekable. If the stream does not have a Meta Seek list or a Cues list at the beginning of the stream, it SHOULD be considered as non seekable. Even though it's still theoretically possible to seek blindly forward in the stream, if the server supports it.
</t>
<t>In the context of a live radio or even web TV it is possible to &quot;Tag&quot; the content that is currently playing. The Tags level 1 element can be placed between Clusters each time necessary. In that case, the new Tags found MUST reset the previously encountered tags and use the new values instead (be they empty).
</t>
</section>

<section anchor="menu-specifications" title="Menu Specifications">
</section>

<section anchor="introduction-3" title="Introduction">
<t>This document is a <spanx style="emph">draft of the Menu system</spanx> that will be the default one in Matroska. 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>

<section anchor="requirements" title="Requirements">
<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 players, the Control Track will just give orders to the player and get the actions associated with the highlights/hotspots.
</t>

<section anchor="highlightshotspots" title="Highlights/Hotspots">
<t>A highlight is basically a rectangle/key associated with an action UID. When that rectangle/key is activated, the player 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>So this highlight is sent from the Control Track to the Player. Then the player has to handle that highlight until it's deactivated (see <eref target="{{site.baseurl}}/chapters/menu.html#playback-features">Playback features</eref>)
</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 player 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 player.
</t>
<t>The format used for storing images SHOULD be extensible. For the moment we'll use PNG and BMP, both with alpha channel.
</t>
</section>

<section anchor="playback-features" title="Playback features">
<t>All the following features will be sent from the Control Track to the Player :
</t>
<t>
<list style="symbols">
<t>Jump to chapter (UID, prev, next, number)</t>
<t>Disable all tracks of a kind (audio, video, subtitle)</t>
<t>Enable track UID (the kind doesn't matter)</t>
<t>Define/Disable a highlight</t>
<t>Enable/Disable jumping</t>
<t>Enable/Disable track selection of a kind</t>
<t>Select Edition ID (see chapters)</t>
<t>Pause playback</t>
<t>Stop playback</t>
<t>Enable/Disable a Chapter UID</t>
<t>Hide/Unhide a Chapter UID</t>
</list>
</t>
<t>All the actions will be written in a normal Matroska track, with a timecode. A &quot;Menu Frame&quot; SHOULD be able to contain more that one action/highlight for a given timecode. (to be determined, EBML format structure)
</t>
</section>

<section anchor="player-requirements" title="Player requirements">
<t>Some players 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 player encounter the default Control Track of a Matroska file, the first order SHOULD be to jump at the start of the active/looped part of the movie.
</t>
</section>
</section>

<section anchor="working-graph" title="Working Graph">
</section>

<section anchor="ideas" title="Ideas">
</section>

<section anchor="data-structure" title="Data Structure">
<t>As a Matroska side project, the obvious choice for storing binary data is EBML.
</t>
</section>

</middle>
<back>
<references title="Normative References">
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3339.xml"?>
<?rfc include="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6386.xml"?>
</references>

</back>
</rfc>
