idnits 2.17.1 draft-ietf-cellar-matroska-07.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == There are 3 instances of lines with non-ascii characters in the document. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (12 April 2021) is 1110 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Outdated reference: A later version (-12) exists of draft-ietf-cellar-codec-05 == Outdated reference: A later version (-12) exists of draft-ietf-cellar-tags-05 Summary: 0 errors (**), 0 flaws (~~), 4 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 cellar S. Lhomme 3 Internet-Draft 4 Intended status: Informational M. Bunkus 5 Expires: 14 October 2021 6 D. Rice 7 12 April 2021 9 Matroska Media Container Format Specifications 10 draft-ietf-cellar-matroska-07 12 Abstract 14 This document defines the Matroska audiovisual container, including 15 definitions of its structural elements, as well as its terminology, 16 vocabulary, and application. 18 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at https://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on 14 October 2021. 35 Copyright Notice 37 Copyright (c) 2021 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 42 license-info) in effect on the date of publication of this document. 43 Please review these documents carefully, as they describe your rights 44 and restrictions with respect to this document. Code Components 45 extracted from this document must include Simplified BSD License text 46 as described in Section 4.e of the Trust Legal Provisions and are 47 provided without warranty as described in the Simplified BSD License. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 52 2. Status of this document . . . . . . . . . . . . . . . . . . . 5 53 3. Security Considerations . . . . . . . . . . . . . . . . . . . 5 54 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 55 5. Notation and Conventions . . . . . . . . . . . . . . . . . . 6 56 6. Basis in EBML . . . . . . . . . . . . . . . . . . . . . . . . 6 57 6.1. Added Constraints on EBML . . . . . . . . . . . . . . . . 6 58 6.2. Matroska Design . . . . . . . . . . . . . . . . . . . . . 7 59 6.2.1. Language Codes . . . . . . . . . . . . . . . . . . . 7 60 6.2.2. Physical Types . . . . . . . . . . . . . . . . . . . 7 61 6.2.3. Block Structure . . . . . . . . . . . . . . . . . . . 8 62 6.2.4. Lacing . . . . . . . . . . . . . . . . . . . . . . . 9 63 7. Matroska Structure . . . . . . . . . . . . . . . . . . . . . 14 64 8. Matroska Schema . . . . . . . . . . . . . . . . . . . . . . . 22 65 8.1. EBMLMaxIDLength Element . . . . . . . . . . . . . . . . . 22 66 8.2. EBMLMaxSizeLength Element . . . . . . . . . . . . . . . . 23 67 9. Segment Element . . . . . . . . . . . . . . . . . . . . . . . 23 68 9.1. SeekHead Element . . . . . . . . . . . . . . . . . . . . 24 69 9.1.1. Seek Element . . . . . . . . . . . . . . . . . . . . 24 70 9.2. Info Element . . . . . . . . . . . . . . . . . . . . . . 25 71 9.2.1. SegmentUID Element . . . . . . . . . . . . . . . . . 25 72 9.2.2. SegmentFilename Element . . . . . . . . . . . . . . . 26 73 9.2.3. PrevUID Element . . . . . . . . . . . . . . . . . . . 26 74 9.2.4. PrevFilename Element . . . . . . . . . . . . . . . . 26 75 9.2.5. NextUID Element . . . . . . . . . . . . . . . . . . . 27 76 9.2.6. NextFilename Element . . . . . . . . . . . . . . . . 27 77 9.2.7. SegmentFamily Element . . . . . . . . . . . . . . . . 28 78 9.2.8. ChapterTranslate Element . . . . . . . . . . . . . . 28 79 9.2.9. TimestampScale Element . . . . . . . . . . . . . . . 30 80 9.2.10. Duration Element . . . . . . . . . . . . . . . . . . 30 81 9.2.11. DateUTC Element . . . . . . . . . . . . . . . . . . . 30 82 9.2.12. Title Element . . . . . . . . . . . . . . . . . . . . 31 83 9.2.13. MuxingApp Element . . . . . . . . . . . . . . . . . . 31 84 9.2.14. WritingApp Element . . . . . . . . . . . . . . . . . 31 85 9.3. Cluster Element . . . . . . . . . . . . . . . . . . . . . 32 86 9.3.1. Timestamp Element . . . . . . . . . . . . . . . . . . 32 87 9.3.2. SilentTracks Element . . . . . . . . . . . . . . . . 32 88 9.3.3. Position Element . . . . . . . . . . . . . . . . . . 33 89 9.3.4. PrevSize Element . . . . . . . . . . . . . . . . . . 33 90 9.3.5. SimpleBlock Element . . . . . . . . . . . . . . . . . 34 91 9.3.6. BlockGroup Element . . . . . . . . . . . . . . . . . 34 92 9.3.7. EncryptedBlock Element . . . . . . . . . . . . . . . 43 93 9.4. Tracks Element . . . . . . . . . . . . . . . . . . . . . 44 94 9.4.1. TrackEntry Element . . . . . . . . . . . . . . . . . 44 95 9.5. Cues Element . . . . . . . . . . . . . . . . . . . . . . 108 96 9.5.1. CuePoint Element . . . . . . . . . . . . . . . . . . 109 98 9.6. Attachments Element . . . . . . . . . . . . . . . . . . . 114 99 9.6.1. AttachedFile Element . . . . . . . . . . . . . . . . 114 100 9.7. Chapters Element . . . . . . . . . . . . . . . . . . . . 118 101 9.7.1. EditionEntry Element . . . . . . . . . . . . . . . . 118 102 9.8. Tags Element . . . . . . . . . . . . . . . . . . . . . . 127 103 9.8.1. Tag Element . . . . . . . . . . . . . . . . . . . . . 128 104 10. Matroska Element Ordering . . . . . . . . . . . . . . . . . . 135 105 10.1. Top-Level Elements . . . . . . . . . . . . . . . . . . . 135 106 10.2. CRC-32 . . . . . . . . . . . . . . . . . . . . . . . . . 135 107 10.3. SeekHead . . . . . . . . . . . . . . . . . . . . . . . . 136 108 10.4. Cues (index) . . . . . . . . . . . . . . . . . . . . . . 136 109 10.5. Info . . . . . . . . . . . . . . . . . . . . . . . . . . 136 110 10.6. Chapters Element . . . . . . . . . . . . . . . . . . . . 136 111 10.7. Attachments . . . . . . . . . . . . . . . . . . . . . . 137 112 10.8. Tags . . . . . . . . . . . . . . . . . . . . . . . . . . 137 113 10.9. Optimum layout from a muxer . . . . . . . . . . . . . . 137 114 10.10. Optimum layout after editing tags . . . . . . . . . . . 137 115 10.11. Optimum layout with Cues at the front . . . . . . . . . 138 116 10.12. Cluster Timestamp . . . . . . . . . . . . . . . . . . . 138 117 11. Chapters . . . . . . . . . . . . . . . . . . . . . . . . . . 138 118 11.1. EditionEntry . . . . . . . . . . . . . . . . . . . . . . 139 119 11.1.1. EditionFlagDefault . . . . . . . . . . . . . . . . . 139 120 11.1.2. Default Edition . . . . . . . . . . . . . . . . . . 139 121 11.1.3. EditionFlagOrdered . . . . . . . . . . . . . . . . . 140 122 11.1.4. ChapterSegmentUID . . . . . . . . . . . . . . . . . 141 123 11.2. ChapterAtom . . . . . . . . . . . . . . . . . . . . . . 142 124 11.2.1. ChapterTimeStart . . . . . . . . . . . . . . . . . . 142 125 11.2.2. ChapterTimeEnd . . . . . . . . . . . . . . . . . . . 142 126 11.2.3. ChapterFlagHidden . . . . . . . . . . . . . . . . . 143 127 11.3. Menu features . . . . . . . . . . . . . . . . . . . . . 143 128 11.4. Chapter Examples . . . . . . . . . . . . . . . . . . . . 144 129 11.4.1. Example 1 : basic chaptering . . . . . . . . . . . . 144 130 11.4.2. Example 2 : nested chapters . . . . . . . . . . . . 146 131 12. Attachments . . . . . . . . . . . . . . . . . . . . . . . . . 149 132 12.1. Cover Art . . . . . . . . . . . . . . . . . . . . . . . 149 133 13. Cues . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 134 13.1. Recommendations . . . . . . . . . . . . . . . . . . . . 150 135 14. Matroska Streaming . . . . . . . . . . . . . . . . . . . . . 151 136 14.1. File Access . . . . . . . . . . . . . . . . . . . . . . 151 137 14.2. Livestreaming . . . . . . . . . . . . . . . . . . . . . 152 138 15. Unknown elements . . . . . . . . . . . . . . . . . . . . . . 152 139 16. Default Values . . . . . . . . . . . . . . . . . . . . . . . 153 140 17. DefaultDecodedFieldDuration . . . . . . . . . . . . . . . . . 153 141 18. Encryption . . . . . . . . . . . . . . . . . . . . . . . . . 154 142 19. Image Presentation . . . . . . . . . . . . . . . . . . . . . 154 143 19.1. Cropping . . . . . . . . . . . . . . . . . . . . . . . . 154 144 19.2. Rotation . . . . . . . . . . . . . . . . . . . . . . . . 155 145 20. Matroska versioning . . . . . . . . . . . . . . . . . . . . . 155 146 21. MIME Types . . . . . . . . . . . . . . . . . . . . . . . . . 155 147 22. Segment Position . . . . . . . . . . . . . . . . . . . . . . 156 148 22.1. Segment Position Exception . . . . . . . . . . . . . . . 156 149 22.2. Example of Segment Position . . . . . . . . . . . . . . 156 150 23. Linked Segments . . . . . . . . . . . . . . . . . . . . . . . 157 151 23.1. Hard Linking . . . . . . . . . . . . . . . . . . . . . . 157 152 23.2. Medium Linking . . . . . . . . . . . . . . . . . . . . . 159 153 23.3. Soft Linking . . . . . . . . . . . . . . . . . . . . . . 160 154 24. Track Flags . . . . . . . . . . . . . . . . . . . . . . . . . 160 155 24.1. Default flag . . . . . . . . . . . . . . . . . . . . . . 160 156 24.2. Forced flag . . . . . . . . . . . . . . . . . . . . . . 160 157 24.3. Hearing-impaired flag . . . . . . . . . . . . . . . . . 160 158 24.4. Visual-impaired flag . . . . . . . . . . . . . . . . . . 161 159 24.5. Descriptions flag . . . . . . . . . . . . . . . . . . . 161 160 24.6. Original flag . . . . . . . . . . . . . . . . . . . . . 161 161 24.7. Commentary flag . . . . . . . . . . . . . . . . . . . . 161 162 24.8. Track Operation . . . . . . . . . . . . . . . . . . . . 161 163 24.9. Overlay Track . . . . . . . . . . . . . . . . . . . . . 162 164 24.10. Multi-planar and 3D videos . . . . . . . . . . . . . . . 162 165 25. Default track selection . . . . . . . . . . . . . . . . . . . 163 166 25.1. Audio Selection . . . . . . . . . . . . . . . . . . . . 163 167 25.2. Subtitle selection . . . . . . . . . . . . . . . . . . . 164 168 26. Timestamps . . . . . . . . . . . . . . . . . . . . . . . . . 166 169 26.1. Timestamp Types . . . . . . . . . . . . . . . . . . . . 166 170 26.2. Block Timestamps . . . . . . . . . . . . . . . . . . . . 166 171 26.3. Raw Timestamp . . . . . . . . . . . . . . . . . . . . . 167 172 26.4. TimestampScale . . . . . . . . . . . . . . . . . . . . . 167 173 26.5. TimestampScale Rounding . . . . . . . . . . . . . . . . 167 174 26.6. TrackTimestampScale . . . . . . . . . . . . . . . . . . 169 175 27. Normative References . . . . . . . . . . . . . . . . . . . . 171 176 28. Informative References . . . . . . . . . . . . . . . . . . . 172 177 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 172 179 1. Introduction 181 Matroska aims to become THE standard of multimedia container formats. 182 It was derived from a project called [MCF], but differentiates from 183 it significantly because it is based on EBML (Extensible Binary Meta 184 Language) [RFC8794], a binary derivative of XML. EBML enables 185 significant advantages in terms of future format extensibility, 186 without breaking file support in old parsers. 188 First, it is essential to clarify exactly "What an Audio/Video 189 container is", to avoid any misunderstandings: 191 * It is NOT a video or audio compression format (codec) 192 * It is an envelope for which there can be many audio, video, and 193 subtitles streams, allowing the user to store a complete movie or 194 CD in a single file. 196 Matroska is designed with the future in mind. It incorporates 197 features like: 199 * Fast seeking in the file 201 * Chapter entries 203 * Full metadata (tags) support 205 * Selectable subtitle/audio/video streams 207 * Modularly expandable 209 * Error resilience (can recover playback even when the stream is 210 damaged) 212 * Streamable over the internet and local networks (HTTP, CIFS, FTP, 213 etc) 215 * Menus (like DVDs have) 217 Matroska is an open standards project. This means for personal use 218 it is absolutely free to use and that the technical specifications 219 describing the bitstream are open to everybody, even to companies 220 that would like to support it in their products. 222 2. Status of this document 224 This document is a work-in-progress specification defining the 225 Matroska file format as part of the IETF Cellar working group 226 (https://datatracker.ietf.org/wg/cellar/charter/). But since it's 227 quite complete it is used as a reference for the development of 228 libmatroska. 230 Note that versions 1, 2, and 3 have been finalized. Version 4 is 231 currently work in progress. There MAY be further additions to v4. 233 3. Security Considerations 235 Matroska inherits security considerations from EBML. 237 Attacks on a "Matroska Reader" could include: 239 * Storage of a arbitrary and potentially executable data within an 240 "Attachment Element". "Matroska Readers" that extract or use data 241 from Matroska Attachments SHOULD check that the data adheres to 242 expectations. 244 * A "Matroska Attachment" with an inaccurate mime-type. 246 4. IANA Considerations 248 To be determined. 250 5. Notation and Conventions 252 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 253 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 254 "OPTIONAL" in this document are to be interpreted as described in BCP 255 14 [RFC2119] [RFC8174] when, and only when, they appear in all 256 capitals, as shown here. 258 This document defines specific terms in order to define the format 259 and application of "Matroska". Specific terms are defined below: 261 "Matroska": A multimedia container format based on EBML (Extensible 262 Binary Meta Language). 264 "Matroska Reader": A data parser that interprets the semantics of a 265 Matroska document and creates a way for programs to use 266 "Matroska". 268 "Matroska Player": A "Matroska Reader" with a primary purpose of 269 playing audiovisual files, including "Matroska" documents. 271 6. Basis in EBML 273 Matroska is a Document Type of EBML (Extensible Binary Meta 274 Language). This specification is dependent on the EBML Specification 275 [RFC8794]. For an understanding of Matroska's EBML Schema, see in 276 particular the sections of the EBML Specification covering EBML 277 Element Types (Section 7), EBML Schema (Section 11.1), and EBML 278 Structure (Section 3). 280 6.1. Added Constraints on EBML 282 As an EBML Document Type, Matroska adds the following constraints to 283 the EBML specification. 285 * The "docType" of the "EBML Header" MUST be "matroska". 287 * The "EBMLMaxIDLength" of the "EBML Header" MUST be "4". 289 * The "EBMLMaxSizeLength" of the "EBML Header" MUST be between "1" 290 and "8" inclusive. 292 6.2. Matroska Design 294 All top-levels elements (Segment and direct sub-elements) are coded 295 on 4 octets -- i.e. class D elements. 297 6.2.1. Language Codes 299 Matroska from version 1 through 3 uses language codes that can be 300 either the 3 letters bibliographic ISO-639-2 form [ISO639-2] (like 301 "fre" for french), or such a language code followed by a dash and a 302 country code for specialities in languages (like "fre-ca" for 303 Canadian French). The "ISO 639-2 Language Elements" are "Language 304 Element", "TagLanguage Element", and "ChapLanguage Element". 306 Starting in Matroska version 4, either [ISO639-2] or [BCP47] MAY be 307 used, although "BCP 47" is RECOMMENDED. The "BCP 47 Language 308 Elements" are "LanguageIETF Element", "TagLanguageIETF Element", and 309 "ChapLanguageIETF Element". If a "BCP 47 Language Element" and an 310 "ISO 639-2 Language Element" are used within the same "Parent 311 Element", then the "ISO 639-2 Language Element" MUST be ignored and 312 precedence given to the "BCP 47 Language Element". 314 Country codes are the same 2 octets country-codes as in Internet 315 domains [IANADomains] based on [ISO3166-1] alpha-2 codes. 317 6.2.2. Physical Types 319 Each level can have different meanings for audio and video. The 320 ORIGINAL_MEDIUM tag can be used to specify a string for 321 ChapterPhysicalEquiv = 60. Here is the list of possible levels for 322 both audio and video: 324 +======================+============+===========+=================+ 325 | ChapterPhysicalEquiv | Audio | Video | Comment | 326 +======================+============+===========+=================+ 327 | 70 | SET / | SET / | the collection | 328 | | PACKAGE | PACKAGE | of different | 329 | | | | media | 330 +----------------------+------------+-----------+-----------------+ 331 | 60 | CD / 12" / | DVD / VHS | the physical | 332 | | 10" / 7" / | / | medium like a | 333 | | TAPE / | LASERDISC | CD or a DVD | 334 | | MINIDISC / | | | 335 | | DAT | | | 336 +----------------------+------------+-----------+-----------------+ 337 | 50 | SIDE | SIDE | when the | 338 | | | | original medium | 339 | | | | (LP/DVD) has | 340 | | | | different sides | 341 +----------------------+------------+-----------+-----------------+ 342 | 40 | - | LAYER | another | 343 | | | | physical level | 344 | | | | on DVDs | 345 +----------------------+------------+-----------+-----------------+ 346 | 30 | SESSION | SESSION | as found on CDs | 347 | | | | and DVDs | 348 +----------------------+------------+-----------+-----------------+ 349 | 20 | TRACK | - | as found on | 350 | | | | audio CDs | 351 +----------------------+------------+-----------+-----------------+ 352 | 10 | INDEX | - | the first | 353 | | | | logical level | 354 | | | | of the side/ | 355 | | | | medium | 356 +----------------------+------------+-----------+-----------------+ 358 Table 1 360 6.2.3. Block Structure 362 Bit 0 is the most significant bit. 364 Frames using references SHOULD be stored in "coding order". That 365 means the references first, and then the frames referencing them. A 366 consequence is that timestamps might not be consecutive. But a frame 367 with a past timestamp MUST reference a frame already known, otherwise 368 it's considered bad/void. 370 6.2.3.1. Block Header 372 +========+========+=============================================+ 373 | Offset | Player | Description | 374 +========+========+=============================================+ 375 | 0x00+ | MUST | Track Number (Track Entry). It is coded in | 376 | | | EBML like form (1 octet if the value is < | 377 | | | 0x80, 2 if < 0x4000, etc) (most significant | 378 | | | bits set to increase the range). | 379 +--------+--------+---------------------------------------------+ 380 | 0x01+ | MUST | Timestamp (relative to Cluster timestamp, | 381 | | | signed int16) | 382 +--------+--------+---------------------------------------------+ 384 Table 2 386 6.2.3.2. Block Header Flags 388 +========+=====+========+====================================+ 389 | Offset | Bit | Player | Description | 390 +========+=====+========+====================================+ 391 | 0x03+ | 0-3 | - | Reserved, set to 0 | 392 +--------+-----+--------+------------------------------------+ 393 | 0x03+ | 4 | - | Invisible, the codec SHOULD decode | 394 | | | | this frame but not display it | 395 +--------+-----+--------+------------------------------------+ 396 | 0x03+ | 5-6 | MUST | Lacing | 397 +--------+-----+--------+------------------------------------+ 398 | | | | * 00 : no lacing | 399 +--------+-----+--------+------------------------------------+ 400 | | | | * 01 : Xiph lacing | 401 +--------+-----+--------+------------------------------------+ 402 | | | | * 11 : EBML lacing | 403 +--------+-----+--------+------------------------------------+ 404 | | | | * 10 : fixed-size lacing | 405 +--------+-----+--------+------------------------------------+ 406 | 0x03+ | 7 | - | not used | 407 +--------+-----+--------+------------------------------------+ 409 Table 3 411 6.2.4. Lacing 413 Lacing is a mechanism to save space when storing data. It is 414 typically used for small blocks of data (referred to as frames in 415 Matroska). There are 3 types of lacing: 417 1. Xiph, inspired by what is found in the Ogg container 418 2. EBML, which is the same with sizes coded differently 420 3. fixed-size, where the size is not coded 422 For example, a user wants to store 3 frames of the same track. The 423 first frame is 800 octets long, the second is 500 octets long and the 424 third is 1000 octets long. As these data are small, they can be 425 stored in a lace to save space. They will then be stored in the same 426 block as follows: 428 6.2.4.1. Xiph lacing 430 * Block head (with lacing bits set to 01) 432 * Lacing head: Number of frames in the lace -1 -- i.e. 2 (the 800 433 and 500 octets one) 435 * Lacing sizes: only the 2 first ones will be coded, 800 gives 436 255;255;255;35, 500 gives 255;245. The size of the last frame is 437 deduced from the total size of the Block. 439 * Data in frame 1 441 * Data in frame 2 443 * Data in frame 3 445 A frame with a size multiple of 255 is coded with a 0 at the end of 446 the size -- for example, 765 is coded 255;255;255;0. 448 6.2.4.2. EBML lacing 450 In this case, the size is not coded as blocks of 255 bytes, but as a 451 difference with the previous size and this size is coded as in EBML. 452 The first size in the lace is unsigned as in EBML. The others use a 453 range shifting to get a sign on each value: 455 +==========================+=============================+ 456 | Bit Representation | Value | 457 +==========================+=============================+ 458 | 1xxx xxxx | value -(2^(6)-1) to 2^(6)-1 | 459 | | (ie 0 to 2^(7)-2 minus | 460 | | 2^(6)-1, half of the range) | 461 +--------------------------+-----------------------------+ 462 | 01xx xxxx xxxx xxxx | value -(2^(13)-1) to | 463 | | 2^(13)-1 | 464 +--------------------------+-----------------------------+ 465 | 001x xxxx xxxx xxxx xxxx | value -(2^(20)-1) to | 466 | xxxx | 2^(20)-1 | 467 +--------------------------+-----------------------------+ 468 | 0001 xxxx xxxx xxxx xxxx | value -(2^(27)-1) to | 469 | xxxx xxxx xxxx | 2^(27)-1 | 470 +--------------------------+-----------------------------+ 471 | 0000 1xxx xxxx xxxx xxxx | value -(2^(34)-1) to | 472 | xxxx xxxx xxxx xxxx xxxx | 2^(34)-1 | 473 +--------------------------+-----------------------------+ 474 | 0000 01xx xxxx xxxx xxxx | value -(2^(41)-1) to | 475 | xxxx xxxx xxxx xxxx xxxx | 2^(41)-1 | 476 | xxxx xxxx | | 477 +--------------------------+-----------------------------+ 478 | 0000 001x xxxx xxxx xxxx | value -(2^(48)-1) to | 479 | xxxx xxxx xxxx xxxx xxxx | 2^(48)-1 | 480 | xxxx xxxx xxxx xxxx | | 481 +--------------------------+-----------------------------+ 483 Table 4 485 * Block head (with lacing bits set to 11) 487 * Lacing head: Number of frames in the lace -1 -- i.e. 2 (the 800 488 and 500 octets one) 490 * Lacing sizes: only the 2 first ones will be coded, 800 gives 0x320 491 0x4000 = 0x4320, 500 is coded as -300 : - 0x12C + 0x1FFF + 0x4000 492 = 0x5ED3. The size of the last frame is deduced from the total 493 size of the Block. 495 * Data in frame 1 497 * Data in frame 2 499 * Data in frame 3 501 6.2.4.3. Fixed-size lacing 503 In this case, only the number of frames in the lace is saved, the 504 size of each frame is deduced from the total size of the Block. For 505 example, for 3 frames of 800 octets each: 507 * Block head (with lacing bits set to 10) 509 * Lacing head: Number of frames in the lace -1 -- i.e. 2 511 * Data in frame 1 513 * Data in frame 2 515 * Data in frame 3 517 6.2.4.4. SimpleBlock Structure 519 The "SimpleBlock" is inspired by the Block structure; see 520 Section 6.2.3. The main differences are the added Keyframe flag and 521 Discardable flag. Otherwise everything is the same. 523 Bit 0 is the most significant bit. 525 Frames using references SHOULD be stored in "coding order". That 526 means the references first, and then the frames referencing them. A 527 consequence is that timestamps might not be consecutive. But a frame 528 with a past timestamp MUST reference a frame already known, otherwise 529 it's considered bad/void. 531 6.2.4.4.1. SimpleBlock Header 533 +========+========+=============================================+ 534 | Offset | Player | Description | 535 +========+========+=============================================+ 536 | 0x00+ | MUST | Track Number (Track Entry). It is coded in | 537 | | | EBML like form (1 octet if the value is < | 538 | | | 0x80, 2 if < 0x4000, etc) (most significant | 539 | | | bits set to increase the range). | 540 +--------+--------+---------------------------------------------+ 541 | 0x01+ | MUST | Timestamp (relative to Cluster timestamp, | 542 | | | signed int16) | 543 +--------+--------+---------------------------------------------+ 545 Table 5 547 6.2.4.4.2. SimpleBlock Header Flags 549 +========+=====+========+==========================================+ 550 | Offset | Bit | Player | Description | 551 +========+=====+========+==========================================+ 552 | 0x03+ | 0 | - | Keyframe, set when the Block contains | 553 | | | | only keyframes | 554 +--------+-----+--------+------------------------------------------+ 555 | 0x03+ | 1-3 | - | Reserved, set to 0 | 556 +--------+-----+--------+------------------------------------------+ 557 | 0x03+ | 4 | - | Invisible, the codec SHOULD decode this | 558 | | | | frame but not display it | 559 +--------+-----+--------+------------------------------------------+ 560 | 0x03+ | 5-6 | MUST | Lacing | 561 +--------+-----+--------+------------------------------------------+ 562 | | | | * 00 : no lacing | 563 +--------+-----+--------+------------------------------------------+ 564 | | | | * 01 : Xiph lacing | 565 +--------+-----+--------+------------------------------------------+ 566 | | | | * 11 : EBML lacing | 567 +--------+-----+--------+------------------------------------------+ 568 | | | | * 10 : fixed-size lacing | 569 +--------+-----+--------+------------------------------------------+ 570 | 0x03+ | 7 | - | Discardable, the frames of the Block can | 571 | | | | be discarded during playing if needed | 572 +--------+-----+--------+------------------------------------------+ 574 Table 6 576 6.2.4.5. Laced Data 578 When lacing bit is set. 580 +========+========+=============================================+ 581 | Offset | Player | Description | 582 +========+========+=============================================+ 583 | 0x00 | MUST | Number of frames in the lace-1 (uint8) | 584 +--------+--------+---------------------------------------------+ 585 | 0x01 / | MUST* | Lace-coded size of each frame of the lace, | 586 | 0xXX | | except for the last one (multiple uint8). | 587 | | | *This is not used with Fixed-size lacing as | 588 | | | it is calculated automatically from (total | 589 | | | size of lace) / (number of frames in lace). | 590 +--------+--------+---------------------------------------------+ 592 Table 7 594 For (possibly) Laced Data 595 +========+========+==========================+ 596 | Offset | Player | Description | 597 +========+========+==========================+ 598 | 0x00 | MUST | Consecutive laced frames | 599 +--------+--------+--------------------------+ 601 Table 8 603 7. Matroska Structure 605 A Matroska file MUST be composed of at least one "EBML Document" 606 using the "Matroska Document Type". Each "EBML Document" MUST start 607 with an "EBML Header" and MUST be followed by the "EBML Root 608 Element", defined as "Segment" in Matroska. Matroska defines several 609 "Top Level Elements" which MAY occur within the "Segment". 611 As an example, a simple Matroska file consisting of a single "EBML 612 Document" could be represented like this: 614 * "EBML Header" 616 * "Segment" 618 A more complex Matroska file consisting of an "EBML Stream" 619 (consisting of two "EBML Documents") could be represented like this: 621 * "EBML Header" 623 * "Segment" 625 * "EBML Header" 627 * "Segment" 629 The following diagram represents a simple Matroska file, comprised of 630 an "EBML Document" with an "EBML Header", a "Segment Element" (the 631 "Root Element"), and all eight Matroska "Top Level Elements". In the 632 following diagrams of this section, horizontal spacing expresses a 633 parent-child relationship between Matroska Elements (e.g., the "Info 634 Element" is contained within the "Segment Element") whereas vertical 635 alignment represents the storage order within the file. 637 +-------------+ 638 | EBML Header | 639 +---------------------------+ 640 | Segment | SeekHead | 641 | |-------------| 642 | | Info | 643 | |-------------| 644 | | Tracks | 645 | |-------------| 646 | | Chapters | 647 | |-------------| 648 | | Cluster | 649 | |-------------| 650 | | Cues | 651 | |-------------| 652 | | Attachments | 653 | |-------------| 654 | | Tags | 655 +---------------------------+ 657 The Matroska "EBML Schema" defines eight "Top Level Elements": 658 "SeekHead", "Info", "Tracks", "Chapters", "Cluster", "Cues", 659 "Attachments", and "Tags". 661 The "SeekHead Element" (also known as "MetaSeek") contains an index 662 of "Top Level Elements" locations within the "Segment". Use of the 663 "SeekHead Element" is RECOMMENDED. Without a "SeekHead Element", a 664 Matroska parser would have to search the entire file to find all of 665 the other "Top Level Elements". This is due to Matroska's flexible 666 ordering requirements; for instance, it is acceptable for the 667 "Chapters Element" to be stored after the "Cluster Elements". 669 +--------------------------------+ 670 | SeekHead | Seek | SeekID | 671 | | |--------------| 672 | | | SeekPosition | 673 +--------------------------------+ 675 Figure 1: Representation of a "SeekHead Element". 677 The "Info Element" contains vital information for identifying the 678 whole "Segment". This includes the title for the "Segment", a 679 randomly generated unique identifier, and the unique identifier(s) of 680 any linked "Segment Elements". 682 +-------------------------+ 683 | Info | SegmentUID | 684 | |------------------| 685 | | SegmentFilename | 686 | |------------------| 687 | | PrevUID | 688 | |------------------| 689 | | PrevFilename | 690 | |------------------| 691 | | NextUID | 692 | |------------------| 693 | | NextFilename | 694 | |------------------| 695 | | SegmentFamily | 696 | |------------------| 697 | | ChapterTranslate | 698 | |------------------| 699 | | TimestampScale | 700 | |------------------| 701 | | Duration | 702 | |------------------| 703 | | DateUTC | 704 | |------------------| 705 | | Title | 706 | |------------------| 707 | | MuxingApp | 708 | |------------------| 709 | | WritingApp | 710 |-------------------------| 712 Figure 2: Representation of an "Info Element" and its "Child 713 Elements". 715 The "Tracks Element" defines the technical details for each track and 716 can store the name, number, unique identifier, language, and type 717 (audio, video, subtitles, etc.) of each track. For example, the 718 "Tracks Element" MAY store information about the resolution of a 719 video track or sample rate of an audio track. 721 The "Tracks Element" MUST identify all the data needed by the codec 722 to decode the data of the specified track. However, the data 723 required is contingent on the codec used for the track. For example, 724 a "Track Element" for uncompressed audio only requires the audio bit 725 rate to be present. A codec such as AC-3 would require that the 726 "CodecID Element" be present for all tracks, as it is the primary way 727 to identify which codec to use to decode the track. 729 +------------------------------------+ 730 | Tracks | TrackEntry | TrackNumber | 731 | | |--------------| 732 | | | TrackUID | 733 | | |--------------| 734 | | | TrackType | 735 | | |--------------| 736 | | | Name | 737 | | |--------------| 738 | | | Language | 739 | | |--------------| 740 | | | CodecID | 741 | | |--------------| 742 | | | CodecPrivate | 743 | | |--------------| 744 | | | CodecName | 745 | | |----------------------------------+ 746 | | | Video | FlagInterlaced | 747 | | | |-------------------| 748 | | | | FieldOrder | 749 | | | |-------------------| 750 | | | | StereoMode | 751 | | | |-------------------| 752 | | | | AlphaMode | 753 | | | |-------------------| 754 | | | | PixelWidth | 755 | | | |-------------------| 756 | | | | PixelHeight | 757 | | | |-------------------| 758 | | | | DisplayWidth | 759 | | | |-------------------| 760 | | | | DisplayHeight | 761 | | | |-------------------| 762 | | | | AspectRatioType | 763 | | | |-------------------| 764 | | | | Color | 765 | | |----------------------------------| 766 | | | Audio | SamplingFrequency | 767 | | | |-------------------| 768 | | | | Channels | 769 | | | |-------------------| 770 | | | | BitDepth | 771 |--------------------------------------------------------| 773 Figure 3: Representation of the "Tracks Element" and a selection 774 of its "Descendant Elements". 776 The "Chapters Element" lists all of the chapters. Chapters are a way 777 to set predefined points to jump to in video or audio. 779 +-----------------------------------------+ 780 | Chapters | Edition | EditionUID | 781 | | Entry |--------------------| 782 | | | EditionFlagDefault | 783 | | |--------------------| 784 | | | EditionFlagOrdered | 785 | | |---------------------------------+ 786 | | | ChapterAtom | ChapterUID | 787 | | | |-------------------| 788 | | | | ChapterStringUID | 789 | | | |-------------------| 790 | | | | ChapterTimeStart | 791 | | | |-------------------| 792 | | | | ChapterTimeEnd | 793 | | | |-------------------| 794 | | | | ChapterFlagHidden | 795 | | | |-------------------------------+ 796 | | | | ChapterDisplay | ChapString | 797 | | | | |--------------| 798 | | | | | ChapLanguage | 799 +------------------------------------------------------------------+ 801 Figure 4: Representation of the "Chapters Element" and a 802 selection of its "Descendant Elements". 804 "Cluster Elements" contain the content for each track, e.g., video 805 frames. A Matroska file SHOULD contain at least one "Cluster 806 Element". The "Cluster Element" helps to break up "SimpleBlock" or 807 "BlockGroup Elements" and helps with seeking and error protection. 808 It is RECOMMENDED that the size of each individual "Cluster Element" 809 be limited to store no more than 5 seconds or 5 megabytes. Every 810 "Cluster Element" MUST contain a "Timestamp Element". This SHOULD be 811 the "Timestamp Element" used to play the first "Block" in the 812 "Cluster Element". There SHOULD be one or more "BlockGroup" or 813 "SimpleBlock Element" in each "Cluster Element". A "BlockGroup 814 Element" MAY contain a "Block" of data and any information relating 815 directly to that "Block". 817 +--------------------------+ 818 | Cluster | Timestamp | 819 | |----------------| 820 | | SilentTracks | 821 | |----------------| 822 | | Position | 823 | |----------------| 824 | | PrevSize | 825 | |----------------| 826 | | SimpleBlock | 827 | |----------------| 828 | | BlockGroup | 829 | |----------------| 830 | | EncryptedBlock | 831 +--------------------------+ 833 Figure 5: Representation of a "Cluster Element" and its immediate 834 "Child Elements". 836 +----------------------------------+ 837 | Block | Portion of | Data Type | 838 | | a Block | - Bit Flag | 839 | |--------------------------+ 840 | | Header | TrackNumber | 841 | | |-------------| 842 | | | Timestamp | 843 | | |-------------| 844 | | | Flags | 845 | | | - Gap | 846 | | | - Lacing | 847 | | | - Reserved | 848 | |--------------------------| 849 | | Optional | FrameSize | 850 | |--------------------------| 851 | | Data | Frame | 852 +----------------------------------+ 854 Figure 6: Representation of the "Block Element" structure. 856 Each "Cluster" MUST contain exactly one "Timestamp Element". The 857 "Timestamp Element" value MUST be stored once per "Cluster". The 858 "Timestamp Element" in the "Cluster" is relative to the entire 859 "Segment". The "Timestamp Element" SHOULD be the first "Element" in 860 the "Cluster". 862 Additionally, the "Block" contains an offset that, when added to the 863 "Cluster"'s "Timestamp Element" value, yields the "Block"'s effective 864 timestamp. Therefore, timestamp in the "Block" itself is relative to 865 the "Timestamp Element" in the "Cluster". For example, if the 866 "Timestamp Element" in the "Cluster" is set to 10 seconds and a 867 "Block" in that "Cluster" is supposed to be played 12 seconds into 868 the clip, the timestamp in the "Block" would be set to 2 seconds. 870 The "ReferenceBlock" in the "BlockGroup" is used instead of the basic 871 "P-frame"/"B-frame" description. Instead of simply saying that this 872 "Block" depends on the "Block" directly before, or directly 873 afterwards, the "Timestamp" of the necessary "Block" is used. 874 Because there can be as many "ReferenceBlock Elements" as necessary 875 for a "Block", it allows for some extremely complex referencing. 877 The "Cues Element" is used to seek when playing back a file by 878 providing a temporal index for some of the "Tracks". It is similar 879 to the "SeekHead Element", but used for seeking to a specific time 880 when playing back the file. It is possible to seek without this 881 element, but it is much more difficult because a "Matroska Reader" 882 would have to 'hunt and peck' through the file looking for the 883 correct timestamp. 885 The "Cues Element" SHOULD contain at least one "CuePoint Element". 886 Each "CuePoint Element" stores the position of the "Cluster" that 887 contains the "BlockGroup" or "SimpleBlock Element". The timestamp is 888 stored in the "CueTime Element" and location is stored in the 889 "CueTrackPositions Element". 891 The "Cues Element" is flexible. For instance, "Cues Element" can be 892 used to index every single timestamp of every "Block" or they can be 893 indexed selectively. For video files, it is RECOMMENDED to index at 894 least the keyframes of the video track. 896 +-------------------------------------+ 897 | Cues | CuePoint | CueTime | 898 | | |-------------------| 899 | | | CueTrackPositions | 900 | |------------------------------| 901 | | CuePoint | CueTime | 902 | | |-------------------| 903 | | | CueTrackPositions | 904 +-------------------------------------+ 906 Figure 7: Representation of a "Cues Element" and two levels of 907 its "Descendant Elements". 909 The "Attachments Element" is for attaching files to a Matroska file 910 such as pictures, webpages, programs, or even the codec needed to 911 play back the file. 913 +------------------------------------------------+ 914 | Attachments | AttachedFile | FileDescription | 915 | | |-------------------| 916 | | | FileName | 917 | | |-------------------| 918 | | | FileMimeType | 919 | | |-------------------| 920 | | | FileData | 921 | | |-------------------| 922 | | | FileUID | 923 | | |-------------------| 924 | | | FileName | 925 | | |-------------------| 926 | | | FileReferral | 927 | | |-------------------| 928 | | | FileUsedStartTime | 929 | | |-------------------| 930 | | | FileUsedEndTime | 931 +------------------------------------------------+ 933 Figure 8: Representation of a "Attachments Element". 935 The "Tags Element" contains metadata that describes the "Segment" and 936 potentially its "Tracks", "Chapters", and "Attachments". Each 937 "Track" or "Chapter" that those tags applies to has its UID listed in 938 the "Tags". The "Tags" contain all extra information about the file: 939 scriptwriter, singer, actors, directors, titles, edition, price, 940 dates, genre, comments, etc. Tags can contain their values in 941 multiple languages. For example, a movie's "title" "Tag" might 942 contain both the original English title as well as the title it was 943 released as in Germany. 945 +-------------------------------------------+ 946 | Tags | Tag | Targets | TargetTypeValue | 947 | | | |------------------| 948 | | | | TargetType | 949 | | | |------------------| 950 | | | | TagTrackUID | 951 | | | |------------------| 952 | | | | TagEditionUID | 953 | | | |------------------| 954 | | | | TagChapterUID | 955 | | | |------------------| 956 | | | | TagAttachmentUID | 957 | | |------------------------------| 958 | | | SimpleTag | TagName | 959 | | | |------------------| 960 | | | | TagLanguage | 961 | | | |------------------| 962 | | | | TagDefault | 963 | | | |------------------| 964 | | | | TagString | 965 | | | |------------------| 966 | | | | TagBinary | 967 | | | |------------------| 968 | | | | SimpleTag | 969 +-------------------------------------------+ 971 Figure 9: Representation of a "Tags Element" and three levels of 972 its "Children Elements". 974 8. Matroska Schema 976 This specification includes an "EBML Schema", which defines the 977 Elements and structure of Matroska as an EBML Document Type. The 978 EBML Schema defines every valid Matroska element in a manner defined 979 by the EBML specification. 981 Here the definition of each Matroska Element is provided. 983 8.1. EBMLMaxIDLength Element 985 name: EBMLMaxIDLength 987 path: "\EBML\EBMLMaxIDLength" 989 id: 0x42F2 991 minOccurs: 1 992 maxOccurs: 1 994 range: 4 996 default: 4 998 type: uinteger 1000 8.2. EBMLMaxSizeLength Element 1002 name: EBMLMaxSizeLength 1004 path: "\EBML\EBMLMaxSizeLength" 1006 id: 0x42F3 1008 minOccurs: 1 1010 maxOccurs: 1 1012 range: 1-8 1014 default: 8 1016 type: uinteger 1018 9. Segment Element 1020 name: Segment 1022 path: "\Segment" 1024 id: 0x18538067 1026 minOccurs: 1 1028 maxOccurs: 1 1030 type: master 1032 unknownsizeallowed: 1 1034 definition: The Root Element that contains all other Top-Level 1035 Elements (Elements defined only at Level 1). A Matroska file is 1036 composed of 1 Segment. 1038 9.1. SeekHead Element 1040 name: SeekHead 1042 path: "\Segment\SeekHead" 1044 id: 0x114D9B74 1046 maxOccurs: 2 1048 type: master 1050 definition: Contains the Segment Position of other Top-Level 1051 Elements. 1053 9.1.1. Seek Element 1055 name: Seek 1057 path: "\Segment\SeekHead\Seek" 1059 id: 0x4DBB 1061 minOccurs: 1 1063 type: master 1065 definition: Contains a single seek entry to an EBML Element. 1067 9.1.1.1. SeekID Element 1069 name: SeekID 1071 path: "\Segment\SeekHead\Seek\SeekID" 1073 id: 0x53AB 1075 minOccurs: 1 1077 maxOccurs: 1 1079 type: binary 1081 definition: The binary ID corresponding to the Element name. 1083 9.1.1.2. SeekPosition Element 1085 name: SeekPosition 1087 path: "\Segment\SeekHead\Seek\SeekPosition" 1089 id: 0x53AC 1091 minOccurs: 1 1093 maxOccurs: 1 1095 type: uinteger 1097 definition: The Segment Position of the Element. 1099 9.2. Info Element 1101 name: Info 1103 path: "\Segment\Info" 1105 id: 0x1549A966 1107 minOccurs: 1 1109 maxOccurs: 1 1111 type: master 1113 recurring: 1 1115 definition: Contains general information about the Segment. 1117 9.2.1. SegmentUID Element 1119 name: SegmentUID 1121 path: "\Segment\Info\SegmentUID" 1123 id: 0x73A4 1125 maxOccurs: 1 1127 range: not 0 1129 type: binary 1130 definition: A randomly generated unique ID to identify the Segment 1131 amongst many others (128 bits). 1133 usage notes: If the Segment is a part of a Linked Segment, then this 1134 Element is REQUIRED. 1136 9.2.2. SegmentFilename Element 1138 name: SegmentFilename 1140 path: "\Segment\Info\SegmentFilename" 1142 id: 0x7384 1144 maxOccurs: 1 1146 type: utf-8 1148 definition: A filename corresponding to this Segment. 1150 9.2.3. PrevUID Element 1152 name: PrevUID 1154 path: "\Segment\Info\PrevUID" 1156 id: 0x3CB923 1158 maxOccurs: 1 1160 type: binary 1162 definition: A unique ID to identify the previous Segment of a Linked 1163 Segment (128 bits). 1165 usage notes: If the Segment is a part of a Linked Segment that uses 1166 Hard Linking, then either the PrevUID or the NextUID Element is 1167 REQUIRED. If a Segment contains a PrevUID but not a NextUID, then 1168 it MAY be considered as the last Segment of the Linked Segment. 1169 The PrevUID MUST NOT be equal to the SegmentUID. 1171 9.2.4. PrevFilename Element 1173 name: PrevFilename 1175 path: "\Segment\Info\PrevFilename" 1177 id: 0x3C83AB 1178 maxOccurs: 1 1180 type: utf-8 1182 definition: A filename corresponding to the file of the previous 1183 Linked Segment. 1185 usage notes: Provision of the previous filename is for display 1186 convenience, but PrevUID SHOULD be considered authoritative for 1187 identifying the previous Segment in a Linked Segment. 1189 9.2.5. NextUID Element 1191 name: NextUID 1193 path: "\Segment\Info\NextUID" 1195 id: 0x3EB923 1197 maxOccurs: 1 1199 type: binary 1201 definition: A unique ID to identify the next Segment of a Linked 1202 Segment (128 bits). 1204 usage notes: If the Segment is a part of a Linked Segment that uses 1205 Hard Linking, then either the PrevUID or the NextUID Element is 1206 REQUIRED. If a Segment contains a NextUID but not a PrevUID, then 1207 it MAY be considered as the first Segment of the Linked Segment. 1208 The NextUID MUST NOT be equal to the SegmentUID. 1210 9.2.6. NextFilename Element 1212 name: NextFilename 1214 path: "\Segment\Info\NextFilename" 1216 id: 0x3E83BB 1218 maxOccurs: 1 1220 type: utf-8 1222 definition: A filename corresponding to the file of the next Linked 1223 Segment. 1225 usage notes: Provision of the next filename is for display 1226 convenience, but NextUID SHOULD be considered authoritative for 1227 identifying the Next Segment. 1229 9.2.7. SegmentFamily Element 1231 name: SegmentFamily 1233 path: "\Segment\Info\SegmentFamily" 1235 id: 0x4444 1237 type: binary 1239 definition: A randomly generated unique ID that all Segments of a 1240 Linked Segment MUST share (128 bits). 1242 usage notes: If the Segment is a part of a Linked Segment that uses 1243 Soft Linking, then this Element is REQUIRED. 1245 9.2.8. ChapterTranslate Element 1247 name: ChapterTranslate 1249 path: "\Segment\Info\ChapterTranslate" 1251 id: 0x6924 1253 type: master 1255 definition: A tuple of corresponding ID used by chapter codecs to 1256 represent this Segment. 1258 9.2.8.1. ChapterTranslateEditionUID Element 1260 name: ChapterTranslateEditionUID 1262 path: "\Segment\Info\ChapterTranslate\ChapterTranslateEditionUID" 1264 id: 0x69FC 1266 type: uinteger 1268 definition: Specify an edition UID on which this correspondence 1269 applies. When not specified, it means for all editions found in 1270 the Segment. 1272 9.2.8.2. ChapterTranslateCodec Element 1274 name: ChapterTranslateCodec 1276 path: "\Segment\Info\ChapterTranslate\ChapterTranslateCodec" 1278 id: 0x69BF 1280 minOccurs: 1 1282 maxOccurs: 1 1284 type: uinteger 1286 definition: The chapter codec; see Section 9.7.1.4.10.1. 1288 restrictions: 1290 +=======+=================+ 1291 | value | label | 1292 +=======+=================+ 1293 | 0 | Matroska Script | 1294 +-------+-----------------+ 1295 | 1 | DVD-menu | 1296 +-------+-----------------+ 1298 Table 9 1300 9.2.8.3. ChapterTranslateID Element 1302 name: ChapterTranslateID 1304 path: "\Segment\Info\ChapterTranslate\ChapterTranslateID" 1306 id: 0x69A5 1308 minOccurs: 1 1310 maxOccurs: 1 1312 type: binary 1314 definition: The binary value used to represent this Segment in the 1315 chapter codec data. The format depends on the ChapProcessCodecID 1316 used; see Section 9.7.1.4.10.1. 1318 9.2.9. TimestampScale Element 1320 name: TimestampScale 1322 path: "\Segment\Info\TimestampScale" 1324 id: 0x2AD7B1 1326 minOccurs: 1 1328 maxOccurs: 1 1330 range: not 0 1332 default: 1000000 1334 type: uinteger 1336 definition: Timestamp scale in nanoseconds (1.000.000 means all 1337 timestamps in the Segment are expressed in milliseconds). 1339 9.2.10. Duration Element 1341 name: Duration 1343 path: "\Segment\Info\Duration" 1345 id: 0x4489 1347 maxOccurs: 1 1349 range: > 0x0p+0 1351 type: float 1353 definition: Duration of the Segment in nanoseconds based on 1354 TimestampScale. 1356 9.2.11. DateUTC Element 1358 name: DateUTC 1360 path: "\Segment\Info\DateUTC" 1362 id: 0x4461 1364 maxOccurs: 1 1365 type: date 1367 definition: The date and time that the Segment was created by the 1368 muxing application or library. 1370 9.2.12. Title Element 1372 name: Title 1374 path: "\Segment\Info\Title" 1376 id: 0x7BA9 1378 maxOccurs: 1 1380 type: utf-8 1382 definition: General name of the Segment. 1384 9.2.13. MuxingApp Element 1386 name: MuxingApp 1388 path: "\Segment\Info\MuxingApp" 1390 id: 0x4D80 1392 minOccurs: 1 1394 maxOccurs: 1 1396 type: utf-8 1398 definition: Muxing application or library (example: "libmatroska- 1399 0.4.3"). 1401 usage notes: Include the full name of the application or library 1402 followed by the version number. 1404 9.2.14. WritingApp Element 1406 name: WritingApp 1408 path: "\Segment\Info\WritingApp" 1410 id: 0x5741 1412 minOccurs: 1 1413 maxOccurs: 1 1415 type: utf-8 1417 definition: Writing application (example: "mkvmerge-0.3.3"). 1419 usage notes: Include the full name of the application followed by 1420 the version number. 1422 9.3. Cluster Element 1424 name: Cluster 1426 path: "\Segment\Cluster" 1428 id: 0x1F43B675 1430 type: master 1432 unknownsizeallowed: 1 1434 definition: The Top-Level Element containing the (monolithic) Block 1435 structure. 1437 9.3.1. Timestamp Element 1439 name: Timestamp 1441 path: "\Segment\Cluster\Timestamp" 1443 id: 0xE7 1445 minOccurs: 1 1447 maxOccurs: 1 1449 type: uinteger 1451 definition: Absolute timestamp of the cluster (based on 1452 TimestampScale). 1454 9.3.2. SilentTracks Element 1456 name: SilentTracks 1458 path: "\Segment\Cluster\SilentTracks" 1460 id: 0x5854 1461 maxOccurs: 1 1463 type: master 1465 definition: The list of tracks that are not used in that part of the 1466 stream. It is useful when using overlay tracks on seeking or to 1467 decide what track to use. 1469 9.3.2.1. SilentTrackNumber Element 1471 name: SilentTrackNumber 1473 path: "\Segment\Cluster\SilentTracks\SilentTrackNumber" 1475 id: 0x58D7 1477 type: uinteger 1479 definition: One of the track number that are not used from now on in 1480 the stream. It could change later if not specified as silent in a 1481 further Cluster. 1483 9.3.3. Position Element 1485 name: Position 1487 path: "\Segment\Cluster\Position" 1489 id: 0xA7 1491 maxOccurs: 1 1493 type: uinteger 1495 definition: The Segment Position of the Cluster in the Segment (0 in 1496 live streams). It might help to resynchronise offset on damaged 1497 streams. 1499 9.3.4. PrevSize Element 1501 name: PrevSize 1503 path: "\Segment\Cluster\PrevSize" 1505 id: 0xAB 1507 maxOccurs: 1 1508 type: uinteger 1510 definition: Size of the previous Cluster, in octets. Can be useful 1511 for backward playing. 1513 9.3.5. SimpleBlock Element 1515 name: SimpleBlock 1517 path: "\Segment\Cluster\SimpleBlock" 1519 id: 0xA3 1521 type: binary 1523 minver: 2 1525 definition: Similar to Block, see Section 6.2.3, but without all the 1526 extra information, mostly used to reduced overhead when no extra 1527 feature is needed; see Section 6.2.4.4 on SimpleBlock Structure. 1529 9.3.6. BlockGroup Element 1531 name: BlockGroup 1533 path: "\Segment\Cluster\BlockGroup" 1535 id: 0xA0 1537 type: master 1539 definition: Basic container of information containing a single Block 1540 and information specific to that Block. 1542 9.3.6.1. Block Element 1544 name: Block 1546 path: "\Segment\Cluster\BlockGroup\Block" 1548 id: 0xA1 1550 minOccurs: 1 1552 maxOccurs: 1 1554 type: binary 1555 definition: Block containing the actual data to be rendered and a 1556 timestamp relative to the Cluster Timestamp; see Section 6.2.3 on 1557 Block Structure. 1559 9.3.6.2. BlockVirtual Element 1561 name: BlockVirtual 1563 path: "\Segment\Cluster\BlockGroup\BlockVirtual" 1565 id: 0xA2 1567 maxOccurs: 1 1569 type: binary 1571 minver: 0 1573 maxver: 0 1575 definition: A Block with no data. It MUST be stored in the stream 1576 at the place the real Block would be in display order. 1578 9.3.6.3. BlockAdditions Element 1580 name: BlockAdditions 1582 path: "\Segment\Cluster\BlockGroup\BlockAdditions" 1584 id: 0x75A1 1586 maxOccurs: 1 1588 type: master 1590 definition: Contain additional blocks to complete the main one. An 1591 EBML parser that has no knowledge of the Block structure could 1592 still see and use/skip these data. 1594 9.3.6.3.1. BlockMore Element 1596 name: BlockMore 1598 path: "\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore" 1600 id: 0xA6 1602 minOccurs: 1 1603 type: master 1605 definition: Contain the BlockAdditional and some parameters. 1607 9.3.6.3.1.1. BlockAddID Element 1609 name: BlockAddID 1611 path: "\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\BlockAdd 1612 ID" 1614 id: 0xEE 1616 minOccurs: 1 1618 maxOccurs: 1 1620 range: not 0 1622 default: 1 1624 type: uinteger 1626 definition: An ID to identify the BlockAdditional level. If 1627 BlockAddIDType of the corresponding block is 0, this value is also 1628 the value of BlockAddIDType for the meaning of the content of 1629 BlockAdditional. 1631 9.3.6.3.1.2. BlockAdditional Element 1633 name: BlockAdditional 1635 path: "\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\BlockAdd 1636 itional" 1638 id: 0xA5 1640 minOccurs: 1 1642 maxOccurs: 1 1644 type: binary 1646 definition: Interpreted by the codec as it wishes (using the 1647 BlockAddID). 1649 9.3.6.4. BlockDuration Element 1651 name: BlockDuration 1653 path: "\Segment\Cluster\BlockGroup\BlockDuration" 1655 id: 0x9B 1657 minOccurs: see implementation notes 1659 maxOccurs: 1 1661 default: see implementation notes 1663 type: uinteger 1665 definition: The duration of the Block (based on TimestampScale). 1666 The BlockDuration Element can be useful at the end of a Track to 1667 define the duration of the last frame (as there is no subsequent 1668 Block available), or when there is a break in a track like for 1669 subtitle tracks. 1671 implementation notes: 1673 +==========================+===============================+ 1674 | attribute | note | 1675 +==========================+===============================+ 1676 | minOccurs | BlockDuration MUST be set | 1677 | | (minOccurs=1) if the | 1678 | | associated TrackEntry stores | 1679 | | a DefaultDuration value. | 1680 +--------------------------+-------------------------------+ 1681 | default | When not written and with no | 1682 | | DefaultDuration, the value is | 1683 | | assumed to be the difference | 1684 | | between the timestamp | 1685 +--------------------------+-------------------------------+ 1686 | of this Block and the | | 1687 | timestamp of the next | | 1688 | Block in "display" order | | 1689 | (not coding order). | | 1690 +--------------------------+-------------------------------+ 1692 Table 10 1694 9.3.6.5. ReferencePriority Element 1696 name: ReferencePriority 1698 path: "\Segment\Cluster\BlockGroup\ReferencePriority" 1700 id: 0xFA 1702 minOccurs: 1 1704 maxOccurs: 1 1706 default: 0 1708 type: uinteger 1710 definition: This frame is referenced and has the specified cache 1711 priority. In cache only a frame of the same or higher priority 1712 can replace this frame. A value of 0 means the frame is not 1713 referenced. 1715 9.3.6.6. ReferenceBlock Element 1717 name: ReferenceBlock 1719 path: "\Segment\Cluster\BlockGroup\ReferenceBlock" 1721 id: 0xFB 1723 type: integer 1725 definition: Timestamp of another frame used as a reference (ie: B or 1726 P frame). The timestamp is relative to the block it's attached 1727 to. 1729 9.3.6.7. ReferenceVirtual Element 1731 name: ReferenceVirtual 1733 path: "\Segment\Cluster\BlockGroup\ReferenceVirtual" 1735 id: 0xFD 1737 maxOccurs: 1 1739 type: integer 1741 minver: 0 1742 maxver: 0 1744 definition: The Segment Position of the data that would otherwise be 1745 in position of the virtual block. 1747 9.3.6.8. CodecState Element 1749 name: CodecState 1751 path: "\Segment\Cluster\BlockGroup\CodecState" 1753 id: 0xA4 1755 maxOccurs: 1 1757 type: binary 1759 minver: 2 1761 definition: The new codec state to use. Data interpretation is 1762 private to the codec. This information SHOULD always be 1763 referenced by a seek entry. 1765 9.3.6.9. DiscardPadding Element 1767 name: DiscardPadding 1769 path: "\Segment\Cluster\BlockGroup\DiscardPadding" 1771 id: 0x75A2 1773 maxOccurs: 1 1775 type: integer 1777 minver: 4 1779 definition: Duration in nanoseconds of the silent data added to the 1780 Block (padding at the end of the Block for positive value, at the 1781 beginning of the Block for negative value). The duration of 1782 DiscardPadding is not calculated in the duration of the TrackEntry 1783 and SHOULD be discarded during playback. 1785 9.3.6.10. Slices Element 1787 name: Slices 1789 path: "\Segment\Cluster\BlockGroup\Slices" 1790 id: 0x8E 1792 maxOccurs: 1 1794 type: master 1796 definition: Contains slices description. 1798 9.3.6.10.1. TimeSlice Element 1800 name: TimeSlice 1802 path: "\Segment\Cluster\BlockGroup\Slices\TimeSlice" 1804 id: 0xE8 1806 type: master 1808 maxver: 1 1810 definition: Contains extra time information about the data contained 1811 in the Block. Being able to interpret this Element is not 1812 REQUIRED for playback. 1814 9.3.6.10.1.1. LaceNumber Element 1816 name: LaceNumber 1818 path: "\Segment\Cluster\BlockGroup\Slices\TimeSlice\LaceNumber" 1820 id: 0xCC 1822 maxOccurs: 1 1824 default: 0 1826 type: uinteger 1828 maxver: 1 1830 definition: The reverse number of the frame in the lace (0 is the 1831 last frame, 1 is the next to last, etc). Being able to interpret 1832 this Element is not REQUIRED for playback. 1834 9.3.6.10.1.2. FrameNumber Element 1836 name: FrameNumber 1837 path: "\Segment\Cluster\BlockGroup\Slices\TimeSlice\FrameNumber" 1839 id: 0xCD 1841 maxOccurs: 1 1843 default: 0 1845 type: uinteger 1847 minver: 0 1849 maxver: 0 1851 definition: The number of the frame to generate from this lace with 1852 this delay (allow you to generate many frames from the same Block/ 1853 Frame). 1855 9.3.6.10.1.3. BlockAdditionID Element 1857 name: BlockAdditionID 1859 path: "\Segment\Cluster\BlockGroup\Slices\TimeSlice\BlockAdditionID" 1861 id: 0xCB 1863 maxOccurs: 1 1865 default: 0 1867 type: uinteger 1869 minver: 0 1871 maxver: 0 1873 definition: The ID of the BlockAdditional Element (0 is the main 1874 Block). 1876 9.3.6.10.1.4. Delay Element 1878 name: Delay 1880 path: "\Segment\Cluster\BlockGroup\Slices\TimeSlice\Delay" 1882 id: 0xCE 1884 maxOccurs: 1 1885 default: 0 1887 type: uinteger 1889 minver: 0 1891 maxver: 0 1893 definition: The (scaled) delay to apply to the Element. 1895 9.3.6.10.1.5. SliceDuration Element 1897 name: SliceDuration 1899 path: "\Segment\Cluster\BlockGroup\Slices\TimeSlice\SliceDuration" 1901 id: 0xCF 1903 maxOccurs: 1 1905 default: 0 1907 type: uinteger 1909 minver: 0 1911 maxver: 0 1913 definition: The (scaled) duration to apply to the Element. 1915 9.3.6.11. ReferenceFrame Element 1917 name: ReferenceFrame 1919 path: "\Segment\Cluster\BlockGroup\ReferenceFrame" 1921 id: 0xC8 1923 maxOccurs: 1 1925 type: master 1927 minver: 0 1929 maxver: 0 1931 definition: Contains information about the last reference frame. 1932 See [DivXTrickTrack]. 1934 9.3.6.11.1. ReferenceOffset Element 1936 name: ReferenceOffset 1938 path: "\Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceOffset" 1940 id: 0xC9 1942 minOccurs: 1 1944 maxOccurs: 1 1946 type: uinteger 1948 minver: 0 1950 maxver: 0 1952 definition: The relative offset, in bytes, from the previous 1953 BlockGroup element for this Smooth FF/RW video track to the 1954 containing BlockGroup element. See [DivXTrickTrack]. 1956 9.3.6.11.2. ReferenceTimestamp Element 1958 name: ReferenceTimestamp 1960 path: "\Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceTimestamp 1961 " 1963 id: 0xCA 1965 minOccurs: 1 1967 maxOccurs: 1 1969 type: uinteger 1971 minver: 0 1973 maxver: 0 1975 definition: The timecode of the BlockGroup pointed to by 1976 ReferenceOffset. See [DivXTrickTrack]. 1978 9.3.7. EncryptedBlock Element 1980 name: EncryptedBlock 1981 path: "\Segment\Cluster\EncryptedBlock" 1983 id: 0xAF 1985 type: binary 1987 minver: 0 1989 maxver: 0 1991 definition: Similar to SimpleBlock, see Section 6.2.4.4, but the 1992 data inside the Block are Transformed (encrypt and/or signed). 1994 9.4. Tracks Element 1996 name: Tracks 1998 path: "\Segment\Tracks" 2000 id: 0x1654AE6B 2002 maxOccurs: 1 2004 type: master 2006 recurring: 1 2008 definition: A Top-Level Element of information with many tracks 2009 described. 2011 9.4.1. TrackEntry Element 2013 name: TrackEntry 2015 path: "\Segment\Tracks\TrackEntry" 2017 id: 0xAE 2019 minOccurs: 1 2021 type: master 2023 definition: Describes a track with all Elements. 2025 9.4.1.1. TrackNumber Element 2027 name: TrackNumber 2028 path: "\Segment\Tracks\TrackEntry\TrackNumber" 2030 id: 0xD7 2032 minOccurs: 1 2034 maxOccurs: 1 2036 range: not 0 2038 type: uinteger 2040 definition: The track number as used in the Block Header (using more 2041 than 127 tracks is not encouraged, though the design allows an 2042 unlimited number). 2044 9.4.1.2. TrackUID Element 2046 name: TrackUID 2048 path: "\Segment\Tracks\TrackEntry\TrackUID" 2050 id: 0x73C5 2052 minOccurs: 1 2054 maxOccurs: 1 2056 range: not 0 2058 type: uinteger 2060 definition: A unique ID to identify the Track. This SHOULD be kept 2061 the same when making a direct stream copy of the Track to another 2062 file. 2064 9.4.1.3. TrackType Element 2066 name: TrackType 2068 path: "\Segment\Tracks\TrackEntry\TrackType" 2070 id: 0x83 2072 minOccurs: 1 2074 maxOccurs: 1 2075 range: 1-254 2077 type: uinteger 2079 definition: A set of track types coded on 8 bits. 2081 restrictions: 2083 +=======+==========+ 2084 | value | label | 2085 +=======+==========+ 2086 | 1 | video | 2087 +-------+----------+ 2088 | 2 | audio | 2089 +-------+----------+ 2090 | 3 | complex | 2091 +-------+----------+ 2092 | 16 | logo | 2093 +-------+----------+ 2094 | 17 | subtitle | 2095 +-------+----------+ 2096 | 18 | buttons | 2097 +-------+----------+ 2098 | 32 | control | 2099 +-------+----------+ 2100 | 33 | metadata | 2101 +-------+----------+ 2103 Table 11 2105 9.4.1.4. FlagEnabled Element 2107 name: FlagEnabled 2109 path: "\Segment\Tracks\TrackEntry\FlagEnabled" 2111 id: 0xB9 2113 minOccurs: 1 2115 maxOccurs: 1 2117 range: 0-1 2119 default: 1 2121 type: uinteger 2122 minver: 2 2124 definition: Set to 1 if the track is usable. It is possible to turn 2125 a not usable track into a usable track using chapter codecs or 2126 control tracks. 2128 9.4.1.5. FlagDefault Element 2130 name: FlagDefault 2132 path: "\Segment\Tracks\TrackEntry\FlagDefault" 2134 id: 0x88 2136 minOccurs: 1 2138 maxOccurs: 1 2140 range: 0-1 2142 default: 1 2144 type: uinteger 2146 definition: Set if that track (audio, video or subs) SHOULD be 2147 eligible for automatic selection by the player; see Section 25 for 2148 more details. 2150 9.4.1.6. FlagForced Element 2152 name: FlagForced 2154 path: "\Segment\Tracks\TrackEntry\FlagForced" 2156 id: 0x55AA 2158 minOccurs: 1 2160 maxOccurs: 1 2162 range: 0-1 2164 default: 0 2166 type: uinteger 2168 definition: Applies only to subtitles. Set if that track SHOULD be 2169 eligible for automatic selection by the player if it matches the 2170 user's language preference, even if the user's preferences would 2171 normally not enable subtitles with the selected audio track; this 2172 can be used for tracks containing only translations of foreign- 2173 language audio or onscreen text. See Section 25 for more details. 2175 9.4.1.7. FlagHearingImpaired Element 2177 name: FlagHearingImpaired 2179 path: "\Segment\Tracks\TrackEntry\FlagHearingImpaired" 2181 id: 0x55AB 2183 maxOccurs: 1 2185 range: 0-1 2187 type: uinteger 2189 definition: Set to 1 if that track is suitable for users with 2190 hearing impairments, set to 0 if it is unsuitable for users with 2191 hearing impairments. 2193 9.4.1.8. FlagVisualImpaired Element 2195 name: FlagVisualImpaired 2197 path: "\Segment\Tracks\TrackEntry\FlagVisualImpaired" 2199 id: 0x55AC 2201 maxOccurs: 1 2203 range: 0-1 2205 type: uinteger 2207 definition: Set to 1 if that track is suitable for users with visual 2208 impairments, set to 0 if it is unsuitable for users with visual 2209 impairments. 2211 9.4.1.9. FlagTextDescriptions Element 2213 name: FlagTextDescriptions 2215 path: "\Segment\Tracks\TrackEntry\FlagTextDescriptions" 2216 id: 0x55AD 2218 maxOccurs: 1 2220 range: 0-1 2222 type: uinteger 2224 definition: Set to 1 if that track contains textual descriptions of 2225 video content, set to 0 if that track does not contain textual 2226 descriptions of video content. 2228 9.4.1.10. FlagOriginal Element 2230 name: FlagOriginal 2232 path: "\Segment\Tracks\TrackEntry\FlagOriginal" 2234 id: 0x55AE 2236 maxOccurs: 1 2238 range: 0-1 2240 type: uinteger 2242 definition: Set to 1 if that track is in the content's original 2243 language, set to 0 if it is a translation. 2245 9.4.1.11. FlagCommentary Element 2247 name: FlagCommentary 2249 path: "\Segment\Tracks\TrackEntry\FlagCommentary" 2251 id: 0x55AF 2253 maxOccurs: 1 2255 range: 0-1 2257 type: uinteger 2259 definition: Set to 1 if that track contains commentary, set to 0 if 2260 it does not contain commentary. 2262 9.4.1.12. FlagLacing Element 2264 name: FlagLacing 2266 path: "\Segment\Tracks\TrackEntry\FlagLacing" 2268 id: 0x9C 2270 minOccurs: 1 2272 maxOccurs: 1 2274 range: 0-1 2276 default: 1 2278 type: uinteger 2280 definition: Set to 1 if the track MAY contain blocks using lacing. 2282 9.4.1.13. MinCache Element 2284 name: MinCache 2286 path: "\Segment\Tracks\TrackEntry\MinCache" 2288 id: 0x6DE7 2290 minOccurs: 1 2292 maxOccurs: 1 2294 default: 0 2296 type: uinteger 2298 definition: The minimum number of frames a player SHOULD be able to 2299 cache during playback. If set to 0, the reference pseudo-cache 2300 system is not used. 2302 9.4.1.14. MaxCache Element 2304 name: MaxCache 2306 path: "\Segment\Tracks\TrackEntry\MaxCache" 2308 id: 0x6DF8 2309 maxOccurs: 1 2311 type: uinteger 2313 definition: The maximum cache size necessary to store referenced 2314 frames in and the current frame. 0 means no cache is needed. 2316 9.4.1.15. DefaultDuration Element 2318 name: DefaultDuration 2320 path: "\Segment\Tracks\TrackEntry\DefaultDuration" 2322 id: 0x23E383 2324 maxOccurs: 1 2326 range: not 0 2328 type: uinteger 2330 definition: Number of nanoseconds (not scaled via TimestampScale) 2331 per frame (frame in the Matroska sense -- one Element put into a 2332 (Simple)Block). 2334 9.4.1.16. DefaultDecodedFieldDuration Element 2336 name: DefaultDecodedFieldDuration 2338 path: "\Segment\Tracks\TrackEntry\DefaultDecodedFieldDuration" 2340 id: 0x234E7A 2342 maxOccurs: 1 2344 range: not 0 2346 type: uinteger 2348 minver: 4 2350 definition: The period in nanoseconds (not scaled by TimestampScale) 2351 between two successive fields at the output of the decoding 2352 process, see Section 17 for more information 2354 9.4.1.17. TrackTimestampScale Element 2356 name: TrackTimestampScale 2358 path: "\Segment\Tracks\TrackEntry\TrackTimestampScale" 2360 id: 0x23314F 2362 minOccurs: 1 2364 maxOccurs: 1 2366 range: > 0x0p+0 2368 default: 0x1p+0 2370 type: float 2372 maxver: 3 2374 definition: DEPRECATED, DO NOT USE. The scale to apply on this 2375 track to work at normal speed in relation with other tracks 2376 (mostly used to adjust video speed when the audio length differs). 2378 9.4.1.18. TrackOffset Element 2380 name: TrackOffset 2382 path: "\Segment\Tracks\TrackEntry\TrackOffset" 2384 id: 0x537F 2386 maxOccurs: 1 2388 default: 0 2390 type: integer 2392 minver: 0 2394 maxver: 0 2396 definition: A value to add to the Block's Timestamp. This can be 2397 used to adjust the playback offset of a track. 2399 9.4.1.19. MaxBlockAdditionID Element 2401 name: MaxBlockAdditionID 2403 path: "\Segment\Tracks\TrackEntry\MaxBlockAdditionID" 2405 id: 0x55EE 2407 minOccurs: 1 2409 maxOccurs: 1 2411 default: 0 2413 type: uinteger 2415 definition: The maximum value of BlockAddID (Section 9.3.6.3.1.1). 2416 A value 0 means there is no BlockAdditions (Section 9.3.6.3) for 2417 this track. 2419 9.4.1.20. BlockAdditionMapping Element 2421 name: BlockAdditionMapping 2423 path: "\Segment\Tracks\TrackEntry\BlockAdditionMapping" 2425 id: 0x41E4 2427 type: master 2429 minver: 4 2431 definition: Contains elements that extend the track format, by 2432 adding content either to each frame, with BlockAddID 2433 (Section 9.3.6.3.1.1), or to the track as a whole with 2434 BlockAddIDExtraData. 2436 9.4.1.20.1. BlockAddIDValue Element 2438 name: BlockAddIDValue 2440 path: "\Segment\Tracks\TrackEntry\BlockAdditionMapping\BlockAddIDVal 2441 ue" 2443 id: 0x41F0 2445 maxOccurs: 1 2446 range: >=2 2448 type: uinteger 2450 minver: 4 2452 definition: If the track format extension needs content beside 2453 frames, the value refers to the BlockAddID (Section 9.3.6.3.1.1), 2454 value being described. To keep MaxBlockAdditionID as low as 2455 possible, small values SHOULD be used. 2457 9.4.1.20.2. BlockAddIDName Element 2459 name: BlockAddIDName 2461 path: "\Segment\Tracks\TrackEntry\BlockAdditionMapping\BlockAddIDNam 2462 e" 2464 id: 0x41A4 2466 maxOccurs: 1 2468 type: string 2470 minver: 4 2472 definition: A human-friendly name describing the type of 2473 BlockAdditional data, as defined by the associated Block 2474 Additional Mapping. 2476 9.4.1.20.3. BlockAddIDType Element 2478 name: BlockAddIDType 2480 path: "\Segment\Tracks\TrackEntry\BlockAdditionMapping\BlockAddIDTyp 2481 e" 2483 id: 0x41E7 2485 minOccurs: 1 2487 maxOccurs: 1 2489 default: 0 2491 type: uinteger 2493 minver: 4 2494 definition: Stores the registered identifer of the Block Additional 2495 Mapping to define how the BlockAdditional data should be handled. 2497 9.4.1.20.4. BlockAddIDExtraData Element 2499 name: BlockAddIDExtraData 2501 path: "\Segment\Tracks\TrackEntry\BlockAdditionMapping\BlockAddIDExt 2502 raData" 2504 id: 0x41ED 2506 maxOccurs: 1 2508 type: binary 2510 minver: 4 2512 definition: Extra binary data that the BlockAddIDType can use to 2513 interpret the BlockAdditional data. The intepretation of the 2514 binary data depends on the BlockAddIDType value and the 2515 corresponding Block Additional Mapping. 2517 9.4.1.21. Name Element 2519 name: Name 2521 path: "\Segment\Tracks\TrackEntry\Name" 2523 id: 0x536E 2525 maxOccurs: 1 2527 type: utf-8 2529 definition: A human-readable track name. 2531 9.4.1.22. Language Element 2533 name: Language 2535 path: "\Segment\Tracks\TrackEntry\Language" 2537 id: 0x22B59C 2539 minOccurs: 1 2541 maxOccurs: 1 2542 default: eng 2544 type: string 2546 definition: Specifies the language of the track in the Matroska 2547 languages form; see Section 6.2.1 on language codes. This Element 2548 MUST be ignored if the LanguageIETF Element is used in the same 2549 TrackEntry. 2551 9.4.1.23. LanguageIETF Element 2553 name: LanguageIETF 2555 path: "\Segment\Tracks\TrackEntry\LanguageIETF" 2557 id: 0x22B59D 2559 maxOccurs: 1 2561 type: string 2563 minver: 4 2565 definition: Specifies the language of the track according to [BCP47] 2566 and using the IANA Language Subtag Registry [IANALangRegistry]. 2567 If this Element is used, then any Language Elements used in the 2568 same TrackEntry MUST be ignored. 2570 9.4.1.24. CodecID Element 2572 name: CodecID 2574 path: "\Segment\Tracks\TrackEntry\CodecID" 2576 id: 0x86 2578 minOccurs: 1 2580 maxOccurs: 1 2582 type: string 2584 definition: An ID corresponding to the codec, see 2585 [I-D.ietf-cellar-codec] for more info. 2587 9.4.1.25. CodecPrivate Element 2589 name: CodecPrivate 2591 path: "\Segment\Tracks\TrackEntry\CodecPrivate" 2593 id: 0x63A2 2595 maxOccurs: 1 2597 type: binary 2599 definition: Private data only known to the codec. 2601 9.4.1.26. CodecName Element 2603 name: CodecName 2605 path: "\Segment\Tracks\TrackEntry\CodecName" 2607 id: 0x258688 2609 maxOccurs: 1 2611 type: utf-8 2613 definition: A human-readable string specifying the codec. 2615 9.4.1.27. AttachmentLink Element 2617 name: AttachmentLink 2619 path: "\Segment\Tracks\TrackEntry\AttachmentLink" 2621 id: 0x7446 2623 maxOccurs: 1 2625 range: not 0 2627 type: uinteger 2629 maxver: 3 2631 definition: The UID of an attachment that is used by this codec. 2633 9.4.1.28. CodecSettings Element 2635 name: CodecSettings 2637 path: "\Segment\Tracks\TrackEntry\CodecSettings" 2639 id: 0x3A9697 2641 maxOccurs: 1 2643 type: utf-8 2645 minver: 0 2647 maxver: 0 2649 definition: A string describing the encoding setting used. 2651 9.4.1.29. CodecInfoURL Element 2653 name: CodecInfoURL 2655 path: "\Segment\Tracks\TrackEntry\CodecInfoURL" 2657 id: 0x3B4040 2659 type: string 2661 minver: 0 2663 maxver: 0 2665 definition: A URL to find information about the codec used. 2667 9.4.1.30. CodecDownloadURL Element 2669 name: CodecDownloadURL 2671 path: "\Segment\Tracks\TrackEntry\CodecDownloadURL" 2673 id: 0x26B240 2675 type: string 2677 minver: 0 2679 maxver: 0 2680 definition: A URL to download about the codec used. 2682 9.4.1.31. CodecDecodeAll Element 2684 name: CodecDecodeAll 2686 path: "\Segment\Tracks\TrackEntry\CodecDecodeAll" 2688 id: 0xAA 2690 minOccurs: 1 2692 maxOccurs: 1 2694 range: 0-1 2696 default: 1 2698 type: uinteger 2700 minver: 2 2702 definition: The codec can decode potentially damaged data. 2704 9.4.1.32. TrackOverlay Element 2706 name: TrackOverlay 2708 path: "\Segment\Tracks\TrackEntry\TrackOverlay" 2710 id: 0x6FAB 2712 type: uinteger 2714 definition: Specify that this track is an overlay track for the 2715 Track specified (in the u-integer). That means when this track 2716 has a gap, see Section 9.3.2 on SilentTracks, the overlay track 2717 SHOULD be used instead. The order of multiple TrackOverlay 2718 matters, the first one is the one that SHOULD be used. If not 2719 found it SHOULD be the second, etc. 2721 9.4.1.33. CodecDelay Element 2723 name: CodecDelay 2725 path: "\Segment\Tracks\TrackEntry\CodecDelay" 2727 id: 0x56AA 2728 maxOccurs: 1 2730 default: 0 2732 type: uinteger 2734 minver: 4 2736 definition: CodecDelay is The codec-built-in delay in nanoseconds. 2737 This value MUST be subtracted from each block timestamp in order 2738 to get the actual timestamp. The value SHOULD be small so the 2739 muxing of tracks with the same actual timestamp are in the same 2740 Cluster. 2742 9.4.1.34. SeekPreRoll Element 2744 name: SeekPreRoll 2746 path: "\Segment\Tracks\TrackEntry\SeekPreRoll" 2748 id: 0x56BB 2750 minOccurs: 1 2752 maxOccurs: 1 2754 default: 0 2756 type: uinteger 2758 minver: 4 2760 definition: After a discontinuity, SeekPreRoll is the duration in 2761 nanoseconds of the data the decoder MUST decode before the decoded 2762 data is valid. 2764 9.4.1.35. TrackTranslate Element 2766 name: TrackTranslate 2768 path: "\Segment\Tracks\TrackEntry\TrackTranslate" 2770 id: 0x6624 2772 type: master 2774 definition: The track identification for the given Chapter Codec. 2776 9.4.1.35.1. TrackTranslateEditionUID Element 2778 name: TrackTranslateEditionUID 2780 path: "\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateEditi 2781 onUID" 2783 id: 0x66FC 2785 type: uinteger 2787 definition: Specify an edition UID on which this translation 2788 applies. When not specified, it means for all editions found in 2789 the Segment. 2791 9.4.1.35.2. TrackTranslateCodec Element 2793 name: TrackTranslateCodec 2795 path: "\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateCodec 2796 " 2798 id: 0x66BF 2800 minOccurs: 1 2802 maxOccurs: 1 2804 type: uinteger 2806 definition: The chapter codec; see Section 9.7.1.4.10.1. 2808 restrictions: 2810 +=======+=================+ 2811 | value | label | 2812 +=======+=================+ 2813 | 0 | Matroska Script | 2814 +-------+-----------------+ 2815 | 1 | DVD-menu | 2816 +-------+-----------------+ 2818 Table 12 2820 9.4.1.35.3. TrackTranslateTrackID Element 2822 name: TrackTranslateTrackID 2823 path: "\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateTrack 2824 ID" 2826 id: 0x66A5 2828 minOccurs: 1 2830 maxOccurs: 1 2832 type: binary 2834 definition: The binary value used to represent this track in the 2835 chapter codec data. The format depends on the ChapProcessCodecID 2836 used; see Section 9.7.1.4.10.1. 2838 9.4.1.36. Video Element 2840 name: Video 2842 path: "\Segment\Tracks\TrackEntry\Video" 2844 id: 0xE0 2846 maxOccurs: 1 2848 type: master 2850 definition: Video settings. 2852 9.4.1.36.1. FlagInterlaced Element 2854 name: FlagInterlaced 2856 path: "\Segment\Tracks\TrackEntry\Video\FlagInterlaced" 2858 id: 0x9A 2860 minOccurs: 1 2862 maxOccurs: 1 2864 range: 0-2 2866 default: 0 2868 type: uinteger 2870 minver: 2 2871 definition: A flag to declare if the video is known to be 2872 progressive, or interlaced, and if applicable to declare details 2873 about the interlacement. 2875 restrictions: 2877 +=======+==============+ 2878 | value | label | 2879 +=======+==============+ 2880 | 0 | undetermined | 2881 +-------+--------------+ 2882 | 1 | interlaced | 2883 +-------+--------------+ 2884 | 2 | progressive | 2885 +-------+--------------+ 2887 Table 13 2889 9.4.1.36.2. FieldOrder Element 2891 name: FieldOrder 2893 path: "\Segment\Tracks\TrackEntry\Video\FieldOrder" 2895 id: 0x9D 2897 minOccurs: 1 2899 maxOccurs: 1 2901 range: 0-14 2903 default: 2 2905 type: uinteger 2907 minver: 4 2909 definition: Declare the field ordering of the video. If 2910 FlagInterlaced is not set to 1, this Element MUST be ignored. 2912 restrictions: 2914 +===================+==============+===============================+ 2915 | value | label | documentation | 2916 +===================+==============+===============================+ 2917 | 0 | progressive | | 2918 +-------------------+--------------+-------------------------------+ 2919 | 1 | tff | Top field displayed first. | 2920 | | | Top field stored first. | 2921 +-------------------+--------------+-------------------------------+ 2922 | 2 | undetermined | | 2923 +-------------------+--------------+-------------------------------+ 2924 | 6 | bff | Bottom field displayed first. | 2925 | | | Bottom field stored first. | 2926 +-------------------+--------------+-------------------------------+ 2927 | 9 | bff(swapped) | Top field displayed first. | 2928 | | | Fields are interleaved in | 2929 | | | storage | 2930 +-------------------+--------------+-------------------------------+ 2931 | with the top line | | | 2932 | of the top field | | | 2933 | stored first. | | | 2934 +-------------------+--------------+-------------------------------+ 2935 | 14 | tff(swapped) | Bottom field displayed first. | 2936 | | | Fields are interleaved in | 2937 | | | storage | 2938 +-------------------+--------------+-------------------------------+ 2939 | with the top line | | | 2940 | of the top field | | | 2941 | stored first. | | | 2942 +-------------------+--------------+-------------------------------+ 2944 Table 14 2946 9.4.1.36.3. StereoMode Element 2948 name: StereoMode 2950 path: "\Segment\Tracks\TrackEntry\Video\StereoMode" 2952 id: 0x53B8 2954 maxOccurs: 1 2956 default: 0 2958 type: uinteger 2960 minver: 3 2961 definition: Stereo-3D video mode. There are some more details in 2962 Section 24.10. 2964 restrictions: 2966 +=======+===================================================+ 2967 | value | label | 2968 +=======+===================================================+ 2969 | 0 | mono | 2970 +-------+---------------------------------------------------+ 2971 | 1 | side by side (left eye first) | 2972 +-------+---------------------------------------------------+ 2973 | 2 | top - bottom (right eye is first) | 2974 +-------+---------------------------------------------------+ 2975 | 3 | top - bottom (left eye is first) | 2976 +-------+---------------------------------------------------+ 2977 | 4 | checkboard (right eye is first) | 2978 +-------+---------------------------------------------------+ 2979 | 5 | checkboard (left eye is first) | 2980 +-------+---------------------------------------------------+ 2981 | 6 | row interleaved (right eye is first) | 2982 +-------+---------------------------------------------------+ 2983 | 7 | row interleaved (left eye is first) | 2984 +-------+---------------------------------------------------+ 2985 | 8 | column interleaved (right eye is first) | 2986 +-------+---------------------------------------------------+ 2987 | 9 | column interleaved (left eye is first) | 2988 +-------+---------------------------------------------------+ 2989 | 10 | anaglyph (cyan/red) | 2990 +-------+---------------------------------------------------+ 2991 | 11 | side by side (right eye first) | 2992 +-------+---------------------------------------------------+ 2993 | 12 | anaglyph (green/magenta) | 2994 +-------+---------------------------------------------------+ 2995 | 13 | both eyes laced in one Block (left eye is first) | 2996 +-------+---------------------------------------------------+ 2997 | 14 | both eyes laced in one Block (right eye is first) | 2998 +-------+---------------------------------------------------+ 3000 Table 15 3002 9.4.1.36.4. AlphaMode Element 3004 name: AlphaMode 3006 path: "\Segment\Tracks\TrackEntry\Video\AlphaMode" 3008 id: 0x53C0 3009 maxOccurs: 1 3011 default: 0 3013 type: uinteger 3015 minver: 3 3017 definition: Alpha Video Mode. Presence of this Element indicates 3018 that the BlockAdditional Element could contain Alpha data. 3020 9.4.1.36.5. OldStereoMode Element 3022 name: OldStereoMode 3024 path: "\Segment\Tracks\TrackEntry\Video\OldStereoMode" 3026 id: 0x53B9 3028 maxOccurs: 1 3030 type: uinteger 3032 maxver: 0 3034 definition: DEPRECATED, DO NOT USE. Bogus StereoMode value used in 3035 old versions of libmatroska. 3037 restrictions: 3039 +=======+===========+ 3040 | value | label | 3041 +=======+===========+ 3042 | 0 | mono | 3043 +-------+-----------+ 3044 | 1 | right eye | 3045 +-------+-----------+ 3046 | 2 | left eye | 3047 +-------+-----------+ 3048 | 3 | both eyes | 3049 +-------+-----------+ 3051 Table 16 3053 9.4.1.36.6. PixelWidth Element 3055 name: PixelWidth 3056 path: "\Segment\Tracks\TrackEntry\Video\PixelWidth" 3058 id: 0xB0 3060 minOccurs: 1 3062 maxOccurs: 1 3064 range: not 0 3066 type: uinteger 3068 definition: Width of the encoded video frames in pixels. 3070 9.4.1.36.7. PixelHeight Element 3072 name: PixelHeight 3074 path: "\Segment\Tracks\TrackEntry\Video\PixelHeight" 3076 id: 0xBA 3078 minOccurs: 1 3080 maxOccurs: 1 3082 range: not 0 3084 type: uinteger 3086 definition: Height of the encoded video frames in pixels. 3088 9.4.1.36.8. PixelCropBottom Element 3090 name: PixelCropBottom 3092 path: "\Segment\Tracks\TrackEntry\Video\PixelCropBottom" 3094 id: 0x54AA 3096 maxOccurs: 1 3098 default: 0 3100 type: uinteger 3102 definition: The number of video pixels to remove at the bottom of 3103 the image. 3105 9.4.1.36.9. PixelCropTop Element 3107 name: PixelCropTop 3109 path: "\Segment\Tracks\TrackEntry\Video\PixelCropTop" 3111 id: 0x54BB 3113 maxOccurs: 1 3115 default: 0 3117 type: uinteger 3119 definition: The number of video pixels to remove at the top of the 3120 image. 3122 9.4.1.36.10. PixelCropLeft Element 3124 name: PixelCropLeft 3126 path: "\Segment\Tracks\TrackEntry\Video\PixelCropLeft" 3128 id: 0x54CC 3130 maxOccurs: 1 3132 default: 0 3134 type: uinteger 3136 definition: The number of video pixels to remove on the left of the 3137 image. 3139 9.4.1.36.11. PixelCropRight Element 3141 name: PixelCropRight 3143 path: "\Segment\Tracks\TrackEntry\Video\PixelCropRight" 3145 id: 0x54DD 3147 maxOccurs: 1 3149 default: 0 3151 type: uinteger 3152 definition: The number of video pixels to remove on the right of the 3153 image. 3155 9.4.1.36.12. DisplayWidth Element 3157 name: DisplayWidth 3159 path: "\Segment\Tracks\TrackEntry\Video\DisplayWidth" 3161 id: 0x54B0 3163 maxOccurs: 1 3165 range: not 0 3167 default: see implementation notes 3169 type: uinteger 3171 definition: Width of the video frames to display. Applies to the 3172 video frame after cropping (PixelCrop* Elements). 3174 implementation notes: 3176 +============================+====================================+ 3177 | attribute | note | 3178 +============================+====================================+ 3179 | default | If the DisplayUnit of the same | 3180 | | TrackEntry is 0, then the default | 3181 | | value for DisplayWidth is equal to | 3182 +----------------------------+------------------------------------+ 3183 | PixelWidth - PixelCropLeft | | 3184 | - PixelCropRight, else | | 3185 | there is no default value. | | 3186 +----------------------------+------------------------------------+ 3188 Table 17 3190 9.4.1.36.13. DisplayHeight Element 3192 name: DisplayHeight 3194 path: "\Segment\Tracks\TrackEntry\Video\DisplayHeight" 3196 id: 0x54BA 3198 maxOccurs: 1 3199 range: not 0 3201 default: see implementation notes 3203 type: uinteger 3205 definition: Height of the video frames to display. Applies to the 3206 video frame after cropping (PixelCrop* Elements). 3208 implementation notes: 3210 +============================+=====================================+ 3211 | attribute | note | 3212 +============================+=====================================+ 3213 | default | If the DisplayUnit of the same | 3214 | | TrackEntry is 0, then the default | 3215 | | value for DisplayHeight is equal to | 3216 +----------------------------+-------------------------------------+ 3217 | PixelHeight - PixelCropTop | | 3218 | - PixelCropBottom, else | | 3219 | there is no default value. | | 3220 +----------------------------+-------------------------------------+ 3222 Table 18 3224 9.4.1.36.14. DisplayUnit Element 3226 name: DisplayUnit 3228 path: "\Segment\Tracks\TrackEntry\Video\DisplayUnit" 3230 id: 0x54B2 3232 maxOccurs: 1 3234 default: 0 3236 type: uinteger 3238 definition: How DisplayWidth & DisplayHeight are interpreted. 3240 restrictions: 3242 +=======+======================+ 3243 | value | label | 3244 +=======+======================+ 3245 | 0 | pixels | 3246 +-------+----------------------+ 3247 | 1 | centimeters | 3248 +-------+----------------------+ 3249 | 2 | inches | 3250 +-------+----------------------+ 3251 | 3 | display aspect ratio | 3252 +-------+----------------------+ 3253 | 4 | unknown | 3254 +-------+----------------------+ 3256 Table 19 3258 9.4.1.36.15. AspectRatioType Element 3260 name: AspectRatioType 3262 path: "\Segment\Tracks\TrackEntry\Video\AspectRatioType" 3264 id: 0x54B3 3266 maxOccurs: 1 3268 default: 0 3270 type: uinteger 3272 definition: Specify the possible modifications to the aspect ratio. 3274 restrictions: 3276 +=======+===================+ 3277 | value | label | 3278 +=======+===================+ 3279 | 0 | free resizing | 3280 +-------+-------------------+ 3281 | 1 | keep aspect ratio | 3282 +-------+-------------------+ 3283 | 2 | fixed | 3284 +-------+-------------------+ 3286 Table 20 3288 9.4.1.36.16. ColourSpace Element 3290 name: ColourSpace 3292 path: "\Segment\Tracks\TrackEntry\Video\ColourSpace" 3294 id: 0x2EB524 3296 minOccurs: see implementation notes 3298 maxOccurs: 1 3300 type: binary 3302 definition: Specify the pixel format used for the Track's data as a 3303 FourCC. This value is similar in scope to the biCompression value 3304 of AVI's BITMAPINFOHEADER. 3306 implementation notes: 3308 +===========+============================================+ 3309 | attribute | note | 3310 +===========+============================================+ 3311 | minOccurs | ColourSpace MUST be set (minOccurs=1) in | 3312 | | TrackEntry, when the CodecID Element of | 3313 | | the TrackEntry is set to "V_UNCOMPRESSED". | 3314 +-----------+--------------------------------------------+ 3316 Table 21 3318 9.4.1.36.17. GammaValue Element 3320 name: GammaValue 3322 path: "\Segment\Tracks\TrackEntry\Video\GammaValue" 3324 id: 0x2FB523 3326 maxOccurs: 1 3328 range: > 0x0p+0 3330 type: float 3332 minver: 0 3334 maxver: 0 3335 definition: Gamma Value. 3337 9.4.1.36.18. FrameRate Element 3339 name: FrameRate 3341 path: "\Segment\Tracks\TrackEntry\Video\FrameRate" 3343 id: 0x2383E3 3345 maxOccurs: 1 3347 range: > 0x0p+0 3349 type: float 3351 minver: 0 3353 maxver: 0 3355 definition: Number of frames per second. This value is 3356 Informational only. It is intended for constant frame rate 3357 streams, and SHOULD NOT be used for a variable frame rate 3358 TrackEntry. 3360 9.4.1.36.19. Colour Element 3362 name: Colour 3364 path: "\Segment\Tracks\TrackEntry\Video\Colour" 3366 id: 0x55B0 3368 maxOccurs: 1 3370 type: master 3372 minver: 4 3374 definition: Settings describing the colour format. 3376 9.4.1.36.19.1. MatrixCoefficients Element 3378 name: MatrixCoefficients 3380 path: "\Segment\Tracks\TrackEntry\Video\Colour\MatrixCoefficients" 3382 id: 0x55B1 3383 maxOccurs: 1 3385 default: 2 3387 type: uinteger 3389 minver: 4 3391 definition: The Matrix Coefficients of the video used to derive luma 3392 and chroma values from red, green, and blue color primaries. For 3393 clarity, the value and meanings for MatrixCoefficients are adopted 3394 from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273. 3396 restrictions: 3398 +=======+=======================================+ 3399 | value | label | 3400 +=======+=======================================+ 3401 | 0 | Identity | 3402 +-------+---------------------------------------+ 3403 | 1 | ITU-R BT.709 | 3404 +-------+---------------------------------------+ 3405 | 2 | unspecified | 3406 +-------+---------------------------------------+ 3407 | 3 | reserved | 3408 +-------+---------------------------------------+ 3409 | 4 | US FCC 73.682 | 3410 +-------+---------------------------------------+ 3411 | 5 | ITU-R BT.470BG | 3412 +-------+---------------------------------------+ 3413 | 6 | SMPTE 170M | 3414 +-------+---------------------------------------+ 3415 | 7 | SMPTE 240M | 3416 +-------+---------------------------------------+ 3417 | 8 | YCoCg | 3418 +-------+---------------------------------------+ 3419 | 9 | BT2020 Non-constant Luminance | 3420 +-------+---------------------------------------+ 3421 | 10 | BT2020 Constant Luminance | 3422 +-------+---------------------------------------+ 3423 | 11 | SMPTE ST 2085 | 3424 +-------+---------------------------------------+ 3425 | 12 | Chroma-derived Non-constant Luminance | 3426 +-------+---------------------------------------+ 3427 | 13 | Chroma-derived Constant Luminance | 3428 +-------+---------------------------------------+ 3429 | 14 | ITU-R BT.2100-0 | 3430 +-------+---------------------------------------+ 3432 Table 22 3434 9.4.1.36.19.2. BitsPerChannel Element 3436 name: BitsPerChannel 3438 path: "\Segment\Tracks\TrackEntry\Video\Colour\BitsPerChannel" 3440 id: 0x55B2 3442 maxOccurs: 1 3444 default: 0 3445 type: uinteger 3447 minver: 4 3449 definition: Number of decoded bits per channel. A value of 0 3450 indicates that the BitsPerChannel is unspecified. 3452 9.4.1.36.19.3. ChromaSubsamplingHorz Element 3454 name: ChromaSubsamplingHorz 3456 path: "\Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingHorz 3457 " 3459 id: 0x55B3 3461 maxOccurs: 1 3463 type: uinteger 3465 minver: 4 3467 definition: The amount of pixels to remove in the Cr and Cb channels 3468 for every pixel not removed horizontally. Example: For video with 3469 4:2:0 chroma subsampling, the ChromaSubsamplingHorz SHOULD be set 3470 to 1. 3472 9.4.1.36.19.4. ChromaSubsamplingVert Element 3474 name: ChromaSubsamplingVert 3476 path: "\Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingVert 3477 " 3479 id: 0x55B4 3481 maxOccurs: 1 3483 type: uinteger 3485 minver: 4 3487 definition: The amount of pixels to remove in the Cr and Cb channels 3488 for every pixel not removed vertically. Example: For video with 3489 4:2:0 chroma subsampling, the ChromaSubsamplingVert SHOULD be set 3490 to 1. 3492 9.4.1.36.19.5. CbSubsamplingHorz Element 3494 name: CbSubsamplingHorz 3496 path: "\Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingHorz" 3498 id: 0x55B5 3500 maxOccurs: 1 3502 type: uinteger 3504 minver: 4 3506 definition: The amount of pixels to remove in the Cb channel for 3507 every pixel not removed horizontally. This is additive with 3508 ChromaSubsamplingHorz. Example: For video with 4:2:1 chroma 3509 subsampling, the ChromaSubsamplingHorz SHOULD be set to 1 and 3510 CbSubsamplingHorz SHOULD be set to 1. 3512 9.4.1.36.19.6. CbSubsamplingVert Element 3514 name: CbSubsamplingVert 3516 path: "\Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingVert" 3518 id: 0x55B6 3520 maxOccurs: 1 3522 type: uinteger 3524 minver: 4 3526 definition: The amount of pixels to remove in the Cb channel for 3527 every pixel not removed vertically. This is additive with 3528 ChromaSubsamplingVert. 3530 9.4.1.36.19.7. ChromaSitingHorz Element 3532 name: ChromaSitingHorz 3534 path: "\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingHorz" 3536 id: 0x55B7 3538 maxOccurs: 1 3539 default: 0 3541 type: uinteger 3543 minver: 4 3545 definition: How chroma is subsampled horizontally. 3547 restrictions: 3549 +=======+=================+ 3550 | value | label | 3551 +=======+=================+ 3552 | 0 | unspecified | 3553 +-------+-----------------+ 3554 | 1 | left collocated | 3555 +-------+-----------------+ 3556 | 2 | half | 3557 +-------+-----------------+ 3559 Table 23 3561 9.4.1.36.19.8. ChromaSitingVert Element 3563 name: ChromaSitingVert 3565 path: "\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingVert" 3567 id: 0x55B8 3569 maxOccurs: 1 3571 default: 0 3573 type: uinteger 3575 minver: 4 3577 definition: How chroma is subsampled vertically. 3579 restrictions: 3581 +=======+================+ 3582 | value | label | 3583 +=======+================+ 3584 | 0 | unspecified | 3585 +-------+----------------+ 3586 | 1 | top collocated | 3587 +-------+----------------+ 3588 | 2 | half | 3589 +-------+----------------+ 3591 Table 24 3593 9.4.1.36.19.9. Range Element 3595 name: Range 3597 path: "\Segment\Tracks\TrackEntry\Video\Colour\Range" 3599 id: 0x55B9 3601 maxOccurs: 1 3603 default: 0 3605 type: uinteger 3607 minver: 4 3609 definition: Clipping of the color ranges. 3611 restrictions: 3613 +=======+=========================================================+ 3614 | value | label | 3615 +=======+=========================================================+ 3616 | 0 | unspecified | 3617 +-------+---------------------------------------------------------+ 3618 | 1 | broadcast range | 3619 +-------+---------------------------------------------------------+ 3620 | 2 | full range (no clipping) | 3621 +-------+---------------------------------------------------------+ 3622 | 3 | defined by MatrixCoefficients / TransferCharacteristics | 3623 +-------+---------------------------------------------------------+ 3625 Table 25 3627 9.4.1.36.19.10. TransferCharacteristics Element 3629 name: TransferCharacteristics 3631 path: "\Segment\Tracks\TrackEntry\Video\Colour\TransferCharacteristi 3632 cs" 3634 id: 0x55BA 3636 maxOccurs: 1 3638 default: 2 3640 type: uinteger 3642 minver: 4 3644 definition: The transfer characteristics of the video. For clarity, 3645 the value and meanings for TransferCharacteristics are adopted 3646 from Table 3 of ISO/IEC 23091-4 or ITU-T H.273. 3648 restrictions: 3650 +=======+=======================================+ 3651 | value | label | 3652 +=======+=======================================+ 3653 | 0 | reserved | 3654 +-------+---------------------------------------+ 3655 | 1 | ITU-R BT.709 | 3656 +-------+---------------------------------------+ 3657 | 2 | unspecified | 3658 +-------+---------------------------------------+ 3659 | 3 | reserved | 3660 +-------+---------------------------------------+ 3661 | 4 | Gamma 2.2 curve - BT.470M | 3662 +-------+---------------------------------------+ 3663 | 5 | Gamma 2.8 curve - BT.470BG | 3664 +-------+---------------------------------------+ 3665 | 6 | SMPTE 170M | 3666 +-------+---------------------------------------+ 3667 | 7 | SMPTE 240M | 3668 +-------+---------------------------------------+ 3669 | 8 | Linear | 3670 +-------+---------------------------------------+ 3671 | 9 | Log | 3672 +-------+---------------------------------------+ 3673 | 10 | Log Sqrt | 3674 +-------+---------------------------------------+ 3675 | 11 | IEC 61966-2-4 | 3676 +-------+---------------------------------------+ 3677 | 12 | ITU-R BT.1361 Extended Colour Gamut | 3678 +-------+---------------------------------------+ 3679 | 13 | IEC 61966-2-1 | 3680 +-------+---------------------------------------+ 3681 | 14 | ITU-R BT.2020 10 bit | 3682 +-------+---------------------------------------+ 3683 | 15 | ITU-R BT.2020 12 bit | 3684 +-------+---------------------------------------+ 3685 | 16 | ITU-R BT.2100 Perceptual Quantization | 3686 +-------+---------------------------------------+ 3687 | 17 | SMPTE ST 428-1 | 3688 +-------+---------------------------------------+ 3689 | 18 | ARIB STD-B67 (HLG) | 3690 +-------+---------------------------------------+ 3692 Table 26 3694 9.4.1.36.19.11. Primaries Element 3696 name: Primaries 3697 path: "\Segment\Tracks\TrackEntry\Video\Colour\Primaries" 3699 id: 0x55BB 3701 maxOccurs: 1 3703 default: 2 3705 type: uinteger 3707 minver: 4 3709 definition: The colour primaries of the video. For clarity, the 3710 value and meanings for Primaries are adopted from Table 2 of ISO/ 3711 IEC 23091-4 or ITU-T H.273. 3713 restrictions: 3715 +=======+========================================+ 3716 | value | label | 3717 +=======+========================================+ 3718 | 0 | reserved | 3719 +-------+----------------------------------------+ 3720 | 1 | ITU-R BT.709 | 3721 +-------+----------------------------------------+ 3722 | 2 | unspecified | 3723 +-------+----------------------------------------+ 3724 | 3 | reserved | 3725 +-------+----------------------------------------+ 3726 | 4 | ITU-R BT.470M | 3727 +-------+----------------------------------------+ 3728 | 5 | ITU-R BT.470BG - BT.601 625 | 3729 +-------+----------------------------------------+ 3730 | 6 | ITU-R BT.601 525 - SMPTE 170M | 3731 +-------+----------------------------------------+ 3732 | 7 | SMPTE 240M | 3733 +-------+----------------------------------------+ 3734 | 8 | FILM | 3735 +-------+----------------------------------------+ 3736 | 9 | ITU-R BT.2020 | 3737 +-------+----------------------------------------+ 3738 | 10 | SMPTE ST 428-1 | 3739 +-------+----------------------------------------+ 3740 | 11 | SMPTE RP 432-2 | 3741 +-------+----------------------------------------+ 3742 | 12 | SMPTE EG 432-2 | 3743 +-------+----------------------------------------+ 3744 | 22 | EBU Tech. 3213-E - JEDEC P22 phosphors | 3745 +-------+----------------------------------------+ 3747 Table 27 3749 9.4.1.36.19.12. MaxCLL Element 3751 name: MaxCLL 3753 path: "\Segment\Tracks\TrackEntry\Video\Colour\MaxCLL" 3755 id: 0x55BC 3757 maxOccurs: 1 3759 type: uinteger 3761 minver: 4 3762 definition: Maximum brightness of a single pixel (Maximum Content 3763 Light Level) in candelas per square meter (cd/m^(2)). 3765 9.4.1.36.19.13. MaxFALL Element 3767 name: MaxFALL 3769 path: "\Segment\Tracks\TrackEntry\Video\Colour\MaxFALL" 3771 id: 0x55BD 3773 maxOccurs: 1 3775 type: uinteger 3777 minver: 4 3779 definition: Maximum brightness of a single full frame (Maximum 3780 Frame-Average Light Level) in candelas per square meter (cd/ 3781 m^(2)). 3783 9.4.1.36.19.14. MasteringMetadata Element 3785 name: MasteringMetadata 3787 path: "\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata" 3789 id: 0x55D0 3791 maxOccurs: 1 3793 type: master 3795 minver: 4 3797 definition: SMPTE 2086 mastering data. 3799 9.4.1.36.19.15. PrimaryRChromaticityX Element 3801 name: PrimaryRChromaticityX 3803 path: "\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Pri 3804 maryRChromaticityX" 3806 id: 0x55D1 3808 maxOccurs: 1 3809 range: 0-1 3811 type: float 3813 minver: 4 3815 definition: Red X chromaticity coordinate, as defined by CIE 1931. 3817 9.4.1.36.19.16. PrimaryRChromaticityY Element 3819 name: PrimaryRChromaticityY 3821 path: "\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Pri 3822 maryRChromaticityY" 3824 id: 0x55D2 3826 maxOccurs: 1 3828 range: 0-1 3830 type: float 3832 minver: 4 3834 definition: Red Y chromaticity coordinate, as defined by CIE 1931. 3836 9.4.1.36.19.17. PrimaryGChromaticityX Element 3838 name: PrimaryGChromaticityX 3840 path: "\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Pri 3841 maryGChromaticityX" 3843 id: 0x55D3 3845 maxOccurs: 1 3847 range: 0-1 3849 type: float 3851 minver: 4 3853 definition: Green X chromaticity coordinate, as defined by CIE 1931. 3855 9.4.1.36.19.18. PrimaryGChromaticityY Element 3857 name: PrimaryGChromaticityY 3859 path: "\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Pri 3860 maryGChromaticityY" 3862 id: 0x55D4 3864 maxOccurs: 1 3866 range: 0-1 3868 type: float 3870 minver: 4 3872 definition: Green Y chromaticity coordinate, as defined by CIE 1931. 3874 9.4.1.36.19.19. PrimaryBChromaticityX Element 3876 name: PrimaryBChromaticityX 3878 path: "\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Pri 3879 maryBChromaticityX" 3881 id: 0x55D5 3883 maxOccurs: 1 3885 range: 0-1 3887 type: float 3889 minver: 4 3891 definition: Blue X chromaticity coordinate, as defined by CIE 1931. 3893 9.4.1.36.19.20. PrimaryBChromaticityY Element 3895 name: PrimaryBChromaticityY 3897 path: "\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Pri 3898 maryBChromaticityY" 3900 id: 0x55D6 3902 maxOccurs: 1 3903 range: 0-1 3905 type: float 3907 minver: 4 3909 definition: Blue Y chromaticity coordinate, as defined by CIE 1931. 3911 9.4.1.36.19.21. WhitePointChromaticityX Element 3913 name: WhitePointChromaticityX 3915 path: "\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Whi 3916 tePointChromaticityX" 3918 id: 0x55D7 3920 maxOccurs: 1 3922 range: 0-1 3924 type: float 3926 minver: 4 3928 definition: White X chromaticity coordinate, as defined by CIE 1931. 3930 9.4.1.36.19.22. WhitePointChromaticityY Element 3932 name: WhitePointChromaticityY 3934 path: "\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Whi 3935 tePointChromaticityY" 3937 id: 0x55D8 3939 maxOccurs: 1 3941 range: 0-1 3943 type: float 3945 minver: 4 3947 definition: White Y chromaticity coordinate, as defined by CIE 1931. 3949 9.4.1.36.19.23. LuminanceMax Element 3951 name: LuminanceMax 3953 path: "\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Lum 3954 inanceMax" 3956 id: 0x55D9 3958 maxOccurs: 1 3960 range: >= 0x0p+0 3962 type: float 3964 minver: 4 3966 definition: Maximum luminance. Represented in candelas per square 3967 meter (cd/m^(2)). 3969 9.4.1.36.19.24. LuminanceMin Element 3971 name: LuminanceMin 3973 path: "\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\Lum 3974 inanceMin" 3976 id: 0x55DA 3978 maxOccurs: 1 3980 range: >= 0x0p+0 3982 type: float 3984 minver: 4 3986 definition: Minimum luminance. Represented in candelas per square 3987 meter (cd/m^(2)). 3989 9.4.1.36.20. Projection Element 3991 name: Projection 3993 path: "\Segment\Tracks\TrackEntry\Video\Projection" 3995 id: 0x7670 3996 maxOccurs: 1 3998 type: master 4000 minver: 4 4002 definition: Describes the video projection details. Used to render 4003 spherical and VR videos. 4005 9.4.1.36.20.1. ProjectionType Element 4007 name: ProjectionType 4009 path: "\Segment\Tracks\TrackEntry\Video\Projection\ProjectionType" 4011 id: 0x7671 4013 minOccurs: 1 4015 maxOccurs: 1 4017 range: 0-3 4019 default: 0 4021 type: uinteger 4023 minver: 4 4025 definition: Describes the projection used for this video track. 4027 restrictions: 4029 +=======+=================+ 4030 | value | label | 4031 +=======+=================+ 4032 | 0 | rectangular | 4033 +-------+-----------------+ 4034 | 1 | equirectangular | 4035 +-------+-----------------+ 4036 | 2 | cubemap | 4037 +-------+-----------------+ 4038 | 3 | mesh | 4039 +-------+-----------------+ 4041 Table 28 4043 9.4.1.36.20.2. ProjectionPrivate Element 4045 name: ProjectionPrivate 4047 path: "\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPrivate 4048 " 4050 id: 0x7672 4052 maxOccurs: 1 4054 type: binary 4056 minver: 4 4058 definition: Private data that only applies to a specific projection. 4060 * If "ProjectionType" equals 0 (Rectangular), then this element must 4061 not be present. 4063 * If "ProjectionType" equals 1 (Equirectangular), then this element 4064 must be present and contain the same binary data that would be 4065 stored inside an ISOBMFF Equirectangular Projection Box ('equi'). 4067 * If "ProjectionType" equals 2 (Cubemap), then this element must be 4068 present and contain the same binary data that would be stored 4069 inside an ISOBMFF Cubemap Projection Box ('cbmp'). 4071 * If "ProjectionType" equals 3 (Mesh), then this element must be 4072 present and contain the same binary data that would be stored 4073 inside an ISOBMFF Mesh Projection Box ('mshp'). 4075 usage notes: ISOBMFF box size and fourcc fields are not included in 4076 the binary data, but the FullBox version and flag fields are. 4077 This is to avoid redundant framing information while preserving 4078 versioning and semantics between the two container formats. 4080 9.4.1.36.20.3. ProjectionPoseYaw Element 4082 name: ProjectionPoseYaw 4084 path: "\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPoseYaw 4085 " 4087 id: 0x7673 4089 minOccurs: 1 4090 maxOccurs: 1 4092 default: 0x0p+0 4094 type: float 4096 minver: 4 4098 definition: Specifies a yaw rotation to the projection. 4100 Value represents a clockwise rotation, in degrees, around the up 4101 vector. This rotation must be applied before any 4102 "ProjectionPosePitch" or "ProjectionPoseRoll" rotations. The value 4103 of this field should be in the -180 to 180 degree range. 4105 9.4.1.36.20.4. ProjectionPosePitch Element 4107 name: ProjectionPosePitch 4109 path: "\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPosePit 4110 ch" 4112 id: 0x7674 4114 minOccurs: 1 4116 maxOccurs: 1 4118 default: 0x0p+0 4120 type: float 4122 minver: 4 4124 definition: Specifies a pitch rotation to the projection. 4126 Value represents a counter-clockwise rotation, in degrees, around the 4127 right vector. This rotation must be applied after the 4128 "ProjectionPoseYaw" rotation and before the "ProjectionPoseRoll" 4129 rotation. The value of this field should be in the -90 to 90 degree 4130 range. 4132 9.4.1.36.20.5. ProjectionPoseRoll Element 4134 name: ProjectionPoseRoll 4136 path: "\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPoseRol 4137 l" 4139 id: 0x7675 4141 minOccurs: 1 4143 maxOccurs: 1 4145 default: 0x0p+0 4147 type: float 4149 minver: 4 4151 definition: Specifies a roll rotation to the projection. 4153 Value represents a counter-clockwise rotation, in degrees, around the 4154 forward vector. This rotation must be applied after the 4155 "ProjectionPoseYaw" and "ProjectionPosePitch" rotations. The value 4156 of this field should be in the -180 to 180 degree range. 4158 9.4.1.37. Audio Element 4160 name: Audio 4162 path: "\Segment\Tracks\TrackEntry\Audio" 4164 id: 0xE1 4166 maxOccurs: 1 4168 type: master 4170 definition: Audio settings. 4172 9.4.1.37.1. SamplingFrequency Element 4174 name: SamplingFrequency 4176 path: "\Segment\Tracks\TrackEntry\Audio\SamplingFrequency" 4178 id: 0xB5 4180 minOccurs: 1 4182 maxOccurs: 1 4184 range: > 0x0p+0 4186 default: 0x1.f4p+12 4187 type: float 4189 definition: Sampling frequency in Hz. 4191 9.4.1.37.2. OutputSamplingFrequency Element 4193 name: OutputSamplingFrequency 4195 path: "\Segment\Tracks\TrackEntry\Audio\OutputSamplingFrequency" 4197 id: 0x78B5 4199 maxOccurs: 1 4201 range: > 0x0p+0 4203 default: see implementation notes 4205 type: float 4207 definition: Real output sampling frequency in Hz (used for SBR 4208 techniques). 4210 implementation notes: 4212 +===========+======================================================+ 4213 | attribute | note | 4214 +===========+======================================================+ 4215 | default | The default value for OutputSamplingFrequency of the | 4216 | | same TrackEntry is equal to the SamplingFrequency. | 4217 +-----------+------------------------------------------------------+ 4219 Table 29 4221 9.4.1.37.3. Channels Element 4223 name: Channels 4225 path: "\Segment\Tracks\TrackEntry\Audio\Channels" 4227 id: 0x9F 4229 minOccurs: 1 4231 maxOccurs: 1 4233 range: not 0 4234 default: 1 4236 type: uinteger 4238 definition: Numbers of channels in the track. 4240 9.4.1.37.4. ChannelPositions Element 4242 name: ChannelPositions 4244 path: "\Segment\Tracks\TrackEntry\Audio\ChannelPositions" 4246 id: 0x7D7B 4248 maxOccurs: 1 4250 type: binary 4252 minver: 0 4254 maxver: 0 4256 definition: Table of horizontal angles for each successive channel. 4258 9.4.1.37.5. BitDepth Element 4260 name: BitDepth 4262 path: "\Segment\Tracks\TrackEntry\Audio\BitDepth" 4264 id: 0x6264 4266 maxOccurs: 1 4268 range: not 0 4270 type: uinteger 4272 definition: Bits per sample, mostly used for PCM. 4274 9.4.1.38. TrackOperation Element 4276 name: TrackOperation 4278 path: "\Segment\Tracks\TrackEntry\TrackOperation" 4280 id: 0xE2 4281 maxOccurs: 1 4283 type: master 4285 minver: 3 4287 definition: Operation that needs to be applied on tracks to create 4288 this virtual track. For more details look at Section 24.8. 4290 9.4.1.38.1. TrackCombinePlanes Element 4292 name: TrackCombinePlanes 4294 path: "\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes" 4296 id: 0xE3 4298 maxOccurs: 1 4300 type: master 4302 minver: 3 4304 definition: Contains the list of all video plane tracks that need to 4305 be combined to create this 3D track 4307 9.4.1.38.1.1. TrackPlane Element 4309 name: TrackPlane 4311 path: "\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\ 4312 TrackPlane" 4314 id: 0xE4 4316 minOccurs: 1 4318 type: master 4320 minver: 3 4322 definition: Contains a video plane track that need to be combined to 4323 create this 3D track 4325 9.4.1.38.1.2. TrackPlaneUID Element 4327 name: TrackPlaneUID 4328 path: "\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\ 4329 TrackPlane\TrackPlaneUID" 4331 id: 0xE5 4333 minOccurs: 1 4335 maxOccurs: 1 4337 range: not 0 4339 type: uinteger 4341 minver: 3 4343 definition: The trackUID number of the track representing the plane. 4345 9.4.1.38.1.3. TrackPlaneType Element 4347 name: TrackPlaneType 4349 path: "\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes\ 4350 TrackPlane\TrackPlaneType" 4352 id: 0xE6 4354 minOccurs: 1 4356 maxOccurs: 1 4358 type: uinteger 4360 minver: 3 4362 definition: The kind of plane this track corresponds to. 4364 restrictions: 4366 +=======+============+ 4367 | value | label | 4368 +=======+============+ 4369 | 0 | left eye | 4370 +-------+------------+ 4371 | 1 | right eye | 4372 +-------+------------+ 4373 | 2 | background | 4374 +-------+------------+ 4376 Table 30 4378 9.4.1.38.2. TrackJoinBlocks Element 4380 name: TrackJoinBlocks 4382 path: "\Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks" 4384 id: 0xE9 4386 maxOccurs: 1 4388 type: master 4390 minver: 3 4392 definition: Contains the list of all tracks whose Blocks need to be 4393 combined to create this virtual track 4395 9.4.1.38.2.1. TrackJoinUID Element 4397 name: TrackJoinUID 4399 path: "\Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks\Tra 4400 ckJoinUID" 4402 id: 0xED 4404 minOccurs: 1 4406 range: not 0 4408 type: uinteger 4410 minver: 3 4412 definition: The trackUID number of a track whose blocks are used to 4413 create this virtual track. 4415 9.4.1.39. TrickTrackUID Element 4417 name: TrickTrackUID 4419 path: "\Segment\Tracks\TrackEntry\TrickTrackUID" 4421 id: 0xC0 4423 maxOccurs: 1 4425 type: uinteger 4427 minver: 0 4429 maxver: 0 4431 definition: The TrackUID of the Smooth FF/RW video in the paired 4432 EBML structure corresponding to this video track. See 4433 [DivXTrickTrack]. 4435 9.4.1.40. TrickTrackSegmentUID Element 4437 name: TrickTrackSegmentUID 4439 path: "\Segment\Tracks\TrackEntry\TrickTrackSegmentUID" 4441 id: 0xC1 4443 maxOccurs: 1 4445 type: binary 4447 minver: 0 4449 maxver: 0 4451 definition: The SegmentUID of the Segment containing the track 4452 identified by TrickTrackUID. See [DivXTrickTrack]. 4454 9.4.1.41. TrickTrackFlag Element 4456 name: TrickTrackFlag 4458 path: "\Segment\Tracks\TrackEntry\TrickTrackFlag" 4460 id: 0xC6 4462 maxOccurs: 1 4463 default: 0 4465 type: uinteger 4467 minver: 0 4469 maxver: 0 4471 definition: Set to 1 if this video track is a Smooth FF/RW track. 4472 If set to 1, MasterTrackUID and MasterTrackSegUID should must be 4473 present and BlockGroups for this track must contain ReferenceFrame 4474 structures. Otherwise, TrickTrackUID and TrickTrackSegUID must be 4475 present if this track has a corresponding Smooth FF/RW track. See 4476 [DivXTrickTrack]. 4478 9.4.1.42. TrickMasterTrackUID Element 4480 name: TrickMasterTrackUID 4482 path: "\Segment\Tracks\TrackEntry\TrickMasterTrackUID" 4484 id: 0xC7 4486 maxOccurs: 1 4488 type: uinteger 4490 minver: 0 4492 maxver: 0 4494 definition: The TrackUID of the video track in the paired EBML 4495 structure that corresponds to this Smooth FF/RW track. See 4496 [DivXTrickTrack]. 4498 9.4.1.43. TrickMasterTrackSegmentUID Element 4500 name: TrickMasterTrackSegmentUID 4502 path: "\Segment\Tracks\TrackEntry\TrickMasterTrackSegmentUID" 4504 id: 0xC4 4506 maxOccurs: 1 4508 type: binary 4510 minver: 0 4511 maxver: 0 4513 definition: The SegmentUID of the Segment containing the track 4514 identified by MasterTrackUID. See [DivXTrickTrack]. 4516 9.4.1.44. ContentEncodings Element 4518 name: ContentEncodings 4520 path: "\Segment\Tracks\TrackEntry\ContentEncodings" 4522 id: 0x6D80 4524 maxOccurs: 1 4526 type: master 4528 definition: Settings for several content encoding mechanisms like 4529 compression or encryption. 4531 9.4.1.44.1. ContentEncoding Element 4533 name: ContentEncoding 4535 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding" 4537 id: 0x6240 4539 minOccurs: 1 4541 type: master 4543 definition: Settings for one content encoding like compression or 4544 encryption. 4546 9.4.1.44.1.1. ContentEncodingOrder Element 4548 name: ContentEncodingOrder 4550 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4551 ontentEncodingOrder" 4553 id: 0x5031 4555 minOccurs: 1 4557 maxOccurs: 1 4558 default: 0 4560 type: uinteger 4562 definition: Tells when this modification was used during encoding/ 4563 muxing starting with 0 and counting upwards. The decoder/demuxer 4564 has to start with the highest order number it finds and work its 4565 way down. This value has to be unique over all 4566 ContentEncodingOrder Elements in the TrackEntry that contains this 4567 ContentEncodingOrder element. 4569 9.4.1.44.1.2. ContentEncodingScope Element 4571 name: ContentEncodingScope 4573 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4574 ontentEncodingScope" 4576 id: 0x5032 4578 minOccurs: 1 4580 maxOccurs: 1 4582 range: not 0 4584 default: 1 4586 type: uinteger 4588 definition: A bit field that describes which Elements have been 4589 modified in this way. Values (big-endian) can be OR'ed. 4591 restrictions: 4593 +=======+==================================================+ 4594 | value | label | 4595 +=======+==================================================+ 4596 | 1 | All frame contents, excluding lacing data | 4597 +-------+--------------------------------------------------+ 4598 | 2 | The track's private data | 4599 +-------+--------------------------------------------------+ 4600 | 4 | The next ContentEncoding (next | 4601 | | "ContentEncodingOrder". Either the data inside | 4602 | | "ContentCompression" and/or "ContentEncryption") | 4603 +-------+--------------------------------------------------+ 4605 Table 31 4607 9.4.1.44.1.3. ContentEncodingType Element 4609 name: ContentEncodingType 4611 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4612 ontentEncodingType" 4614 id: 0x5033 4616 minOccurs: 1 4618 maxOccurs: 1 4620 default: 0 4622 type: uinteger 4624 definition: A value describing what kind of transformation is 4625 applied. 4627 restrictions: 4629 +=======+=============+ 4630 | value | label | 4631 +=======+=============+ 4632 | 0 | Compression | 4633 +-------+-------------+ 4634 | 1 | Encryption | 4635 +-------+-------------+ 4637 Table 32 4639 9.4.1.44.1.4. ContentCompression Element 4641 name: ContentCompression 4643 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4644 ontentCompression" 4646 id: 0x5034 4648 maxOccurs: 1 4650 type: master 4652 definition: Settings describing the compression used. This Element 4653 MUST be present if the value of ContentEncodingType is 0 and 4654 absent otherwise. Each block MUST be decompressable even if no 4655 previous block is available in order not to prevent seeking. 4657 9.4.1.44.1.5. ContentCompAlgo Element 4659 name: ContentCompAlgo 4661 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4662 ontentCompression\ContentCompAlgo" 4664 id: 0x4254 4666 minOccurs: 1 4668 maxOccurs: 1 4670 default: 0 4672 type: uinteger 4674 definition: The compression algorithm used. 4676 restrictions: 4678 +=======+==================+ 4679 | value | label | 4680 +=======+==================+ 4681 | 0 | zlib | 4682 +-------+------------------+ 4683 | 1 | bzlib | 4684 +-------+------------------+ 4685 | 2 | lzo1x | 4686 +-------+------------------+ 4687 | 3 | Header Stripping | 4688 +-------+------------------+ 4690 Table 33 4692 9.4.1.44.1.6. ContentCompSettings Element 4694 name: ContentCompSettings 4696 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4697 ontentCompression\ContentCompSettings" 4699 id: 0x4255 4700 maxOccurs: 1 4702 type: binary 4704 definition: Settings that might be needed by the decompressor. For 4705 Header Stripping ("ContentCompAlgo"=3), the bytes that were 4706 removed from the beginning of each frames of the track. 4708 9.4.1.44.1.7. ContentEncryption Element 4710 name: ContentEncryption 4712 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4713 ontentEncryption" 4715 id: 0x5035 4717 maxOccurs: 1 4719 type: master 4721 definition: Settings describing the encryption used. This Element 4722 MUST be present if the value of "ContentEncodingType" is 1 4723 (encryption) and MUST be ignored otherwise. 4725 9.4.1.44.1.8. ContentEncAlgo Element 4727 name: ContentEncAlgo 4729 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4730 ontentEncryption\ContentEncAlgo" 4732 id: 0x47E1 4734 minOccurs: 1 4736 maxOccurs: 1 4738 default: 0 4740 type: uinteger 4742 definition: The encryption algorithm used. The value "0" means that 4743 the contents have not been encrypted but only signed. 4745 restrictions: 4747 +=======+=======================+ 4748 | value | label | 4749 +=======+=======================+ 4750 | 0 | Not encrypted | 4751 +-------+-----------------------+ 4752 | 1 | DES - FIPS 46-3 | 4753 +-------+-----------------------+ 4754 | 2 | Triple DES - RFC 1851 | 4755 +-------+-----------------------+ 4756 | 3 | Twofish | 4757 +-------+-----------------------+ 4758 | 4 | Blowfish | 4759 +-------+-----------------------+ 4760 | 5 | AES - FIPS 187 | 4761 +-------+-----------------------+ 4763 Table 34 4765 9.4.1.44.1.9. ContentEncKeyID Element 4767 name: ContentEncKeyID 4769 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4770 ontentEncryption\ContentEncKeyID" 4772 id: 0x47E2 4774 maxOccurs: 1 4776 type: binary 4778 definition: For public key algorithms this is the ID of the public 4779 key the the data was encrypted with. 4781 9.4.1.44.1.10. ContentEncAESSettings Element 4783 name: ContentEncAESSettings 4785 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4786 ontentEncryption\ContentEncAESSettings" 4788 id: 0x47E7 4790 maxOccurs: 1 4792 type: master 4794 minver: 4 4795 definition: Settings describing the encryption algorithm used. If 4796 "ContentEncAlgo" != 5 this MUST be ignored. 4798 9.4.1.44.1.11. AESSettingsCipherMode Element 4800 name: AESSettingsCipherMode 4802 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4803 ontentEncryption\ContentEncAESSettings\AESSettingsCipherMode" 4805 id: 0x47E8 4807 minOccurs: 1 4809 maxOccurs: 1 4811 type: uinteger 4813 minver: 4 4815 definition: The AES cipher mode used in the encryption. 4817 restrictions: 4819 +=======+==================================================+ 4820 | value | label | 4821 +=======+==================================================+ 4822 | 1 | AES-CTR / Counter, NIST SP 800-38A | 4823 +-------+--------------------------------------------------+ 4824 | 2 | AES-CBC / Cipher Block Chaining, NIST SP 800-38A | 4825 +-------+--------------------------------------------------+ 4827 Table 35 4829 9.4.1.44.1.12. ContentSignature Element 4831 name: ContentSignature 4833 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4834 ontentEncryption\ContentSignature" 4836 id: 0x47E3 4838 maxOccurs: 1 4840 type: binary 4842 definition: A cryptographic signature of the contents. 4844 9.4.1.44.1.13. ContentSigKeyID Element 4846 name: ContentSigKeyID 4848 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4849 ontentEncryption\ContentSigKeyID" 4851 id: 0x47E4 4853 maxOccurs: 1 4855 type: binary 4857 definition: This is the ID of the private key the data was signed 4858 with. 4860 9.4.1.44.1.14. ContentSigAlgo Element 4862 name: ContentSigAlgo 4864 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4865 ontentEncryption\ContentSigAlgo" 4867 id: 0x47E5 4869 maxOccurs: 1 4871 default: 0 4873 type: uinteger 4875 definition: The algorithm used for the signature. 4877 restrictions: 4879 +=======+============+ 4880 | value | label | 4881 +=======+============+ 4882 | 0 | Not signed | 4883 +-------+------------+ 4884 | 1 | RSA | 4885 +-------+------------+ 4887 Table 36 4889 9.4.1.44.1.15. ContentSigHashAlgo Element 4891 name: ContentSigHashAlgo 4893 path: "\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding\C 4894 ontentEncryption\ContentSigHashAlgo" 4896 id: 0x47E6 4898 maxOccurs: 1 4900 default: 0 4902 type: uinteger 4904 definition: The hash algorithm used for the signature. 4906 restrictions: 4908 +=======+============+ 4909 | value | label | 4910 +=======+============+ 4911 | 0 | Not signed | 4912 +-------+------------+ 4913 | 1 | SHA1-160 | 4914 +-------+------------+ 4915 | 2 | MD5 | 4916 +-------+------------+ 4918 Table 37 4920 9.5. Cues Element 4922 name: Cues 4924 path: "\Segment\Cues" 4926 id: 0x1C53BB6B 4928 minOccurs: see implementation notes 4930 maxOccurs: 1 4932 type: master 4934 definition: A Top-Level Element to speed seeking access. All 4935 entries are local to the Segment. 4937 implementation notes: 4939 +===========+====================================================+ 4940 | attribute | note | 4941 +===========+====================================================+ 4942 | minOccurs | This Element SHOULD be set when the Segment is not | 4943 | | transmitted as a live stream (see #livestreaming). | 4944 +-----------+----------------------------------------------------+ 4946 Table 38 4948 9.5.1. CuePoint Element 4950 name: CuePoint 4952 path: "\Segment\Cues\CuePoint" 4954 id: 0xBB 4956 minOccurs: 1 4958 type: master 4960 definition: Contains all information relative to a seek point in the 4961 Segment. 4963 9.5.1.1. CueTime Element 4965 name: CueTime 4967 path: "\Segment\Cues\CuePoint\CueTime" 4969 id: 0xB3 4971 minOccurs: 1 4973 maxOccurs: 1 4975 type: uinteger 4977 definition: Absolute timestamp according to the Segment time base. 4979 9.5.1.2. CueTrackPositions Element 4981 name: CueTrackPositions 4983 path: "\Segment\Cues\CuePoint\CueTrackPositions" 4984 id: 0xB7 4986 minOccurs: 1 4988 type: master 4990 definition: Contain positions for different tracks corresponding to 4991 the timestamp. 4993 9.5.1.2.1. CueTrack Element 4995 name: CueTrack 4997 path: "\Segment\Cues\CuePoint\CueTrackPositions\CueTrack" 4999 id: 0xF7 5001 minOccurs: 1 5003 maxOccurs: 1 5005 range: not 0 5007 type: uinteger 5009 definition: The track for which a position is given. 5011 9.5.1.2.2. CueClusterPosition Element 5013 name: CueClusterPosition 5015 path: "\Segment\Cues\CuePoint\CueTrackPositions\CueClusterPosition" 5017 id: 0xF1 5019 minOccurs: 1 5021 maxOccurs: 1 5023 type: uinteger 5025 definition: The Segment Position of the Cluster containing the 5026 associated Block. 5028 9.5.1.2.3. CueRelativePosition Element 5030 name: CueRelativePosition 5031 path: "\Segment\Cues\CuePoint\CueTrackPositions\CueRelativePosition" 5033 id: 0xF0 5035 maxOccurs: 1 5037 type: uinteger 5039 minver: 4 5041 definition: The relative position inside the Cluster of the 5042 referenced SimpleBlock or BlockGroup with 0 being the first 5043 possible position for an Element inside that Cluster. 5045 9.5.1.2.4. CueDuration Element 5047 name: CueDuration 5049 path: "\Segment\Cues\CuePoint\CueTrackPositions\CueDuration" 5051 id: 0xB2 5053 maxOccurs: 1 5055 type: uinteger 5057 minver: 4 5059 definition: The duration of the block according to the Segment time 5060 base. If missing the track's DefaultDuration does not apply and 5061 no duration information is available in terms of the cues. 5063 9.5.1.2.5. CueBlockNumber Element 5065 name: CueBlockNumber 5067 path: "\Segment\Cues\CuePoint\CueTrackPositions\CueBlockNumber" 5069 id: 0x5378 5071 maxOccurs: 1 5073 range: not 0 5075 default: 1 5077 type: uinteger 5078 definition: Number of the Block in the specified Cluster. 5080 9.5.1.2.6. CueCodecState Element 5082 name: CueCodecState 5084 path: "\Segment\Cues\CuePoint\CueTrackPositions\CueCodecState" 5086 id: 0xEA 5088 maxOccurs: 1 5090 default: 0 5092 type: uinteger 5094 minver: 2 5096 definition: The Segment Position of the Codec State corresponding to 5097 this Cue Element. 0 means that the data is taken from the initial 5098 Track Entry. 5100 9.5.1.2.7. CueReference Element 5102 name: CueReference 5104 path: "\Segment\Cues\CuePoint\CueTrackPositions\CueReference" 5106 id: 0xDB 5108 type: master 5110 minver: 2 5112 definition: The Clusters containing the referenced Blocks. 5114 9.5.1.2.7.1. CueRefTime Element 5116 name: CueRefTime 5118 path: "\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefT 5119 ime" 5121 id: 0x96 5123 minOccurs: 1 5125 maxOccurs: 1 5126 type: uinteger 5128 minver: 2 5130 definition: Timestamp of the referenced Block. 5132 9.5.1.2.7.2. CueRefCluster Element 5134 name: CueRefCluster 5136 path: "\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefC 5137 luster" 5139 id: 0x97 5141 minOccurs: 1 5143 maxOccurs: 1 5145 type: uinteger 5147 minver: 0 5149 maxver: 0 5151 definition: The Segment Position of the Cluster containing the 5152 referenced Block. 5154 9.5.1.2.7.3. CueRefNumber Element 5156 name: CueRefNumber 5158 path: "\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefN 5159 umber" 5161 id: 0x535F 5163 maxOccurs: 1 5165 range: not 0 5167 default: 1 5169 type: uinteger 5171 minver: 0 5173 maxver: 0 5174 definition: Number of the referenced Block of Track X in the 5175 specified Cluster. 5177 9.5.1.2.7.4. CueRefCodecState Element 5179 name: CueRefCodecState 5181 path: "\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueRefC 5182 odecState" 5184 id: 0xEB 5186 maxOccurs: 1 5188 default: 0 5190 type: uinteger 5192 minver: 0 5194 maxver: 0 5196 definition: The Segment Position of the Codec State corresponding to 5197 this referenced Element. 0 means that the data is taken from the 5198 initial Track Entry. 5200 9.6. Attachments Element 5202 name: Attachments 5204 path: "\Segment\Attachments" 5206 id: 0x1941A469 5208 maxOccurs: 1 5210 type: master 5212 definition: Contain attached files. 5214 9.6.1. AttachedFile Element 5216 name: AttachedFile 5218 path: "\Segment\Attachments\AttachedFile" 5220 id: 0x61A7 5221 minOccurs: 1 5223 type: master 5225 definition: An attached file. 5227 9.6.1.1. FileDescription Element 5229 name: FileDescription 5231 path: "\Segment\Attachments\AttachedFile\FileDescription" 5233 id: 0x467E 5235 maxOccurs: 1 5237 type: utf-8 5239 definition: A human-friendly name for the attached file. 5241 9.6.1.2. FileName Element 5243 name: FileName 5245 path: "\Segment\Attachments\AttachedFile\FileName" 5247 id: 0x466E 5249 minOccurs: 1 5251 maxOccurs: 1 5253 type: utf-8 5255 definition: Filename of the attached file. 5257 9.6.1.3. FileMimeType Element 5259 name: FileMimeType 5261 path: "\Segment\Attachments\AttachedFile\FileMimeType" 5263 id: 0x4660 5265 minOccurs: 1 5267 maxOccurs: 1 5268 type: string 5270 definition: MIME type of the file. 5272 9.6.1.4. FileData Element 5274 name: FileData 5276 path: "\Segment\Attachments\AttachedFile\FileData" 5278 id: 0x465C 5280 minOccurs: 1 5282 maxOccurs: 1 5284 type: binary 5286 definition: The data of the file. 5288 9.6.1.5. FileUID Element 5290 name: FileUID 5292 path: "\Segment\Attachments\AttachedFile\FileUID" 5294 id: 0x46AE 5296 minOccurs: 1 5298 maxOccurs: 1 5300 range: not 0 5302 type: uinteger 5304 definition: Unique ID representing the file, as random as possible. 5306 9.6.1.6. FileReferral Element 5308 name: FileReferral 5310 path: "\Segment\Attachments\AttachedFile\FileReferral" 5312 id: 0x4675 5314 maxOccurs: 1 5315 type: binary 5317 minver: 0 5319 maxver: 0 5321 definition: A binary value that a track/codec can refer to when the 5322 attachment is needed. 5324 9.6.1.7. FileUsedStartTime Element 5326 name: FileUsedStartTime 5328 path: "\Segment\Attachments\AttachedFile\FileUsedStartTime" 5330 id: 0x4661 5332 maxOccurs: 1 5334 type: uinteger 5336 minver: 0 5338 maxver: 0 5340 definition: The timecode at which this optimized font attachment 5341 comes into context, based on the Segment TimecodeScale. This 5342 element is reserved for future use and if written must be the 5343 segment start time. See [DivXWorldFonts]. 5345 9.6.1.8. FileUsedEndTime Element 5347 name: FileUsedEndTime 5349 path: "\Segment\Attachments\AttachedFile\FileUsedEndTime" 5351 id: 0x4662 5353 maxOccurs: 1 5355 type: uinteger 5357 minver: 0 5359 maxver: 0 5361 definition: The timecode at which this optimized font attachment 5362 goes out of context, based on the Segment TimecodeScale. This 5363 element is reserved for future use and if written must be the 5364 segment end time. See [DivXWorldFonts]. 5366 9.7. Chapters Element 5368 name: Chapters 5370 path: "\Segment\Chapters" 5372 id: 0x1043A770 5374 maxOccurs: 1 5376 type: master 5378 recurring: 1 5380 definition: A system to define basic menus and partition data. For 5381 more detailed information, look at the Chapters explanation in 5382 Section 11. 5384 9.7.1. EditionEntry Element 5386 name: EditionEntry 5388 path: "\Segment\Chapters\EditionEntry" 5390 id: 0x45B9 5392 minOccurs: 1 5394 type: master 5396 definition: Contains all information about a Segment edition. 5398 9.7.1.1. EditionUID Element 5400 name: EditionUID 5402 path: "\Segment\Chapters\EditionEntry\EditionUID" 5404 id: 0x45BC 5406 maxOccurs: 1 5408 range: not 0 5409 type: uinteger 5411 definition: A unique ID to identify the edition. It's useful for 5412 tagging an edition. 5414 9.7.1.2. EditionFlagDefault Element 5416 name: EditionFlagDefault 5418 path: "\Segment\Chapters\EditionEntry\EditionFlagDefault" 5420 id: 0x45DB 5422 minOccurs: 1 5424 maxOccurs: 1 5426 range: 0-1 5428 default: 0 5430 type: uinteger 5432 definition: Set to 1 if the edition SHOULD be used as the default 5433 one. 5435 9.7.1.3. EditionFlagOrdered Element 5437 name: EditionFlagOrdered 5439 path: "\Segment\Chapters\EditionEntry\EditionFlagOrdered" 5441 id: 0x45DD 5443 maxOccurs: 1 5445 range: 0-1 5447 default: 0 5449 type: uinteger 5451 definition: Specify if the chapters can be defined multiple times 5452 and the order to play them is enforced. 5454 9.7.1.4. ChapterAtom Element 5456 name: ChapterAtom 5458 path: "\Segment\Chapters\EditionEntry\+ChapterAtom" 5460 id: 0xB6 5462 minOccurs: 1 5464 type: master 5466 recursive: 1 5468 definition: Contains the atom information to use as the chapter atom 5469 (apply to all tracks). 5471 9.7.1.4.1. ChapterUID Element 5473 name: ChapterUID 5475 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterUID" 5477 id: 0x73C4 5479 minOccurs: 1 5481 maxOccurs: 1 5483 range: not 0 5485 type: uinteger 5487 definition: A unique ID to identify the Chapter. 5489 9.7.1.4.2. ChapterStringUID Element 5491 name: ChapterStringUID 5493 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterStringUID" 5495 id: 0x5654 5497 maxOccurs: 1 5499 type: utf-8 5501 minver: 3 5502 definition: A unique string ID to identify the Chapter. Use for 5503 WebVTT cue identifier storage [WebVTT]. 5505 9.7.1.4.3. ChapterTimeStart Element 5507 name: ChapterTimeStart 5509 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterTimeStart" 5511 id: 0x91 5513 minOccurs: 1 5515 maxOccurs: 1 5517 type: uinteger 5519 definition: Timestamp of the start of Chapter (not scaled). 5521 9.7.1.4.4. ChapterTimeEnd Element 5523 name: ChapterTimeEnd 5525 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterTimeEnd" 5527 id: 0x92 5529 maxOccurs: 1 5531 type: uinteger 5533 definition: Timestamp of the end of Chapter (timestamp excluded, not 5534 scaled). The value MUST be strictly greater than the 5535 "ChapterTimeStart" of the same "ChapterAtom". 5537 9.7.1.4.5. ChapterFlagHidden Element 5539 name: ChapterFlagHidden 5541 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterFlagHidden 5542 " 5544 id: 0x98 5546 minOccurs: 1 5548 maxOccurs: 1 5549 range: 0-1 5551 default: 0 5553 type: uinteger 5555 definition: Set to 1 if a chapter is hidden. Hidden chapters it 5556 SHOULD NOT be available to the user interface (but still to 5557 Control Tracks; see Section 11.2.3 on Chapter flags). 5559 9.7.1.4.6. ChapterSegmentUID Element 5561 name: ChapterSegmentUID 5563 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterSegmentUID 5564 " 5566 id: 0x6E67 5568 minOccurs: see implementation notes 5570 maxOccurs: 1 5572 range: >0 5574 type: binary 5576 definition: The SegmentUID of another Segment to play during this 5577 chapter. 5579 implementation notes: 5581 +===========+=============================================+ 5582 | attribute | note | 5583 +===========+=============================================+ 5584 | minOccurs | ChapterSegmentUID MUST be set (minOccurs=1) | 5585 | | if ChapterSegmentEditionUID is used. | 5586 +-----------+---------------------------------------------+ 5588 Table 39 5590 9.7.1.4.7. ChapterSegmentEditionUID Element 5592 name: ChapterSegmentEditionUID 5594 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterSegmentEdi 5595 tionUID" 5597 id: 0x6EBC 5599 maxOccurs: 1 5601 range: not 0 5603 type: uinteger 5605 definition: The EditionUID to play from the Segment linked in 5606 ChapterSegmentUID. If ChapterSegmentEditionUID is undeclared, 5607 then no Edition of the linked Segment is used. 5609 9.7.1.4.8. ChapterPhysicalEquiv Element 5611 name: ChapterPhysicalEquiv 5613 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterPhysicalEq 5614 uiv" 5616 id: 0x63C3 5618 maxOccurs: 1 5620 type: uinteger 5622 definition: Specify the physical equivalent of this ChapterAtom like 5623 "DVD" (60) or "SIDE" (50); see Section 6.2.2 for a complete list 5624 of values. 5626 9.7.1.4.9. ChapterDisplay Element 5628 name: ChapterDisplay 5630 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay" 5632 id: 0x80 5634 type: master 5636 definition: Contains all possible strings to use for the chapter 5637 display. 5639 9.7.1.4.9.1. ChapString Element 5641 name: ChapString 5643 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay\Ch 5644 apString" 5646 id: 0x85 5648 minOccurs: 1 5650 maxOccurs: 1 5652 type: utf-8 5654 definition: Contains the string to use as the chapter atom. 5656 9.7.1.4.9.2. ChapLanguage Element 5658 name: ChapLanguage 5660 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay\Ch 5661 apLanguage" 5663 id: 0x437C 5665 minOccurs: 1 5667 default: eng 5669 type: string 5671 definition: The languages corresponding to the string, in the 5672 bibliographic ISO-639-2 form [ISO639-2]. This Element MUST be 5673 ignored if the ChapLanguageIETF Element is used within the same 5674 ChapterDisplay Element. 5676 9.7.1.4.9.3. ChapLanguageIETF Element 5678 name: ChapLanguageIETF 5680 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay\Ch 5681 apLanguageIETF" 5683 id: 0x437D 5685 type: string 5687 minver: 4 5689 definition: Specifies the language used in the ChapString according 5690 to [BCP47] and using the IANA Language Subtag Registry 5691 [IANALangRegistry]. If this Element is used, then any 5692 ChapLanguage Elements used in the same ChapterDisplay MUST be 5693 ignored. 5695 9.7.1.4.9.4. ChapCountry Element 5697 name: ChapCountry 5699 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapterDisplay\Ch 5700 apCountry" 5702 id: 0x437E 5704 type: string 5706 definition: The countries corresponding to the string, same 2 octets 5707 country-codes as in Internet domains [IANADomains] based on 5708 [ISO3166-1] alpha-2 codes. This Element MUST be ignored if the 5709 ChapLanguageIETF Element is used within the same ChapterDisplay 5710 Element. 5712 9.7.1.4.10. ChapProcess Element 5714 name: ChapProcess 5716 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess" 5718 id: 0x6944 5720 type: master 5722 definition: Contains all the commands associated to the Atom. 5724 9.7.1.4.10.1. ChapProcessCodecID Element 5726 name: ChapProcessCodecID 5728 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapP 5729 rocessCodecID" 5731 id: 0x6955 5733 minOccurs: 1 5735 maxOccurs: 1 5737 default: 0 5739 type: uinteger 5741 definition: Contains the type of the codec used for the processing. 5743 A value of 0 means native Matroska processing (to be defined), a 5744 value of 1 means the DVD command set is used; see Section 11.3 on 5745 DVD menus. More codec IDs can be added later. 5747 9.7.1.4.10.2. ChapProcessPrivate Element 5749 name: ChapProcessPrivate 5751 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapP 5752 rocessPrivate" 5754 id: 0x450D 5756 maxOccurs: 1 5758 type: binary 5760 definition: Some optional data attached to the ChapProcessCodecID 5761 information. For ChapProcessCodecID = 1, it is the "DVD level" 5762 equivalent; see Section 11.3 on DVD menus. 5764 9.7.1.4.10.3. ChapProcessCommand Element 5766 name: ChapProcessCommand 5768 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapP 5769 rocessCommand" 5771 id: 0x6911 5773 type: master 5775 definition: Contains all the commands associated to the Atom. 5777 9.7.1.4.10.4. ChapProcessTime Element 5779 name: ChapProcessTime 5781 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapP 5782 rocessCommand\ChapProcessTime" 5784 id: 0x6922 5786 minOccurs: 1 5788 maxOccurs: 1 5790 type: uinteger 5791 definition: Defines when the process command SHOULD be handled 5793 restrictions: 5795 +=======+===============================+ 5796 | value | label | 5797 +=======+===============================+ 5798 | 0 | during the whole chapter | 5799 +-------+-------------------------------+ 5800 | 1 | before starting playback | 5801 +-------+-------------------------------+ 5802 | 2 | after playback of the chapter | 5803 +-------+-------------------------------+ 5805 Table 40 5807 9.7.1.4.10.5. ChapProcessData Element 5809 name: ChapProcessData 5811 path: "\Segment\Chapters\EditionEntry\+ChapterAtom\ChapProcess\ChapP 5812 rocessCommand\ChapProcessData" 5814 id: 0x6933 5816 minOccurs: 1 5818 maxOccurs: 1 5820 type: binary 5822 definition: Contains the command information. The data SHOULD be 5823 interpreted depending on the ChapProcessCodecID value. For 5824 ChapProcessCodecID = 1, the data correspond to the binary DVD cell 5825 pre/post commands; see Section 11.3 on DVD menus. 5827 9.8. Tags Element 5829 name: Tags 5831 path: "\Segment\Tags" 5833 id: 0x1254C367 5835 type: master 5837 definition: Element containing metadata describing Tracks, Editions, 5838 Chapters, Attachments, or the Segment as a whole. A list of valid 5839 tags can be found in [I-D.ietf-cellar-tags]. 5841 9.8.1. Tag Element 5843 name: Tag 5845 path: "\Segment\Tags\Tag" 5847 id: 0x7373 5849 minOccurs: 1 5851 type: master 5853 definition: A single metadata descriptor. 5855 9.8.1.1. Targets Element 5857 name: Targets 5859 path: "\Segment\Tags\Tag\Targets" 5861 id: 0x63C0 5863 minOccurs: 1 5865 maxOccurs: 1 5867 type: master 5869 definition: Specifies which other elements the metadata represented 5870 by the Tag applies to. If empty or not present, then the Tag 5871 describes everything in the Segment. 5873 9.8.1.1.1. TargetTypeValue Element 5875 name: TargetTypeValue 5877 path: "\Segment\Tags\Tag\Targets\TargetTypeValue" 5879 id: 0x68CA 5881 maxOccurs: 1 5883 default: 50 5885 type: uinteger 5886 definition: A number to indicate the logical level of the target. 5888 restrictions: 5890 +=======+==========================+================================+ 5891 | value | label | documentation | 5892 +=======+==========================+================================+ 5893 | 70 | COLLECTION | The highest hierarchical level | 5894 | | | that tags can describe. | 5895 +-------+--------------------------+--------------------------------+ 5896 | 60 | EDITION / ISSUE / | A list of lower levels grouped | 5897 | | VOLUME / OPUS / | together. | 5898 | | SEASON / SEQUEL | | 5899 +-------+--------------------------+--------------------------------+ 5900 | 50 | ALBUM / OPERA / | The most common grouping level | 5901 | | CONCERT / MOVIE / | of music and video (equals to | 5902 | | EPISODE / CONCERT | an episode for TV series). | 5903 +-------+--------------------------+--------------------------------+ 5904 | 40 | PART / SESSION | When an album or episode has | 5905 | | | different logical parts. | 5906 +-------+--------------------------+--------------------------------+ 5907 | 30 | TRACK / SONG / | The common parts of an album | 5908 | | CHAPTER | or movie. | 5909 +-------+--------------------------+--------------------------------+ 5910 | 20 | SUBTRACK / PART / | Corresponds to parts of a | 5911 | | MOVEMENT / SCENE | track for audio (like a | 5912 | | | movement). | 5913 +-------+--------------------------+--------------------------------+ 5914 | 10 | SHOT | The lowest hierarchy found in | 5915 | | | music or movies. | 5916 +-------+--------------------------+--------------------------------+ 5918 Table 41 5920 9.8.1.1.2. TargetType Element 5922 name: TargetType 5924 path: "\Segment\Tags\Tag\Targets\TargetType" 5926 id: 0x63CA 5928 maxOccurs: 1 5930 type: string 5932 definition: An informational string that can be used to display the 5933 logical level of the target like "ALBUM", "TRACK", "MOVIE", 5934 "CHAPTER", etc ; see Section 6.4 of [I-D.ietf-cellar-tags]. 5936 restrictions: 5938 +============+============+ 5939 | value | label | 5940 +============+============+ 5941 | COLLECTION | COLLECTION | 5942 +------------+------------+ 5943 | EDITION | EDITION | 5944 +------------+------------+ 5945 | ISSUE | ISSUE | 5946 +------------+------------+ 5947 | VOLUME | VOLUME | 5948 +------------+------------+ 5949 | OPUS | OPUS | 5950 +------------+------------+ 5951 | SEASON | SEASON | 5952 +------------+------------+ 5953 | SEQUEL | SEQUEL | 5954 +------------+------------+ 5955 | ALBUM | ALBUM | 5956 +------------+------------+ 5957 | OPERA | OPERA | 5958 +------------+------------+ 5959 | CONCERT | CONCERT | 5960 +------------+------------+ 5961 | MOVIE | MOVIE | 5962 +------------+------------+ 5963 | EPISODE | EPISODE | 5964 +------------+------------+ 5965 | PART | PART | 5966 +------------+------------+ 5967 | SESSION | SESSION | 5968 +------------+------------+ 5969 | TRACK | TRACK | 5970 +------------+------------+ 5971 | SONG | SONG | 5972 +------------+------------+ 5973 | CHAPTER | CHAPTER | 5974 +------------+------------+ 5975 | SUBTRACK | SUBTRACK | 5976 +------------+------------+ 5977 | PART | PART | 5978 +------------+------------+ 5979 | MOVEMENT | MOVEMENT | 5980 +------------+------------+ 5981 | SCENE | SCENE | 5982 +------------+------------+ 5983 | SHOT | SHOT | 5984 +------------+------------+ 5986 Table 42 5988 9.8.1.1.3. TagTrackUID Element 5990 name: TagTrackUID 5992 path: "\Segment\Tags\Tag\Targets\TagTrackUID" 5994 id: 0x63C5 5996 default: 0 5998 type: uinteger 6000 definition: A unique ID to identify the Track(s) the tags belong to. 6001 If the value is 0 at this level, the tags apply to all tracks in 6002 the Segment. 6004 9.8.1.1.4. TagEditionUID Element 6006 name: TagEditionUID 6008 path: "\Segment\Tags\Tag\Targets\TagEditionUID" 6010 id: 0x63C9 6012 default: 0 6014 type: uinteger 6016 definition: A unique ID to identify the EditionEntry(s) the tags 6017 belong to. If the value is 0 at this level, the tags apply to all 6018 editions in the Segment. 6020 9.8.1.1.5. TagChapterUID Element 6022 name: TagChapterUID 6024 path: "\Segment\Tags\Tag\Targets\TagChapterUID" 6026 id: 0x63C4 6028 default: 0 6029 type: uinteger 6031 definition: A unique ID to identify the Chapter(s) the tags belong 6032 to. If the value is 0 at this level, the tags apply to all 6033 chapters in the Segment. 6035 9.8.1.1.6. TagAttachmentUID Element 6037 name: TagAttachmentUID 6039 path: "\Segment\Tags\Tag\Targets\TagAttachmentUID" 6041 id: 0x63C6 6043 default: 0 6045 type: uinteger 6047 definition: A unique ID to identify the Attachment(s) the tags 6048 belong to. If the value is 0 at this level, the tags apply to all 6049 the attachments in the Segment. 6051 9.8.1.2. SimpleTag Element 6053 name: SimpleTag 6055 path: "\Segment\Tags\Tag\+SimpleTag" 6057 id: 0x67C8 6059 minOccurs: 1 6061 type: master 6063 recursive: 1 6065 definition: Contains general information about the target. 6067 9.8.1.2.1. TagName Element 6069 name: TagName 6071 path: "\Segment\Tags\Tag\+SimpleTag\TagName" 6073 id: 0x45A3 6075 minOccurs: 1 6076 maxOccurs: 1 6078 type: utf-8 6080 definition: The name of the Tag that is going to be stored. 6082 9.8.1.2.2. TagLanguage Element 6084 name: TagLanguage 6086 path: "\Segment\Tags\Tag\+SimpleTag\TagLanguage" 6088 id: 0x447A 6090 minOccurs: 1 6092 maxOccurs: 1 6094 default: und 6096 type: string 6098 definition: Specifies the language of the tag specified, in the 6099 Matroska languages form; see Section 6.2.1 on language codes. 6100 This Element MUST be ignored if the TagLanguageIETF Element is 6101 used within the same SimpleTag Element. 6103 9.8.1.2.3. TagLanguageIETF Element 6105 name: TagLanguageIETF 6107 path: "\Segment\Tags\Tag\+SimpleTag\TagLanguageIETF" 6109 id: 0x447B 6111 maxOccurs: 1 6113 type: string 6115 minver: 4 6117 definition: Specifies the language used in the TagString according 6118 to [BCP47] and using the IANA Language Subtag Registry 6119 [IANALangRegistry]. If this Element is used, then any TagLanguage 6120 Elements used in the same SimpleTag MUST be ignored. 6122 9.8.1.2.4. TagDefault Element 6124 name: TagDefault 6126 path: "\Segment\Tags\Tag\+SimpleTag\TagDefault" 6128 id: 0x4484 6130 minOccurs: 1 6132 maxOccurs: 1 6134 range: 0-1 6136 default: 1 6138 type: uinteger 6140 definition: A boolean value to indicate if this is the default/ 6141 original language to use for the given tag. 6143 9.8.1.2.5. TagString Element 6145 name: TagString 6147 path: "\Segment\Tags\Tag\+SimpleTag\TagString" 6149 id: 0x4487 6151 maxOccurs: 1 6153 type: utf-8 6155 definition: The value of the Tag. 6157 9.8.1.2.6. TagBinary Element 6159 name: TagBinary 6161 path: "\Segment\Tags\Tag\+SimpleTag\TagBinary" 6163 id: 0x4485 6165 maxOccurs: 1 6167 type: binary 6169 definition: The values of the Tag, if it is binary. Note that this 6170 cannot be used in the same SimpleTag as TagString. 6172 10. Matroska Element Ordering 6174 Except for the "EBML Header" and the "CRC-32 Element", the EBML 6175 specification does not require any particular storage order for 6176 "Elements". The Matroska specification however defines mandates and 6177 recommendations for ordering certain "Elements" in order to 6178 facilitate better playback, seeking, and editing efficiency. This 6179 section describes and offers rationale for ordering requirements and 6180 recommendations for Matroska. 6182 10.1. Top-Level Elements 6184 The "Info Element" is the only REQUIRED "Top-Level Element" in a 6185 Matroska file. To be playable, Matroska MUST also contain at least 6186 one "Tracks Element" and "Cluster Element". The first "Info Element" 6187 and the first "Tracks Element" MUST either be stored before the first 6188 "Cluster Element" or both SHALL be referenced by a "SeekHead Element" 6189 occurring before the first "Cluster Element". 6191 It is possible to edit a Matroska file after it has been created. 6192 For example, chapters, tags, or attachments can be added. When new 6193 "Top-Level Elements" are added to a Matroska file, the "SeekHead" 6194 Element(s) MUST be updated so that the "SeekHead" Element(s) itemize 6195 the identity and position of all "Top-Level Elements". Editing, 6196 removing, or adding "Elements" to a Matroska file often requires that 6197 some existing "Elements" be voided or extended; therefore, it is 6198 RECOMMENDED to use "Void Elements" as padding in between "Top-Level 6199 Elements". 6201 10.2. CRC-32 6203 As noted by the EBML specification, if a "CRC-32 Element" is used, 6204 then the "CRC-32 Element" MUST be the first ordered "Element" within 6205 its "Parent Element". The Matroska specification recommends that 6206 "CRC-32 Elements" SHOULD NOT be used as an immediate "Child Element" 6207 of the "Segment Element"; however all "Top-Level Elements" of an 6208 "EBML Document" SHOULD include a "CRC-32 Element" as a "Child 6209 Element". 6211 10.3. SeekHead 6213 If used, the first "SeekHead Element" SHOULD be the first non-"CRC-32 6214 Child Element" of the "Segment Element". If a second "SeekHead 6215 Element" is used, then the first "SeekHead Element" MUST reference 6216 the identity and position of the second "SeekHead". Additionally, 6217 the second "SeekHead Element" MUST only reference "Cluster" Elements 6218 and not any other "Top-Level Element" already contained within the 6219 first "SeekHead Element". The second "SeekHead Element" MAY be 6220 stored in any order relative to the other "Top-Level Elements". 6221 Whether one or two "SeekHead Element(s)" are used, the "SeekHead 6222 Element(s)" MUST collectively reference the identity and position of 6223 all "Top-Level Elements" except for the first "SeekHead Element". 6225 It is RECOMMENDED that the first "SeekHead Element" be followed by a 6226 "Void Element" to allow for the "SeekHead Element" to be expanded to 6227 cover new "Top-Level Elements" that could be added to the Matroska 6228 file, such as "Tags", "Chapters", and "Attachments" Elements. 6230 10.4. Cues (index) 6232 The "Cues Element" is RECOMMENDED to optimize seeking access in 6233 Matroska. It is programmatically simpler to add the "Cues Element" 6234 after all "Cluster Elements" have been written because this does not 6235 require a prediction of how much space to reserve before writing the 6236 "Cluster Elements". However, storing the "Cues Element" before the 6237 "Cluster Elements" can provide some seeking advantages. If the "Cues 6238 Element" is present, then it SHOULD either be stored before the first 6239 "Cluster Element" or be referenced by a "SeekHead Element". 6241 10.5. Info 6243 The first "Info Element" SHOULD occur before the first "Tracks 6244 Element" and first "Cluster Element" except when referenced by a 6245 "SeekHead Element". 6247 10.6. Chapters Element 6249 The "Chapters Element" SHOULD be placed before the "Cluster 6250 Element(s)". The "Chapters Element" can be used during playback even 6251 if the user does not need to seek. It immediately gives the user 6252 information about what section is being read and what other sections 6253 are available. In the case of Ordered Chapters it is RECOMMENDED to 6254 evaluate the logical linking even before playing. The "Chapters 6255 Element" SHOULD be placed before the first "Tracks Element" and after 6256 the first "Info Element". 6258 10.7. Attachments 6260 The "Attachments Element" is not intended to be used by default when 6261 playing the file, but could contain information relevant to the 6262 content, such as cover art or fonts. Cover art is useful even before 6263 the file is played and fonts could be needed before playback starts 6264 for initialization of subtitles. The "Attachments Element" MAY be 6265 placed before the first "Cluster Element"; however if the 6266 "Attachments Element" is likely to be edited, then it SHOULD be 6267 placed after the last "Cluster Element". 6269 10.8. Tags 6271 The "Tags Element" is most subject to changes after the file was 6272 originally created. For easier editing, the "Tags Element" SHOULD be 6273 placed at the end of the "Segment Element", even after the 6274 "Attachments Element". On the other hand, it is inconvenient to have 6275 to seek in the "Segment" for tags, especially for network streams. 6276 So it's better if the "Tags Element" is found early in the stream. 6277 When editing the "Tags Element", the original "Tags Element" at the 6278 beginning can be overwritten with a "Void Element" and a new "Tags 6279 Element" written at the end of the "Segment Element". The file size 6280 will only marginally change. 6282 10.9. Optimum layout from a muxer 6284 * SeekHead 6286 * Info 6288 * Tracks 6290 * Chapters 6292 * Attachments 6294 * Tags 6296 * Clusters 6298 * Cues 6300 10.10. Optimum layout after editing tags 6302 * SeekHead 6304 * Info 6305 * Tracks 6307 * Chapters 6309 * Attachments 6311 * Void 6313 * Clusters 6315 * Cues 6317 * Tags 6319 10.11. Optimum layout with Cues at the front 6321 * SeekHead 6323 * Info 6325 * Tracks 6327 * Chapters 6329 * Attachments 6331 * Tags 6333 * Cues 6335 * Clusters 6337 10.12. Cluster Timestamp 6339 The "Timestamp Element" MUST occur as in storage order before any 6340 "SimpleBlock", "BlockGroup", or "EncryptedBlock", within the "Cluster 6341 Element". 6343 11. Chapters 6345 The Matroska Chapters system can have multiple "Editions" and each 6346 "Edition" can consist of "Simple Chapters" where a chapter start time 6347 is used as marker in the timeline only. An "Edition" can be more 6348 complex with "Ordered Chapters" where a chapter end time stamp is 6349 additionally used or much more complex with "Linked Chapters". The 6350 Matroska Chapters system can also have a menu structure, borrowed 6351 from the DVD menu system, or have it's own Native Matroska menu 6352 structure. 6354 11.1. EditionEntry 6356 The "EditionEntry" is also called an "Edition". An "Edition" 6357 contains a set of "Edition" flags and MUST contain at least one 6358 "ChapterAtom Element". Chapters are always inside an "Edition" (or a 6359 Chapter itself part of an "Edition"). Multiple Editions are allowed. 6360 Some of these Editions MAY be ordered and others not. 6362 11.1.1. EditionFlagDefault 6364 Only one "Edition" SHOULD have an "EditionFlagDefault" flag set to 6365 "true". 6367 11.1.2. Default Edition 6369 The "Default Edition" is the "Edition" that a "Matroska Player" 6370 SHOULD use for playback by default. 6372 The first "Edition" with the "EditionFlagDefault" flag set to "true" 6373 is the "Default Edition". 6375 When all "EditionFlagDefault" flags are set to "false", then the 6376 first "Edition" is the "Default Edition". 6378 +===========+=============+=================+ 6379 | Edition | FlagDefault | Default Edition | 6380 +===========+=============+=================+ 6381 | Edition 1 | true | X | 6382 +-----------+-------------+-----------------+ 6383 | Edition 2 | true | | 6384 +-----------+-------------+-----------------+ 6385 | Edition 3 | true | | 6386 +-----------+-------------+-----------------+ 6388 Table 43: Default edition, all default 6390 +===========+=============+=================+ 6391 | Edition | FlagDefault | Default Edition | 6392 +===========+=============+=================+ 6393 | Edition 1 | false | X | 6394 +-----------+-------------+-----------------+ 6395 | Edition 2 | false | | 6396 +-----------+-------------+-----------------+ 6397 | Edition 3 | false | | 6398 +-----------+-------------+-----------------+ 6400 Table 44: Default edition, no default 6402 +===========+=============+=================+ 6403 | Edition | FlagDefault | Default Edition | 6404 +===========+=============+=================+ 6405 | Edition 1 | false | | 6406 +-----------+-------------+-----------------+ 6407 | Edition 2 | true | X | 6408 +-----------+-------------+-----------------+ 6409 | Edition 3 | false | | 6410 +-----------+-------------+-----------------+ 6412 Table 45: Default edition, with default 6414 11.1.3. EditionFlagOrdered 6416 The "EditionFlagOrdered Flag" is a significant feature as it enables 6417 an "Edition" of "Ordered Chapters" which defines and arranges a 6418 virtual timeline rather than simply labeling points within the 6419 timeline. For example, with "Editions" of "Ordered Chapters" a 6420 single "Matroska file" can present multiple edits of a film without 6421 duplicating content. Alternatively, if a videotape is digitized in 6422 full, one "Ordered Edition" could present the full content (including 6423 colorbars, countdown, slate, a feature presentation, and black 6424 frames), while another "Edition" of "Ordered Chapters" can use 6425 "Chapters" that only mark the intended presentation with the 6426 colorbars and other ancillary visual information excluded. If an 6427 "Edition" of "Ordered Chapters" is enabled, then the "Matroska 6428 Player" MUST play those Chapters in their stored order from the 6429 timestamp marked in the "ChapterTimeStart Element" to the timestamp 6430 marked in to "ChapterTimeEnd Element". 6432 If the "EditionFlagOrdered Flag" is set to "false", "Simple Chapters" 6433 are used and only the "ChapterTimeStart" of a "Chapter" is used as 6434 chapter mark to jump to the predefined point in the timeline. With 6435 "Simple Chapters", a "Matroska Player" MUST ignore certain "Chapter 6436 Elements". All these elements are now informational only. 6438 The following list shows the different Chapter elements only found in 6439 "Ordered Chapters". 6441 +======================================+ 6442 | Ordered Chapter elements | 6443 +======================================+ 6444 | ChapterAtom/ChapterSegmentUID | 6445 +--------------------------------------+ 6446 | ChapterAtom/ChapterSegmentEditionUID | 6447 +--------------------------------------+ 6448 | ChapterAtom/ChapterTrack | 6449 +--------------------------------------+ 6450 | ChapterAtom/ChapProcess | 6451 +--------------------------------------+ 6452 | Info/SegmentFamily | 6453 +--------------------------------------+ 6454 | Info/ChapterTranslate | 6455 +--------------------------------------+ 6456 | TrackEntry/TrackTranslate | 6457 +--------------------------------------+ 6459 Table 46: elements only found in 6460 ordered chapters 6462 Furthermore there are other EBML "Elements" which could be used if 6463 the "EditionFlagOrdered" flag is set to "true". 6465 11.1.3.1. Ordered-Edition and Matroska Segment-Linking 6467 * Hard Linking: "Ordered-Chapters" supersedes the "Hard Linking". 6469 * Soft Linking: In this complex system "Ordered Chapters" are 6470 REQUIRED and a "Chapter CODEC" MUST interpret the "ChapProcess" of 6471 all chapters. 6473 * Medium Linking: "Ordered Chapters" are used in a normal way and 6474 can be combined with the "ChapterSegmentUID" element which 6475 establishes a link to another Segment. 6477 See Section 23 on the Linked Segments for more information about 6478 "Hard Linking", "Soft Linking", and "Medium Linking". 6480 11.1.4. ChapterSegmentUID 6482 The "ChapterSegmentUID" is a binary value and the base element to set 6483 up a "Linked Chapter" in 2 variations: the Linked-Duration linking 6484 and the Linked-Edition linking. For both variations, the following 3 6485 conditions MUST be met: 6487 1. The "EditionFlagOrdered Flag" MUST be true. 6489 2. The "ChapterSegmentUID" MUST NOT be the "SegmentUID" of its own 6490 "Segment". 6492 3. The linked Segments MUST BE in the same folder. 6494 11.1.4.1. Variation 1: Linked-Duration 6496 Two more conditions MUST be met: 6498 1. "ChapterTimeStart" and "ChapterTimeEnd" timestamps MUST be in the 6499 range of the linked Segment duration. 6501 2. "ChapterSegmentEditionUID" MUST be not set. 6503 A "Matroska Player" MUST play the content of the linked Segment from 6504 the "ChapterTimeStart" until "ChapterTimeEnd" timestamp. 6506 11.1.4.2. Variation 2: Linked-Edition 6508 When the "ChapterSegmentEditionUID" is set to a valid "EditionUID" 6509 from the linked Segment. A "Matroska Player" MUST play these linked 6510 "Edition". 6512 11.2. ChapterAtom 6514 The "ChapterAtom" is also called a "Chapter". A "Chapter" element 6515 can be used recursively. Such a child "Chapter" is called "Nested 6516 Chapter". 6518 11.2.1. ChapterTimeStart 6520 A not scaled timestamp of the start of "Chapter" with nanosecond 6521 accuracy. For "Simple Chapters" this is the position of the chapter 6522 markers in the timeline. 6524 11.2.2. ChapterTimeEnd 6526 A not scaled timestamp of the end of "Chapter" with nanosecond 6527 accuracy. The end timestamp is used when the "EditionFlagOrdered" 6528 flag of the "Edition" is set to "true". The timestamp defined by the 6529 "ChapterTimeEnd" is not part of the "Chapter". A "Matroska Player" 6530 calculates the duration of this "Chapter" using the difference 6531 between the "ChapterTimeEnd" and "ChapterTimeStart". The end 6532 timestamp MUST be greater than the start timestamp otherwise the 6533 duration would be negative which is illegal. If the duration of a 6534 "Chapter" is 0, this "Chapter" MUST be ignored. 6536 +===========+=================+===============+=============+ 6537 | Chapter | Start timestamp | End timestamp | Duration | 6538 +===========+=================+===============+=============+ 6539 | Chapter 1 | 0 | 1000000000 | 1000000000 | 6540 +-----------+-----------------+---------------+-------------+ 6541 | Chapter 2 | 1000000000 | 5000000000 | 4000000000 | 6542 +-----------+-----------------+---------------+-------------+ 6543 | Chapter 3 | 6000000000 | 6000000000 | 0 (chapter | 6544 | | | | not used) | 6545 +-----------+-----------------+---------------+-------------+ 6546 | Chapter 4 | 9000000000 | 8000000000 | -1000000000 | 6547 | | | | (illegal) | 6548 +-----------+-----------------+---------------+-------------+ 6550 Table 47 6552 11.2.3. ChapterFlagHidden 6554 Each Chapter "ChapterFlagHidden" flag works independently from parent 6555 chapters. A "Nested Chapter" with "ChapterFlagHidden" flag set to 6556 "false" remains visible even if the "Parent Chapter" 6557 "ChapterFlagHidden" flag is set to "true". 6559 +==========================+===================+=========+ 6560 | Chapter + Nested Chapter | ChapterFlagHidden | visible | 6561 +==========================+===================+=========+ 6562 | Chapter 1 | false | yes | 6563 +--------------------------+-------------------+---------+ 6564 | Nested Chapter 1.1 | false | yes | 6565 +--------------------------+-------------------+---------+ 6566 | Nested Chapter 1.2 | true | no | 6567 +--------------------------+-------------------+---------+ 6568 | Chapter 2 | true | no | 6569 +--------------------------+-------------------+---------+ 6570 | Nested Chapter 2.1 | false | yes | 6571 +--------------------------+-------------------+---------+ 6572 | Nested Chapter 2.2 | true | no | 6573 +--------------------------+-------------------+---------+ 6575 Table 48 6577 11.3. Menu features 6579 The menu features are handled like a "chapter codec". That means 6580 each codec has a type, some private data and some data in the 6581 chapters. 6583 The type of the menu system is defined by the "ChapProcessCodecID" 6584 parameter. For now, only 2 values are supported : 0 matroska script, 6585 1 menu borrowed from the DVD. The private data depend on the type of 6586 menu system (stored in "ChapProcessPrivate"), idem for the data in 6587 the chapters (stored in "ChapProcessData"). 6589 The menu system, as well a Chapter Codecs in general, can do actions 6590 on the "Matroska Player" like jumping to another Chapter or Edition, 6591 selecting different tracks and possibly more. The scope of all the 6592 possibilities of Chapter Codecs is not covered in this document as it 6593 depends on the Chapter Codec features and its integration in a 6594 "Matroska Player". 6596 11.4. Chapter Examples 6598 11.4.1. Example 1 : basic chaptering 6600 In this example a movie is split in different chapters. It could 6601 also just be an audio file (album) on which each track corresponds to 6602 a chapter. 6604 * 00000ms - 05000ms : Intro 6606 * 05000ms - 25000ms : Before the crime 6608 * 25000ms - 27500ms : The crime 6610 * 27500ms - 38000ms : The killer arrested 6612 * 38000ms - 43000ms : Credits 6614 This would translate in the following matroska form : 6616 6617 6618 16603393396715046047 6619 6620 1193046 6621 0 6622 5000000000 6623 6624 Intro 6625 eng 6626 6627 0 6628 6629 6630 2311527 6631 5000000000 6632 25000000000 6633 6634 Before the crime 6635 eng 6636 6637 6638 Avant le crime 6639 fra 6640 6641 0 6642 6643 6644 3430008 6645 25000000000 6646 27500000000 6647 6648 The crime 6649 eng 6650 6651 6652 Le crime 6653 fra 6654 6655 0 6656 6657 6658 4548489 6659 27500000000 6660 38000000000 6661 6662 After the crime 6663 eng 6664 6665 6666 Après le crime 6667 fra 6668 6669 0 6670 6671 6672 5666960 6673 38000000000 6674 43000000000 6675 6676 Credits 6677 eng 6678 6679 6680 Générique 6681 fra 6682 6683 0 6684 6685 0 6686 6687 6689 11.4.2. Example 2 : nested chapters 6691 In this example an (existing) album is split into different chapters, 6692 and one of them contain another splitting. 6694 11.4.2.1. The Micronauts "Bleep To Bleep" 6696 * 00:00 - 12:28 : Baby Wants To Bleep/Rock 6698 - 00:00 - 04:38 : Baby wants to bleep (pt.1) 6700 - 04:38 - 07:12 : Baby wants to rock 6702 - 07:12 - 10:33 : Baby wants to bleep (pt.2) 6704 - 10:33 - 12:28 : Baby wants to bleep (pt.3) 6706 * 12:30 - 19:38 : Bleeper_O+2 6708 * 19:40 - 22:20 : Baby wants to bleep (pt.4) 6710 * 22:22 - 25:18 : Bleep to bleep 6712 * 25:20 - 33:35 : Baby wants to bleep (k) 6714 * 33:37 - 44:28 : Bleeper 6716 6717 6718 1281690858003401414 6719 6720 1 6721 0 6722 748000000 6723 6724 Baby wants to Bleep/Rock 6725 eng 6726 6727 6728 2 6729 0 6730 278000000 6731 6732 Baby wants to bleep (pt.1) 6733 eng 6734 6735 0 6736 6737 6738 3 6739 278000000 6740 432000000 6741 6742 Baby wants to rock 6743 eng 6744 6745 0 6746 6747 6748 4 6749 432000000 6750 633000000 6751 6752 Baby wants to bleep (pt.2) 6753 eng 6754 6755 0 6756 6757 6758 5 6759 633000000 6760 748000000 6761 6762 Baby wants to bleep (pt.3) 6763 eng 6764 6765 0 6766 6767 0 6768 6769 6770 6 6771 750000000 6772 1178500000 6773 6774 Bleeper_O+2 6775 eng 6776 6777 0 6778 6779 6780 7 6781 1180500000 6782 1340000000 6783 6784 Baby wants to bleep (pt.4) 6785 eng 6786 6787 0 6788 6789 6790 8 6791 1342000000 6792 1518000000 6793 6794 Bleep to bleep 6795 eng 6796 6797 0 6798 6799 6800 9 6801 1520000000 6802 2015000000 6803 6804 Baby wants to bleep (k) 6805 eng 6806 6807 0 6808 6809 6810 10 6811 2017000000 6812 2668000000 6813 6814 Bleeper 6815 eng 6816 6817 0 6818 6819 0 6820 6821 6823 12. Attachments 6825 Matroska supports storage of related files and data in the 6826 "Attachments Element" (a "Top-Level Element"). "Attachment Elements" 6827 can be used to store related cover art, font files, transcripts, 6828 reports, error recovery files, picture, or text-based annotations, 6829 copies of specifications, or other ancillary files related to the 6830 "Segment". 6832 "Matroska Readers" MUST NOT execute files stored as "Attachment 6833 Elements". 6835 12.1. Cover Art 6837 This section defines a set of guidelines for the storage of cover art 6838 in Matroska files. A "Matroska Reader" MAY use embedded cover art to 6839 display a representational still-image depiction of the multimedia 6840 contents of the Matroska file. 6842 Only JPEG and PNG image formats SHOULD be used for cover art 6843 pictures. 6845 There can be two different covers for a movie/album: a portrait style 6846 (e.g., a DVD case) and a landscape style (e.g., a wide banner ad). 6848 There can be two versions of the same cover, the "normal cover" and 6849 the "small cover". The dimension of the "normal cover" SHOULD be 600 6850 pixels on the smallest side -- for example, 960x600 for landscape, 6851 600x800 for portrait, or 600x600 for square. The dimension of the 6852 "small cover" SHOULD be 120 pixels on the smallest side -- for 6853 example, 192x120 or 120x160. 6855 Versions of cover art can be differentiated by the filename, which is 6856 stored in the "FileName Element". The default filename of the 6857 "normal cover" in square or portrait mode is "cover.(jpg|png)". When 6858 stored, the "normal cover" SHOULD be the first Attachment in storage 6859 order. The "small cover" SHOULD be prefixed with "small_", such as 6860 "small_cover.(jpg|png)". The landscape variant SHOULD be suffixed 6861 with "_land", such as "cover_land.(jpg|png)". The filenames are case 6862 sensitive. 6864 The following table provides examples of file names for cover art in 6865 Attachments. 6867 +======================+===================+=================+ 6868 | FileName | Image Orientation | Pixel Length of | 6869 | | | Smallest Side | 6870 +======================+===================+=================+ 6871 | cover.jpg | Portrait or | 600 | 6872 | | square | | 6873 +----------------------+-------------------+-----------------+ 6874 | small_cover.png | Portrait or | 120 | 6875 | | square | | 6876 +----------------------+-------------------+-----------------+ 6877 | cover_land.png | Landscape | 600 | 6878 +----------------------+-------------------+-----------------+ 6879 | small_cover_land.jpg | Landscape | 120 | 6880 +----------------------+-------------------+-----------------+ 6882 Table 49 6884 13. Cues 6886 The "Cues Element" provides an index of certain "Cluster Elements" to 6887 allow for optimized seeking to absolute timestamps within the 6888 "Segment". The "Cues Element" contains one or many "CuePoint 6889 Elements" which each MUST reference an absolute timestamp (via the 6890 "CueTime Element"), a "Track" (via the "CueTrack Element"), and a 6891 "Segment Position" (via the "CueClusterPosition Element"). 6892 Additional non-mandated Elements are part of the "CuePoint Element" 6893 such as "CueDuration", "CueRelativePosition", "CueCodecState" and 6894 others which provide any "Matroska Reader" with additional 6895 information to use in the optimization of seeking performance. 6897 13.1. Recommendations 6899 The following recommendations are provided to optimize Matroska 6900 performance. 6902 * Unless Matroska is used as a live stream, it SHOULD contain a 6903 "Cues Element". 6905 * For each video track, each keyframe SHOULD be referenced by a 6906 "CuePoint Element". 6908 * It is RECOMMENDED to not reference non-keyframes of video tracks 6909 in "Cues" unless it references a "Cluster Element" which contains 6910 a "CodecState Element" but no keyframes. 6912 * For each subtitle track present, each subtitle frame SHOULD be 6913 referenced by a "CuePoint Element" with a "CueDuration Element". 6915 * References to audio tracks MAY be skipped in "CuePoint Elements" 6916 if a video track is present. When included the "CuePoint 6917 Elements" SHOULD reference audio keyframes at most once every 500 6918 milliseconds. 6920 * If the referenced frame is not stored within the first 6921 "SimpleBlock", or first "BlockGroup" within its "Cluster Element", 6922 then the "CueRelativePosition Element" SHOULD be written to 6923 reference where in the "Cluster" the reference frame is stored. 6925 * If a "CuePoint Element" references "Cluster Element" that includes 6926 a "CodecState Element", then that "CuePoint Element" MUST use a 6927 "CueCodecState Element". 6929 * "CuePoint Elements" SHOULD be numerically sorted in storage order 6930 by the value of the "CueTime Element". 6932 14. Matroska Streaming 6934 In Matroska, there are two kinds of streaming: file access and 6935 livestreaming. 6937 14.1. File Access 6939 File access can simply be reading a file located on your computer, 6940 but also includes accessing a file from an HTTP (web) server or CIFS 6941 (Windows share) server. These protocols are usually safe from 6942 reading errors and seeking in the stream is possible. However, when 6943 a file is stored far away or on a slow server, seeking can be an 6944 expensive operation and SHOULD be avoided. The following guidelines, 6945 when followed, help reduce the number of seeking operations for 6946 regular playback and also have the playback start quickly without a 6947 lot of data needed to read first (like a "Cues Element", "Attachment 6948 Element" or "SeekHead Element"). 6950 Matroska, having a small overhead, is well suited for storing music/ 6951 videos on file servers without a big impact on the bandwidth used. 6952 Matroska does not require the index to be loaded before playing, 6953 which allows playback to start very quickly. The index can be loaded 6954 only when seeking is requested the first time. 6956 14.2. Livestreaming 6958 Livestreaming is the equivalent of television broadcasting on the 6959 internet. There are 2 families of servers for livestreaming: RTP/ 6960 RTSP and HTTP. Matroska is not meant to be used over RTP. RTP 6961 already has timing and channel mechanisms that would be wasted if 6962 doubled in Matroska. Additionally, having the same information at 6963 the RTP and Matroska level would be a source of confusion if they do 6964 not match. Livestreaming of Matroska over HTTP (or any other plain 6965 protocol based on TCP) is possible. 6967 A live Matroska stream is different from a file because it usually 6968 has no known end (only ending when the client disconnects). For 6969 this, all bits of the "size" portion of the "Segment Element" MUST be 6970 set to 1. Another option is to concatenate "Segment Elements" with 6971 known sizes, one after the other. This solution allows a change of 6972 codec/resolution between each segment. For example, this allows for 6973 a switch between 4:3 and 16:9 in a television program. 6975 When "Segment Elements" are continuous, certain "Elements", like 6976 "MetaSeek", "Cues", "Chapters", and "Attachments", MUST NOT be used. 6978 It is possible for a "Matroska Player" to detect that a stream is not 6979 seekable. If the stream has neither a "MetaSeek" list or a "Cues" 6980 list at the beginning of the stream, it SHOULD be considered non- 6981 seekable. Even though it is possible to seek blindly forward in the 6982 stream, it is NOT RECOMMENDED. 6984 In the context of live radio or web TV, it is possible to "tag" the 6985 content while it is playing. The "Tags Element" can be placed 6986 between "Clusters" each time it is necessary. In that case, the new 6987 "Tags Element" MUST reset the previously encountered "Tags Elements" 6988 and use the new values instead. 6990 15. Unknown elements 6992 Matroska is based upon the principle that a reading application does 6993 not have to support 100% of the specifications in order to be able to 6994 play the file. A Matroska file therefore contains version indicators 6995 that tell a reading application what to expect. 6997 It is possible and valid to have the version fields indicate that the 6998 file contains Matroska "Elements" from a higher specification version 6999 number while signaling that a reading application MUST only support a 7000 lower version number properly in order to play it back (possibly with 7001 a reduced feature set). For example, a reading application 7002 supporting at least Matroska version "V" reading a file whose 7003 "DocTypeReadVersion" field is equal to or lower than "V" MUST skip 7004 Matroska/EBML "Elements" it encounters but does not know about if 7005 that unknown element fits into the size constraints set by the 7006 current "Parent Element". 7008 16. Default Values 7010 The default value of an "Element" is assumed when not present in the 7011 data stream. It is assumed only in the scope of its "Parent 7012 Element". For example, the "Language Element" is in the scope of the 7013 "Track Element". If the "Parent Element" is not present or assumed, 7014 then the "Child Element" cannot be assumed. 7016 17. DefaultDecodedFieldDuration 7018 The "DefaultDecodedFieldDuration Element" can signal to the 7019 displaying application how often fields of a video sequence will be 7020 available for displaying. It can be used for both interlaced and 7021 progressive content. If the video sequence is signaled as 7022 interlaced, then the period between two successive fields at the 7023 output of the decoding process equals "DefaultDecodedFieldDuration". 7025 For video sequences signaled as progressive, it is twice the value of 7026 "DefaultDecodedFieldDuration". 7028 These values are valid at the end of the decoding process before 7029 post-processing (such as deinterlacing or inverse telecine) is 7030 applied. 7032 Examples: 7034 * Blu-ray movie: 1000000000ns/(48/1.001) = 20854167ns 7036 * PAL broadcast/DVD: 1000000000ns/(50/1.000) = 20000000ns 7038 * N/ATSC broadcast: 1000000000ns/(60/1.001) = 16683333ns 7040 * hard-telecined DVD: 1000000000ns/(60/1.001) = 16683333ns (60 7041 encoded interlaced fields per second) 7043 * soft-telecined DVD: 1000000000ns/(60/1.001) = 16683333ns (48 7044 encoded interlaced fields per second, with "repeat_first_field = 7045 1") 7047 18. Encryption 7049 Encryption in Matroska is designed in a very generic style to allow 7050 people to implement whatever form of encryption is best for them. It 7051 is possible to use the encryption framework in Matroska as a type of 7052 DRM (Digital Rights Management). 7054 Because encryption occurs within the "Block Element", it is possible 7055 to manipulate encrypted streams without decrypting them. The streams 7056 could potentially be copied, deleted, cut, appended, or any number of 7057 other possible editing techniques without decryption. The data can 7058 be used without having to expose it or go through the decrypting 7059 process. 7061 Encryption can also be layered within Matroska. This means that two 7062 completely different types of encryption can be used, requiring two 7063 separate keys to be able to decrypt a stream. 7065 Encryption information is stored in the "ContentEncodings Element" 7066 under the "ContentEncryption Element". 7068 19. Image Presentation 7070 19.1. Cropping 7072 The "PixelCrop Elements" ("PixelCropTop", "PixelCropBottom", 7073 "PixelCropRight", and "PixelCropLeft") indicate when, and by how 7074 much, encoded videos frames SHOULD be cropped for display. These 7075 Elements allow edges of the frame that are not intended for display, 7076 such as the sprockets of a full-frame film scan or the VANC area of a 7077 digitized analog videotape, to be stored but hidden. "PixelCropTop" 7078 and "PixelCropBottom" store an integer of how many rows of pixels 7079 SHOULD be cropped from the top and bottom of the image 7080 (respectively). "PixelCropLeft" and "PixelCropRight" store an 7081 integer of how many columns of pixels SHOULD be cropped from the left 7082 and right of the image (respectively). For example, a pillar-boxed 7083 video that stores a 1440x1080 visual image within the center of a 7084 padded 1920x1080 encoded image MAY set both "PixelCropLeft" and 7085 "PixelCropRight" to "240", so that a "Matroska Player" SHOULD crop 7086 off 240 columns of pixels from the left and right of the encoded 7087 image to present the image with the pillar-boxes hidden. 7089 19.2. Rotation 7091 The ProjectionPoseRoll Element (see Section 9.4.1.36.20.5) can be 7092 used to indicate that the image from the associated video track 7093 SHOULD be rotated for presentation. For instance, the following 7094 representation of the Projection Element Section 9.4.1.36.20) and the 7095 ProjectionPoseRoll Element represents a video track where the image 7096 SHOULD be presentation with a 90 degree counter-clockwise rotation. 7098 7099 90 7100 7102 20. Matroska versioning 7104 The "EBML Header" of each Matroska document informs the reading 7105 application on what version of Matroska to expect. The "Elements" 7106 within "EBML Header" with jurisdiction over this information are 7107 "DocTypeVersion" and "DocTypeReadVersion". 7109 "DocTypeVersion" MUST be equal to or greater than the highest 7110 Matroska version number of any "Element" present in the Matroska 7111 file. For example, a file using the "SimpleBlock Element" MUST have 7112 a "DocTypeVersion" equal to or greater than 2. A file containing 7113 "CueRelativePosition" Elements MUST have a "DocTypeVersion" equal to 7114 or greater than 4. 7116 The "DocTypeReadVersion" MUST contain the minimum version number that 7117 a reading application can minimally support in order to play the file 7118 back -- optionally with a reduced feature set. For example, if a 7119 file contains only "Elements" of version 2 or lower except for 7120 "CueRelativePosition" (which is a version 4 Matroska "Element"), then 7121 "DocTypeReadVersion" SHOULD still be set to 2 and not 4 because 7122 evaluating "CueRelativePosition" is not necessary for standard 7123 playback -- it makes seeking more precise if used. 7125 "DocTypeVersion" MUST always be equal to or greater than 7126 "DocTypeReadVersion". 7128 A reading application supporting Matroska version "V" MUST NOT refuse 7129 to read an application with "DocReadTypeVersion" equal to or lower 7130 than "V" even if "DocTypeVersion" is greater than "V". See also the 7131 note about Unknown Elements in Section 15. 7133 21. MIME Types 7135 There is no IETF endorsed MIME type for Matroska files. These 7136 definitions can be used: 7138 * .mka : Matroska audio "audio/x-matroska" 7140 * .mkv : Matroska video "video/x-matroska" 7142 * .mk3d : Matroska 3D video "video/x-matroska-3d" 7144 22. Segment Position 7146 The "Segment Position" of an "Element" refers to the position of the 7147 first octet of the "Element ID" of that "Element", measured in 7148 octets, from the beginning of the "Element Data" section of the 7149 containing "Segment Element". In other words, the "Segment Position" 7150 of an "Element" is the distance in octets from the beginning of its 7151 containing "Segment Element" minus the size of the "Element ID" and 7152 "Element Data Size" of that "Segment Element". The "Segment 7153 Position" of the first "Child Element" of the "Segment Element" is 0. 7154 An "Element" which is not stored within a "Segment Element", such as 7155 the "Elements" of the "EBML Header", do not have a "Segment 7156 Position". 7158 22.1. Segment Position Exception 7160 "Elements" that are defined to store a "Segment Position" MAY define 7161 reserved values to indicate a special meaning. 7163 22.2. Example of Segment Position 7165 This table presents an example of "Segment Position" by showing a 7166 hexadecimal representation of a very small Matroska file with labels 7167 to show the offsets in octets. The file contains a "Segment Element" 7168 with an "Element ID" of "0x18538067" and a "MuxingApp Element" with 7169 an "Element ID" of "0x4D80". 7171 0 1 2 7172 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 7173 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 7174 0 |1A|45|DF|A3|8B|42|82|88|6D|61|74|72|6F|73|6B|61|18|53|80|67| 7175 20 |93|15|49|A9|66|8E|4D|80|84|69|65|74|66|57|41|84|69|65|74|66| 7177 In the above example, the "Element ID" of the "Segment Element" is 7178 stored at offset 16, the "Element Data Size" of the "Segment Element" 7179 is stored at offset 20, and the "Element Data" of the "Segment 7180 Element" is stored at offset 21. 7182 The "MuxingApp Element" is stored at offset 26. Since the "Segment 7183 Position" of an "Element" is calculated by subtracting the position 7184 of the "Element Data" of the containing "Segment Element" from the 7185 position of that "Element", the "Segment Position" of "MuxingApp 7186 Element" in the above example is '26 - 21' or '5'. 7188 23. Linked Segments 7190 Matroska provides several methods to link two or many "Segment 7191 Elements" together to create a "Linked Segment". A "Linked Segment" 7192 is a set of multiple "Segments" related together into a single 7193 presentation by using Hard Linking, Medium Linking, or Soft Linking. 7194 All "Segments" within a "Linked Segment" MUST utilize the same track 7195 numbers and timescale. All "Segments" within a "Linked Segment" MUST 7196 be stored within the same directory. All "Segments" within a "Linked 7197 Segment" MUST store a "SegmentUID". 7199 23.1. Hard Linking 7201 Hard Linking (also called splitting) is the process of creating a 7202 "Linked Segment" by relating multiple "Segment Elements" using the 7203 "NextUID" and "PrevUID" Elements. Within a "Linked Segment", the 7204 timestamps of each "Segment" MUST follow consecutively in linking 7205 order. With Hard Linking, the chapters of any "Segment" within the 7206 "Linked Segment" MUST only reference the current "Segment". With 7207 Hard Linking, the "NextUID" and "PrevUID" MUST reference the 7208 respective "SegmentUID" values of the next and previous "Segments". 7209 The first "Segment" of a "Linked Segment" SHOULD have a "NextUID 7210 Element" and MUST NOT have a "PrevUID Element". The last "Segment" 7211 of a "Linked Segment" SHOULD have a "PrevUID Element" and MUST NOT 7212 have a "NextUID Element". The middle "Segments" of a "Linked 7213 Segment" SHOULD have both a "NextUID Element" and a "PrevUID 7214 Element". 7216 In a chain of "Linked Segments" the "NextUID" always takes precedence 7217 over the "PrevUID". So if SegmentA has a NextUID to SegmentB and 7218 SegmentB has a PrevUID to SegmentC, the link to use is SegmentA to 7219 SegmentB. If SegmentB has a PrevUID to SegmentA but SegmentA has no 7220 NextUID, then the Matroska Player MAY consider these two Segments 7221 linked as SegmentA followed by SegmentB. 7223 As an example, three "Segments" can be Hard Linked as a "Linked 7224 Segment" through cross-referencing each other with "SegmentUID", 7225 "PrevUID", and "NextUID", as in this table. 7227 +==========+==================+==================+==================+ 7228 |file name | SegmentUID | PrevUID | NextUID | 7229 +==========+==================+==================+==================+ 7230 |start.mkv | 71000c23cd310998 | n/a | a77b3598941cb803 | 7231 | | 53fbc94dd984a5dd | | eac0fcdafe44fac9 | 7232 +----------+------------------+------------------+------------------+ 7233 |middle.mkv| a77b3598941cb803 | 71000c23cd310998 | 6c92285fa6d3e827 | 7234 | | eac0fcdafe44fac9 | 53fbc94dd984a5dd | b198d120ea3ac674 | 7235 +----------+------------------+------------------+------------------+ 7236 |end.mkv | 6c92285fa6d3e827 | a77b3598941cb803 | n/a | 7237 | | b198d120ea3ac674 | eac0fcdafe44fac9 | | 7238 +----------+------------------+------------------+------------------+ 7240 Table 50 7242 An other example where only the "NextUID" Element is used. 7244 +============+==================+=========+==================+ 7245 | file name | SegmentUID | PrevUID | NextUID | 7246 +============+==================+=========+==================+ 7247 | start.mkv | 71000c23cd310998 | n/a | a77b3598941cb803 | 7248 | | 53fbc94dd984a5dd | | eac0fcdafe44fac9 | 7249 +------------+------------------+---------+------------------+ 7250 | middle.mkv | a77b3598941cb803 | n/a | 6c92285fa6d3e827 | 7251 | | eac0fcdafe44fac9 | | b198d120ea3ac674 | 7252 +------------+------------------+---------+------------------+ 7253 | end.mkv | 6c92285fa6d3e827 | n/a | n/a | 7254 | | b198d120ea3ac674 | | | 7255 +------------+------------------+---------+------------------+ 7257 Table 51 7259 A next example where only the "PrevUID" Element is used. 7261 +============+==================+==================+=========+ 7262 | file name | SegmentUID | PrevUID | NextUID | 7263 +============+==================+==================+=========+ 7264 | start.mkv | 71000c23cd310998 | n/a | n/a | 7265 | | 53fbc94dd984a5dd | | | 7266 +------------+------------------+------------------+---------+ 7267 | middle.mkv | a77b3598941cb803 | 71000c23cd310998 | n/a | 7268 | | eac0fcdafe44fac9 | 53fbc94dd984a5dd | | 7269 +------------+------------------+------------------+---------+ 7270 | end.mkv | 6c92285fa6d3e827 | a77b3598941cb803 | n/a | 7271 | | b198d120ea3ac674 | eac0fcdafe44fac9 | | 7272 +------------+------------------+------------------+---------+ 7274 Table 52 7276 In this example only the "middle.mkv" is using the "PrevUID" and 7277 "NextUID" Elements. 7279 +==========+==================+==================+==================+ 7280 |file name | SegmentUID | PrevUID | NextUID | 7281 +==========+==================+==================+==================+ 7282 |start.mkv | 71000c23cd310998 | n/a | n/a | 7283 | | 53fbc94dd984a5dd | | | 7284 +----------+------------------+------------------+------------------+ 7285 |middle.mkv| a77b3598941cb803 | 71000c23cd310998 | 6c92285fa6d3e827 | 7286 | | eac0fcdafe44fac9 | 53fbc94dd984a5dd | b198d120ea3ac674 | 7287 +----------+------------------+------------------+------------------+ 7288 |end.mkv | 6c92285fa6d3e827 | n/a | n/a | 7289 | | b198d120ea3ac674 | | | 7290 +----------+------------------+------------------+------------------+ 7292 Table 53 7294 23.2. Medium Linking 7296 Medium Linking creates relationships between "Segments" using Ordered 7297 Chapters and the "ChapterSegmentUID Element". A "Segment Edition" 7298 with Ordered Chapters MAY contain Chapter elements that reference 7299 timestamp ranges from other "Segments". The "Segment" referenced by 7300 the Ordered Chapter via the "ChapterSegmentUID Element" SHOULD be 7301 played as part of a Linked Segment. The timestamps of Segment 7302 content referenced by Ordered Chapters MUST be adjusted according to 7303 the cumulative duration of the the previous Ordered Chapters. 7305 As an example a file named "intro.mkv" could have a "SegmentUID" of 7306 "0xb16a58609fc7e60653a60c984fc11ead". Another file called 7307 "program.mkv" could use a Chapter Edition that contains two Ordered 7308 Chapters. The first chapter references the "Segment" of "intro.mkv" 7309 with the use of a "ChapterSegmentUID", "ChapterSegmentEditionUID", 7310 "ChapterTimeStart", and optionally a "ChapterTimeEnd" element. The 7311 second chapter references content within the "Segment" of 7312 "program.mkv". A "Matroska Player" SHOULD recognize the "Linked 7313 Segment" created by the use of "ChapterSegmentUID" in an enabled 7314 "Edition" and present the reference content of the two "Segments" 7315 together. 7317 23.3. Soft Linking 7319 Soft Linking is used by codec chapters. They can reference another 7320 "Segment" and jump to that "Segment". The way the "Segments" are 7321 described are internal to the chapter codec and unknown to the 7322 Matroska level. But there are "Elements" within the "Info Element" 7323 (such as "ChapterTranslate") that can translate a value representing 7324 a "Segment" in the chapter codec and to the current "SegmentUID". 7325 All "Segments" that could be used in a "Linked Segment" in this way 7326 SHOULD be marked as members of the same family via the "SegmentFamily 7327 Element", so that the "Matroska Player" can quickly switch from one 7328 to the other. 7330 24. Track Flags 7332 24.1. Default flag 7334 The "default track" flag is a hint for a "Matroska Player" indicating 7335 that a given track SHOULD be eligible to be automatically selected as 7336 the default track for a given language. If no tracks in a given 7337 language have the default track flag set, then all tracks in that 7338 language are eligible for automatic selection. This can be used to 7339 indicate that a track provides "regular service" suitable for users 7340 with default settings, as opposed to specialized services, such as 7341 commentary, hearing-impaired captions, or descriptive audio. 7343 The "Matroska Player" MAY override the "default track" flag for any 7344 reason, including user preferences to prefer tracks providing 7345 accessibility services. 7347 24.2. Forced flag 7349 The "forced" flag tells the "Matroska Player" that it SHOULD display 7350 this subtitle track, even if user preferences usually would not call 7351 for any subtitles to be displayed alongside the current selected 7352 audio track. This can be used to indicate that a track contains 7353 translations of onscreen text, or of dialogue spoken in a different 7354 language than the track's primary one. 7356 24.3. Hearing-impaired flag 7358 The "hearing impaired" flag tells the "Matroska Player" that it 7359 SHOULD prefer this track when selecting a default track for a 7360 hearing-impaired user, and that it MAY prefer to select a different 7361 track when selecting a default track for a non-hearing-impaired user. 7363 24.4. Visual-impaired flag 7365 The "visual impaired" flag tells the "Matroska Player" that it SHOULD 7366 prefer this track when selecting a default track for a visually- 7367 impaired user, and that it MAY prefer to select a different track 7368 when selecting a default track for a non-visually-impaired user. 7370 24.5. Descriptions flag 7372 The "descriptions" flag tells the "Matroska Player" that this track 7373 is suitable to play via a text-to-speech system for a visually- 7374 impaired user, and that it SHOULD NOT automatically select this track 7375 when selecting a default track for a non-visually-impaired user. 7377 24.6. Original flag 7379 The "original" flag tells the "Matroska Player" that this track is in 7380 the original language, and that it SHOULD prefer it if configured to 7381 prefer original-language tracks of this track's type. 7383 24.7. Commentary flag 7385 The "commentary" flag tells the "Matroska Player" that this track 7386 contains commentary on the content. 7388 24.8. Track Operation 7390 "TrackOperation" allows combining multiple tracks to make a virtual 7391 one. It uses two separate system to combine tracks. One to create a 7392 3D "composition" (left/right/background planes) and one to simplify 7393 join two tracks together to make a single track. 7395 A track created with "TrackOperation" is a proper track with a UID 7396 and all its flags. However the codec ID is meaningless because each 7397 "sub" track needs to be decoded by its own decoder before the 7398 "operation" is applied. The "Cues Elements" corresponding to such a 7399 virtual track SHOULD be the sum of the "Cues Elements" for each of 7400 the tracks it's composed of (when the "Cues" are defined per track). 7402 In the case of "TrackJoinBlocks", the "Block Elements" (from 7403 "BlockGroup" and "SimpleBlock") of all the tracks SHOULD be used as 7404 if they were defined for this new virtual "Track". When two "Block 7405 Elements" have overlapping start or end timestamps, it's up to the 7406 underlying system to either drop some of these frames or render them 7407 the way they overlap. This situation SHOULD be avoided when creating 7408 such tracks as you can never be sure of the end result on different 7409 platforms. 7411 24.9. Overlay Track 7413 Overlay tracks SHOULD be rendered in the same channel as the track 7414 its linked to. When content is found in such a track, it SHOULD be 7415 played on the rendering channel instead of the original track. 7417 24.10. Multi-planar and 3D videos 7419 There are two different ways to compress 3D videos: have each eye 7420 track in a separate track and have one track have both eyes combined 7421 inside (which is more efficient, compression-wise). Matroska 7422 supports both ways. 7424 For the single track variant, there is the "StereoMode Element", 7425 which defines how planes are assembled in the track (mono or left- 7426 right combined). Odd values of StereoMode means the left plane comes 7427 first for more convenient reading. The pixel count of the track 7428 ("PixelWidth"/"PixelHeight") is the raw amount of pixels, for example 7429 3840x1080 for full HD side by side, and the 7430 "DisplayWidth"/"DisplayHeight" in pixels is the amount of pixels for 7431 one plane (1920x1080 for that full HD stream). Old stereo 3D were 7432 displayed using anaglyph (cyan and red colours separated). For 7433 compatibility with such movies, there is a value of the StereoMode 7434 that corresponds to AnaGlyph. 7436 There is also a "packed" mode (values 13 and 14) which consists of 7437 packing two frames together in a "Block" using lacing. The first 7438 frame is the left eye and the other frame is the right eye (or vice 7439 versa). The frames SHOULD be decoded in that order and are possibly 7440 dependent on each other (P and B frames). 7442 For separate tracks, Matroska needs to define exactly which track 7443 does what. "TrackOperation" with "TrackCombinePlanes" do that. For 7444 more details look at Section 24.8 on how TrackOperation works. 7446 The 3D support is still in infancy and may evolve to support more 7447 features. 7449 The StereoMode used to be part of Matroska v2 but it didn't meet the 7450 requirement for multiple tracks. There was also a bug in libmatroska 7451 prior to 0.9.0 that would save/read it as 0x53B9 instead of 0x53B8. 7452 "Matroska Readers" may support these legacy files by checking 7453 Matroska v2 or 0x53B9. The older values were 0: mono, 1: right eye, 7454 2: left eye, 3: both eyes. 7456 25. Default track selection 7458 This section provides some example sets of Tracks and hypothetical 7459 user settings, along with indications of which ones a similarly- 7460 configured "Matroska Player" SHOULD automatically select for playback 7461 by default in such a situation. A player MAY provide additional 7462 settings with more detailed controls for more nuanced scenarios. 7463 These examples are provided as guidelines to illustrate the intended 7464 usages of the various supported Track flags, and their expected 7465 behaviors. 7467 Track names are shown in English for illustrative purposes; actual 7468 files may have titles in the language of each track, or provide 7469 titles in multiple languages. 7471 25.1. Audio Selection 7473 Example track set: 7475 +===+=====+====+======+========+=======+================+===========+ 7476 |No.|Type |Lang|Layout|Original|Default|Other flags |Name | 7477 +===+=====+====+======+========+=======+================+===========+ 7478 |1 |Video|und |N/A |N/A |N/A |None | | 7479 +---+-----+----+------+--------+-------+----------------+-----------+ 7480 |2 |Audio|eng |5.1 |1 |1 |None | | 7481 +---+-----+----+------+--------+-------+----------------+-----------+ 7482 |3 |Audio|eng |2.0 |1 |1 |None | | 7483 +---+-----+----+------+--------+-------+----------------+-----------+ 7484 |4 |Audio|eng |2.0 |1 |0 |Visual-impaired |Descriptive| 7485 | | | | | | | |audio | 7486 +---+-----+----+------+--------+-------+----------------+-----------+ 7487 |5 |Audio|esp |5.1 |0 |1 |None | | 7488 +---+-----+----+------+--------+-------+----------------+-----------+ 7489 |6 |Audio|esp |2.0 |0 |0 |Visual-impaired |Descriptive| 7490 | | | | | | | |audio | 7491 +---+-----+----+------+--------+-------+----------------+-----------+ 7492 |7 |Audio|eng |2.0 |1 |0 |Commentary |Director's | 7493 | | | | | | | |Commentary | 7494 +---+-----+----+------+--------+-------+----------------+-----------+ 7495 |8 |Audio|eng |2.0 |1 |0 |None |Karaoke | 7496 +---+-----+----+------+--------+-------+----------------+-----------+ 7498 Table 54 7500 Here we have a file with 7 audio tracks, of which 5 are in English 7501 and 2 are in Spanish. 7503 The English tracks all have the Original flag, indicating that 7504 English is the original content language. 7506 Generally the player will first consider the track languages: if the 7507 player has an option to prefer original-language audio and the user 7508 has enabled it, then it should prefer one of the Original-flagged 7509 tracks. If configured to specifically prefer audio tracks in English 7510 or Spanish, the player should select one of the tracks in the 7511 corresponding language. The player may also wish to prefer an 7512 Original-flagged track if no tracks matching any of the user's 7513 explicitly-preferred languages are available. 7515 Two of the tracks have the Visual-impaired flag. If the player has 7516 been configured to prefer such tracks, it should select one; 7517 otherwise, it should avoid them if possible. 7519 If selecting an English track, when other settings have left multiple 7520 possible options, it may be useful to exclude the tracks that lack 7521 the Default flag: here, one provides descriptive service for the 7522 visually impaired (which has its own flag and may be automatically 7523 selected by user configuration, but is unsuitable for users with 7524 default-configured players), one is a commentary track (which has its 7525 own flag, which the player may or may not have specialized handling 7526 for), and the last contains karaoke versions of the music that plays 7527 during the film, which is an unusual specialized audio service that 7528 Matroska has no built-in support for indicating, so it's indicated in 7529 the track name instead. By not setting the Default flag on these 7530 specialized tracks, the file's author hints that they should not be 7531 automatically selected by a default-configured player. 7533 Having narrowed its choices down, our example player now may have to 7534 select between tracks 2 and 3. The only difference between these 7535 tracks is their channel layouts: 2 is 5.1 surround, while 3 is 7536 stereo. If the player is aware that the output device is a pair of 7537 headphones or stereo speakers, it may wish to prefer the stereo mix 7538 automatically. On the other hand, if it knows that the device is a 7539 surround system, it may wish to prefer the surround mix. 7541 If the player finishes analyzing all of the available audio tracks 7542 and finds that multiple seem equally and maximally preferable, it 7543 SHOULD default to the first of the group. 7545 25.2. Subtitle selection 7547 Example track set: 7549 +===+===========+====+=========+=======+======+==========+==========+ 7550 |No.| Type |Lang|Original |Default|Forced| Other | Name | 7551 | | | | | | | flags | | 7552 +===+===========+====+=========+=======+======+==========+==========+ 7553 |1 | Video |und |N/A |N/A |N/A | None | | 7554 +---+-----------+----+---------+-------+------+----------+----------+ 7555 |2 | Audio |fra |1 |1 |N/A | None | | 7556 +---+-----------+----+---------+-------+------+----------+----------+ 7557 |3 | Audio |por |0 |1 |N/A | None | | 7558 +---+-----------+----+---------+-------+------+----------+----------+ 7559 |4 | Subtitles |fra |1 |1 |0 | None | | 7560 +---+-----------+----+---------+-------+------+----------+----------+ 7561 |5 | Subtitles |fra |1 |0 |0 | Hearing- | Captions | 7562 | | | | | | | impaired | for the | 7563 | | | | | | | | hearing- | 7564 | | | | | | | | impaired | 7565 +---+-----------+----+---------+-------+------+----------+----------+ 7566 |6 | Subtitles |por |0 |1 |0 | None | | 7567 +---+-----------+----+---------+-------+------+----------+----------+ 7568 |7 | Subtitles |por |0 |0 |1 | None | Signs | 7569 +---+-----------+----+---------+-------+------+----------+----------+ 7570 |8 | Subtitles |por |0 |0 |0 | Hearing- | SDH | 7571 | | | | | | | impaired | | 7572 +---+-----------+----+---------+-------+------+----------+----------+ 7574 Table 55 7576 Here we have 2 audio tracks and 5 subtitle tracks. As we can see, 7577 French is the original language. 7579 We'll start by discussing the case where the user prefers French (or 7580 Original-language) audio (or has explicitly selected the French audio 7581 track), and also prefers French subtitles. 7583 In this case, if the player isn't configured to display captions when 7584 the audio matches their preferred subtitle languages, the player 7585 doesn't need to select a subtitle track at all. 7587 If the user _has_ indicated that they want captions to be displayed, 7588 the selection simply comes down to whether Hearing-impaired subtitles 7589 are preferred. 7591 The situation for a user who prefers Portuguese subtitles starts out 7592 somewhat analogous. If they select the original French audio (either 7593 by explicit audio language preference, preference for Original- 7594 language tracks, or by explicitly selecting that track), then the 7595 selection once again comes down to the hearing-impaired preference. 7597 However, the case where the Portuguese audio track is selected has an 7598 important catch: a Forced track in Portuguese is present. This may 7599 contain translations of onscreen text from the video track, or of 7600 portions of the audio that are not translated (music, for instance). 7601 This means that even if the user's preferences wouldn't normally call 7602 for captions here, the Forced track should be selected nonetheless, 7603 rather than selecting no track at all. On the other hand, if the 7604 user's preferences _do_ call for captions, the non-Forced tracks 7605 should be preferred, as the Forced track will not contain captioning 7606 for the dialogue. 7608 26. Timestamps 7610 Historically timestamps in Matroska were mistakenly called timecodes. 7611 The "Timestamp Element" was called Timecode, the "TimestampScale 7612 Element" was called TimecodeScale, the "TrackTimestampScale Element" 7613 was called TrackTimecodeScale and the "ReferenceTimestamp Element" 7614 was called ReferenceTimeCode. 7616 26.1. Timestamp Types 7618 * Absolute Timestamp = Block+Cluster 7620 * Relative Timestamp = Block 7622 * Scaled Timestamp = Block+Cluster 7624 * Raw Timestamp = (Block+Cluster)*TimestampScale*TrackTimestampScale 7626 26.2. Block Timestamps 7628 The "Block Element"'s timestamp MUST be a signed integer that 7629 represents the "Raw Timestamp" relative to the "Cluster"'s "Timestamp 7630 Element", multiplied by the "TimestampScale Element". See 7631 Section 26.4 for more information. 7633 The "Block Element"'s timestamp MUST be represented by a 16bit signed 7634 integer (sint16). The "Block"'s timestamp has a range of -32768 to 7635 +32767 units. When using the default value of the "TimestampScale 7636 Element", each integer represents 1ms. The maximum time span of 7637 "Block Elements" in a "Cluster" using the default "TimestampScale 7638 Element" of 1ms is 65536ms. 7640 If a "Cluster"'s "Timestamp Element" is set to zero, it is possible 7641 to have "Block Elements" with a negative "Raw Timestamp". "Block 7642 Elements" with a negative "Raw Timestamp" are not valid. 7644 26.3. Raw Timestamp 7646 The exact time of an object SHOULD be represented in nanoseconds. To 7647 find out a "Block"'s "Raw Timestamp", you need the "Block"'s 7648 "Timestamp Element", the "Cluster"'s "Timestamp Element", and the 7649 "TimestampScale Element". 7651 26.4. TimestampScale 7653 The "TimestampScale Element" is used to calculate the "Raw Timestamp" 7654 of a "Block". The timestamp is obtained by adding the "Block"'s 7655 timestamp to the "Cluster"'s "Timestamp Element", and then 7656 multiplying that result by the "TimestampScale". The result will be 7657 the "Block"'s "Raw Timestamp" in nanoseconds. The formula for this 7658 would look like: 7660 (a + b) * c 7662 a = `Block`'s Timestamp 7663 b = `Cluster`'s Timestamp 7664 c = `TimestampScale` 7666 For example, assume a "Cluster"'s "Timestamp" has a value of 564264, 7667 the "Block" has a "Timestamp" of 1233, and the "TimestampScale 7668 Element" is the default of 1000000. 7670 (1233 + 564264) * 1000000 = 565497000000 7672 So, the "Block" in this example has a specific time of 565497000000 7673 in nanoseconds. In milliseconds this would be 565497ms. 7675 26.5. TimestampScale Rounding 7677 Because the default value of "TimestampScale" is 1000000, which makes 7678 each integer in the "Cluster" and "Block" "Timestamp Elements" equal 7679 1ms, this is the most commonly used. When dealing with audio, this 7680 causes inaccuracy when seeking. When the audio is combined with 7681 video, this is not an issue. For most cases, the the synch of audio 7682 to video does not need to be more than 1ms accurate. This becomes 7683 obvious when one considers that sound will take 2-3ms to travel a 7684 single meter, so distance from your speakers will have a greater 7685 effect on audio/visual synch than this. 7687 However, when dealing with audio-only files, seeking accuracy can 7688 become critical. For instance, when storing a whole CD in a single 7689 track, a user will want to be able to seek to the exact sample that a 7690 song begins at. If seeking a few sample ahead or behind, a crack or 7691 pop may result as a few odd samples are rendered. Also, when 7692 performing precise editing, it may be very useful to have the audio 7693 accuracy down to a single sample. 7695 When storing timestamps for an audio stream, the "TimestampScale 7696 Element" SHOULD have an accuracy of at least that of the audio sample 7697 rate, otherwise there are rounding errors that prevent users from 7698 knowing the precise location of a sample. Here's how a program has 7699 to round each timestamp in order to be able to recreate the sample 7700 number accurately. 7702 Let's assume that the application has an audio track with a sample 7703 rate of 44100. As written above the "TimestampScale" MUST have at 7704 least the accuracy of the sample rate itself: 1000000000 / 44100 = 7705 22675.7369614512. This value MUST always be truncated. Otherwise 7706 the accuracy will not suffice. So in this example the application 7707 will use 22675 for the "TimestampScale". The application could even 7708 use some lower value like 22674, which would allow it to be a little 7709 bit imprecise about the original timestamps. But more about that in 7710 a minute. 7712 Next the application wants to write sample number 52340 and 7713 calculates the timestamp. This is easy. In order to calculate the 7714 "Raw Timestamp" in ns all it has to do is calculate "Raw Timestamp = 7715 round(1000000000 * sample_number / sample_rate)". Rounding at this 7716 stage is very important! The application might skip it if it choses 7717 a slightly smaller value for the "TimestampScale" factor instead of 7718 the truncated one like shown above. Otherwise it has to round or the 7719 results won't be reversible. For our example we get "Raw Timestamp = 7720 round(1000000000 * 52340 / 44100) = round(1186848072.56236) = 7721 1186848073". 7723 The next step is to calculate the "Absolute Timestamp" - that is the 7724 timestamp that will be stored in the Matroska file. Here the 7725 application has to divide the "Raw Timestamp" from the previous 7726 paragraph by the "TimestampScale" factor and round the result: 7727 "Absolute Timestamp = round(Raw Timestamp / TimestampScale_factor)", 7728 which will result in the following for our example: "Absolute 7729 Timestamp = round(1186848073 / 22675) = round(52341.7011245866) = 7730 52342". This number is the one the application has to write to the 7731 file. 7733 Now our file is complete, and we want to play it back with another 7734 application. Its task is to find out which sample the first 7735 application wrote into the file. So it starts reading the Matroska 7736 file and finds the "TimestampScale" factor 22675 and the audio sample 7737 rate 44100. Later it finds a data block with the "Absolute 7738 Timestamp" of 52342. But how does it get the sample number from 7739 these numbers? 7741 First it has to calculate the "Raw Timestamp" of the block it has 7742 just read. Here's no rounding involved, just an integer 7743 multiplication: "Raw Timestamp = Absolute Timestamp * 7744 TimestampScale_factor". In our example: "Raw Timestamp = 52342 * 7745 22675 = 1186854850". 7747 The conversion from the "Raw Timestamp" to the sample number again 7748 requires rounding: "sample_number = round(Raw Timestamp * sample_rate 7749 / 1000000000)". In our example: "sample_number = round(1186854850 * 7750 44100 / 1000000000) = round(52340.298885) = 52340". This is exactly 7751 the sample number that the previous program started with. 7753 Some general notes for a program: 7755 1. Always calculate the timestamps / sample numbers with floating 7756 point numbers of at least 64bit precision (called 'double' in 7757 most modern programming languages). If you're calculating with 7758 integers, then make sure they're 64bit long, too. 7760 2. Always round if you divide. Always! If you don't you'll end up 7761 with situations in which you have a timestamp in the Matroska 7762 file that does not correspond to the sample number that it 7763 started with. Using a slightly lower timestamp scale factor can 7764 help here in that it removes the need for proper rounding in the 7765 conversion from sample number to "Raw Timestamp". 7767 26.6. TrackTimestampScale 7769 The "TrackTimestampScale Element" is used align tracks that would 7770 otherwise be played at different speeds. An example of this would be 7771 if you have a film that was originally recorded at 24fps video. When 7772 playing this back through a PAL broadcasting system, it is standard 7773 to speed up the film to 25fps to match the 25fps display speed of the 7774 PAL broadcasting standard. However, when broadcasting the video 7775 through NTSC, it is typical to leave the film at its original speed. 7776 If you wanted to make a single file where there was one video stream, 7777 and an audio stream used from the PAL broadcast, as well as an audio 7778 stream used from the NTSC broadcast, you would have the problem that 7779 the PAL audio stream would be 1/24th faster than the NTSC audio 7780 stream, quickly leading to problems. It is possible to stretch out 7781 the PAL audio track and re-encode it at a slower speed, however when 7782 dealing with lossy audio codecs, this often results in a loss of 7783 audio quality and/or larger file sizes. 7785 This is the type of problem that "TrackTimestampScale" was designed 7786 to fix. Using it, the video can be played back at a speed that will 7787 synch with either the NTSC or the PAL audio stream, depending on 7788 which is being used for playback. To continue the above example: 7790 Track 1: Video 7791 Track 2: NTSC Audio 7792 Track 3: PAL Audio 7794 Because the NTSC track is at the original speed, it will used as the 7795 default value of 1.0 for its "TrackTimestampScale". The video will 7796 also be aligned to the NTSC track with the default value of 1.0. 7798 The "TrackTimestampScale" value to use for the PAL track would be 7799 calculated by determining how much faster the PAL track is than the 7800 NTSC track. In this case, because we know the video for the NTSC 7801 audio is being played back at 24fps and the video for the PAL audio 7802 is being played back at 25fps, the calculation would be: 7804 25/24 is almost 1.04166666666666666667 7806 When writing a file that uses a non-default "TrackTimestampScale", 7807 the values of the "Block"'s timestamp are whatever they would be when 7808 normally storing the track with a default value for the 7809 "TrackTimestampScale". However, the data is interleaved a little 7810 differently. Data SHOULD be interleaved by its Raw Timestamp, see 7811 Section 26.3, in the order handed back from the encoder. The "Raw 7812 Timestamp" of a "Block" from a track using "TrackTimestampScale" is 7813 calculated using: 7815 "(Block's Timestamp + Cluster's Timestamp) * TimestampScale * 7816 TrackTimestampScale" 7818 So, a Block from the PAL track above that had a Scaled Timestamp, see 7819 Section 26.1, of 100 seconds would have a "Raw Timestamp" of 7820 104.66666667 seconds, and so would be stored in that part of the 7821 file. 7823 When playing back a track using the "TrackTimestampScale", if the 7824 track is being played by itself, there is no need to scale it. From 7825 the above example, when playing the Video with the NTSC Audio, 7826 neither are scaled. However, when playing back the Video with the 7827 PAL Audio, the timestamps from the PAL Audio track are scaled using 7828 the "TrackTimestampScale", resulting in the video playing back in 7829 synch with the audio. 7831 It would be possible for a "Matroska Player" to also adjust the 7832 audio's samplerate at the same time as adjusting the timestamps if 7833 you wanted to play the two audio streams synchronously. It would 7834 also be possible to adjust the video to match the audio's speed. 7835 However, for playback, the selected track(s) timestamps SHOULD be 7836 adjusted if they need to be scaled. 7838 While the above example deals specifically with audio tracks, this 7839 element can be used to align video, audio, subtitles, or any other 7840 type of track contained in a Matroska file. 7842 27. Normative References 7844 [BCP47] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying 7845 Languages", DOI 10.17487/RFC5646, September 2009, 7846 . 7848 [I-D.ietf-cellar-codec] 7849 Lhomme, S., Bunkus, M., and D. Rice, "Matroska Media 7850 Container Codec Specifications", Work in Progress, 7851 Internet-Draft, draft-ietf-cellar-codec-05, 19 October 7852 2020, 7853 . 7855 [I-D.ietf-cellar-tags] 7856 Lhomme, S., Bunkus, M., and D. Rice, "Matroska Media 7857 Container Tag Specifications", Work in Progress, Internet- 7858 Draft, draft-ietf-cellar-tags-05, 19 October 2020, 7859 . 7861 [IANADomains] 7862 "IANA Root Zone Database", 7863 . 7865 [IANALangRegistry] 7866 "IANA Language Subtag Registry", 28 February 2013, 7867 . 7870 [ISO3166-1] 7871 International Organization for Standardization, "Codes for 7872 the representation of names of countries and their 7873 subdivisions -- Part 1: Country code", ISO 3166-1:2020, 7874 August 2020, . 7876 [ISO639-2] United States Library Of Congress, "Codes for the 7877 Representation of Names of Languages", ISO 639-2:1998, 21 7878 December 2017, . 7881 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 7882 Requirement Levels", BCP 14, RFC 2119, 7883 DOI 10.17487/RFC2119, March 1997, 7884 . 7886 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 7887 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 7888 May 2017, . 7890 [RFC8794] Lhomme, S., Rice, D., and M. Bunkus, "Extensible Binary 7891 Meta Language", RFC 8794, DOI 10.17487/RFC8794, July 2020, 7892 . 7894 [WebVTT] Pieters, S., Pfeiffer, S., Ed., Jägenstedt, P., and I. 7895 Hickson, "WebVTT Cue Identifier", 4 April 2019, 7896 . 7898 28. Informative References 7900 [DivXTrickTrack] 7901 "DivX Trick Track Extensions", 14 December 2010, 7902 . 7905 [DivXWorldFonts] 7906 "DivX World Fonts Extensions", 14 December 2010, 7907 . 7910 [MCF] "Media Container Format", 17 July 2002, 7911 . 7913 Authors' Addresses 7915 Steve Lhomme 7917 Email: slhomme@matroska.org 7918 Moritz Bunkus 7920 Email: moritz@bunkus.org 7922 Dave Rice 7924 Email: dave@dericed.com