Matroskaslhomme@matroska.orgmoritz@bunkus.orgdave@dericed.com
art
cellarThis document defines the Matroska audiovisual container, including definitions of its structural Elements, as well as its terminology, vocabulary, and application.
Matroska aims to become THE standard of multimedia container formats. It was derived from a project called MCF, but differentiates from it significantly because it is based on EBML (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.
First, it is essential to clarify exactly "What an Audio/Video container is", to avoid any misunderstandings:
It is NOT a video or audio compression format (codec)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.Matroska is designed with the future in mind. It incorporates features like:
Fast seeking in the fileChapter entriesFull metadata (tags) supportSelectable subtitle/audio/video streamsModularly expandableError resilience (can recover playback even when the stream is damaged)Streamable over the internet and local networks (HTTP, CIFS, FTP, etc)Menus (like DVDs have)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.
This document is a work-in-progress specification defining the Matroska file format as part of the IETF Cellar working group. 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 here (PDF doc by Alexander Noé -- outdated).
For a simplified diagram of the layout of a Matroska file, see the Diagram page.
A more refined and detailed version of the EBML specifications is being worked on here.
The table found below is now generated from the "source" of the Matroska specification. This XML file 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.
Note that versions 1, 2 and 3 have been finalized. Version 4 is currently work in progress. There MAY be further additions to v4.
Matroska inherits security considerations from EBML.
Attacks on a Matroska Reader could include:
Storage of a arbitrary and potentially executable data within an Attachment Element. Matroska Readers that extract or use data from Matroska Attachments SHOULD check that the data adheres to expectations.A Matroska Attachment with an inaccurate mime-type.To be determined.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
Matroska is a Document Type of EBML (Extensible Binary Meta Language). This specification is dependent on the EBML Specification. For an understanding of Matroska's EBML Schema, see in particular the sections of the EBML Specification covering EBML Element Types, EBML Schema, and EBML Structure.
As an EBML Document Type, Matroska adds the following constraints to the EBML specification.
The docType of the EBML Header MUST be 'matroska'.The EBMLMaxIDLength of the EBML Header MUST be 4.The EBMLMaxSizeLength of the EBML Header MUST be 8 or less.All top-levels elements (Segment and direct sub-elements) are coded on 4 octets, i.e. class D elements.
Matroska from version 1 through 3 uses language codes that can be either the 3 letters bibliographic ISO-639-2 form (like "fre" for french), or such a language code followed by a dash and a country code for specialities in languages (like "fre-ca" for Canadian French). The ISO 639-2 Language Elements are "Language Element", "TagLanguage Element", and "ChapLanguage Element".
Starting in Matroska version 4, either ISO 639-2 or BCP 47 MAY be used, although BCP 47 is RECOMMENDED. The BCP 47 Language Elements are "LanguageIETF Element", "TagLanguageIETF Element", and "ChapLanguageIETF Element". If a BCP 47 Language Element and an ISO 639-2 Language Element are used within the same Parent Element, then the ISO 639-2 Lanaguage Element MUST be ignored and precedence given to the BCP 47 Language Element.
Country codes are the same as used for internet domains.
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 :
ChapterPhysicalEquivAudioVideoComment70SET / PACKAGESET / PACKAGEthe collection of different media60CD / 12" / 10" / 7" / TAPE / MINIDISC / DATDVD / VHS / LASERDISCthe physical medium like a CD or a DVD50SIDESIDEwhen the original medium (LP/DVD) has different sides40-LAYERanother physical level on DVDs30SESSIONSESSIONas found on CDs and DVDs20TRACK-as found on audio CDs10INDEX-the first logical level of the side/mediumSize = 1 + (1-8) + 4 + (4 + (4)) octets. So from 6 to 21 octets.
Bit 0 is the most significant bit.
Frames using references SHOULD be stored in "coding order". 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.
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.
OffsetPlayerDescription0x00+MUSTTrack Number (Track Entry). It is coded in EBML like form (1 octet if the value is < 0x80, 2 if < 0x4000, etc) (most significant bits set to increase the range).0x01+MUSTTimecode (relative to Cluster timecode, signed int16)OffsetBitPlayerDescription0x03+0-3-Reserved, set to 00x03+4-Invisible, the codec SHOULD decode this frame but not display it0x03+5-6MUSTLacing* 00 : no lacing* 01 : Xiph lacing* 11 : EBML lacing* 10 : fixed-size lacing0x03+7-not usedWhen lacing bit is set.
OffsetPlayerDescription0x00MUSTNumber of frames in the lace-1 (uint8)0x01 / 0xXXMUST*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).For (possibly) Laced Data
OffsetPlayerDescription0x00MUSTConsecutive laced framesLacing 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...
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:
Block head (with lacing bits set to 01)Lacing head: Number of frames in the lace -1, i.e. 2 (the 800 and 500 octets one)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.Data in frame 1Data in frame 2Data in frame 3A 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.
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 :
Bit RepresentationValue1xxx xxxxvalue -(2^6-1) to 2^6-1 (ie 0 to 2^7-2 minus 2^6-1, half of the range)01xx xxxx xxxx xxxxvalue -(2^13-1) to 2^13-1001x xxxx xxxx xxxx xxxx xxxxvalue -(2^20-1) to 2^20-10001 xxxx xxxx xxxx xxxx xxxx xxxx xxxxvalue -(2^27-1) to 2^27-10000 1xxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxxvalue -(2^34-1) to 2^34-10000 01xx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxxvalue -(2^41-1) to 2^41-10000 001x xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxxvalue -(2^48-1) to 2^48-1Block head (with lacing bits set to 11)Lacing head: Number of frames in the lace -1, i.e. 2 (the 800 and 400 octets one)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.Data in frame 1Data in frame 2Data in frame 3In 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 :
Block head (with lacing bits set to 10)Lacing head: Number of frames in the lace -1, i.e. 2Data in frame 1Data in frame 2Data in frame 3The 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.
Size = 1 + (1-8) + 4 + (4 + (4)) octets. So from 6 to 21 octets.
Bit 0 is the most significant bit.
Frames using references SHOULD be stored in "coding order". 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.
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.
OffsetPlayerDescription0x00+MUSTTrack Number (Track Entry). It is coded in EBML like form (1 octet if the value is < 0x80, 2 if < 0x4000, etc) (most significant bits set to increase the range).0x01+MUSTTimecode (relative to Cluster timecode, signed int16)OffsetBitPlayerDescription0x03+0-Keyframe, set when the Block contains only keyframes0x03+1-3-Reserved, set to 00x03+4-Invisible, the codec SHOULD decode this frame but not display it0x03+5-6MUSTLacing* 00 : no lacing* 01 : Xiph lacing* 11 : EBML lacing* 10 : fixed-size lacing0x03+7-Discardable, the frames of the Block can be discarded during playing if neededWhen lacing bit is set.
OffsetPlayerDescription0x00MUSTNumber of frames in the lace-1 (uint8)0x01 / 0xXXMUST*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).For (possibly) Laced Data
OffsetPlayerDescription0x00MUSTConsecutive laced framesA Matroska file is composed of one or many EBML Documents that use the Matroska Document Type. Each EBML Document MUST start with an EBML Header and then the Root Element, which is called Segment in Matroska. Matroska defines several Top Level Elements which MAY occur within the Segment.
As an example, a simple Matroska file consisting of a single EBML Document could be represented like this:
EBML HeaderSegmentA more complex Matroska file consisting of an EBML Stream (consisting of two EBML Documents) could be represented like this:
EBML HeaderSegmentEBML HeaderSegmentThe following diagram represents a simple Matroska file, comprised of an EBML Document with an EBML Header, a Segment Element (the Root Element), and all eight Matroska Top Level Elements. In the following diagrams of this section, horizontal spacing expresses a parent-child relationship between Matroska Elements (e.g. the Info Element is contained within the Segment Element) whereas vertical alignment represents the storage order within the file.
The Matroska EBML Schema defines eight Top Level Elements: SeekHead, Info, Tracks, Chapters, Cluster, Cues, Attachments, and Tags.
The SeekHead Element (also known as MetaSeek) contains an index of where other Top Level Elements of the Segment 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 SeekHead Element a Matroska Parser would have to search the entire file to find all of the other Top Level Elements. This is because Matroska has flexible ordering requirements; for instance, the Chapters Element could be stored after the Cluster Elements.
The Info Element contains vital information for identifying the whole Segment. This includes the title for the Segment, a randomly generated unique identifier so that the file can be identified around the world, and if it is part of a series of Segments, the unique identifier(s) of any linked Segments.
The Tracks Elements 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 Tracks Elements can store the name, number, unique identifier, language, and type (audio, video, subtitles, etc) of each track. The Tracks Element also identifies what codec to use to decode the track and has the codec's private data for the track.
The Chapters Element section lists all of the Chapters. Chapters are a way to set predefined points to jump to in video or audio.
The Cluster Elements contain all of the video frames and audio for each track. In a given Matroska file, there are usually many Cluster Elements. The Clusters help to break up the SimpleBlock or BlockGroup Elements and help with seeking and error protection. It is RECOMMENDED the size of each individual Cluster Element 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) BlockGroups or SimpleBlocks in each Cluster. A BlockGroup can contain a Block of data, and any information relating directly to that Block.
Below is a representation of the Block structure.
Portion of Block
Data Type
Bit FlagHeader
TrackNumberTimecodeFlagsGapLacingReservedOptional
FrameSizeData
FrameAlthough 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 Segment. 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.
The ReferenceBlock in the BlockGroup, is used instead of the basic "P-frame"/"B-frame" 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 ReferenceBlock Elements as you want for a Block, it allows for some extremely complex referencing.
The Cues Element is used to seek when playing back a file by providing a temporal index for each of the tracks. It is similar to the SeekHead Element, 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. Cues contains CuePoint Elements which store the timecode (CueTime) and then a listing for the exact position in the file for each of the tracks for that timecode. The Cues are pretty flexible for what exactly you want to index. For instance, you can index every single timecode of every Block or index selectively. If you have a video file, it is RECOMMENDED to index at least the keyframes of the video track.
The Attachments Element is for attaching files to a Matroska file such as pictures, webpages, programs, or even the codec needed to play back the file.
The Tags Element contains metadata that describes the Segment and potentially its Tracks, Chapters, and Attachments. 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.
This specification includes an EBML Schema 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.
In addition to the EBML Schema definition provided by the EBML Specification, Matroska adds the following additional attributes:
attribute namerequireddefinitionwebmNoA boolean to express if the Matroska Element is also supported within version 2 of the webm specification. Please consider the webm specification as the authoritative on webm.Here the definition of each Matroska Element is provided.
% concatenate with Matroska EBML Schema converted to markdown %
name: Segmentpath: 1*1(\Segment)id: 0x18538067minOccurs: 1maxOccurs: 1type: masterunknownsizeallowed: 1minver: 1documentation: The Root Element that contains all other Top-Level Elements (Elements defined only at Level 1). A Matroska file is composed of 1 Segment.
name: SeekHeadpath: 0*2(\Segment\SeekHead)id: 0x114D9B74maxOccurs: 2type: masterminver: 1documentation: Contains the Segment Position of other Top-Level Elements.
name: Seekpath: 1*(\Segment\SeekHead\Seek)id: 0x4DBBminOccurs: 1type: masterminver: 1documentation: Contains a single seek entry to an EBML Element.
name: SeekIDpath: 1*1(\Segment\SeekHead\Seek\SeekID)id: 0x53ABminOccurs: 1maxOccurs: 1type: binaryminver: 1documentation: The binary ID corresponding to the Element name.
name: SeekPositionpath: 1*1(\Segment\SeekHead\Seek\SeekPosition)id: 0x53ACminOccurs: 1maxOccurs: 1type: uintegerminver: 1documentation: The Segment Position of the Element.
name: Infopath: 1*(\Segment\Info)id: 0x1549A966minOccurs: 1type: masterminver: 1definition: Contains general information about the Segment.
name: SegmentUIDpath: 0*1(\Segment\Info\SegmentUID)id: 0x73A4maxOccurs: 1range: not 0size: 16type: binaryminver: 1definition: A randomly generated unique ID to identify the Segment amongst many others (128 bits).
usage notes: If the Segment is a part of a Linked Segment then this Element is REQUIRED.
name: SegmentFilenamepath: 0*1(\Segment\Info\SegmentFilename)id: 0x7384maxOccurs: 1type: utf-8minver: 1definition: A filename corresponding to this Segment.
name: PrevUIDpath: 0*1(\Segment\Info\PrevUID)id: 0x3CB923maxOccurs: 1size: 16type: binaryminver: 1definition: A unique ID to identify the previous Segment of a Linked Segment (128 bits).
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.
name: PrevFilenamepath: 0*1(\Segment\Info\PrevFilename)id: 0x3C83ABmaxOccurs: 1type: utf-8minver: 1definition: A filename corresponding to the file of the previous Linked Segment.
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.
name: NextUIDpath: 0*1(\Segment\Info\NextUID)id: 0x3EB923maxOccurs: 1size: 16type: binaryminver: 1definition: A unique ID to identify the next Segment of a Linked Segment (128 bits).
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.
name: NextFilenamepath: 0*1(\Segment\Info\NextFilename)id: 0x3E83BBmaxOccurs: 1type: utf-8minver: 1definition: A filename corresponding to the file of the next Linked Segment.
usage notes: Provision of the next filename is for display convenience, but NextUID SHOULD be considered authoritative for identifying the Next Segment.
name: SegmentFamilypath: 0*(\Segment\Info\SegmentFamily)id: 0x4444size: 16type: binaryminver: 1definition: A randomly generated unique ID that all Segments of a Linked Segment MUST share (128 bits).
usage notes: If the Segment is a part of a Linked Segment that uses Soft Linking then this Element is REQUIRED.
name: ChapterTranslatepath: 0*(\Segment\Info\ChapterTranslate)id: 0x6924type: masterminver: 1documentation: A tuple of corresponding ID used by chapter codecs to represent this Segment.
name: ChapterTranslateEditionUIDpath: 0*(\Segment\Info\ChapterTranslate\ChapterTranslateEditionUID)id: 0x69FCtype: uintegerminver: 1documentation: Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the Segment.
name: ChapterTranslateCodecpath: 1*1(\Segment\Info\ChapterTranslate\ChapterTranslateCodec)id: 0x69BFminOccurs: 1maxOccurs: 1type: uintegerminver: 1documentation: The chapter codec
name: ChapterTranslateIDpath: 1*1(\Segment\Info\ChapterTranslate\ChapterTranslateID)id: 0x69A5minOccurs: 1maxOccurs: 1type: binaryminver: 1documentation: The binary value used to represent this Segment in the chapter codec data. The format depends on the ChapProcessCodecID used.
name: TimecodeScalepath: 1*1(\Segment\Info\TimecodeScale)id: 0x2AD7B1minOccurs: 1maxOccurs: 1range: not 0default: 1000000type: uintegerminver: 1documentation: Timestamp scale in nanoseconds (1.000.000 means all timestamps in the Segment are expressed in milliseconds).
name: Durationpath: 0*1(\Segment\Info\Duration)id: 0x4489maxOccurs: 1range: > 0x0p+0type: floatminver: 1definition: Duration of the Segment in nanoseconds based on TimecodeScale.
name: DateUTCpath: 0*1(\Segment\Info\DateUTC)id: 0x4461maxOccurs: 1type: dateminver: 1documentation: The date and time that the Segment was created by the muxing application or library.
name: Titlepath: 0*1(\Segment\Info\Title)id: 0x7BA9maxOccurs: 1type: utf-8minver: 1documentation: General name of the Segment.
name: MuxingApppath: 1*1(\Segment\Info\MuxingApp)id: 0x4D80minOccurs: 1maxOccurs: 1type: utf-8minver: 1definition: Muxing application or library (example: "libmatroska-0.4.3").
usage notes: Include the full name of the application or library followed by the version number.
name: WritingApppath: 1*1(\Segment\Info\WritingApp)id: 0x5741minOccurs: 1maxOccurs: 1type: utf-8minver: 1definition: Writing application (example: "mkvmerge-0.3.3").
usage notes: Include the full name of the application followed by the version number.
name: Clusterpath: 0*(\Segment\Cluster)id: 0x1F43B675type: masterunknownsizeallowed: 1minver: 1documentation: The Top-Level Element containing the (monolithic) Block structure.
name: Timecodepath: 1*1(\Segment\Cluster\Timecode)id: 0xE7minOccurs: 1maxOccurs: 1type: uintegerminver: 1documentation: Absolute timestamp of the cluster (based on TimecodeScale).
name: SilentTrackspath: 0*1(\Segment\Cluster\SilentTracks)id: 0x5854maxOccurs: 1type: masterminver: 1documentation: 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.
name: SilentTrackNumberpath: 0*(\Segment\Cluster\SilentTracks\SilentTrackNumber)id: 0x58D7type: uintegerminver: 1documentation: 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.
name: Positionpath: 0*1(\Segment\Cluster\Position)id: 0xA7maxOccurs: 1type: uintegerminver: 1documentation: The Segment Position of the Cluster in the Segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.
name: PrevSizepath: 0*1(\Segment\Cluster\PrevSize)id: 0xABmaxOccurs: 1type: uintegerminver: 1documentation: Size of the previous Cluster, in octets. Can be useful for backward playing.
name: SimpleBlockpath: 0*(\Segment\Cluster\SimpleBlock)id: 0xA3type: binaryminver: 2documentation: Similar to Block but without all the extra information, mostly used to reduced overhead when no extra feature is needed. (see SimpleBlock Structure)
name: BlockGrouppath: 0*(\Segment\Cluster\BlockGroup)id: 0xA0type: masterminver: 1documentation: Basic container of information containing a single Block and information specific to that Block.
name: Blockpath: 1*1(\Segment\Cluster\BlockGroup\Block)id: 0xA1minOccurs: 1maxOccurs: 1type: binaryminver: 1documentation: Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)
name: BlockVirtualpath: 0*1(\Segment\Cluster\BlockGroup\BlockVirtual)id: 0xA2maxOccurs: 1type: binaryminver: 0maxver: 0documentation: 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)
name: BlockAdditionspath: 0*1(\Segment\Cluster\BlockGroup\BlockAdditions)id: 0x75A1maxOccurs: 1type: masterminver: 1documentation: 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.
name: BlockMorepath: 1*(\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore)id: 0xA6minOccurs: 1type: masterminver: 1documentation: Contain the BlockAdditional and some parameters.
name: BlockAddIDpath: 1*1(\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\BlockAddID)id: 0xEEminOccurs: 1maxOccurs: 1range: not 0default: 1type: uintegerminver: 1documentation: An ID to identify the BlockAdditional level.
name: BlockAdditionalpath: 1*1(\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\BlockAdditional)id: 0xA5minOccurs: 1maxOccurs: 1type: binaryminver: 1documentation: Interpreted by the codec as it wishes (using the BlockAddID).
name: BlockDurationpath: 0*1(\Segment\Cluster\BlockGroup\BlockDuration)id: 0x9BmaxOccurs: 1default: DefaultDurationtype: uintegerminver: 1documentation: 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 "display" 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.
name: ReferencePrioritypath: 1*1(\Segment\Cluster\BlockGroup\ReferencePriority)id: 0xFAminOccurs: 1maxOccurs: 1default: 0type: uintegerminver: 1documentation: 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.
name: ReferenceBlockpath: 0*(\Segment\Cluster\BlockGroup\ReferenceBlock)id: 0xFBtype: integerminver: 1documentation: Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to.
name: ReferenceVirtualpath: 0*1(\Segment\Cluster\BlockGroup\ReferenceVirtual)id: 0xFDmaxOccurs: 1type: integerminver: 0maxver: 0documentation: The Segment Position of the data that would otherwise be in position of the virtual block.
name: CodecStatepath: 0*1(\Segment\Cluster\BlockGroup\CodecState)id: 0xA4maxOccurs: 1type: binaryminver: 2documentation: The new codec state to use. Data interpretation is private to the codec. This information SHOULD always be referenced by a seek entry.
name: DiscardPaddingpath: 0*1(\Segment\Cluster\BlockGroup\DiscardPadding)id: 0x75A2maxOccurs: 1type: integerminver: 4documentation: 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.
name: Slicespath: 0*1(\Segment\Cluster\BlockGroup\Slices)id: 0x8EmaxOccurs: 1type: masterminver: 1documentation: Contains slices description.
name: TimeSlicepath: 0*(\Segment\Cluster\BlockGroup\Slices\TimeSlice)id: 0xE8type: masterminver: 1maxver: 1documentation: Contains extra time information about the data contained in the Block. Being able to interpret this Element is not REQUIRED for playback.
name: LaceNumberpath: 0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\LaceNumber)id: 0xCCmaxOccurs: 1default: 0type: uintegerminver: 1maxver: 1documentation: 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.
name: FrameNumberpath: 0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\FrameNumber)id: 0xCDmaxOccurs: 1default: 0type: uintegerminver: 0maxver: 0documentation: The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame).
name: BlockAdditionIDpath: 0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\BlockAdditionID)id: 0xCBmaxOccurs: 1default: 0type: uintegerminver: 0maxver: 0documentation: The ID of the BlockAdditional Element (0 is the main Block).
name: Delaypath: 0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\Delay)id: 0xCEmaxOccurs: 1default: 0type: uintegerminver: 0maxver: 0documentation: The (scaled) delay to apply to the Element.
name: SliceDurationpath: 0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\SliceDuration)id: 0xCFmaxOccurs: 1default: 0type: uintegerminver: 0maxver: 0documentation: The (scaled) duration to apply to the Element.
name: ReferenceFramepath: 0*1(\Segment\Cluster\BlockGroup\ReferenceFrame)id: 0xC8maxOccurs: 1type: masterminver: 0maxver: 0documentation:
DivX trick track extensions
name: ReferenceOffsetpath: 1*1(\Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceOffset)id: 0xC9minOccurs: 1maxOccurs: 1type: uintegerminver: 0maxver: 0documentation:
DivX trick track extensions
name: ReferenceTimeCodepath: 1*1(\Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceTimeCode)id: 0xCAminOccurs: 1maxOccurs: 1type: uintegerminver: 0maxver: 0documentation:
DivX trick track extensions
name: EncryptedBlockpath: 0*(\Segment\Cluster\EncryptedBlock)id: 0xAFtype: binaryminver: 0maxver: 0documentation: Similar to SimpleBlock but the data inside the Block are Transformed (encrypt and/or signed). (see EncryptedBlock Structure)
name: Trackspath: 0*(\Segment\Tracks)id: 0x1654AE6Btype: masterminver: 1documentation: A Top-Level Element of information with many tracks described.
name: TrackEntrypath: 1*(\Segment\Tracks\TrackEntry)id: 0xAEminOccurs: 1type: masterminver: 1documentation: Describes a track with all Elements.
name: TrackNumberpath: 1*1(\Segment\Tracks\TrackEntry\TrackNumber)id: 0xD7minOccurs: 1maxOccurs: 1range: not 0type: uintegerminver: 1documentation: The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number).
name: TrackUIDpath: 1*1(\Segment\Tracks\TrackEntry\TrackUID)id: 0x73C5minOccurs: 1maxOccurs: 1range: not 0type: uintegerminver: 1documentation: 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.
name: TrackTypepath: 1*1(\Segment\Tracks\TrackEntry\TrackType)id: 0x83minOccurs: 1maxOccurs: 1range: 1-254type: uintegerminver: 1documentation: A set of track types coded on 8 bits.
name: FlagEnabledpath: 1*1(\Segment\Tracks\TrackEntry\FlagEnabled)id: 0xB9minOccurs: 1maxOccurs: 1range: 0-1default: 1type: uintegerminver: 2documentation: Set if the track is usable. (1 bit)
name: FlagDefaultpath: 1*1(\Segment\Tracks\TrackEntry\FlagDefault)id: 0x88minOccurs: 1maxOccurs: 1range: 0-1default: 1type: uintegerminver: 1documentation: Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)
name: FlagForcedpath: 1*1(\Segment\Tracks\TrackEntry\FlagForced)id: 0x55AAminOccurs: 1maxOccurs: 1range: 0-1default: 0type: uintegerminver: 1documentation: 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)
name: FlagLacingpath: 1*1(\Segment\Tracks\TrackEntry\FlagLacing)id: 0x9CminOccurs: 1maxOccurs: 1range: 0-1default: 1type: uintegerminver: 1documentation: Set if the track MAY contain blocks using lacing. (1 bit)
name: MinCachepath: 1*1(\Segment\Tracks\TrackEntry\MinCache)id: 0x6DE7minOccurs: 1maxOccurs: 1default: 0type: uintegerminver: 1documentation: 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.
name: MaxCachepath: 0*1(\Segment\Tracks\TrackEntry\MaxCache)id: 0x6DF8maxOccurs: 1type: uintegerminver: 1documentation: The maximum cache size necessary to store referenced frames in and the current frame. 0 means no cache is needed.
name: DefaultDurationpath: 0*1(\Segment\Tracks\TrackEntry\DefaultDuration)id: 0x23E383maxOccurs: 1range: not 0type: uintegerminver: 1documentation: Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one Element put into a (Simple)Block).
name: DefaultDecodedFieldDurationpath: 0*1(\Segment\Tracks\TrackEntry\DefaultDecodedFieldDuration)id: 0x234E7AmaxOccurs: 1range: not 0type: uintegerminver: 4documentation: The period in nanoseconds (not scaled by TimcodeScale)
between two successive fields at the output of the decoding process (see the notes)
name: TrackTimecodeScalepath: 1*1(\Segment\Tracks\TrackEntry\TrackTimecodeScale)id: 0x23314FminOccurs: 1maxOccurs: 1range: > 0x0p+0default: 0x1p+0type: floatminver: 1maxver: 3documentation: 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).
name: TrackOffsetpath: 0*1(\Segment\Tracks\TrackEntry\TrackOffset)id: 0x537FmaxOccurs: 1default: 0type: integerminver: 0maxver: 0documentation: A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track.
name: MaxBlockAdditionIDpath: 1*1(\Segment\Tracks\TrackEntry\MaxBlockAdditionID)id: 0x55EEminOccurs: 1maxOccurs: 1default: 0type: uintegerminver: 1documentation: The maximum value of BlockAddID. A value 0 means there is no BlockAdditions for this track.
name: Namepath: 0*1(\Segment\Tracks\TrackEntry\Name)id: 0x536EmaxOccurs: 1type: utf-8minver: 1documentation: A human-readable track name.
name: Languagepath: 0*1(\Segment\Tracks\TrackEntry\Language)id: 0x22B59CmaxOccurs: 1default: engtype: stringminver: 1documentation: 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.
name: LanguageIETFpath: 0*1(\Segment\Tracks\TrackEntry\LanguageIETF)id: 0x22B59DmaxOccurs: 1type: stringminver: 4documentation: 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.
name: CodecIDpath: 1*1(\Segment\Tracks\TrackEntry\CodecID)id: 0x86minOccurs: 1maxOccurs: 1type: stringminver: 1documentation: An ID corresponding to the codec, see the codec page for more info.
name: CodecPrivatepath: 0*1(\Segment\Tracks\TrackEntry\CodecPrivate)id: 0x63A2maxOccurs: 1type: binaryminver: 1documentation: Private data only known to the codec.
name: CodecNamepath: 0*1(\Segment\Tracks\TrackEntry\CodecName)id: 0x258688maxOccurs: 1type: utf-8minver: 1documentation: A human-readable string specifying the codec.
name: AttachmentLinkpath: 0*1(\Segment\Tracks\TrackEntry\AttachmentLink)id: 0x7446maxOccurs: 1range: not 0type: uintegerminver: 1maxver: 3documentation: The UID of an attachment that is used by this codec.
name: CodecSettingspath: 0*1(\Segment\Tracks\TrackEntry\CodecSettings)id: 0x3A9697maxOccurs: 1type: utf-8minver: 0maxver: 0documentation: A string describing the encoding setting used.
name: CodecInfoURLpath: 0*(\Segment\Tracks\TrackEntry\CodecInfoURL)id: 0x3B4040type: stringminver: 0maxver: 0documentation: A URL to find information about the codec used.
name: CodecDownloadURLpath: 0*(\Segment\Tracks\TrackEntry\CodecDownloadURL)id: 0x26B240type: stringminver: 0maxver: 0documentation: A URL to download about the codec used.
name: CodecDecodeAllpath: 1*1(\Segment\Tracks\TrackEntry\CodecDecodeAll)id: 0xAAminOccurs: 1maxOccurs: 1range: 0-1default: 1type: uintegerminver: 2documentation: The codec can decode potentially damaged data (1 bit).
name: TrackOverlaypath: 0*(\Segment\Tracks\TrackEntry\TrackOverlay)id: 0x6FABtype: uintegerminver: 1documentation: 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.
name: CodecDelaypath: 0*1(\Segment\Tracks\TrackEntry\CodecDelay)id: 0x56AAmaxOccurs: 1default: 0type: uintegerminver: 4documentation: 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.
name: SeekPreRollpath: 1*1(\Segment\Tracks\TrackEntry\SeekPreRoll)id: 0x56BBminOccurs: 1maxOccurs: 1default: 0type: uintegerminver: 4documentation: After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder MUST decode before the decoded data is valid.
name: TrackTranslatepath: 0*(\Segment\Tracks\TrackEntry\TrackTranslate)id: 0x6624type: masterminver: 1documentation: The track identification for the given Chapter Codec.
name: TrackTranslateEditionUIDpath: 0*(\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateEditionUID)id: 0x66FCtype: uintegerminver: 1documentation: Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the Segment.
name: TrackTranslateCodecpath: 1*1(\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateCodec)id: 0x66BFminOccurs: 1maxOccurs: 1type: uintegerminver: 1documentation: The chapter codec.
name: TrackTranslateTrackIDpath: 1*1(\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateTrackID)id: 0x66A5minOccurs: 1maxOccurs: 1type: binaryminver: 1documentation: The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used.
name: Videopath: 0*1(\Segment\Tracks\TrackEntry\Video)id: 0xE0maxOccurs: 1type: masterminver: 1documentation: Video settings.
name: FlagInterlacedpath: 1*1(\Segment\Tracks\TrackEntry\Video\FlagInterlaced)id: 0x9AminOccurs: 1maxOccurs: 1range: 0-2default: 0type: uintegerminver: 2documentation: A flag to declare is the video is known to be progressive or interlaced and if applicable to declare details about the interlacement.
name: FieldOrderpath: 1*1(\Segment\Tracks\TrackEntry\Video\FieldOrder)id: 0x9DminOccurs: 1maxOccurs: 1range: 0-14default: 2type: uintegerminver: 4documentation: Declare the field ordering of the video. If FlagInterlaced is not set to 1, this Element MUST be ignored.
name: StereoModepath: 0*1(\Segment\Tracks\TrackEntry\Video\StereoMode)id: 0x53B8maxOccurs: 1default: 0type: uintegerminver: 3documentation: Stereo-3D video mode. There are some more details on 3D support in the Specification Notes.
name: AlphaModepath: 0*1(\Segment\Tracks\TrackEntry\Video\AlphaMode)id: 0x53C0maxOccurs: 1default: 0type: uintegerminver: 3documentation: Alpha Video Mode. Presence of this Element indicates that the BlockAdditional Element could contain Alpha data.
name: OldStereoModepath: 0*1(\Segment\Tracks\TrackEntry\Video\OldStereoMode)id: 0x53B9maxOccurs: 1type: uintegermaxver: 0documentation: DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska.
name: PixelWidthpath: 1*1(\Segment\Tracks\TrackEntry\Video\PixelWidth)id: 0xB0minOccurs: 1maxOccurs: 1range: not 0type: uintegerminver: 1documentation: Width of the encoded video frames in pixels.
name: PixelHeightpath: 1*1(\Segment\Tracks\TrackEntry\Video\PixelHeight)id: 0xBAminOccurs: 1maxOccurs: 1range: not 0type: uintegerminver: 1documentation: Height of the encoded video frames in pixels.
name: PixelCropBottompath: 0*1(\Segment\Tracks\TrackEntry\Video\PixelCropBottom)id: 0x54AAmaxOccurs: 1default: 0type: uintegerminver: 1documentation: The number of video pixels to remove at the bottom of the image (for HDTV content).
name: PixelCropToppath: 0*1(\Segment\Tracks\TrackEntry\Video\PixelCropTop)id: 0x54BBmaxOccurs: 1default: 0type: uintegerminver: 1documentation: The number of video pixels to remove at the top of the image.
name: PixelCropLeftpath: 0*1(\Segment\Tracks\TrackEntry\Video\PixelCropLeft)id: 0x54CCmaxOccurs: 1default: 0type: uintegerminver: 1documentation: The number of video pixels to remove on the left of the image.
name: PixelCropRightpath: 0*1(\Segment\Tracks\TrackEntry\Video\PixelCropRight)id: 0x54DDmaxOccurs: 1default: 0type: uintegerminver: 1documentation: The number of video pixels to remove on the right of the image.
name: DisplayWidthpath: 0*1(\Segment\Tracks\TrackEntry\Video\DisplayWidth)id: 0x54B0maxOccurs: 1range: not 0default: PixelWidth - PixelCropLeft - PixelCropRighttype: uintegerminver: 1documentation: 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.
name: DisplayHeightpath: 0*1(\Segment\Tracks\TrackEntry\Video\DisplayHeight)id: 0x54BAmaxOccurs: 1range: not 0default: PixelHeight - PixelCropTop - PixelCropBottomtype: uintegerminver: 1documentation: 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.
name: DisplayUnitpath: 0*1(\Segment\Tracks\TrackEntry\Video\DisplayUnit)id: 0x54B2maxOccurs: 1default: 0type: uintegerminver: 1documentation: How DisplayWidth & DisplayHeight are interpreted.
name: AspectRatioTypepath: 0*1(\Segment\Tracks\TrackEntry\Video\AspectRatioType)id: 0x54B3maxOccurs: 1default: 0type: uintegerminver: 1documentation: Specify the possible modifications to the aspect ratio.
name: ColourSpacepath: 0*1(\Segment\Tracks\TrackEntry\Video\ColourSpace)id: 0x2EB524maxOccurs: 1size: 4type: binaryminver: 1documentation: Same value as in AVI (32 bits).
name: GammaValuepath: 0*1(\Segment\Tracks\TrackEntry\Video\GammaValue)id: 0x2FB523maxOccurs: 1range: > 0x0p+0type: floatminver: 0maxver: 0documentation: Gamma Value.
name: FrameRatepath: 0*1(\Segment\Tracks\TrackEntry\Video\FrameRate)id: 0x2383E3maxOccurs: 1range: > 0x0p+0type: floatminver: 0maxver: 0documentation: Number of frames per second. Informational only.
name: Colourpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour)id: 0x55B0maxOccurs: 1type: masterminver: 4documentation: Settings describing the colour format.
name: MatrixCoefficientspath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MatrixCoefficients)id: 0x55B1maxOccurs: 1default: 2type: uintegerminver: 4documentation: 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.
name: BitsPerChannelpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\BitsPerChannel)id: 0x55B2maxOccurs: 1default: 0type: uintegerminver: 4documentation: Number of decoded bits per channel. A value of 0 indicates that the BitsPerChannel is unspecified.
name: ChromaSubsamplingHorzpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingHorz)id: 0x55B3maxOccurs: 1type: uintegerminver: 4documentation: 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.
name: ChromaSubsamplingVertpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingVert)id: 0x55B4maxOccurs: 1type: uintegerminver: 4documentation: 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.
name: CbSubsamplingHorzpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingHorz)id: 0x55B5maxOccurs: 1type: uintegerminver: 4documentation: 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.
name: CbSubsamplingVertpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingVert)id: 0x55B6maxOccurs: 1type: uintegerminver: 4documentation: The amount of pixels to remove in the Cb channel for every pixel not removed vertically. This is additive with ChromaSubsamplingVert.
name: ChromaSitingHorzpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingHorz)id: 0x55B7maxOccurs: 1default: 0type: uintegerminver: 4documentation: How chroma is subsampled horizontally.
name: ChromaSitingVertpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingVert)id: 0x55B8maxOccurs: 1default: 0type: uintegerminver: 4documentation: How chroma is subsampled vertically.
name: Rangepath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\Range)id: 0x55B9maxOccurs: 1default: 0type: uintegerminver: 4documentation: Clipping of the color ranges.
name: TransferCharacteristicspath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\TransferCharacteristics)id: 0x55BAmaxOccurs: 1default: 2type: uintegerminver: 4documentation: 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.
name: Primariespath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\Primaries)id: 0x55BBmaxOccurs: 1default: 2type: uintegerminver: 4documentation: 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.
name: MaxCLLpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MaxCLL)id: 0x55BCmaxOccurs: 1type: uintegerminver: 4documentation: Maximum brightness of a single pixel (Maximum Content Light Level) in candelas per square meter (cd/m²).
name: MaxFALLpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MaxFALL)id: 0x55BDmaxOccurs: 1type: uintegerminver: 4documentation: Maximum brightness of a single full frame (Maximum Frame-Average Light Level) in candelas per square meter (cd/m²).
name: MasteringMetadatapath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata)id: 0x55D0maxOccurs: 1type: masterminver: 4documentation: SMPTE 2086 mastering data.
name: PrimaryRChromaticityXpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryRChromaticityX)id: 0x55D1maxOccurs: 1range: 0-1type: floatminver: 4documentation: Red X chromaticity coordinate as defined by CIE 1931.
name: PrimaryRChromaticityYpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryRChromaticityY)id: 0x55D2maxOccurs: 1range: 0-1type: floatminver: 4documentation: Red Y chromaticity coordinate as defined by CIE 1931.
name: PrimaryGChromaticityXpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryGChromaticityX)id: 0x55D3maxOccurs: 1range: 0-1type: floatminver: 4documentation: Green X chromaticity coordinate as defined by CIE 1931.
name: PrimaryGChromaticityYpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryGChromaticityY)id: 0x55D4maxOccurs: 1range: 0-1type: floatminver: 4documentation: Green Y chromaticity coordinate as defined by CIE 1931.
name: PrimaryBChromaticityXpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryBChromaticityX)id: 0x55D5maxOccurs: 1range: 0-1type: floatminver: 4documentation: Blue X chromaticity coordinate as defined by CIE 1931.
name: PrimaryBChromaticityYpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\PrimaryBChromaticityY)id: 0x55D6maxOccurs: 1range: 0-1type: floatminver: 4documentation: Blue Y chromaticity coordinate as defined by CIE 1931.
name: WhitePointChromaticityXpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\WhitePointChromaticityX)id: 0x55D7maxOccurs: 1range: 0-1type: floatminver: 4documentation: White X chromaticity coordinate as defined by CIE 1931.
name: WhitePointChromaticityYpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\WhitePointChromaticityY)id: 0x55D8maxOccurs: 1range: 0-1type: floatminver: 4documentation: White Y chromaticity coordinate as defined by CIE 1931.
name: LuminanceMaxpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\LuminanceMax)id: 0x55D9maxOccurs: 1range: 0-9999.99type: floatminver: 4documentation: Maximum luminance. Represented in candelas per square meter (cd/m²).
name: LuminanceMinpath: 0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\LuminanceMin)id: 0x55DAmaxOccurs: 1range: 0-999.9999type: floatminver: 4documentation: Mininum luminance. Represented in candelas per square meter (cd/m²).
name: Projectionpath: 0*1(\Segment\Tracks\TrackEntry\Video\Projection)id: 0x7670maxOccurs: 1type: masterminver: 4documentation: Describes the video projection details. Used to render spherical and VR videos.
name: ProjectionTypepath: 1*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionType)id: 0x7671minOccurs: 1maxOccurs: 1range: 0-3default: 0type: uintegerminver: 4documentation: Describes the projection used for this video track.
name: ProjectionPrivatepath: 0*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPrivate)id: 0x7672maxOccurs: 1type: binaryminver: 4documentation: 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.
name: ProjectionPoseYawpath: 1*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPoseYaw)id: 0x7673minOccurs: 1maxOccurs: 1default: 0x0p+0type: floatminver: 4documentation: 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.
name: ProjectionPosePitchpath: 1*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPosePitch)id: 0x7674minOccurs: 1maxOccurs: 1default: 0x0p+0type: floatminver: 4documentation: 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.
name: ProjectionPoseRollpath: 1*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPoseRoll)id: 0x7675minOccurs: 1maxOccurs: 1default: 0x0p+0type: floatminver: 4documentation: 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.
name: Audiopath: 0*1(\Segment\Tracks\TrackEntry\Audio)id: 0xE1maxOccurs: 1type: masterminver: 1documentation: Audio settings.
name: SamplingFrequencypath: 1*1(\Segment\Tracks\TrackEntry\Audio\SamplingFrequency)id: 0xB5minOccurs: 1maxOccurs: 1range: > 0x0p+0default: 0x1.f4p+12type: floatminver: 1documentation: Sampling frequency in Hz.
name: OutputSamplingFrequencypath: 0*1(\Segment\Tracks\TrackEntry\Audio\OutputSamplingFrequency)id: 0x78B5maxOccurs: 1range: > 0x0p+0default: SamplingFrequencytype: floatminver: 1documentation: Real output sampling frequency in Hz (used for SBR techniques).
name: Channelspath: 1*1(\Segment\Tracks\TrackEntry\Audio\Channels)id: 0x9FminOccurs: 1maxOccurs: 1range: not 0default: 1type: uintegerminver: 1documentation: Numbers of channels in the track.
name: ChannelPositionspath: 0*1(\Segment\Tracks\TrackEntry\Audio\ChannelPositions)id: 0x7D7BmaxOccurs: 1type: binaryminver: 0maxver: 0documentation: Table of horizontal angles for each successive channel, see appendix.
name: BitDepthpath: 0*1(\Segment\Tracks\TrackEntry\Audio\BitDepth)id: 0x6264maxOccurs: 1range: not 0type: uintegerminver: 1documentation: Bits per sample, mostly used for PCM.
name: TrackOperationpath: 0*1(\Segment\Tracks\TrackEntry\TrackOperation)id: 0xE2maxOccurs: 1type: masterminver: 3documentation: Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject.
name: TrackCombinePlanespath: 0*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes)id: 0xE3maxOccurs: 1type: masterminver: 3documentation: Contains the list of all video plane tracks that need to be combined to create this 3D track
name: TrackPlanepath: 1*(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\TrackPlane)id: 0xE4minOccurs: 1type: masterminver: 3documentation: Contains a video plane track that need to be combined to create this 3D track
name: TrackPlaneUIDpath: 1*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\TrackPlane\TrackPlaneUID)id: 0xE5minOccurs: 1maxOccurs: 1range: not 0type: uintegerminver: 3documentation: The trackUID number of the track representing the plane.
name: TrackPlaneTypepath: 1*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\TrackPlane\TrackPlaneType)id: 0xE6minOccurs: 1maxOccurs: 1type: uintegerminver: 3documentation: The kind of plane this track corresponds to.
name: TrackJoinBlockspath: 0*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks)id: 0xE9maxOccurs: 1type: masterminver: 3documentation: Contains the list of all tracks whose Blocks need to be combined to create this virtual track
name: TrackJoinUIDpath: 1*(\Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks\TrackJoinUID)id: 0xEDminOccurs: 1range: not 0type: uintegerminver: 3documentation: The trackUID number of a track whose blocks are used to create this virtual track.
name: TrickTrackUIDpath: 0*1(\Segment\Tracks\TrackEntry\TrickTrackUID)id: 0xC0maxOccurs: 1type: uintegerminver: 0maxver: 0documentation:
DivX trick track extensions
name: TrickTrackSegmentUIDpath: 0*1(\Segment\Tracks\TrackEntry\TrickTrackSegmentUID)id: 0xC1maxOccurs: 1size: 16type: binaryminver: 0maxver: 0documentation:
DivX trick track extensions
name: TrickTrackFlagpath: 0*1(\Segment\Tracks\TrackEntry\TrickTrackFlag)id: 0xC6maxOccurs: 1default: 0type: uintegerminver: 0maxver: 0documentation:
DivX trick track extensions
name: TrickMasterTrackUIDpath: 0*1(\Segment\Tracks\TrackEntry\TrickMasterTrackUID)id: 0xC7maxOccurs: 1type: uintegerminver: 0maxver: 0documentation:
DivX trick track extensions
name: TrickMasterTrackSegmentUIDpath: 0*1(\Segment\Tracks\TrackEntry\TrickMasterTrackSegmentUID)id: 0xC4maxOccurs: 1size: 16type: binaryminver: 0maxver: 0documentation:
DivX trick track extensions
name: ContentEncodingspath: 0*1(\Segment\Tracks\TrackEntry\ContentEncodings)id: 0x6D80maxOccurs: 1type: masterminver: 1documentation: Settings for several content encoding mechanisms like compression or encryption.
name: ContentEncodingpath: 1*(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding)id: 0x6240minOccurs: 1type: masterminver: 1documentation: Settings for one content encoding like compression or encryption.
name: ContentEncodingOrderpath: 1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncodingOrder)id: 0x5031minOccurs: 1maxOccurs: 1default: 0type: uintegerminver: 1documentation: 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.
name: ContentEncodingScopepath: 1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncodingScope)id: 0x5032minOccurs: 1maxOccurs: 1range: not 0default: 1type: uintegerminver: 1documentation: 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)
name: ContentEncodingTypepath: 1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncodingType)id: 0x5033minOccurs: 1maxOccurs: 1default: 0type: uintegerminver: 1documentation: A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption
name: ContentCompressionpath: 0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentCompression)id: 0x5034maxOccurs: 1type: masterminver: 1documentation: 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.
name: ContentCompAlgopath: 1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentCompression\ContentCompAlgo)id: 0x4254minOccurs: 1maxOccurs: 1default: 0type: uintegerminver: 1documentation: The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 1 - bzlib, 2 - lzo1x 3 - Header Stripping
name: ContentCompSettingspath: 0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentCompression\ContentCompSettings)id: 0x4255maxOccurs: 1type: binaryminver: 1documentation: 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.
name: ContentEncryptionpath: 0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption)id: 0x5035maxOccurs: 1type: masterminver: 1documentation: Settings describing the encryption used. This Element MUST be present if the value of ContentEncodingType is 1 and absent otherwise.
name: ContentEncAlgopath: 0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentEncAlgo)id: 0x47E1maxOccurs: 1default: 0type: uintegerminver: 1documentation: 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
name: ContentEncKeyIDpath: 0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentEncKeyID)id: 0x47E2maxOccurs: 1type: binaryminver: 1documentation: For public key algorithms this is the ID of the public key the the data was encrypted with.
name: ContentSignaturepath: 0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentSignature)id: 0x47E3maxOccurs: 1type: binaryminver: 1documentation: A cryptographic signature of the contents.
name: ContentSigKeyIDpath: 0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentSigKeyID)id: 0x47E4maxOccurs: 1type: binaryminver: 1documentation: This is the ID of the private key the data was signed with.
name: ContentSigAlgopath: 0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentSigAlgo)id: 0x47E5maxOccurs: 1default: 0type: uintegerminver: 1documentation: 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
name: ContentSigHashAlgopath: 0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\ContentEncryption\ContentSigHashAlgo)id: 0x47E6maxOccurs: 1default: 0type: uintegerminver: 1documentation: 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
name: Cuespath: 0*1(\Segment\Cues)id: 0x1C53BB6BmaxOccurs: 1type: masterminver: 1documentation: A Top-Level Element to speed seeking access. All entries are local to the Segment. This Element SHOULD be mandatory for non "live" streams.
name: CuePointpath: 1*(\Segment\Cues\CuePoint)id: 0xBBminOccurs: 1type: masterminver: 1documentation: Contains all information relative to a seek point in the Segment.
name: CueTimepath: 1*1(\Segment\Cues\CuePoint\CueTime)id: 0xB3minOccurs: 1maxOccurs: 1type: uintegerminver: 1documentation: Absolute timestamp according to the Segment time base.
name: CueTrackPositionspath: 1*(\Segment\Cues\CuePoint\CueTrackPositions)id: 0xB7minOccurs: 1type: masterminver: 1documentation: Contain positions for different tracks corresponding to the timestamp.
name: CueTrackpath: 1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueTrack)id: 0xF7minOccurs: 1maxOccurs: 1range: not 0type: uintegerminver: 1documentation: The track for which a position is given.
name: CueClusterPositionpath: 1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueClusterPosition)id: 0xF1minOccurs: 1maxOccurs: 1type: uintegerminver: 1documentation: The Segment Position of the Cluster containing the associated Block.
name: CueRelativePositionpath: 0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueRelativePosition)id: 0xF0maxOccurs: 1type: uintegerminver: 4documentation: The relative position of the referenced block inside the cluster with 0 being the first possible position for an Element inside that cluster.
name: CueDurationpath: 0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueDuration)id: 0xB2maxOccurs: 1type: uintegerminver: 4documentation: 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.
name: CueBlockNumberpath: 0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueBlockNumber)id: 0x5378maxOccurs: 1range: not 0default: 1type: uintegerminver: 1documentation: Number of the Block in the specified Cluster.
name: CueCodecStatepath: 0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueCodecState)id: 0xEAmaxOccurs: 1default: 0type: uintegerminver: 2documentation: The Segment Position of the Codec State corresponding to this Cue Element. 0 means that the data is taken from the initial Track Entry.
name: CueReferencepath: 0*(\Segment\Cues\CuePoint\CueTrackPositions\CueReference)id: 0xDBtype: masterminver: 2documentation: The Clusters containing the referenced Blocks.
name: CueRefTimepath: 1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefTime)id: 0x96minOccurs: 1maxOccurs: 1type: uintegerminver: 2documentation: Timestamp of the referenced Block.
name: CueRefClusterpath: 1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefCluster)id: 0x97minOccurs: 1maxOccurs: 1type: uintegerminver: 0maxver: 0documentation: The Segment Position of the Cluster containing the referenced Block.
name: CueRefNumberpath: 0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefNumber)id: 0x535FmaxOccurs: 1range: not 0default: 1type: uintegerminver: 0maxver: 0documentation: Number of the referenced Block of Track X in the specified Cluster.
name: CueRefCodecStatepath: 0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefCodecState)id: 0xEBmaxOccurs: 1default: 0type: uintegerminver: 0maxver: 0documentation: The Segment Position of the Codec State corresponding to this referenced Element. 0 means that the data is taken from the initial Track Entry.
name: Attachmentspath: 0*1(\Segment\Attachments)id: 0x1941A469maxOccurs: 1type: masterminver: 1documentation: Contain attached files.
name: AttachedFilepath: 1*(\Segment\Attachments\AttachedFile)id: 0x61A7minOccurs: 1type: masterminver: 1documentation: An attached file.
name: FileDescriptionpath: 0*1(\Segment\Attachments\AttachedFile\FileDescription)id: 0x467EmaxOccurs: 1type: utf-8minver: 1documentation: A human-friendly name for the attached file.
name: FileNamepath: 1*1(\Segment\Attachments\AttachedFile\FileName)id: 0x466EminOccurs: 1maxOccurs: 1type: utf-8minver: 1documentation: Filename of the attached file.
name: FileMimeTypepath: 1*1(\Segment\Attachments\AttachedFile\FileMimeType)id: 0x4660minOccurs: 1maxOccurs: 1type: stringminver: 1documentation: MIME type of the file.
name: FileDatapath: 1*1(\Segment\Attachments\AttachedFile\FileData)id: 0x465CminOccurs: 1maxOccurs: 1type: binaryminver: 1documentation: The data of the file.
name: FileUIDpath: 1*1(\Segment\Attachments\AttachedFile\FileUID)id: 0x46AEminOccurs: 1maxOccurs: 1range: not 0type: uintegerminver: 1documentation: Unique ID representing the file, as random as possible.
name: FileReferralpath: 0*1(\Segment\Attachments\AttachedFile\FileReferral)id: 0x4675maxOccurs: 1type: binaryminver: 0maxver: 0documentation: A binary value that a track/codec can refer to when the attachment is needed.
name: FileUsedStartTimepath: 0*1(\Segment\Attachments\AttachedFile\FileUsedStartTime)id: 0x4661maxOccurs: 1type: uintegerminver: 0maxver: 0documentation:
DivX font extension
name: FileUsedEndTimepath: 0*1(\Segment\Attachments\AttachedFile\FileUsedEndTime)id: 0x4662maxOccurs: 1type: uintegerminver: 0maxver: 0documentation:
DivX font extension
name: Chapterspath: 0*1(\Segment\Chapters)id: 0x1043A770maxOccurs: 1type: masterminver: 1documentation: A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation.
name: EditionEntrypath: 1*(\Segment\Chapters\EditionEntry)id: 0x45B9minOccurs: 1type: masterminver: 1documentation: Contains all information about a Segment edition.
name: EditionUIDpath: 0*1(\Segment\Chapters\EditionEntry\EditionUID)id: 0x45BCmaxOccurs: 1range: not 0type: uintegerminver: 1documentation: A unique ID to identify the edition. It's useful for tagging an edition.
name: EditionFlagHiddenpath: 1*1(\Segment\Chapters\EditionEntry\EditionFlagHidden)id: 0x45BDminOccurs: 1maxOccurs: 1range: 0-1default: 0type: uintegerminver: 1documentation: 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)
name: EditionFlagDefaultpath: 1*1(\Segment\Chapters\EditionEntry\EditionFlagDefault)id: 0x45DBminOccurs: 1maxOccurs: 1range: 0-1default: 0type: uintegerminver: 1documentation: If a flag is set (1) the edition SHOULD be used as the default one. (1 bit)
name: EditionFlagOrderedpath: 0*1(\Segment\Chapters\EditionEntry\EditionFlagOrdered)id: 0x45DDmaxOccurs: 1range: 0-1default: 0type: uintegerminver: 1documentation: Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)
name: ChapterAtompath: 1*(\Segment\Chapters\EditionEntry(1*(\ChapterAtom)))id: 0xB6minOccurs: 1type: masterrecursive: 1minver: 1documentation: Contains the atom information to use as the chapter atom (apply to all tracks).
name: ChapterUIDpath: 1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterUID)id: 0x73C4minOccurs: 1maxOccurs: 1range: not 0type: uintegerminver: 1documentation: A unique ID to identify the Chapter.
name: ChapterStringUIDpath: 0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterStringUID)id: 0x5654maxOccurs: 1type: utf-8minver: 3documentation: A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage.
name: ChapterTimeStartpath: 1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTimeStart)id: 0x91minOccurs: 1maxOccurs: 1type: uintegerminver: 1documentation: Timestamp of the start of Chapter (not scaled).
name: ChapterTimeEndpath: 0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTimeEnd)id: 0x92maxOccurs: 1type: uintegerminver: 1documentation: Timestamp of the end of Chapter (timestamp excluded, not scaled).
name: ChapterFlagHiddenpath: 1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterFlagHidden)id: 0x98minOccurs: 1maxOccurs: 1range: 0-1default: 0type: uintegerminver: 1documentation: 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)
name: ChapterFlagEnabledpath: 1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterFlagEnabled)id: 0x4598minOccurs: 1maxOccurs: 1range: 0-1default: 1type: uintegerminver: 1documentation: 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)
name: ChapterSegmentUIDpath: 0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterSegmentUID)id: 0x6E67maxOccurs: 1range: >0size: 16type: binaryminver: 1documentation: The SegmentUID of another Segment to play during this chapter.
usage notes: ChapterSegmentUID is mandatory if ChapterSegmentEditionUID is used.
name: ChapterSegmentEditionUIDpath: 0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterSegmentEditionUID)id: 0x6EBCmaxOccurs: 1range: not 0type: uintegerminver: 1documentation: The EditionUID to play from the Segment linked in ChapterSegmentUID. If ChapterSegmentEditionUID is undeclared then no Edition of the linked Segment is used.
name: ChapterPhysicalEquivpath: 0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterPhysicalEquiv)id: 0x63C3maxOccurs: 1type: uintegerminver: 1documentation: Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.
name: ChapterTrackpath: 0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTrack)id: 0x8FmaxOccurs: 1type: masterminver: 1documentation: List of tracks on which the chapter applies. If this Element is not present, all tracks apply
name: ChapterTrackNumberpath: 1*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTrack\ChapterTrackNumber)id: 0x89minOccurs: 1range: not 0type: uintegerminver: 1documentation: 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.
name: ChapterDisplaypath: 0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay)id: 0x80type: masterminver: 1documentation: Contains all possible strings to use for the chapter display.
name: ChapStringpath: 1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\ChapString)id: 0x85minOccurs: 1maxOccurs: 1type: utf-8minver: 1documentation: Contains the string to use as the chapter atom.
name: ChapLanguagepath: 1*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\ChapLanguage)id: 0x437CminOccurs: 1default: engtype: stringminver: 1documentation: 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.
name: ChapLanguageIETFpath: 0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\ChapLanguageIETF)id: 0x437DmaxOccurs: 1type: stringminver: 4documentation: 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.
name: ChapCountrypath: 0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\ChapCountry)id: 0x437Etype: stringminver: 1documentation: 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.
name: ChapProcesspath: 0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess)id: 0x6944type: masterminver: 1documentation: Contains all the commands associated to the Atom.
name: ChapProcessCodecIDpath: 1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\ChapProcessCodecID)id: 0x6955minOccurs: 1maxOccurs: 1default: 0type: uintegerminver: 1documentation: 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.
name: ChapProcessPrivatepath: 0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\ChapProcessPrivate)id: 0x450DmaxOccurs: 1type: binaryminver: 1documentation: Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.
name: ChapProcessCommandpath: 0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\ChapProcessCommand)id: 0x6911type: masterminver: 1documentation: Contains all the commands associated to the Atom.
name: ChapProcessTimepath: 1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\ChapProcessCommand\ChapProcessTime)id: 0x6922minOccurs: 1maxOccurs: 1type: uintegerminver: 1documentation: Defines when the process command SHOULD be handled
name: ChapProcessDatapath: 1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\ChapProcessCommand\ChapProcessData)id: 0x6933minOccurs: 1maxOccurs: 1type: binaryminver: 1documentation: 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.
name: Tagspath: 0*(\Segment\Tags)id: 0x1254C367type: masterminver: 1documentation: Element containing metadata describing Tracks, Editions, Chapters, Attachments, or the Segment as a whole. A list of valid tags can be found here.
name: Tagpath: 1*(\Segment\Tags\Tag)id: 0x7373minOccurs: 1type: masterminver: 1documentation: A single metadata descriptor.
name: Targetspath: 1*1(\Segment\Tags\Tag\Targets)id: 0x63C0minOccurs: 1maxOccurs: 1type: masterminver: 1documentation: 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.
name: TargetTypeValuepath: 0*1(\Segment\Tags\Tag\Targets\TargetTypeValue)id: 0x68CAmaxOccurs: 1default: 50type: uintegerminver: 1documentation: A number to indicate the logical level of the target.
name: TargetTypepath: 0*1(\Segment\Tags\Tag\Targets\TargetType)id: 0x63CAmaxOccurs: 1type: stringminver: 1documentation: An informational string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).
name: TagTrackUIDpath: 0*(\Segment\Tags\Tag\Targets\TagTrackUID)id: 0x63C5default: 0type: uintegerminver: 1documentation: 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.
name: TagEditionUIDpath: 0*(\Segment\Tags\Tag\Targets\TagEditionUID)id: 0x63C9default: 0type: uintegerminver: 1documentation: 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.
name: TagChapterUIDpath: 0*(\Segment\Tags\Tag\Targets\TagChapterUID)id: 0x63C4default: 0type: uintegerminver: 1documentation: 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.
name: TagAttachmentUIDpath: 0*(\Segment\Tags\Tag\Targets\TagAttachmentUID)id: 0x63C6default: 0type: uintegerminver: 1documentation: 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.
name: SimpleTagpath: 1*(\Segment\Tags\Tag(1*(\SimpleTag)))id: 0x67C8minOccurs: 1type: masterrecursive: 1minver: 1documentation: Contains general information about the target.
name: TagNamepath: 1*1(\Segment\Tags\Tag\SimpleTag\TagName)id: 0x45A3minOccurs: 1maxOccurs: 1type: utf-8minver: 1documentation: The name of the Tag that is going to be stored.
name: TagLanguagepath: 1*1(\Segment\Tags\Tag\SimpleTag\TagLanguage)id: 0x447AminOccurs: 1maxOccurs: 1default: undtype: stringminver: 1documentation: 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.
name: TagLanguageIETFpath: 0*1(\Segment\Tags\Tag\SimpleTag\TagLanguageIETF)id: 0x447BmaxOccurs: 1type: stringminver: 4documentation: 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.
name: TagDefaultpath: 1*1(\Segment\Tags\Tag\SimpleTag\TagDefault)id: 0x4484minOccurs: 1maxOccurs: 1range: 0-1default: 1type: uintegerminver: 1documentation: A boolean value to indicate if this is the default/original language to use for the given tag.
name: TagStringpath: 0*1(\Segment\Tags\Tag\SimpleTag\TagString)id: 0x4487maxOccurs: 1type: utf-8minver: 1documentation: The value of the Tag.
name: TagBinarypath: 0*1(\Segment\Tags\Tag\SimpleTag\TagBinary)id: 0x4485maxOccurs: 1type: binaryminver: 1documentation: The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString.
If you intend to implement a Matroska player, make sure you can handle all the files in our test suite, or at least the features presented there, not necessarily the same codecs.
An EBML file always starts with 0x1A. The 0x1A makes the DOS command "type" 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.
Next the EBML header is stored. This allows the the parser to know what type of EBML file it is parsing.
The Block's timecode is signed integer that represents the Raw Timecode relative to the Cluster'sTimecode, multiplied by the TimecodeScale (see the TimecodeScale notes).
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.
If a Cluster'sTimecode is set to zero, it is possible to have Blocks with a negative Raw Timecode. Blocks with a negative Raw Timecode are not valid.
The DefaultDecodedFieldDuration 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.
If the video sequence is signaled as interlaced, then the period between two successive fields at the output of the decoding process equals DefaultDecodedFieldDuration.
For video sequences signaled as progressive it is twice the value of DefaultDecodedFieldDuration.
These values are valid at the end of the decoding process before post-processing like deinterlacing or inverse telecine is applied.
Examples:
Blu-ray movie: 1000000000ns/(48/1.001) = 20854167nsPAL broadcast/DVD: 1000000000ns/(50/1.000) = 20000000nsN/ATSC broadcast: 1000000000ns/(60/1.001) = 16683333nshard-telecined DVD: 1000000000ns/(60/1.001) = 16683333ns (60 encoded interlaced fields per second)soft-telecined DVD: 1000000000ns/(60/1.001) = 16683333ns (48 encoded interlaced fields per second, with "repeat_first_field = 1")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 Language in the scope of the Track element). If the Parent Element is not present or assumed, then the Element cannot be assumed.
Digital Rights Management. See Encryption.
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.
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.
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.
Encryption information is stored in the ContentEncodings Master-element under the ContentEncryption Element.
Thanks to the PixelCropXXX elements, it's possible to crop the image before being resized. That means the image size follows this path:
PixelXXX (size of the coded image) -> PixelCropXXX (size of the image to keep) -> DisplayXXX (resized cropped image)
The EBML Header each Matroska file starts with contains two version number fields that inform a reading application about what to expect. These are DocTypeVersion and DocTypeReadVersion.
DocTypeVersion 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 DocTypeVersion of at least 2 while a file containing CueRelativePosition Elements MUST have a DocTypeVersion of at least 4.
The DocTypeReadVersion 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 CueRelativePosition (which is a version 4 Matroska Element) then DocTypeReadVersion SHOULD still be set to 2 and not 4 because evaluating CueRelativePosition is not REQUIRED for standard playback -- it only makes seeking more precise if used.
DocTypeVersion MUST always be equal to or greater than DocTypeReadVersion.
A reading application supporting Matroska version V MUST NOT refuse to read an application with DocReadTypeVersion equal to or lower than V even if DocTypeVersion is greater than V. See also the note about Unknown Elements.
There is no IETF endorsed MIME type for Matroska files. But you can use the ones we have defined on our web server:
.mka : Matroska audio audio/x-matroska.mkv : Matroska video video/x-matroska.mk3d : Matroska 3D video video/x-matroska-3dAn Octet refers to a byte made of 8 bits.
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.
The Segment Position of an Element refers to the position of the first octet of the Element ID of that Element, measured in octets, from the beginning of the Element Data section of the containing Segment Element. In other words, the Segment Position of an Element is the distance in octets from the beginning of its containing Segment Element minus the size of the Element ID and Element Data Size of that Segment Element. The Segment Position of the first Child Element of the Segment Element is 0. An Element which is not stored within a Segment Element, such as the Elements of the EBML Header, do not have a Segment Position.
Elements that are defined to store a Segment Position MAY define reserved values to indicate a special meaning.
This table presents an example of Segment Position by showing a hexadecimal representation of a very small Matroska file with labels to show the offsets in octets. The file contains a Segment Element with an Element ID of 0x18538067 and a MuxingApp Element with an Element ID of 0x4D80.
In the above example, the Element ID of the Segment Element is stored at offset 16, the Element Data Size of the Segment Element is stored at offset 20, and the Element Data of the Segment Element is stored at offset 21.
The MuxingApp Element is stored at offset 26. Since the Segment Position of an Element is calculated by subtracting the position of the Element Data of the containing Segment Element from the position of that Element, the Segment Position of MuxingApp Element in the above example is 26 - 21 or 5.
The exact time of an object represented in nanoseconds. To find out a Block's Raw Timecode, you need the Block's timecode, the Cluster'sTimecode, and the TimecodeScale. For calculation, please see the see the TimecodeScale notes.
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 SegmentUID.
Hard Linking (also called splitting) is the process of creating a Linked Segment by relating multiple Segments using the PrevUID and NextUID 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 NextUID and PrevUID MUST reference the respective SegmentUID values of the next and previous Segments. The first Segment of a Linked Segment MUST have a NextUID Element and MUST NOT have a PrevUID Element. The last Segment of a Linked Segment MUST have a PrevUID Element and MUST NOT have a NextUID Element. The middle Segments of a Linked Segment MUST have both a NextUID Element and a PrevUID Element.
As an example four Segments MAY be Hard Linked as a Linked Segment through cross-referencing each other with SegmentUID, PrevUID, and NextUID as in this table.
file nameSegmentUIDPrevUIDNextUIDstart.mkv71000c23cd31099853fbc94dd984a5ddn/aa77b3598941cb803eac0fcdafe44fac9middle.mkva77b3598941cb803eac0fcdafe44fac971000c23cd31099853fbc94dd984a5dd6c92285fa6d3e827b198d120ea3ac674end.mkv6c92285fa6d3e827b198d120ea3ac674a77b3598941cb803eac0fcdafe44fac9n/aSoft 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 Info Element (such as ChapterTranslate) that can translate a value representing a Segment in the chapter codec and to the current SegmentUID. 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.
Medium Linking creates relationships between Segments using Ordered Chapters and the ChapterSegmentUID 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 ChapterSegmentUID 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.
As an example a file named intro.mkv could have a SegmentUID of 0xb16a58609fc7e60653a60c984fc11ead. Another file called program.mkv could use a Chapter Edition that contains two Ordered Chapters. The first chapter references the Segment of intro.mkv with the use of a ChapterSegmentUID, ChapterSegmentEditionUID, ChapterTimeStart and optionally a ChapterTimeEnd element. The second chapter references content within the Segment of program.mkv. A player SHOULD recognize the Linked Segment created by the use of ChapterSegmentUID in an enabled Edition and present the reference content of the two Segments together.
Absolute Timecode = Block+ClusterRelative Timecode = BlockScaled Timecode = Block+ClusterRaw Timecode = (Block+Cluster)TimecodeScaleTrackTimecodeScaleThe TimecodeScale is used to calculate the Raw Timecode of a Block. The timecode is obtained by adding the Block's timecode to the Cluster'sTimecode, 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:
An example of this is, assume a Cluster'sTimecode has a value of 564264, the Block has a Timecode of 1233, and the timecodescale is the default of 1000000.
So, the Block in this example has a specific time of 565497000000 in nanoseconds. In milliseconds this would be 565497ms.
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.
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.
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.
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.
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 RawTimecode = round(1000000000 * sample_number / sample_rate). 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 RawTimecode = round(1000000000 * 52340 / 44100) = round(1186848072.56236) = 1186848073.
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: AbsoluteTimecode = round(RawTimecode / TimecodeScale_facotr) which will result in the following for our example: AbsoluteTimecode = round(1186848073 / 22675) = round(52341.7011245866) = 52342. This number is the one the application has to write to the file.
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?
First it has to calculate the Raw Timecode of the block it has just read. Here's no rounding involved, just an integer multiplication: RawTimecode = AbsoluteTimecode * TimecodeScale_factor. In our example: RawTimecode = 52342 * 22675 = 1186854850.
The conversion from the RawTimecode to the sample number again requires rounding: sample_number = round(RawTimecode * sample_rate / 1000000000). In our example: sample_number = round(1186854850 * 44100 / 1000000000) = round(52340.298885) = 52340. This is exactly the sample number that the previous program started with.
Some general notes for a program:
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.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.The "default track" 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 "default track" flag is set to "1". If no such track is found then the first track of this kind SHOULD be chosen.
Only one track of a kind MAY have its "default track" flag set in a segment. If a track entry does not contain the "default track" flag element then its default value "1" is to be used.
The "forced" flag tells the playback application that it MUST display/play this track or another track of the same kind that also has its "forced" flag set. When there are multiple "forced" 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 "forced" flag may be use simultaneously with the "forced" track (like DVD subtitles for example).
The TrackTimecodeScale 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.
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:
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.
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:
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 Raw Timecode in the order handed back from the encoder. The Raw Timecode of a Block from a track using TrackTimecodeScale is calculated using:
(Block's Timecode + Cluster's Timecode) * TimecodeScale * TrackTimecodeScaleSo, a Block from the PAL track above that had a Scaled Timecode of 100 seconds would have a Raw Timecode of 104.66666667 seconds, and so would be stored in that part of the file.
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.
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.
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.
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 version indicators that tell a reading application what to expect.
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.
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.
For the single track variant, there is the StereoMode 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.
There is also a "packed" 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).
For separate tracks, Matroska needs to define exactly which track does what. TrackOperation with TrackCombinePlanes do that. For more details look at how TrackOperation works.
The 3D support is still in infancy and may evolve to support more features.
The StereoMode used to be part of Matroska v2 but it didn't meet the requirement for multiple tracks. There was also a bug in libmatroska prior to 0.9.0 that would save/read it as 0x53B9 instead of 0x53B8. 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.
TrackOperation allows combining multiple tracks to make a virtual one. It uses 2 separate system to combine tracks. One to create a 3D "composition" (left/right/background planes) and one to simplify join 2 tracks together to make a single track.
A track created with TrackOperation is a proper track with a UID and all its flags. However the codec ID is meaningless because each "sub" track needs to be decoded by its own decoder before the "operation" 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).
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.
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.
A valid Matroska file requires only one Top-Level Element, the Info Element; however, to be playable Matroska MUST also contain at least one Tracks and Cluster Element. The first Info Element and the first Tracks Element MUST either be stored before the first Cluster Element or both be referenced by a SeekHead Element which occurs before the first Cluster Element.
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 SeekHead Element(s) MUST be updated so that the SeekHead 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.
As noted by the EBML specification, if a CRC-32 Element is used then the CRC-32 Element MUST be the first ordered Element within its Parent Element. The Matroska specification recommends that CRC-32 Elements SHOULD NOT be used as an immediate Child Element of the Segment Element; however all Top-Level Elements of an EBML Document SHOULD include a CRC-32 Element as a Child Element.
If used, the first SeekHead Element SHOULD be the first non-CRC-32 Child Element of the Segment Element. If a second SeekHead Element is used then the first SeekHead MUST reference the identity and position of the second SeekHead, the second SeekHead MUST only reference Cluster Elements and not any other Top-Level Element already contained within the first SeekHead, and the second SeekHead MAY be stored in any order relative to the other Top-Level Elements. Whether one or two SeekHead Element(s) are used, the SeekHead Element(s) MUST collectively reference the identity and position of all Top-Level Elements except for the first SeekHead itself.
It is RECOMMENDED that the first SeekHead Element be followed by some padding (a Void Element) to allow for the SeekHead Element to be expanded to cover new Top-Level Elements that could be added to the Matroska file, such as Tags, Chapters and Attachments Elements.
The Cues Element is RECOMMENDED to optimize seeking access in Matroska. It is programmatically simpler to add the Cues Element after all of the Cluster Elements are written because this does not require a prediction of how much space to reserve before writing the Cluster Elements. On the other hand, storing the Cues Element before the Cluster Elements can provide some seeking advantages. If the Cues Element is present, then it SHOULD either be stored before the first Cluster Element or be referenced by a SeekHead Element.
The first Info Element SHOULD occur before the first Tracks and first Cluster Element.
The Chapters Element SHOULD be placed before the Cluster Element(s). The Chapters 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 Chapters Element SHOULD be placed before the first Tracks Element and after the first Info Element.
The Attachments 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 Attachments Element MAY be placed before the first Cluster Element; however if the Attachments Element is likely to be edited, then it SHOULD be placed after the last Cluster Element.
The Tags Element is the one that is most subject to changes after the file was originally created. So for easier editing the Tags Element SHOULD be placed at the end of the Segment Element, even after the Attachments Element. On the other hand, it is inconvenient to have to seek in the Segment for tags especially for network streams. So it's better if the Tags Element(s) are found early in the stream. When editing the Tags Element(s), the original Tags Element at the beginning can be voided and a new one written right at the end of the Segment Element. The file size will only marginally change.
SeekHeadInfoTracksChaptersAttachmentsTagsClustersCuesSeekHeadInfoTracksChaptersAttachmentsVoidClustersCuesTagsSeekHeadInfoTracksChaptersAttachmentsTagsCuesClustersAs each BlockGroup and SimpleBlock of a Cluster Element needs the Cluster Timecode, the Timecode Element MUST occur as the first Child Element within the Cluster Element.
A Codec Mapping is a set of attributes to identify, name, and contextualise the format and characteristics of encoded data that can be contained within Matroska Clusters.
Each TrackEntry used within Matroska MUST reference a defined Codec Mapping using the Codec ID to identify and describe the format of the encoded data in its associated Clusters. This Codec ID 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.
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 Codec ID so that all developers supporting Matroska will use the same Codec ID. If you feel we missed support for a very important codec, please tell us on our development mailing list (cellar at ietf.org).
Support for a codec is defined in Matroska with the following values.
Each codec supported for storage in Matroska MUST have a unique Codec ID. Each Codec ID MUST be prefixed with the string from the following table according to the associated type of the codec. All characters of a Codec ID Prefix MUST be capital letters (A-Z) except for the last character of a Codec ID Prefix which MUST be an underscore ("_").
Codec Type | Codec ID Prefix
Video | "V_"
Audio | "A_"
Subtitle | "S_"
Button | "B_"
Each Codec ID MUST include a Major Codec ID immediately following the Codec ID Prefix. A Major Codec ID MAY be followed by an OPTIONAL Codec ID Suffix to communicate a refinement of the Major Codec ID. If a Codec ID Suffix is used, then the Codec ID MUST include a forward slash ("/") as a separator between the Major Codec ID and the Codec ID Suffix. The Major Codec ID MUST be composed of only capital letters (A-Z) and numbers (0-9). The Codec ID Suffix MUST be composed of only capital letters (A-Z), numbers (0-9), underscore ("_"), and forward slash ("/").
The following table provides examples of valid Codec IDs and their components:
Codec ID Prefix | Major Codec ID | Separator | Codec ID Suffix | Codec ID
A_ | AAC | / | MPEG2/LC/SBR | AAAC/MPEG2/LC/SBR
V | V_MPEG4 | / | ISO/ASP | VMPEG4/ISO/ASP
V | MPEG1 | | | V_MPEG1
Each encoding supported for storage in Matroska MUST have a Codec Name. The Codec Name provides a readable label for the encoding.
An optional description for the encoding. This value is only intended for human consumption.
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 CodecPrivate Element. When the Initialisation is updated within a track then that updated Initialisation data MUST be written into the CodecState Element of the first Cluster to require it. If the encoding does not require any form of Initialisation then none MUST be used to define the Initialisation and the CodecPrivate Element SHOULD NOT be written and MUST be ignored. Data that is defined Initialisation to be stored in the CodecPrivate Element is known as Private Data.
Documentation of the associated normative and informative references for the codec is RECOMMENDED.
A timestamp, expressed in that notes when support for the Codec Mapping within Matroska was deprecated. If a Codec Mapping is defined with a Deprecation Date, then it is RECOMMENDED that Matroska writers SHOULD NOT use the Codec Mapping after the Deprecation Date.
A Codec Mapping MAY only be defined with a Superseded By value, if it has an expressed Deprecation Date. If used, the Superseded By value MUST store the Codec ID of another Codec Mapping that has superseded the Codec Mapping.
Codec ID: V_MS/VFW/FOURCCCodec Name: Microsoft (TM) Video Codec Manager (VCM)
Description: The private data contains the VCM structure BITMAPINFOHEADER including the extra private bytes, as defined by Microsoft. 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 ???
Initialisation: Private Data contains the VCM structure BITMAPINFOHEADER including the extra private bytes, as defined by Microsoft in .
Citation: Codec ID: V_UNCOMPRESSED
Codec Name: Video, raw uncompressed video frames
Description: All details about the used colour specs and bit depth are to be put/read from the KaxCodecColourSpace elements.
Initialisation: none
Codec ID: V_MPEG4/ISO/SP
Codec Name: MPEG4 ISO simple profile (DivX4)
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.
Initialisation: none
Codec ID: V_MPEG4/ISO/ASP
Codec Name: MPEG4 ISO advanced simple profile (DivX5, XviD, FFMPEG)
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 no dummy frames inserted, the frame order is exactly the same as the coding order, same as in MP4 streams.
Initialisation: none
Codec ID: V_MPEG4/ISO/AP
Codec Name: MPEG4 ISO advanced profile
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 no dummy frames inserted, the frame order is exactly the same as the coding order, same as in MP4 streams.
Initialisation: none
Codec ID: V_MPEG4/MS/V3
Codec Name: Microsoft (TM) MPEG4 V3
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.
Initialisation: none
Codec ID: V_MPEG1
Codec Name: MPEG 1
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
Initialisation: none
Codec ID: V_MPEG2
Codec Name: MPEG 2
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
Initialisation: none
Codec ID: V_REAL/RV10
Codec Name: RealVideo 1.0 aka RealVideo 5
Description: Individual slices from the Real container are combined into a single frame.
Initialisation: The Private Data contains a real_video_props_t structure in Big Endian byte order as found in librmff.
Codec ID: V_REAL/RV20
Codec Name: RealVideo G2 and RealVideo G2+SVT
Description: Individual slices from the Real container are combined into a single frame.
Initialisation: The Private Data contains a real_video_props_t structure in Big Endian byte order as found in librmff.
Codec ID: V_REAL/RV30
Codec Name: RealVideo 8
Description: Individual slices from the Real container are combined into a single frame.
Initialisation: The Private Data contains a real_video_props_t structure in Big Endian byte order as found in librmff.
Codec ID: V_REAL/RV40
Codec Name: rv40 : RealVideo 9
Description: Individual slices from the Real container are combined into a single frame.
Initialisation: The Private Data contains a real_video_props_t structure in Big Endian byte order as found in librmff.
Codec ID: V_QUICKTIME
Codec Name: Video taken from QuickTime(TM) files
Description: Several codecs as stored in QuickTime, e.g. Sorenson or Cinepak.
Initialisation: The Private Data contains all additional data that is stored in the 'stsd' (sample description) atom in the QuickTime file after the mandatory video descriptor structure (starting with the size and FourCC fields). For an explanation of the QuickTime file format read QuickTime File Format Specification.
Codec ID: V_THEORA
Codec Name: Theora
Initialisation: The Private Data contains the first three Theora packets in order. The lengths of the packets precedes them. The actual layout is:
Byte 1: number of distinct packets '#p' minus one inside the CodecPrivate block. This MUST be '2' for current (as of 2016-07-08) Theora headers.Bytes 2..n: lengths of the first '#p' packets, coded in Xiph-style lacing. 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 Theora identification header, followed by the commend header followed by the codec setup header. Those are described in the Theora specs.Codec ID: V_PRORES
Codec Name: Apple ProRes
Initialisation: The Private Data contains the fourcc as found in MP4 movies:
apch: ProRes 422 High Qualityapcn: ProRes 422 Standard Definitionapcs: ProRes 422 LTapco: ProRes 422 Proxyap4h: ProRes 4444this page for more technical details on ProResCodec ID: V_VP8
Codec Name: VP8 Codec format
Description: VP8 is an open and royalty free video compression format developed by Google and created by On2 Technologies as a successor to VP7. Initialisation: none
Codec ID: V_VP9
Codec Name: VP9 Codec format
Description: VP9 is an open and royalty free video compression format developed by Google as a successor to VP8. Draft VP9 Bitstream and Decoding Process SpecificationInitialisation: none
Codec ID: V_FFV1
Codec Name: FF Video Codec 1
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. Draft FFV1 SpecificationInitialisation: For FFV1 versions 0 or 1, Private Data SHOULD NOT be written. For FFV1 version 3 or greater, the Private Data MUST contain the FFV1 Configuration Record structure, as defined in , and no other data.
Codec ID: A_MPEG/L3
Codec Name: MPEG Audio 1, 2, 2.5 Layer III
Description: The data contain everything needed for playback in the MPEG Audio header of each frame. Corresponding ACM wFormatTag : 0x0055
Initialisation: none
Codec ID: A_MPEG/L2
Codec Name: MPEG Audio 1, 2 Layer II
Description: The data contain everything needed for playback in the MPEG Audio header of each frame. Corresponding ACM wFormatTag : 0x0050
Initialisation: none
Codec ID: A_MPEG/L1
Codec Name: MPEG Audio 1, 2 Layer I
Description: The data contain everything needed for playback in the MPEG Audio header of each frame. Corresponding ACM wFormatTag : 0x0050
Initialisation: none
Codec ID: A_PCM/INT/BIG
Codec Name: PCM Integer Big Endian
Description: The bitdepth has to be read and set from KaxAudioBitDepth element. Corresponding ACM wFormatTag : ???
Initialisation: none
Codec ID: A_PCM/INT/LIT
Codec Name: PCM Integer Little Endian
Description: The bitdepth has to be read and set from KaxAudioBitDepth element. Corresponding ACM wFormatTag : 0x0001
Initialisation: none
Codec ID: A_PCM/FLOAT/IEEE
Codec Name: Floating Point, IEEE compatible
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
Initialisation: none
Codec ID: A_MPC
Codec Name: MPC (musepack) SV8
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.
Codec ID: A_AC3
Codec Name: (Dolby™) AC3
Description: BSID <= 8 !! The private data is void ??? Corresponding ACM wFormatTag : 0x2000 ; channel number have to be read from the corresponding audio element
Codec ID: A_AC3/BSID9
Codec Name: (Dolby™) AC3
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
Initialisation: none
Codec ID: A_AC3/BSID10
Codec Name: (Dolby™) AC3
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
Initialisation: none
Codec ID: A_ALAC
Codec Name: ALAC (Apple Lossless Audio Codec)
Initialisation: The Private Data contains ALAC's magic cookie (both the codec specific configuration as well as the optional channel layout information). Its format is described in ALAC's official source code.
Codec ID: A_DTS
Codec Name: Digital Theatre System
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
Initialisation: none
Codec ID: A_DTS/EXPRESS
Codec Name: Digital Theatre System Express
Description: DTS Express (a.k.a. LBR) audio streams. The private data is void. Corresponding ACM wFormatTag : 0x2001
Initialisation: none
Codec ID: A_DTS/LOSSLESS
Codec Name: Digital Theatre System Lossless
Description: DTS Lossless audio that does not have a core substream. The private data is void. Corresponding ACM wFormatTag : 0x2001
Initialisation: none
Codec ID: A_VORBIS
Codec Name: Vorbis
Initialisation: The Private Data 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 '#p' 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 '#p' packets, coded in Xiph-style lacing. 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 Vorbis identification header, followed by the Vorbis comment header followed by the codec setup header.
Codec ID: A_FLAC
Codec Name: FLAC (Free Lossless Audio Codec)Initialisation: The Private Data contains all the header/metadata packets before the first data packet. These include the first header packet containing only the word fLaC as well as all metadata packets.
Codec ID: A_REAL/14_4
Codec Name: Real Audio 1
Initialisation: The Private Data contains either the "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure (differentiated by their "version" field; Big Endian byte order) as found in librmff.
Codec ID: A_REAL/28_8
Codec Name: Real Audio 2
Initialisation: The Private Data contains either the "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure (differentiated by their "version" field; Big Endian byte order) as found in librmff.
Codec ID: A_REAL/COOK
Codec Name: Real Audio Cook Codec (codename: Gecko)
Initialisation: The Private Data contains either the "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure (differentiated by their "version" field; Big Endian byte order) as found in librmff.
Codec ID: A_REAL/SIPR
Codec Name: Sipro Voice Codec
Initialisation: The Private Data contains either the "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure (differentiated by their "version" field; Big Endian byte order) as found in librmff.
Codec ID: A_REAL/RALF
Codec Name: Real Audio Lossless Format
Initialisation: The Private Data contains either the "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure (differentiated by their "version" field; Big Endian byte order) as found in librmff.
Codec ID: A_REAL/ATRC
Codec Name: Sony Atrac3 Codec
Initialisation: The Private Data contains either the "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure (differentiated by their "version" field; Big Endian byte order) as found in librmff.
Codec ID: A_MS/ACM
Codec Name: Microsoft(TM) Audio Codec Manager (ACM)
Description: The data are stored in little endian format (like on IA32 machines).
Initialisation: The Private Data contains the ACM structure WAVEFORMATEX including the extra private bytes, as defined by Microsoft.
Codec ID: A_AAC/MPEG2/MAIN
Codec Name: MPEG2 Main Profile
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.
Initialisation: none
Codec ID: A_AAC/MPEG2/LC
Codec Name: Low Complexity
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.
Initialisation: none
Codec ID: A_AAC/MPEG2/LC/SBR
Codec Name: Low Complexity with Spectral Band Replication
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.
Initialisation: none
Codec ID: A_AAC/MPEG2/SSR
Codec Name: Scalable Sampling Rate
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.
Initialisation: none
Codec ID: A_AAC/MPEG4/MAIN
Codec Name: MPEG4 Main Profile
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.
Initialisation: none
Codec ID: A_AAC/MPEG4/LC
Codec Name: Low Complexity
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.
Initialisation: none
Codec ID: A_AAC/MPEG4/LC/SBR
Codec Name: Low Complexity with Spectral Band Replication
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.
Initialisation: none
Codec ID: A_AAC/MPEG4/SSR
Codec Name: Scalable Sampling Rate
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.
Initialisation: none
Codec ID: A_AAC/MPEG4/LTP
Codec Name: Long Term Prediction
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.
Initialisation: none
Codec ID: A_QUICKTIME
Codec Name: Audio taken from QuickTime(TM) files
Description: Several codecs as stored in QuickTime, e.g. QDesign Music v1 or v2.
Initialisation: The Private Data contains all additional data that is stored in the 'stsd' (sample description) atom in the QuickTime file after the mandatory sound descriptor structure (starting with the size and FourCC fields). For an explanation of the QuickTime file format read QuickTime File Format Specification.
Codec ID: A_QUICKTIME/QDMC
Codec Name: QDesign Music
Description:
Initialisation: The Private Data contains all additional data that is stored in the 'stsd' (sample description) atom in the QuickTime file after the mandatory sound descriptor structure (starting with the size and FourCC fields). For an explanation of the QuickTime file format read QuickTime File Format Specification.
Superseded By: A_QUICKTIME
Codec ID: A_QUICKTIME/QDM2
Codec Name: QDesign Music v2
Description:
Initialisation: The Private Data contains all additional data that is stored in the 'stsd' (sample description) atom in the QuickTime file after the mandatory sound descriptor structure (starting with the size and FourCC fields). For an explanation of the QuickTime file format read QuickTime File Format Specification.
Superseded By: A_QUICKTIME
Codec ID: A_TTA1
Codec Name: The True Audio lossless audio compressor
Description: TTA format description
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
Initialisation: none
Codec ID: A_WAVPACK4
Codec Name: WavPack lossless audio compressor
Description: The Wavpack packets consist of a stripped header followed by the frame data. For multi-track (> 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 WavPack muxing description.
Initialisation: none
Codec ID: S_TEXT/UTF8
Codec Name: UTF-8 Plain Text
Description: Basic text subtitles. For more information, please look at the Subtitle specifications.
Codec ID: S_TEXT/SSA
Codec Name: Subtitles Format
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 specs for SSA/ASS.
Codec ID: S_TEXT/ASS
Codec Name: Advanced Subtitles Format
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 specs for SSA/ASS.
Codec ID: S_TEXT/USF
Codec Name: Universal Subtitle Format
Description: This is mostly defined, but not typed out yet. It will first be available on the USF specs page.
Codec ID: S_TEXT/WEBVTT
Codec Name: Web Video Text Tracks Format (WebVTT)
Description: Advanced text subtitles. For more information about the storage please look at the WebVTT in Matroska specifications.
Codec ID: S_IMAGE/BMP
Codec Name: Bitmap
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.
Codec ID: S_DVBSUB
Codec Name: Digital Video Broadcasting (DVB) subtitles
Description: This is the graphical subtitle format used in the Digital Video Broadcasting standard. For more information about the storage please look at the Digital Video Broadcasting (DVB) subtitles in Matroska specifications.
Codec ID: S_VOBSUB
Codec Name: VobSub subtitles
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 alt: or langidx:. The line beginning with id: 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 CodecPrivate element.
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.
Codec ID: S_HDMV/PGS
Codec Name: HDMV presentation graphics subtitles (PGS)
Description: This is the graphical subtitle format used on Blu-rays. For more information about the storage please look at the HDMV presentation graphics subtitles in Matroska specifications.
Codec ID: S_HDMV/TEXTST
Codec Name: HDMV text subtitles
Description: This is the textual subtitle format used on Blu-rays. For more information about the storage please look at the HDMV text subtitles in Matroska specifications.
Codec ID: S_KATE
Codec Name: Karaoke And Text Encapsulation
Description: A subtitle format developed for ogg. The mapping for Matroska is described on the Xiph wiki. As for Theora and Vorbis, Kate headers are stored in the private data as xiph-laced packets.
Codec ID: B_VOBBTN
Codec Name: VobBtn Buttons
Description: Based on MPEG/VOB PCI packets. The file contains a header consisting of the string "butonDVD" followed by the width and height in pixels (16 bits integer each) and 4 reserved bytes. The rest is full PCI packets.
#Chapters
Two Chapter Flags are defined to describe the bevahior of the ChapterAtom Element: ChapterFlagHidden and ChapterFlagEnabled.
If a ChapterAtom Element is a Child Element of another ChapterAtom Element which has a Chapter Flag set to true, then the Child ChapterAtom Element MUST be interpretted as having its same Chapter Flag set to true. If a ChapterAtom Element is a Child Element of another ChapterAtom Element which has a Chapter Flag set to false or the ChapterAtom Element does not have a ChapterAtom Element as its Parent Element, then it MUST be interpretted according to its own Chapter Flag.
As an example, consider a Parent ChapterAtom Element that has its ChapterFlagHidden set to true and also contains two child ChapterAtoms, the first with ChapterFlagHidden set to true and the second with ChapterFlagHidden either set to false or not present at all (in which case the default value of the Element applies, which is false). Since the parent ChapterAtom has its ChapterFlagHidden set to true then all of its children ChapterAtoms MUST also be interpretted as if their ChapterFlagHidden is also set to true. However, if a Control Track toggles the parent's ChapterFlagHidden flag to false, then only the parent ChapterAtom and its second child ChapterAtom MUST be interpretted as if ChapterFlagHidden is set to false. The first child ChapterAtom which has the ChapterFlagHidden flag set to true retains its value until its value is toggled to false by a Control Track.
Three Edition Flags are defined to describe the bevahior of the EditionEntry Element: EditionFlagHidden, EditionFlagDefault and EditionFlagOrdered.
The EditionFlagHidden Flag behaves similarly to the ChapterFlagHidden Flag: if EditionFlagHidden is set to true then its Child ChapterAtoms Elements MUST also be interpretted as if their ChapterFlagHidden is also set to true, regardless of their own ChapterFlagHidden flags. If the EditionFlagHidden is toggled by a Control Track to false then the ChapterFlagHidden Flags of the Child ChapterAtoms Elements SHALL determine if the ChapterAtom is hidden or not.
The menu features are handled like a chapter codec. That means each codec has a type, some private data and some data in the chapters.
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).
This is the case when ChapProcessCodecID = 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 ";". You can also include comments at the end of lines with "//" or comment many lines using "/* */". The scripts are stored in ChapProcessData. For the moment ChapProcessPrivate is not used.
The one and only command existing for the moment is GotoAndPlay( ChapterUID );. 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.
This is the case when ChapProcessCodecID = 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:
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 | - |
You can also recover wether a Segment is a Video Manager (VMG), Video Title Set (VTS) or Video Title Set Menu (VTSM) from the ChapterTranslateID element found in the Segment Info. This field uses 2 octets as follows:
Domain Type: 0 for VMG, the domain number for VTS and VTSMDomain Value: 0 for VMG and VTSM, 1 for the VTS source.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]
The following octets of ChapProcessPrivate are as follows:
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)]
If the level specified in ChapProcessPrivate is a PGC (0x20), there is an octet called the Playback Type, specifying the kind of PGC defined:
0x00: entry only/basic PGC0x82: Title+Entry Menu (only found in the Video Manager domain)0x83: Root Menu (only found in the VTSM domain)0x84: Subpicture Menu (only found in the VTSM domain)0x85: Audio Menu (only found in the VTSM domain)0x86: Angle Menu (only found in the VTSM domain)0x87: Chapter Menu (only found in the VTSM domain)The next 4 following octets correspond to the User Operation flags in the standard PGC. When a bit is set, the command SHOULD be disabled.
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)].
More information on the DVD commands and format on DVD-replica, where we got most of the info about it. You can also get information on DVD from the DVDinfo project.
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.
00000ms - 05000ms : Intro05000ms - 25000ms : Before the crime25000ms - 27500ms : The crime27500ms - 38000ms : The killer arrested38000ms - 43000ms : CreditsThis would translate in the following matroska form :
In this example an (existing) album is split into different chapters, and one of them contain another splitting.
00:00 - 12:28 : Baby Wants To Bleep/Rock
00:00 - 04:38 : Baby wants to bleep (pt.1)04:38 - 07:12 : Baby wants to rock07:12 - 10:33 : Baby wants to bleep (pt.2)10:33 - 12:28 : Baby wants to bleep (pt.3)12:30 - 19:38 : Bleeper_O+219:40 - 22:20 : Baby wants to bleep (pt.4)22:22 - 25:18 : Bleep to bleep25:20 - 33:35 : Baby wants to bleep (k)33:37 - 44:28 : BleeperBecause 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.
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.
Here is a list of pointers for storing subtitles in Matroska:
Any Matroska file containing only subtitles SHOULD use the extension ".mks".As a general rule of thumb for all codecs, information that is global to an entire stream SHOULD be stored in the CodecPrivate element.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.Because a "subtitle" stream is actually just an overlay stream, anything with a transparency layer could be use, including video.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.
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.
The .IFO file will not be used at all.
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.
The .IDX file is reformatted (see below) and placed in the CodecPrivate.
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.
Here is an example .IDX file:
First, lines beginning with "#" are removed. These are comments to make text file editing easier, and as this is not a text file, they aren't needed.
Next remove the "langidx" and "id" 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.
Finally, the "timestamp" 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.
Once all of these items are removed, the data to store in the CodecPrivate SHOULD look like this:
There SHOULD also be two Blocks containing one image each with the timecodes "00:00:01:101" and "00:00:08:708".
SRT is perhaps the most basic of all subtitle formats.
It consists of four parts, all in text..
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.
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.
Here is an example SRT file:
In this example, the text "Senator, we're making our final approach into Coruscant." would be converted into UTF-8 and placed in the Block. The timecode of the block would be set to "00:02:17,440". And the BlockDuration element would be set to "00:00:02,935".
The same is repeated for the next subtitle.
Because there are no general settings for SRT, the CodecPrivate is left blank.
SSA stands for Sub Station Alpha. It's the file format used by the popular subtitle editor, SubStation Alpha. This format is widely used by fansubbers.
It allows you to do some advanced display features, like positioning, karaoke, style managements...
For detailed information on SSA/ASS, see the SSA specs. 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.
Like SRT, this format is text based with a particular syntax.
A file consists of 4 or 5 parts, declared ala INI file (but it's not an INI !)
The first, "[Script Info]" contains some information about the subtitle file, such as it's title, who created it, type of script and a very important one : "PlayResY". 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.
The second, "[V4 Styles]", 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 ...
For example this :
The third, "[Events]", 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).
"[Pictures]" or "[Fonts]" 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.
Now, how are they stored in Matroska ?
All text is converted to UTF-8* All the headers are stored in CodecPrivate ( Script Info and the Styles list)* Start & 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.) "ReadOrder field is needed for the decoder to be able to reorder the streamed samples as they were placed originally in the file."Here is an example of an SSA file.
Here is what would be placed into the CodecPrivate element.
And here are the two blocks that would be generated.
Block's timecode: 00:02:40.650
BlockDuration: 00:00:01.140
Block's timecode: 00:02:42.420
BlockDuration: 00:00:01.730
Under construction
The "Web Video Text Tracks Format" (short: WebVTT) is developed by the World Wide Web Consortium (W3C). Its specifications are freely available.
The guiding principles for the storage of WebVTT in Matroska are:
Consistency: store data in a similar way to other subtitle codecsSimplicity: making decoding and remuxing as easy as possible for existing infrastructuresCompleteness: keeping as much data as possible from the original WebVTT fileThe CodecID to use is S_TEXT/WEBVTT.
This element contains all global blocks before the first subtitle entry. This starts at the "WEBVTT" file identification marker but excludes the optional byte order mark.
Non-global WebVTT blocks (e.g. "NOTE") 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).
Each WebVTT Cue Text is stored directly in the Matroska Block.
A muxer MUST change all WebVTT Cue Timestamps present within the Cue Text to be relative to the Matroska Block's timestamp.
The Cue's start timestamp is used as the Matroska Block's timestamp.
The difference between the Cue's end timestamp and its start timestamp is used as the Matroska Block's duration.
Each Matroska Block may be accompanied by one BlockAdditions element. Its format is as follows:
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.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.The third and all following lines contain all WebVTT Comment Blocks that precede the current WebVTT Cue Block. These may be absent.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.
Here's an example how a WebVTT is transformed.
Let's take the following example file:
The resulting CodecPrivate element will look like this:
Example Cue 1: timestamp 00:00:00.000, duration 00:00:10.000, Block's content:
BlockAddition's content starts with one empty line as there's no Cue Settings List:
Example Cue 2: timestamp 00:00:25.000, duration 00:00:10.000, Block's content:
BlockAddition's content starts with two empty lines as there's neither a Cue Settings List nor a Cue Identifier:
Example Cue 3: timestamp 00:01:03.000, duration 00:00:03.500, Block's content:
BlockAddition's content ends with an empty line as there's no Cue Identifier and there were no WebVTT Comment blocks:
Example Cue 4: timestamp 00:03:10.000, duration 00:00:10.000, Block's content:
Example entry 4: Entries can even include timestamps. For example:This becomes visible five seconds after the first part.
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.
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 not support subtitles at all; the proposal suggests splitting the information across multiple tracks making demuxer's and remuxer's life very difficult.
The specifications for the HDMV presentation graphics subtitle format (short: HDMV PGS) can be found in the document "Blu-ray Disc Read-Only Format; Part 3 — Audio Visual Basic Specifications" in section 9.14 "HDMV graphics streams".
The CodecID to use is S_HDMV/PGS. A CodecPrivate element is not used.
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 "Segment coding structure and parameters" of the Blu-ray specifications.
Each Segment contains a presentation timestamp. This timestamp will be used as the timestamp for the Matroska Block.
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.
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.
The specifications for the HDMV text subtitle format (short: HDMV TextST) can be found in the document "Blu-ray Disc Read-Only Format; Part 3 — Audio Visual Basic Specifications" in section 9.15 "HDMV text subtitle streams".
The CodecID to use is S_HDMV/TEXTST.
A CodecPrivate Element is required. It MUST contain the stream's Dialog Style Segment as described in section 9.15.4.2 "Dialog Style Segment" of the Blu-ray specifications.
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 "Dialog presentation segment" of the Blu-ray specifications.
Each Segment contains a start and an end presentation timestamp (short: start PTS & 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.
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.
When TextST subtitles are stored inside Matroska, the only allowed character set is UTF-8.
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.
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.
The specifications for the Digital Video Broadcasting subtitle bitstream format (short: DVB subtitles) can be found in the document "ETSI EN 300 743 - Digital Video Broadcasting (DVB); Subtitling systems". The storage of DVB subtitles in MPEG transport streams is specified in the document "ETSI EN 300 468 - Digital Video Broadcasting (DVB); Specification for Service Information (SI) in DVB systems".
The CodecID to use is S_DVBSUB.
The CodecPrivate element is five bytes long and has the following structure:
2 bytes: composition page ID (bit string, left bit first)2 bytes: ancillary page ID (bit string, left bit first)1 byte: subtitling type (bit string, left bit first)The semantics of these bytes are the same as the ones described in section 6.2.41 "Subtitling descriptor" of ETSI EN 300 468.
Each Matroska Block consists of one or more DVB Subtitle Segments as described in segment 7.2 "Syntax and semantics of the subtitling segment" of ETSI EN 300 743.
Each Matroska Block SHOULD have a Duration indicating how long the DVB Subtitle Segments in that Block SHOULD be displayed.
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:
Targets
TrackUIDBAND
LEADPERFORMERADDRESS
DATEDATEENDADDRESS
DATEIn this way, it becomes possible to store any Tag as attributes of another tag.
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.
For authoring Tags outside of EBML, the following XML syntax is proposedused in mkvmerge. Binary data SHOULD be stored using BASE64 encoding if it is being stored at authoring time.
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.
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.
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).
To be able to save tags from other systems to Matroska we need to translate them to our system. There is a translation table on our site.
The TagName SHOULD always be written in all capital letters and contain no space.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, "2004". To store a specific day such as May 1st, 2003, you would use "2003-05-01".Fields that require a Float SHOULD use the "." mark instead of the "," mark. To display it differently for another local, applications SHOULD support auto replacement on display. Also, a thousandths separator SHOULD NOT be used.For currency amounts, there SHOULD only be a numeric value in the Tag. Only numbers, no letters or symbols other than ".". For instance, you would store "15.59" instead of "$15.59USD".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.
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 & 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).
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
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 "").
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.
Here is an example of how these organizational 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.
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.
Nesting Information tags are intended to contain other tags.
Tag NameTypeDescriptionORIGINAL-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 "under" the ORIGINAL tag like LYRICIST, PERFORMER, etc.SAMPLE-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 "under" the SAMPLE tag like TITLE, ARTIST, DATE_RELEASED, etc.COUNTRYUTF-8The name of the country (biblio ISO-639-2) 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 "under" the COUNTRY_SPECIFIC tag like LABEL, PUBLISH_RATING, etc.Tag NameTypeDescriptionTOTAL_PARTSUTF-8Total number of parts defined at the first lower level. (e.g. if TargetType is ALBUM, the total number of tracks of an audio CD)PART_NUMBERUTF-8Number of the current part of the current level. (e.g. if TargetType is TRACK, the track number of an audio CD)PART_OFFSETUTF-8A 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)Tag NameTypeDescriptionTITLEUTF-8The title of this item. For example, for music you might label this "Canon in D", or for video's audio track you might use "English 5.1" This is akin to the TIT2 tag in ID3.SUBTITLEUTF-8Sub Title of the entity.Nested Information includes tags contained in other tags.
Tag NameTypeDescriptionURLUTF-8URL corresponding to the tag it's included in.SORT_WITHUTF-8A child element to indicate what alternative value the parent tag can have to be sorted, for example "Pet Shop Boys" instead of "The Pet Shop Boys". Or "Marley Bob" and "Marley Ziggy" (no comma needed).INSTRUMENTSUTF-8The instruments that are being used/played, separated by a comma. It SHOULD be a child of the following tags: ARTIST, LEAD_PERFORMER or ACCOMPANIMENT.EMAILUTF-8Email corresponding to the tag it's included in.ADDRESSUTF-8The physical address of the entity. The address SHOULD include a country code. It can be useful for a recording label.FAXUTF-8The fax number corresponding to the tag it's included in. It can be useful for a recording label.PHONEUTF-8The phone number corresponding to the tag it's included in. It can be useful for a recording label.Tag NameTypeDescriptionARTISTUTF-8A person or band/collective generally considered responsible for the work. This is akin to the TPE1 tag in ID3.LEAD_PERFORMERUTF-8Lead Performer/Soloist(s). This can sometimes be the same as ARTIST.ACCOMPANIMENTUTF-8Band/orchestra/accompaniment/musician. This is akin to the TPE2 tag in ID3.COMPOSERUTF-8The name of the composer of this item. This is akin to the TCOM tag in ID3.ARRANGERUTF-8The person who arranged the piece, e.g., Ravel.LYRICSUTF-8The 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.LYRICISTUTF-8The person who wrote the lyrics for a musical item. This is akin to the TEXT tag in ID3.CONDUCTORUTF-8Conductor/performer refinement. This is akin to the TPE3.DIRECTORUTF-8This is akin to the IART tag in RIFF.ASSISTANT_DIRECTORUTF-8The name of the assistant director.DIRECTOR_OF_PHOTOGRAPHYUTF-8The name of the director of photography, also known as cinematographer. This is akin to the ICNM tag in Extended RIFF.SOUND_ENGINEERUTF-8The name of the sound engineer or sound recordist.ART_DIRECTORUTF-8The person who oversees the artists and craftspeople who build the sets.PRODUCTION_DESIGNERUTF-8Artist responsible for designing the overall visual appearance of a movie.CHOREGRAPHERUTF-8The name of the choregrapherCOSTUME_DESIGNERUTF-8The name of the costume designerACTORUTF-8An 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.CHARACTERUTF-8The name of the character an actor or actress plays in this movie. This SHOULD be a sub-tag of an ACTOR tag in order not to cause ambiguities.WRITTEN_BYUTF-8The author of the story or script (used for movies and TV shows).SCREENPLAY_BYUTF-8The author of the screenplay or scenario (used for movies and TV shows).EDITED_BYUTF-8This is akin to the IEDT tag in Extended RIFF.PRODUCERUTF-8Produced by. This is akin to the IPRO tag in Extended RIFF.COPRODUCERUTF-8The name of a co-producer.EXECUTIVE_PRODUCERUTF-8The name of an executive producer.DISTRIBUTED_BYUTF-8This is akin to the IDST tag in Extended RIFF.MASTERED_BYUTF-8The engineer who mastered the content for a physical medium or for digital distribution.ENCODED_BYUTF-8This is akin to the TENC tag in ID3.MIXED_BYUTF-8DJ mix by the artist specifiedREMIXED_BYUTF-8Interpreted, remixed, or otherwise modified by. This is akin to the TPE4 tag in ID3.PRODUCTION_STUDIOUTF-8This is akin to the ISTD tag in Extended RIFF.THANKS_TOUTF-8A very general tag for everyone else that wants to be listed.PUBLISHERUTF-8This is akin to the TPUB tag in ID3.LABELUTF-8The record label or imprint on the disc.Tag NameTypeDescriptionGENREUTF-8The main genre (classical, ambient-house, synthpop, sci-fi, drama, etc). The format follows the infamous TCON tag in ID3.MOODUTF-8Intended to reflect the mood of the item with a few keywords, e.g. "Romantic", "Sad" or "Uplifting". The format follows that of the TMOO tag in ID3.ORIGINAL_MEDIA_TYPEUTF-8Describes the original type of the media, such as, "DVD", "CD", "computer image," "drawing," "lithograph," and so forth. This is akin to the TMED tag in ID3.CONTENT_TYPEUTF-8The type of the item. e.g. Documentary, Feature Film, Cartoon, Music Video, Music, Sound FX, ...SUBJECTUTF-8Describes the topic of the file, such as "Aerial view of Seattle."DESCRIPTIONUTF-8A short description of the content, such as "Two birds flying."KEYWORDSUTF-8Keywords to the item separated by a comma, used for searching.SUMMARYUTF-8A plot outline or a summary of the story.SYNOPSISUTF-8A description of the story line of the item.INITIAL_KEYUTF-8The initial key that a musical track starts in. The format is identical to ID3.PERIODUTF-8Describes the period that the piece is from or about. For example, "Renaissance".LAW_RATINGUTF-8Depending on the COUNTRY 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).ICRAbinaryThe ICRA content rating for parental control. (Previously RSACi)Tag NameTypeDescriptionDATE_RELEASEDUTF-8The time that the item was originally released. This is akin to the TDRL tag in ID3.DATE_RECORDEDUTF-8The time that the recording began. This is akin to the TDRC tag in ID3.DATE_ENCODEDUTF-8The time that the encoding of this item was completed began. This is akin to the TDEN tag in ID3.DATE_TAGGEDUTF-8The time that the tags were done for this item. This is akin to the TDTG tag in ID3.DATE_DIGITIZEDUTF-8The time that the item was transferred to a digital medium. This is akin to the IDIT tag in RIFF.DATE_WRITTENUTF-8The time that the writing of the music/script began.DATE_PURCHASEDUTF-8Information on when the file was purchased (see also ).Tag NameTypeDescriptionRECORDING_LOCATIONUTF-8The location where the item was recorded. The countries corresponding to the string, same 2 octets as in Internet domains, or possibly ISO-3166. This code is followed by a comma, then more detailed information such as state/province, another comma, and then city. For example, "US, Texas, Austin". 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, "US, , Austin".COMPOSITION_LOCATIONUTF-8Location that the item was originally designed/written. The countries corresponding to the string, same 2 octets as in Internet domains, or possibly ISO-3166. This code is followed by a comma, then more detailed information such as state/province, another comma, and then city. For example, "US, Texas, Austin". 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, "US, , Austin".COMPOSER_NATIONALITYUTF-8Nationality of the main composer of the item, mostly for classical music. The countries corresponding to the string, same 2 octets as in Internet domains, or possibly ISO-3166.Tag NameTypeDescriptionCOMMENTUTF-8Any comment related to the content.PLAY_COUNTERUTF-8The number of time the item has been played.RATINGUTF-8A 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.Tag NameTypeDescriptionENCODERUTF-8The software or hardware used to encode this item. ("LAME" or "XviD")ENCODER_SETTINGSUTF-8A list of the settings used for encoding this item. No specific format.BPSUTF-8The average bits per second of the specified item. This is only the data in the Blocks, and excludes headers and any container overhead.FPSUTF-8The 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.BPMUTF-8Average number of beats per minute in the complete target (e.g. a chapter). Usually a decimal number.MEASUREUTF-8In music, a measure is a unit of time in Western music like "4/4". 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.TUNINGUTF-8It is saved as a frequency in hertz to allow near-perfect tuning of instruments to the same tone as the musical piece (e.g. "441.34" in Hertz). The default value is 440.0 Hz.REPLAYGAIN_GAINbinaryThe gain to apply to reach 89dB SPL on playback. This is based on the Replay Gain standard. Note that ReplayGain information can be found at all TargetType levels (track, album, etc).REPLAYGAIN_PEAKbinaryThe maximum absolute peak value of the item. This is based on the Replay Gain standard.Tag NameTypeDescriptionISRCUTF-8The International Standard Recording Code, excluding the "ISRC" prefix and including hyphens.MCDIbinaryThis 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.ISBNUTF-8International Standard Book NumberBARCODEUTF-8EAN-13 (European Article Numbering) or UPC-A (Universal Product Code) bar code identifierCATALOG_NUMBERUTF-8A label-specific string used to identify the release (TIC 01 for example).LABEL_CODEUTF-8A 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).LCCNUTF-8Library of Congress Control NumberTag NameTypeDescriptionPURCHASE_ITEMUTF-8URL to purchase this file. This is akin to the WPAY tag in ID3.PURCHASE_INFOUTF-8Information on where to purchase this album. This is akin to the WCOM tag in ID3.PURCHASE_OWNERUTF-8Information on the person who purchased the file. This is akin to the TOWN tag in ID3.PURCHASE_PRICEUTF-8The amount paid for entity. There SHOULD only be a numeric value in here. Only numbers, no letters or symbols other than ".". For instance, you would store "15.59" instead of "$15.59USD".PURCHASE_CURRENCYUTF-8The currency type used to pay for the entity. Use ISO-4217 for the 3 letter currency code.Tag NameTypeDescriptionCOPYRIGHTUTF-8The copyright information as per the copyright holder. This is akin to the TCOP tag in ID3.PRODUCTION_COPYRIGHTUTF-8The copyright information as per the production copyright holder. This is akin to the TPRO tag in ID3.LICENSEUTF-8The license applied to the content (like Creative Commons variants).TERMS_OF_USEUTF-8The terms of use for this item. This is akin to the USER tag in ID3.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.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.
Matroska Readers MUST NOT execute files stored as Attachments.
This section defines a set of guidelines for the storage of cover art in Matroska files. A Matroska Reader MAY use embedded cover art to display a representation still-image depiction of the multimedia contents of the Matroska file.
Cover art SHOULD only use the JPEG and PNG picture formats.
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).
There can be 2 versions of the same cover, the normal cover and the small cover. The dimension of the normal cover SHOULD be 600 on the smallest side (for example, 960x600 for landscape, 600x800 for portrait, or 600x600 for square). The dimension of the small cover SHOULD be 120 on the smallest side (for example, 192x120 or 120x160).
Versions of cover art can be differentiated by the filename, which is stored in the FileName Element. The default filename of the normal cover in square or portrait mode is cover.(jpg|png). When stored, the normal cover SHOULD be the first Attachment in storage order. The small cover SHOULD be prefixed with "small_", such as small_cover.(jpg|png). The landscape variant SHOULD be suffixed with "_land", such as cover_land.(jpg|png). The filenames are case sensitive and SHOULD all be lower case.
The following table provides examples of file names for cover art in Attachments.
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
The Cues Element provides an index of certain Cluster Elements to allow for optimized seeking to absolute timestamps within the Segment. The Cues Element contains one or many CuePoint Elements which each MUST reference an absolute timestamp (via the CueTime Element), a Track (via the CueTrack Element), and a Segment Position (via the CueClusterPosition Element). Additional non-mandated Elements are part of the CuePoint Element such as CueDuration, CueRelativePosition, CueCodecState and others which provide any potential Matroska reader with additional information to use in the optimization of seeking performance.
The following recommendations are provided to optimize Matroska performance.
Unless Matroska is used as a live stream, it SHOULD contain a Cues Element.For each video track, each keyframe SHOULD be referenced by a CuePoint Element.It is RECOMMENDED to not reference non-keyframes of video tracks in Cues unless it references a Cluster Element which contains a CodecState Element but no keyframes.For each subtitle track present, each subtitle frame SHOULD be referenced by a CuePoint Element with a CueDuration Element.Audio tracks SHOULD only be referenced in CuePoint Elements if no video track is present. In this case CuePoint Elements SHOULD reference audio keyframes at most once every 500 milliseconds.If the referenced frame is not stored within the first SimpleBlock or first BlockGroup within its Cluster Element, then the CueRelativePosition Element SHOULD be written to reference where in the Cluster the reference frame is stored.If a CuePoint Element references Cluster Element that includes a CodecState Element, then that CuePoint Element MUST use a CueCodecState Element.CuePoint Elements SHOULD be numerically sorted in storage order by the value of the CueTime Element.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.
In the case of Matroska, there are mostly 2 different kinds of stream: file access and live streaming.
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 few guidelines 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).
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.
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.
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 "unknown" 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).
The Segment(s) being continuous, certain elements like Meta Seek, Cues, Chapters, Attachments MUST NOT be used in this context.
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.
In the context of a live radio or even web TV it is possible to "Tag" 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).
This document is a draft of the Menu system that will be the default one in Matroska. As it will just be composed of a Control Track, it will be seen as a "codec" and could be replaced later by something else if needed.
A menu is like what you see on DVDs, when you have some screens to select the audio format, subtitles or scene selection.
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.
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.
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.
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 Playback features)
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).
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.
The format used for storing images SHOULD be extensible. For the moment we'll use PNG and BMP, both with alpha channel.
All the following features will be sent from the Control Track to the Player :
Jump to chapter (UID, prev, next, number)Disable all tracks of a kind (audio, video, subtitle)Enable track UID (the kind doesn't matter)Define/Disable a highlightEnable/Disable jumpingEnable/Disable track selection of a kindSelect Edition ID (see chapters)Pause playbackStop playbackEnable/Disable a Chapter UIDHide/Unhide a Chapter UIDAll the actions will be written in a normal Matroska track, with a timecode. A "Menu Frame" SHOULD be able to contain more that one action/highlight for a given timecode. (to be determined, EBML format structure)
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.
As a Matroska side project, the obvious choice for storing binary data is EBML.