idnits 2.17.1 draft-lhomme-cellar-matroska-01.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: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. == There are 1 instance of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 664 has weird spacing: '...xx xxxx xxxx ...' == Line 665 has weird spacing: '...1x xxxx xxxx ...' == Line 666 has weird spacing: '...01 xxxx xxxx ...' == Line 668 has weird spacing: '...00 1xxx xxxx ...' == Line 669 has weird spacing: '...xx xxxx xxxx ...' == (4 more instances...) -- The exact meaning of the all-uppercase expression 'MAY NOT' is not defined in RFC 2119. If it is intended as a requirements expression, it should be rewritten using one of the combinations defined in RFC 2119; otherwise it should not be all-uppercase. == The expression 'MAY NOT', while looking like RFC 2119 requirements text, is not defined in RFC 2119, and should not be used. Consider using 'MUST NOT' instead (if that is what you mean). Found 'MAY NOT' in this paragraph: Frames using references SHOULD be stored in "coding order". That means the references first and then the frames referencing them. A consequence is that timecodes MAY NOT be consecutive. But a frame with a past timecode MUST reference a frame already known, otherwise it's considered bad/void. == The expression 'MAY NOT', while looking like RFC 2119 requirements text, is not defined in RFC 2119, and should not be used. Consider using 'MUST NOT' instead (if that is what you mean). Found 'MAY NOT' in this paragraph: Frames using references SHOULD be stored in "coding order". That means the references first and then the frames referencing them. A consequence is that timecodes MAY NOT be consecutive. But a frame with a past timecode MUST reference a frame already known, otherwise it's considered bad/void. == The expression 'MAY NOT', while looking like RFC 2119 requirements text, is not defined in RFC 2119, and should not be used. Consider using 'MUST NOT' instead (if that is what you mean). Found 'MAY NOT' in this paragraph: The EncryptedBlock is very inspired by the [SimpleBlock structure](({{site.baseurl}}/index.html#simpleblock_structure). The main differences is that the raw data are Transformed. That means the data after the lacing definition (if present) have been processed before put into the Block. The laced sizes apply on the decoded (Inverse Transform) data. This size of the Transformed data MAY NOT match the size of the initial chunk of data. == The expression 'MAY NOT', while looking like RFC 2119 requirements text, is not defined in RFC 2119, and should not be used. Consider using 'MUST NOT' instead (if that is what you mean). Found 'MAY NOT' in this paragraph: Frames using references SHOULD be stored in "coding order". That means the references first and then the frames referencing them. A consequence is that timecodes MAY NOT be consecutive. But a frame with a past timecode MUST reference a frame already known, otherwise it's considered bad/void. -- The document date (November 23, 2016) is 2682 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Missing reference section? '1' on line 7291 looks like a reference -- Missing reference section? '2' on line 7293 looks like a reference -- Missing reference section? '3' on line 7296 looks like a reference -- Missing reference section? '4' on line 7298 looks like a reference -- Missing reference section? '5' on line 7300 looks like a reference -- Missing reference section? '6' on line 7302 looks like a reference -- Missing reference section? '7' on line 7305 looks like a reference -- Missing reference section? '8' on line 7308 looks like a reference -- Missing reference section? '9' on line 7310 looks like a reference -- Missing reference section? '10' on line 7313 looks like a reference -- Missing reference section? '11' on line 7316 looks like a reference -- Missing reference section? '12' on line 7319 looks like a reference -- Missing reference section? '13' on line 7322 looks like a reference -- Missing reference section? '14' on line 7324 looks like a reference -- Missing reference section? '15' on line 7326 looks like a reference -- Missing reference section? '16' on line 7328 looks like a reference -- Missing reference section? '17' on line 7330 looks like a reference -- Missing reference section? '18' on line 7332 looks like a reference -- Missing reference section? '19' on line 7334 looks like a reference -- Missing reference section? '20' on line 7336 looks like a reference -- Missing reference section? '21' on line 7338 looks like a reference -- Missing reference section? '22' on line 7340 looks like a reference -- Missing reference section? '23' on line 7342 looks like a reference -- Missing reference section? '24' on line 7344 looks like a reference -- Missing reference section? '25' on line 7346 looks like a reference -- Missing reference section? '26' on line 7348 looks like a reference -- Missing reference section? '27' on line 7350 looks like a reference -- Missing reference section? '28' on line 7352 looks like a reference -- Missing reference section? '29' on line 7354 looks like a reference -- Missing reference section? '30' on line 7356 looks like a reference -- Missing reference section? '31' on line 7358 looks like a reference -- Missing reference section? '32' on line 7360 looks like a reference -- Missing reference section? '33' on line 7362 looks like a reference -- Missing reference section? '34' on line 7364 looks like a reference -- Missing reference section? '35' on line 7366 looks like a reference -- Missing reference section? '36' on line 7369 looks like a reference -- Missing reference section? '37' on line 7371 looks like a reference -- Missing reference section? '38' on line 7373 looks like a reference -- Missing reference section? '39' on line 7375 looks like a reference -- Missing reference section? '40' on line 7377 looks like a reference -- Missing reference section? '41' on line 7379 looks like a reference -- Missing reference section? '42' on line 7381 looks like a reference -- Missing reference section? '43' on line 7383 looks like a reference -- Missing reference section? '44' on line 7385 looks like a reference -- Missing reference section? '45' on line 7387 looks like a reference -- Missing reference section? '46' on line 7389 looks like a reference -- Missing reference section? '47' on line 7392 looks like a reference -- Missing reference section? '48' on line 7395 looks like a reference -- Missing reference section? '49' on line 7398 looks like a reference -- Missing reference section? '50' on line 7401 looks like a reference -- Missing reference section? '51' on line 7403 looks like a reference -- Missing reference section? '52' on line 7405 looks like a reference -- Missing reference section? 'TM' on line 5991 looks like a reference -- Missing reference section? '53' on line 7408 looks like a reference -- Missing reference section? '54' on line 7411 looks like a reference -- Missing reference section? '55' on line 7413 looks like a reference -- Missing reference section? '56' on line 7415 looks like a reference -- Missing reference section? '57' on line 7417 looks like a reference -- Missing reference section? '58' on line 7419 looks like a reference -- Missing reference section? '59' on line 7421 looks like a reference -- Missing reference section? '60' on line 7424 looks like a reference -- Missing reference section? '61' on line 7427 looks like a reference -- Missing reference section? '62' on line 7430 looks like a reference -- Missing reference section? '63' on line 7432 looks like a reference -- Missing reference section? '64' on line 7434 looks like a reference -- Missing reference section? '65' on line 7436 looks like a reference -- Missing reference section? '66' on line 7438 looks like a reference -- Missing reference section? '67' on line 7440 looks like a reference -- Missing reference section? '68' on line 7442 looks like a reference -- Missing reference section? '69' on line 7444 looks like a reference -- Missing reference section? '70' on line 7446 looks like a reference -- Missing reference section? '71' on line 7448 looks like a reference -- Missing reference section? '72' on line 7450 looks like a reference -- Missing reference section? '73' on line 7452 looks like a reference -- Missing reference section? '74' on line 7454 looks like a reference -- Missing reference section? '75' on line 7456 looks like a reference -- Missing reference section? '76' on line 7458 looks like a reference -- Missing reference section? '0' on line 6428 looks like a reference -- Missing reference section? '77' on line 7460 looks like a reference -- Missing reference section? '78' on line 7462 looks like a reference -- Missing reference section? '79' on line 7464 looks like a reference -- Missing reference section? '80' on line 7466 looks like a reference -- Missing reference section? '81' on line 7468 looks like a reference -- Missing reference section? '83' on line 7470 looks like a reference -- Missing reference section? 'Events' on line 6780 looks like a reference -- Missing reference section? '85' on line 7472 looks like a reference -- Missing reference section? '86' on line 7474 looks like a reference -- Missing reference section? '87' on line 7476 looks like a reference -- Missing reference section? '88' on line 7478 looks like a reference -- Missing reference section? '89' on line 7480 looks like a reference -- Missing reference section? '90' on line 7482 looks like a reference -- Missing reference section? '91' on line 7485 looks like a reference -- Missing reference section? '92' on line 7487 looks like a reference -- Missing reference section? '93' on line 7490 looks like a reference -- Missing reference section? '94' on line 7492 looks like a reference Summary: 1 error (**), 0 flaws (~~), 12 warnings (==), 98 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 cellar S. Lhomme 3 Internet-Draft 4 Intended status: Standards Track M. Bunkus 5 Expires: May 27, 2017 6 D. Rice 7 November 23, 2016 9 Matroska 10 draft-lhomme-cellar-matroska-01 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 http://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 May 27, 2017. 35 Copyright Notice 37 Copyright (c) 2016 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 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 9 53 2. Status of this document . . . . . . . . . . . . . . . . . . . 10 54 3. Security Considerations . . . . . . . . . . . . . . . . . . . 10 55 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 56 5. Notations and Conventions . . . . . . . . . . . . . . . . . . 10 57 6. Basis in EBML . . . . . . . . . . . . . . . . . . . . . . . . 11 58 6.1. Added Constaints on EBML . . . . . . . . . . . . . . . . 11 59 6.2. Matroska Design . . . . . . . . . . . . . . . . . . . . . 11 60 6.2.1. Language Codes . . . . . . . . . . . . . . . . . . . 11 61 6.2.2. Physical Types . . . . . . . . . . . . . . . . . . . 11 62 6.2.3. Block Structure . . . . . . . . . . . . . . . . . . . 12 63 6.2.4. Lacing . . . . . . . . . . . . . . . . . . . . . . . 14 64 7. Matroska Schema . . . . . . . . . . . . . . . . . . . . . . . 19 65 7.1. Matroska Additions to Schema Element Attributes . . . . . 19 66 7.2. Matroska Schema . . . . . . . . . . . . . . . . . . . . . 20 67 7.2.1. Segment Element . . . . . . . . . . . . . . . . . . . 20 68 7.2.2. SeekHead Element . . . . . . . . . . . . . . . . . . 20 69 7.2.3. Seek Element . . . . . . . . . . . . . . . . . . . . 21 70 7.2.4. SeekID Element . . . . . . . . . . . . . . . . . . . 21 71 7.2.5. SeekPosition Element . . . . . . . . . . . . . . . . 21 72 7.2.6. Info Element . . . . . . . . . . . . . . . . . . . . 22 73 7.2.7. SegmentUID Element . . . . . . . . . . . . . . . . . 22 74 7.2.8. SegmentFilename Element . . . . . . . . . . . . . . . 23 75 7.2.9. PrevUID Element . . . . . . . . . . . . . . . . . . . 23 76 7.2.10. PrevFilename Element . . . . . . . . . . . . . . . . 23 77 7.2.11. NextUID Element . . . . . . . . . . . . . . . . . . . 24 78 7.2.12. NextFilename Element . . . . . . . . . . . . . . . . 24 79 7.2.13. SegmentFamily Element . . . . . . . . . . . . . . . . 25 80 7.2.14. ChapterTranslate Element . . . . . . . . . . . . . . 25 81 7.2.15. ChapterTranslateEditionUID Element . . . . . . . . . 25 82 7.2.16. ChapterTranslateCodec Element . . . . . . . . . . . . 26 83 7.2.17. ChapterTranslateID Element . . . . . . . . . . . . . 26 84 7.2.18. TimecodeScale Element . . . . . . . . . . . . . . . . 26 85 7.2.19. Duration Element . . . . . . . . . . . . . . . . . . 27 86 7.2.20. DateUTC Element . . . . . . . . . . . . . . . . . . . 27 87 7.2.21. Title Element . . . . . . . . . . . . . . . . . . . . 28 88 7.2.22. MuxingApp Element . . . . . . . . . . . . . . . . . . 28 89 7.2.23. WritingApp Element . . . . . . . . . . . . . . . . . 28 90 7.2.24. Cluster Element . . . . . . . . . . . . . . . . . . . 29 91 7.2.25. Timecode Element . . . . . . . . . . . . . . . . . . 29 92 7.2.26. SilentTracks Element . . . . . . . . . . . . . . . . 29 93 7.2.27. SilentTrackNumber Element . . . . . . . . . . . . . . 30 94 7.2.28. Position Element . . . . . . . . . . . . . . . . . . 30 95 7.2.29. PrevSize Element . . . . . . . . . . . . . . . . . . 30 96 7.2.30. SimpleBlock Element . . . . . . . . . . . . . . . . . 31 97 7.2.31. BlockGroup Element . . . . . . . . . . . . . . . . . 31 98 7.2.32. Block Element . . . . . . . . . . . . . . . . . . . . 31 99 7.2.33. BlockVirtual Element . . . . . . . . . . . . . . . . 32 100 7.2.34. BlockAdditions Element . . . . . . . . . . . . . . . 32 101 7.2.35. BlockMore Element . . . . . . . . . . . . . . . . . . 33 102 7.2.36. BlockAddID Element . . . . . . . . . . . . . . . . . 33 103 7.2.37. BlockAdditional Element . . . . . . . . . . . . . . . 33 104 7.2.38. BlockDuration Element . . . . . . . . . . . . . . . . 34 105 7.2.39. ReferencePriority Element . . . . . . . . . . . . . . 34 106 7.2.40. ReferenceBlock Element . . . . . . . . . . . . . . . 35 107 7.2.41. ReferenceVirtual Element . . . . . . . . . . . . . . 35 108 7.2.42. CodecState Element . . . . . . . . . . . . . . . . . 35 109 7.2.43. DiscardPadding Element . . . . . . . . . . . . . . . 36 110 7.2.44. Slices Element . . . . . . . . . . . . . . . . . . . 36 111 7.2.45. TimeSlice Element . . . . . . . . . . . . . . . . . . 36 112 7.2.46. LaceNumber Element . . . . . . . . . . . . . . . . . 37 113 7.2.47. FrameNumber Element . . . . . . . . . . . . . . . . . 37 114 7.2.48. BlockAdditionID Element . . . . . . . . . . . . . . . 38 115 7.2.49. Delay Element . . . . . . . . . . . . . . . . . . . . 38 116 7.2.50. SliceDuration Element . . . . . . . . . . . . . . . . 38 117 7.2.51. ReferenceFrame Element . . . . . . . . . . . . . . . 39 118 7.2.52. ReferenceOffset Element . . . . . . . . . . . . . . . 39 119 7.2.53. ReferenceTimeCode Element . . . . . . . . . . . . . . 39 120 7.2.54. EncryptedBlock Element . . . . . . . . . . . . . . . 40 121 7.2.55. Tracks Element . . . . . . . . . . . . . . . . . . . 40 122 7.2.56. TrackEntry Element . . . . . . . . . . . . . . . . . 41 123 7.2.57. TrackNumber Element . . . . . . . . . . . . . . . . . 41 124 7.2.58. TrackUID Element . . . . . . . . . . . . . . . . . . 41 125 7.2.59. TrackType Element . . . . . . . . . . . . . . . . . . 42 126 7.2.60. FlagEnabled Element . . . . . . . . . . . . . . . . . 42 127 7.2.61. FlagDefault Element . . . . . . . . . . . . . . . . . 43 128 7.2.62. FlagForced Element . . . . . . . . . . . . . . . . . 43 129 7.2.63. FlagLacing Element . . . . . . . . . . . . . . . . . 44 130 7.2.64. MinCache Element . . . . . . . . . . . . . . . . . . 44 131 7.2.65. MaxCache Element . . . . . . . . . . . . . . . . . . 44 132 7.2.66. DefaultDuration Element . . . . . . . . . . . . . . . 45 133 7.2.67. DefaultDecodedFieldDuration Element . . . . . . . . . 45 134 7.2.68. TrackTimecodeScale Element . . . . . . . . . . . . . 45 135 7.2.69. TrackOffset Element . . . . . . . . . . . . . . . . . 46 136 7.2.70. MaxBlockAdditionID Element . . . . . . . . . . . . . 46 137 7.2.71. Name Element . . . . . . . . . . . . . . . . . . . . 47 138 7.2.72. Language Element . . . . . . . . . . . . . . . . . . 47 139 7.2.73. CodecID Element . . . . . . . . . . . . . . . . . . . 47 140 7.2.74. CodecPrivate Element . . . . . . . . . . . . . . . . 48 141 7.2.75. CodecName Element . . . . . . . . . . . . . . . . . . 48 142 7.2.76. AttachmentLink Element . . . . . . . . . . . . . . . 48 143 7.2.77. CodecSettings Element . . . . . . . . . . . . . . . . 49 144 7.2.78. CodecInfoURL Element . . . . . . . . . . . . . . . . 49 145 7.2.79. CodecDownloadURL Element . . . . . . . . . . . . . . 49 146 7.2.80. CodecDecodeAll Element . . . . . . . . . . . . . . . 50 147 7.2.81. TrackOverlay Element . . . . . . . . . . . . . . . . 50 148 7.2.82. CodecDelay Element . . . . . . . . . . . . . . . . . 51 149 7.2.83. SeekPreRoll Element . . . . . . . . . . . . . . . . . 51 150 7.2.84. TrackTranslate Element . . . . . . . . . . . . . . . 51 151 7.2.85. TrackTranslateEditionUID Element . . . . . . . . . . 52 152 7.2.86. TrackTranslateCodec Element . . . . . . . . . . . . . 52 153 7.2.87. TrackTranslateTrackID Element . . . . . . . . . . . . 52 154 7.2.88. Video Element . . . . . . . . . . . . . . . . . . . . 53 155 7.2.89. FlagInterlaced Element . . . . . . . . . . . . . . . 53 156 7.2.90. FieldOrder Element . . . . . . . . . . . . . . . . . 54 157 7.2.91. StereoMode Element . . . . . . . . . . . . . . . . . 54 158 7.2.92. AlphaMode Element . . . . . . . . . . . . . . . . . . 55 159 7.2.93. OldStereoMode Element . . . . . . . . . . . . . . . . 55 160 7.2.94. PixelWidth Element . . . . . . . . . . . . . . . . . 55 161 7.2.95. PixelHeight Element . . . . . . . . . . . . . . . . . 56 162 7.2.96. PixelCropBottom Element . . . . . . . . . . . . . . . 56 163 7.2.97. PixelCropTop Element . . . . . . . . . . . . . . . . 57 164 7.2.98. PixelCropLeft Element . . . . . . . . . . . . . . . . 57 165 7.2.99. PixelCropRight Element . . . . . . . . . . . . . . . 57 166 7.2.100. DisplayWidth Element . . . . . . . . . . . . . . . . 58 167 7.2.101. DisplayHeight Element . . . . . . . . . . . . . . . 58 168 7.2.102. DisplayUnit Element . . . . . . . . . . . . . . . . 58 169 7.2.103. AspectRatioType Element . . . . . . . . . . . . . . 59 170 7.2.104. ColourSpace Element . . . . . . . . . . . . . . . . 59 171 7.2.105. GammaValue Element . . . . . . . . . . . . . . . . . 60 172 7.2.106. FrameRate Element . . . . . . . . . . . . . . . . . 60 173 7.2.107. Colour Element . . . . . . . . . . . . . . . . . . . 60 174 7.2.108. MatrixCoefficients Element . . . . . . . . . . . . . 61 175 7.2.109. BitsPerChannel Element . . . . . . . . . . . . . . . 61 176 7.2.110. ChromaSubsamplingHorz Element . . . . . . . . . . . 61 177 7.2.111. ChromaSubsamplingVert Element . . . . . . . . . . . 62 178 7.2.112. CbSubsamplingHorz Element . . . . . . . . . . . . . 62 179 7.2.113. CbSubsamplingVert Element . . . . . . . . . . . . . 63 180 7.2.114. ChromaSitingHorz Element . . . . . . . . . . . . . . 63 181 7.2.115. ChromaSitingVert Element . . . . . . . . . . . . . . 63 182 7.2.116. Range Element . . . . . . . . . . . . . . . . . . . 64 183 7.2.117. TransferCharacteristics Element . . . . . . . . . . 64 184 7.2.118. Primaries Element . . . . . . . . . . . . . . . . . 65 185 7.2.119. MaxCLL Element . . . . . . . . . . . . . . . . . . . 65 186 7.2.120. MaxFALL Element . . . . . . . . . . . . . . . . . . 65 187 7.2.121. MasteringMetadata Element . . . . . . . . . . . . . 66 188 7.2.122. PrimaryRChromaticityX Element . . . . . . . . . . . 66 189 7.2.123. PrimaryRChromaticityY Element . . . . . . . . . . . 66 190 7.2.124. PrimaryGChromaticityX Element . . . . . . . . . . . 67 191 7.2.125. PrimaryGChromaticityY Element . . . . . . . . . . . 67 192 7.2.126. PrimaryBChromaticityX Element . . . . . . . . . . . 67 193 7.2.127. PrimaryBChromaticityY Element . . . . . . . . . . . 68 194 7.2.128. WhitePointChromaticityX Element . . . . . . . . . . 68 195 7.2.129. WhitePointChromaticityY Element . . . . . . . . . . 68 196 7.2.130. LuminanceMax Element . . . . . . . . . . . . . . . . 69 197 7.2.131. LuminanceMin Element . . . . . . . . . . . . . . . . 69 198 7.2.132. Audio Element . . . . . . . . . . . . . . . . . . . 70 199 7.2.133. SamplingFrequency Element . . . . . . . . . . . . . 70 200 7.2.134. OutputSamplingFrequency Element . . . . . . . . . . 70 201 7.2.135. Channels Element . . . . . . . . . . . . . . . . . . 71 202 7.2.136. ChannelPositions Element . . . . . . . . . . . . . . 71 203 7.2.137. BitDepth Element . . . . . . . . . . . . . . . . . . 72 204 7.2.138. TrackOperation Element . . . . . . . . . . . . . . . 72 205 7.2.139. TrackCombinePlanes Element . . . . . . . . . . . . . 72 206 7.2.140. TrackPlane Element . . . . . . . . . . . . . . . . . 73 207 7.2.141. TrackPlaneUID Element . . . . . . . . . . . . . . . 73 208 7.2.142. TrackPlaneType Element . . . . . . . . . . . . . . . 73 209 7.2.143. TrackJoinBlocks Element . . . . . . . . . . . . . . 74 210 7.2.144. TrackJoinUID Element . . . . . . . . . . . . . . . . 74 211 7.2.145. TrickTrackUID Element . . . . . . . . . . . . . . . 75 212 7.2.146. TrickTrackSegmentUID Element . . . . . . . . . . . . 75 213 7.2.147. TrickTrackFlag Element . . . . . . . . . . . . . . . 75 214 7.2.148. TrickMasterTrackUID Element . . . . . . . . . . . . 76 215 7.2.149. TrickMasterTrackSegmentUID Element . . . . . . . . . 76 216 7.2.150. ContentEncodings Element . . . . . . . . . . . . . . 76 217 7.2.151. ContentEncoding Element . . . . . . . . . . . . . . 77 218 7.2.152. ContentEncodingOrder Element . . . . . . . . . . . . 77 219 7.2.153. ContentEncodingScope Element . . . . . . . . . . . . 78 220 7.2.154. ContentEncodingType Element . . . . . . . . . . . . 78 221 7.2.155. ContentCompression Element . . . . . . . . . . . . . 79 222 7.2.156. ContentCompAlgo Element . . . . . . . . . . . . . . 79 223 7.2.157. ContentCompSettings Element . . . . . . . . . . . . 79 224 7.2.158. ContentEncryption Element . . . . . . . . . . . . . 80 225 7.2.159. ContentEncAlgo Element . . . . . . . . . . . . . . . 80 226 7.2.160. ContentEncKeyID Element . . . . . . . . . . . . . . 81 227 7.2.161. ContentSignature Element . . . . . . . . . . . . . . 81 228 7.2.162. ContentSigKeyID Element . . . . . . . . . . . . . . 81 229 7.2.163. ContentSigAlgo Element . . . . . . . . . . . . . . . 82 230 7.2.164. ContentSigHashAlgo Element . . . . . . . . . . . . . 82 231 7.2.165. Cues Element . . . . . . . . . . . . . . . . . . . . 82 232 7.2.166. CuePoint Element . . . . . . . . . . . . . . . . . . 83 233 7.2.167. CueTime Element . . . . . . . . . . . . . . . . . . 83 234 7.2.168. CueTrackPositions Element . . . . . . . . . . . . . 83 235 7.2.169. CueTrack Element . . . . . . . . . . . . . . . . . . 84 236 7.2.170. CueClusterPosition Element . . . . . . . . . . . . . 84 237 7.2.171. CueRelativePosition Element . . . . . . . . . . . . 85 238 7.2.172. CueDuration Element . . . . . . . . . . . . . . . . 85 239 7.2.173. CueBlockNumber Element . . . . . . . . . . . . . . . 85 240 7.2.174. CueCodecState Element . . . . . . . . . . . . . . . 86 241 7.2.175. CueReference Element . . . . . . . . . . . . . . . . 86 242 7.2.176. CueRefTime Element . . . . . . . . . . . . . . . . . 86 243 7.2.177. CueRefCluster Element . . . . . . . . . . . . . . . 87 244 7.2.178. CueRefNumber Element . . . . . . . . . . . . . . . . 87 245 7.2.179. CueRefCodecState Element . . . . . . . . . . . . . . 88 246 7.2.180. Attachments Element . . . . . . . . . . . . . . . . 88 247 7.2.181. AttachedFile Element . . . . . . . . . . . . . . . . 88 248 7.2.182. FileDescription Element . . . . . . . . . . . . . . 89 249 7.2.183. FileName Element . . . . . . . . . . . . . . . . . . 89 250 7.2.184. FileMimeType Element . . . . . . . . . . . . . . . . 89 251 7.2.185. FileData Element . . . . . . . . . . . . . . . . . . 90 252 7.2.186. FileUID Element . . . . . . . . . . . . . . . . . . 90 253 7.2.187. FileReferral Element . . . . . . . . . . . . . . . . 90 254 7.2.188. FileUsedStartTime Element . . . . . . . . . . . . . 91 255 7.2.189. FileUsedEndTime Element . . . . . . . . . . . . . . 91 256 7.2.190. Chapters Element . . . . . . . . . . . . . . . . . . 91 257 7.2.191. EditionEntry Element . . . . . . . . . . . . . . . . 92 258 7.2.192. EditionUID Element . . . . . . . . . . . . . . . . . 92 259 7.2.193. EditionFlagHidden Element . . . . . . . . . . . . . 92 260 7.2.194. EditionFlagDefault Element . . . . . . . . . . . . . 93 261 7.2.195. EditionFlagOrdered Element . . . . . . . . . . . . . 93 262 7.2.196. ChapterAtom Element . . . . . . . . . . . . . . . . 94 263 7.2.197. ChapterUID Element . . . . . . . . . . . . . . . . . 94 264 7.2.198. ChapterStringUID Element . . . . . . . . . . . . . . 94 265 7.2.199. ChapterTimeStart Element . . . . . . . . . . . . . . 95 266 7.2.200. ChapterTimeEnd Element . . . . . . . . . . . . . . . 95 267 7.2.201. ChapterFlagHidden Element . . . . . . . . . . . . . 95 268 7.2.202. ChapterFlagEnabled Element . . . . . . . . . . . . . 96 269 7.2.203. ChapterSegmentUID Element . . . . . . . . . . . . . 96 270 7.2.204. ChapterSegmentEditionUID Element . . . . . . . . . . 97 271 7.2.205. ChapterPhysicalEquiv Element . . . . . . . . . . . . 97 272 7.2.206. ChapterTrack Element . . . . . . . . . . . . . . . . 98 273 7.2.207. ChapterTrackNumber Element . . . . . . . . . . . . . 98 274 7.2.208. ChapterDisplay Element . . . . . . . . . . . . . . . 98 275 7.2.209. ChapString Element . . . . . . . . . . . . . . . . . 99 276 7.2.210. ChapLanguage Element . . . . . . . . . . . . . . . . 99 277 7.2.211. ChapCountry Element . . . . . . . . . . . . . . . . 100 278 7.2.212. ChapProcess Element . . . . . . . . . . . . . . . . 100 279 7.2.213. ChapProcessCodecID Element . . . . . . . . . . . . . 100 280 7.2.214. ChapProcessPrivate Element . . . . . . . . . . . . . 101 281 7.2.215. ChapProcessCommand Element . . . . . . . . . . . . . 101 282 7.2.216. ChapProcessTime Element . . . . . . . . . . . . . . 101 283 7.2.217. ChapProcessData Element . . . . . . . . . . . . . . 102 284 7.2.218. Tags Element . . . . . . . . . . . . . . . . . . . . 102 285 7.2.219. Tag Element . . . . . . . . . . . . . . . . . . . . 103 286 7.2.220. Targets Element . . . . . . . . . . . . . . . . . . 103 287 7.2.221. TargetTypeValue Element . . . . . . . . . . . . . . 103 288 7.2.222. TargetType Element . . . . . . . . . . . . . . . . . 104 289 7.2.223. TagTrackUID Element . . . . . . . . . . . . . . . . 104 290 7.2.224. TagEditionUID Element . . . . . . . . . . . . . . . 104 291 7.2.225. TagChapterUID Element . . . . . . . . . . . . . . . 105 292 7.2.226. TagAttachmentUID Element . . . . . . . . . . . . . . 105 293 7.2.227. SimpleTag Element . . . . . . . . . . . . . . . . . 106 294 7.2.228. TagName Element . . . . . . . . . . . . . . . . . . 106 295 7.2.229. TagLanguage Element . . . . . . . . . . . . . . . . 106 296 7.2.230. TagDefault Element . . . . . . . . . . . . . . . . . 107 297 7.2.231. TagString Element . . . . . . . . . . . . . . . . . 107 298 7.2.232. TagBinary Element . . . . . . . . . . . . . . . . . 108 299 8. Beginning of File . . . . . . . . . . . . . . . . . . . . . . 108 300 9. Block Timecodes . . . . . . . . . . . . . . . . . . . . . . . 108 301 10. Default decoded field duration . . . . . . . . . . . . . . . 109 302 11. Default Values . . . . . . . . . . . . . . . . . . . . . . . 109 303 12. DRM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 304 13. Encryption . . . . . . . . . . . . . . . . . . . . . . . . . 110 305 14. Image cropping . . . . . . . . . . . . . . . . . . . . . . . 110 306 15. Matroska version indicators . . . . . . . . . . . . . . . . . 110 307 16. Mime Types . . . . . . . . . . . . . . . . . . . . . . . . . 111 308 17. Octet . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 309 18. Overlay Track . . . . . . . . . . . . . . . . . . . . . . . . 111 310 19. Position References . . . . . . . . . . . . . . . . . . . . . 111 311 20. Raw Timecode . . . . . . . . . . . . . . . . . . . . . . . . 112 312 21. Linked Segments . . . . . . . . . . . . . . . . . . . . . . . 112 313 21.1. Hard Linking . . . . . . . . . . . . . . . . . . . . . . 112 314 21.2. Soft Linking . . . . . . . . . . . . . . . . . . . . . . 113 315 21.3. Medium Linking . . . . . . . . . . . . . . . . . . . . . 113 316 22. Timecode Types . . . . . . . . . . . . . . . . . . . . . . . 114 317 23. TimecodeScale . . . . . . . . . . . . . . . . . . . . . . . . 114 318 24. TimecodeScale Rounding . . . . . . . . . . . . . . . . . . . 114 319 25. Track Flags . . . . . . . . . . . . . . . . . . . . . . . . . 116 320 25.1. Default flag . . . . . . . . . . . . . . . . . . . . . . 116 321 25.2. Forced flag . . . . . . . . . . . . . . . . . . . . . . 116 322 26. TrackTimecodeScale . . . . . . . . . . . . . . . . . . . . . 117 323 27. Unknown elements . . . . . . . . . . . . . . . . . . . . . . 118 324 28. Multi-planar and 3D videos . . . . . . . . . . . . . . . . . 119 325 29. Track Operation . . . . . . . . . . . . . . . . . . . . . . . 119 326 30. Matroska Element Ordering Guidelines . . . . . . . . . . . . 120 327 30.1. Top-Level Elements . . . . . . . . . . . . . . . . . . . 120 328 30.2. CRC-32 . . . . . . . . . . . . . . . . . . . . . . . . . 120 329 30.3. SeekHead . . . . . . . . . . . . . . . . . . . . . . . . 121 330 30.4. Cues (index) . . . . . . . . . . . . . . . . . . . . . . 121 331 30.5. Info . . . . . . . . . . . . . . . . . . . . . . . . . . 121 332 30.6. Chapters . . . . . . . . . . . . . . . . . . . . . . . . 121 333 30.7. Attachments . . . . . . . . . . . . . . . . . . . . . . 122 334 30.8. Tags . . . . . . . . . . . . . . . . . . . . . . . . . . 122 335 30.9. Optimum layout from a muxer . . . . . . . . . . . . . . 122 336 30.10. Optimum layout after editing tags . . . . . . . . . . . 122 337 30.11. Optimum layout with Cues at the front . . . . . . . . . 123 338 30.12. Cluster Timecode . . . . . . . . . . . . . . . . . . . . 123 339 31. CodecID . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 340 31.1. Video Codecs . . . . . . . . . . . . . . . . . . . . . . 124 341 31.2. Audio . . . . . . . . . . . . . . . . . . . . . . . . . 127 342 31.3. Subtitle . . . . . . . . . . . . . . . . . . . . . . . . 132 343 31.4. Buttons . . . . . . . . . . . . . . . . . . . . . . . . 133 344 31.5. Example 1 : basic chaptering . . . . . . . . . . . . . . 133 345 31.6. Example 2 : nested chapters . . . . . . . . . . . . . . 134 346 31.6.1. The Micronauts "Bleep To Bleep" . . . . . . . . . . 134 347 31.7. Edition and chapter flags . . . . . . . . . . . . . . . 135 348 31.7.1. Chapter flags . . . . . . . . . . . . . . . . . . . 135 349 31.7.2. Edition flags . . . . . . . . . . . . . . . . . . . 136 350 31.8. Menu features . . . . . . . . . . . . . . . . . . . . . 136 351 31.8.1. Matroska Script (0) . . . . . . . . . . . . . . . . 136 352 31.8.2. DVD menu (1) . . . . . . . . . . . . . . . . . . . . 136 353 32. Subtitles . . . . . . . . . . . . . . . . . . . . . . . . . . 138 354 33. Images Subtitles . . . . . . . . . . . . . . . . . . . . . . 139 355 34. SRT Subtitles . . . . . . . . . . . . . . . . . . . . . . . . 142 356 35. SSA/ASS Subtitles . . . . . . . . . . . . . . . . . . . . . . 142 357 36. USF Subtitles . . . . . . . . . . . . . . . . . . . . . . . . 145 358 37. WebVTT . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 359 37.1. Storage of WebVTT in Matroska . . . . . . . . . . . . . 146 360 37.1.1. CodecID: codec identification . . . . . . . . . . . 146 361 37.1.2. CodecPrivate: storage of gloal WebVTT blocks . . . . 146 362 37.1.3. Storage of non-global WebVTT blocks . . . . . . . . 146 363 37.1.4. Storage of Cues in Matroska blocks . . . . . . . . . 146 364 37.1.5. BlockAdditions: storing non-global WebVTT blocks, 365 Cue Settings Lists and Cue identifiers . . . . . . . 146 366 37.2. Examples of transformation . . . . . . . . . . . . . . . 147 367 37.2.1. Example WebVTT file . . . . . . . . . . . . . . . . 147 368 37.2.2. CodecPrivate . . . . . . . . . . . . . . . . . . . . 147 369 37.2.3. Storage of Cue 1 . . . . . . . . . . . . . . . . . . 147 370 37.2.4. Storage of Cue 2 . . . . . . . . . . . . . . . . . . 147 371 37.2.5. Storage of Cue 3 . . . . . . . . . . . . . . . . . . 147 372 37.2.6. Storage of Cue 4 . . . . . . . . . . . . . . . . . . 148 373 37.3. Storage of WebVTT in Matroska vs. WebM . . . . . . . . . 148 374 38. Tagging . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 375 38.1. Why official tags matter . . . . . . . . . . . . . . . . 148 376 38.2. Tag translations . . . . . . . . . . . . . . . . . . . . 149 377 38.3. Tag Formatting . . . . . . . . . . . . . . . . . . . . . 149 378 38.4. Target types . . . . . . . . . . . . . . . . . . . . . . 150 379 38.5. Official tags . . . . . . . . . . . . . . . . . . . . . 150 380 38.6. Notes . . . . . . . . . . . . . . . . . . . . . . . . . 150 381 39. Attachments . . . . . . . . . . . . . . . . . . . . . . . . . 151 382 39.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 151 383 39.2. Cover Art . . . . . . . . . . . . . . . . . . . . . . . 151 384 39.3. Font files . . . . . . . . . . . . . . . . . . . . . . . 152 385 40. Matroska Streaming . . . . . . . . . . . . . . . . . . . . . 152 386 41. File Access . . . . . . . . . . . . . . . . . . . . . . . . . 152 387 42. Live Streaming . . . . . . . . . . . . . . . . . . . . . . . 152 388 43. Menu Specifications . . . . . . . . . . . . . . . . . . . . . 153 389 44. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 153 390 45. Requirements . . . . . . . . . . . . . . . . . . . . . . . . 153 391 45.1. Highlights/Hotspots . . . . . . . . . . . . . . . . . . 153 392 45.2. Playback features . . . . . . . . . . . . . . . . . . . 154 393 45.3. Player requirements . . . . . . . . . . . . . . . . . . 155 394 46. Working Graph . . . . . . . . . . . . . . . . . . . . . . . . 155 395 47. Ideas . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 396 48. Data Structure . . . . . . . . . . . . . . . . . . . . . . . 155 397 49.1. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 155 398 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 159 400 1. Introduction 402 Matroska aims to become THE standard of multimedia container formats. 403 It was derived from a project called MCF [1], but differentiates from 404 it significantly because it is based on EBML [2] (Extensible Binary 405 Meta Language), a binary derivative of XML. EBML enables significant 406 advantages in terms of future format extensibility, without breaking 407 file support in old parsers. 409 First, it is essential to clarify exactly "What an Audio/Video 410 container is", to avoid any misunderstandings: 412 o It is NOT a video or audio compression format (codec) 414 o It is an envelope for which there can be many audio, video and 415 subtitles streams, allowing the user to store a complete movie or 416 CD in a single file. 418 Matroska is designed with the future in mind. It incorporates 419 features like: 421 o Fast seeking in the file 423 o Chapter entries 425 o Full metadata (tags) support 427 o Selectable subtitle/audio/video streams 429 o Modularly expandable 431 o Error resilience (can recover playback even when the stream is 432 damaged) 434 o Streamable over the internet and local networks (HTTP, CIFS, FTP, 435 etc) 437 o Menus (like DVDs have) 439 Matroska is an open standards project. This means for personal use 440 it is absolutely free to use and that the technical specifications 441 describing the bitstream are open to everybody, even to companies 442 that would like to support it in their products. 444 2. Status of this document 446 This document is a work-in-progress specification defining the 447 Matroska file format as part of the IETF Cellar working group [3]. 448 But since it's quite complete it is used as a reference for the 449 development of libmatroska. Legacy versions of the specification can 450 be found here [4] (PDF doc by Alexander Noe -- outdated). 452 For a simplified diagram of the layout of a Matroska file, see the 453 Diagram page [5]. 455 A more refined and detailed version of the EBML specifications is 456 being worked on here [6]. 458 The table found below is now generated from the "source" of the 459 Matroska specification. This XML file [7] is also used to generate 460 the semantic data used in libmatroska and libmatroska2. We encourage 461 anyone to use and monitor its changes so your code is spec-proof and 462 always up to date. 464 Note that versions 1, 2 and 3 have been finalized. Version 4 is 465 currently work in progress. There MAY be further additions to v4. 467 3. Security Considerations 469 Matroska inherits security considerations from EBML. Other security 470 considerations are to be determined. 472 4. IANA Considerations 474 To be determined. 476 5. Notations and Conventions 478 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 479 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 480 document are to be interpreted as described in RFC 2119 [8]. 482 6. Basis in EBML 484 Matroska is a Document Type of EBML (Extensible Binary Meta 485 Language). This specification is dependent on the EBML Specification 486 [9]. For an understanding of Matroska's EBML Schema, see in 487 particular the sections of the EBML Specification covering EBML 488 Element Types [10], EBML Schema [11], and EBML Structure [12]. 490 6.1. Added Constaints on EBML 492 As an EBML Document Type, Matroska adds the following constraints to 493 the EBML specification. 495 o The "docType" of the "EBML Header" MUST be 'matroska'. 497 o The "EBMLMaxIDLength" of the "EBML Header" MUST be "4". 499 o The "EBMLMaxSizeLength" of the "EBML Header" MUST be "8" or less. 501 6.2. Matroska Design 503 All top-levels elements (Segment and direct sub-elements) are coded 504 on 4 octets, i.e. class D elements. 506 6.2.1. Language Codes 508 Language codes can be either the 3 letters bibliographic ISO-639-2 509 [13] form (like "fre" for french), or such a language code followed 510 by a dash and a country code for specialities in languages (like 511 "fre-ca" for Canadian French). Country codes are the same as used 512 for internet domains [14]. 514 6.2.2. Physical Types 516 Each level can have different meanings for audio and video. The 517 ORIGINAL_MEDIUM tag can be used to specify a string for 518 ChapterPhysicalEquiv = 60. Here is the list of possible levels for 519 both audio and video : 521 +----------------------+--------------+-----------+-----------------+ 522 | ChapterPhysicalEquiv | Audio | Video | Comment | 523 +----------------------+--------------+-----------+-----------------+ 524 | 70 | SET / | SET / | the collection | 525 | | PACKAGE | PACKAGE | of different | 526 | | | | media | 527 | 60 | CD / 12" / | DVD / VHS | the physical | 528 | | 10" / 7" / | / | medium like a | 529 | | TAPE / | LASERDISC | CD or a DVD | 530 | | MINIDISC / | | | 531 | | DAT | | | 532 | 50 | SIDE | SIDE | when the | 533 | | | | original medium | 534 | | | | (LP/DVD) has | 535 | | | | different sides | 536 | 40 | - | LAYER | another | 537 | | | | physical level | 538 | | | | on DVDs | 539 | 30 | SESSION | SESSION | as found on CDs | 540 | | | | and DVDs | 541 | 20 | TRACK | - | as found on | 542 | | | | audio CDs | 543 | 10 | INDEX | - | the first | 544 | | | | logical level | 545 | | | | of the | 546 | | | | side/medium | 547 +----------------------+--------------+-----------+-----------------+ 549 6.2.3. Block Structure 551 Size = 1 + (1-8) + 4 + (4 + (4)) octets. So from 6 to 21 octets. 553 Bit 0 is the most significant bit. 555 Frames using references SHOULD be stored in "coding order". That 556 means the references first and then the frames referencing them. A 557 consequence is that timecodes MAY NOT be consecutive. But a frame 558 with a past timecode MUST reference a frame already known, otherwise 559 it's considered bad/void. 561 There can be many Blocks in a BlockGroup provided they all have the 562 same timecode. It is used with different parts of a frame with 563 different priorities. 565 6.2.3.1. Block Header 567 +--------+--------+-------------------------------------------------+ 568 | Offset | Player | Description | 569 +--------+--------+-------------------------------------------------+ 570 | 0x00+ | MUST | Track Number (Track Entry). It is coded in EBML | 571 | | | like form (1 octet if the value is < 0x80, 2 if | 572 | | | < 0x4000, etc) (most significant bits set to | 573 | | | increase the range). | 574 | 0x01+ | MUST | Timecode (relative to Cluster timecode, signed | 575 | | | int16) | 576 +--------+--------+-------------------------------------------------+ 578 6.2.3.2. Block Header Flags 580 +--------+-----+--------+-------------------------------------------+ 581 | Offset | Bit | Player | Description | 582 +--------+-----+--------+-------------------------------------------+ 583 | 0x03+ | 0-3 | - | Reserved, set to 0 | 584 | 0x03+ | 4 | - | Invisible, the codec SHOULD decode this | 585 | | | | frame but not display it | 586 | 0x03+ | 5-6 | MUST | Lacing | 587 | | | | * 00 : no lacing | 588 | | | | * 01 : Xiph lacing | 589 | | | | * 11 : EBML lacing | 590 | | | | * 10 : fixed-size lacing | 591 | 0x03+ | 7 | - | not used | 592 +--------+-----+--------+-------------------------------------------+ 594 6.2.3.3. Laced Data 596 When lacing bit is set. 598 +--------+--------+-------------------------------------------------+ 599 | Offset | Player | Description | 600 +--------+--------+-------------------------------------------------+ 601 | 0x00 | MUST | Number of frames in the lace-1 (uint8) | 602 | 0x01 / | MUST* | Lace-coded size of each frame of the lace, | 603 | 0xXX | | except for the last one (multiple uint8). *This | 604 | | | is not used with Fixed-size lacing as it is | 605 | | | calculated automatically from (total size of | 606 | | | lace) / (number of frames in lace). | 607 +--------+--------+-------------------------------------------------+ 609 For (possibly) Laced Data 610 +--------+--------+--------------------------+ 611 | Offset | Player | Description | 612 +--------+--------+--------------------------+ 613 | 0x00 | MUST | Consecutive laced frames | 614 +--------+--------+--------------------------+ 616 6.2.4. Lacing 618 Lacing is a mechanism to save space when storing data. It is 619 typically used for small blocks of data (refered to as frames in 620 matroska). There are 3 types of lacing : the Xiph one inspired by 621 what is found in the Ogg container, the EBML one which is the same 622 with sizes coded differently and the fixed-size one where the size is 623 not coded. As an example is better than words... 625 Let's say you want to store 3 frames of the same track. The first 626 frame is 800 octets long, the second is 500 octets long and the third 627 is 1000 octets long. As these data are small, you can store them in 628 a lace to save space. They will then be solved in the same block as 629 follows: 631 6.2.4.1. Xiph lacing 633 o Block head (with lacing bits set to 01) 635 o Lacing head: Number of frames in the lace -1, i.e. 2 (the 800 and 636 500 octets one) 638 o Lacing sizes: only the 2 first ones will be coded, 800 gives 639 255;255;255;35, 500 gives 255;245. The size of the last frame is 640 deduced from the total size of the Block. 642 o Data in frame 1 644 o Data in frame 2 646 o Data in frame 3 648 A frame with a size multiple of 255 is coded with a 0 at the end of 649 the size, for example 765 is coded 255;255;255;0. 651 6.2.4.2. EBML lacing 653 In this case the size is not coded as blocks of 255 bytes, but as a 654 difference with the previous size and this size is coded as in EBML. 655 The first size in the lace is unsigned as in EBML. The others use a 656 range shifting to get a sign on each value : 658 +----------------------------------+--------------------------------+ 659 | Bit Representation | Value | 660 +----------------------------------+--------------------------------+ 661 | 1xxx xxxx | value -(2^6-1) to 2^6-1 (ie 0 | 662 | | to 2^7-2 minus 2^6-1, half of | 663 | | the range) | 664 | 01xx xxxx xxxx xxxx | value -(2^13-1) to 2^13-1 | 665 | 001x xxxx xxxx xxxx xxxx xxxx | value -(2^20-1) to 2^20-1 | 666 | 0001 xxxx xxxx xxxx xxxx xxxx | value -(2^27-1) to 2^27-1 | 667 | xxxx xxxx | | 668 | 0000 1xxx xxxx xxxx xxxx xxxx | value -(2^34-1) to 2^34-1 | 669 | xxxx xxxx xxxx xxxx | | 670 | 0000 01xx xxxx xxxx xxxx xxxx | value -(2^41-1) to 2^41-1 | 671 | xxxx xxxx xxxx xxxx xxxx xxxx | | 672 | 0000 001x xxxx xxxx xxxx xxxx | value -(2^48-1) to 2^48-1 | 673 | xxxx xxxx xxxx xxxx xxxx xxxx | | 674 | xxxx xxxx | | 675 +----------------------------------+--------------------------------+ 677 o Block head (with lacing bits set to 11) 679 o Lacing head: Number of frames in the lace -1, i.e. 2 (the 800 and 680 400 octets one) 682 o Lacing sizes: only the 2 first ones will be coded, 800 gives 0x320 683 0x4000 = 0x4320, 500 is coded as -300 : - 0x12C + 0x1FFF + 0x4000 684 = 0x5ED3. The size of the last frame is deduced from the total 685 size of the Block. 687 o Data in frame 1 689 o Data in frame 2 691 o Data in frame 3 693 6.2.4.3. Fixed-size lacing 695 In this case only the number of frames in the lace is saved, the size 696 of each frame is deduced from the total size of the Block. For 697 example, for 3 frames of 800 octets each : 699 o Block head (with lacing bits set to 10) 701 o Lacing head: Number of frames in the lace -1, i.e. 2 703 o Data in frame 1 705 o Data in frame 2 706 o Data in frame 3 708 6.2.4.4. SimpleBlock Structure 710 The SimpleBlock is very inspired by the [Block 711 structure](({{site.baseurl}}/index.html#block-structure). The main 712 differences are the added Keyframe flag and Discardable flag. 713 Otherwise everything is the same. 715 Size = 1 + (1-8) + 4 + (4 + (4)) octets. So from 6 to 21 octets. 717 Bit 0 is the most significant bit. 719 Frames using references SHOULD be stored in "coding order". That 720 means the references first and then the frames referencing them. A 721 consequence is that timecodes MAY NOT be consecutive. But a frame 722 with a past timecode MUST reference a frame already known, otherwise 723 it's considered bad/void. 725 There can be many Blocks in a BlockGroup provided they all have the 726 same timecode. It is used with different parts of a frame with 727 different priorities. 729 6.2.4.4.1. SimpleBlock Header 731 +--------+--------+-------------------------------------------------+ 732 | Offset | Player | Description | 733 +--------+--------+-------------------------------------------------+ 734 | 0x00+ | MUST | Track Number (Track Entry). It is coded in EBML | 735 | | | like form (1 octet if the value is < 0x80, 2 if | 736 | | | < 0x4000, etc) (most significant bits set to | 737 | | | increase the range). | 738 | 0x01+ | MUST | Timecode (relative to Cluster timecode, signed | 739 | | | int16) | 740 +--------+--------+-------------------------------------------------+ 742 6.2.4.4.2. SimpleBlock Header Flags 743 +--------+-----+--------+-------------------------------------------+ 744 | Offset | Bit | Player | Description | 745 +--------+-----+--------+-------------------------------------------+ 746 | 0x03+ | 0 | - | Keyframe, set when the Block contains | 747 | | | | only keyframes | 748 | 0x03+ | 1-3 | - | Reserved, set to 0 | 749 | 0x03+ | 4 | - | Invisible, the codec SHOULD decode this | 750 | | | | frame but not display it | 751 | 0x03+ | 5-6 | MUST | Lacing | 752 | | | | * 00 : no lacing | 753 | | | | * 01 : Xiph lacing | 754 | | | | * 11 : EBML lacing | 755 | | | | * 10 : fixed-size lacing | 756 | 0x03+ | 7 | - | Discardable, the frames of the Block can | 757 | | | | be discarded during playing if needed | 758 +--------+-----+--------+-------------------------------------------+ 760 6.2.4.5. Laced Data 762 When lacing bit is set. 764 +--------+--------+-------------------------------------------------+ 765 | Offset | Player | Description | 766 +--------+--------+-------------------------------------------------+ 767 | 0x00 | MUST | Number of frames in the lace-1 (uint8) | 768 | 0x01 / | MUST* | Lace-coded size of each frame of the lace, | 769 | 0xXX | | except for the last one (multiple uint8). *This | 770 | | | is not used with Fixed-size lacing as it is | 771 | | | calculated automatically from (total size of | 772 | | | lace) / (number of frames in lace). | 773 +--------+--------+-------------------------------------------------+ 775 For (possibly) Laced Data 777 +--------+--------+--------------------------+ 778 | Offset | Player | Description | 779 +--------+--------+--------------------------+ 780 | 0x00 | MUST | Consecutive laced frames | 781 +--------+--------+--------------------------+ 783 6.2.4.6. EncryptedBlock Structure 785 The EncryptedBlock is very inspired by the [SimpleBlock 786 structure](({{site.baseurl}}/index.html#simpleblock_structure). The 787 main differences is that the raw data are Transformed. That means 788 the data after the lacing definition (if present) have been processed 789 before put into the Block. The laced sizes apply on the decoded 790 (Inverse Transform) data. This size of the Transformed data MAY NOT 791 match the size of the initial chunk of data. 793 The other difference is that the number of frames in the lace are not 794 saved if "no lacing" is specified (bits 5 and 6 set to 0). 796 The Transformation is specified by a TransformID in the Block (MUST 797 be the same for all frames within the EncryptedBlock). 799 Size = 1 + (1-8) + 4 + (4 + (4)) octets. So from 6 to 21 octets. 801 Bit 0 is the most significant bit. 803 Frames using references SHOULD be stored in "coding order". That 804 means the references first and then the frames referencing them. A 805 consequence is that timecodes MAY NOT be consecutive. But a frame 806 with a past timecode MUST reference a frame already known, otherwise 807 it's considered bad/void. 809 There can be many Blocks in a BlockGroup provided they all have the 810 same timecode. It is used with different parts of a frame with 811 different priorities. 813 | EncryptedBlock Header | | Offset | Player | Description | | 0x00+ | 814 MUST | Track Number (Track Entry). It is coded in EBML like form (1 815 octet if the value is < 0x80, 2 if < 0x4000, etc) (most significant 816 bits set to increase the range). | | 0x01+ | MUST | Timecode 817 (relative to Cluster timecode, signed int16) | | 0x03+ | - | 819 | Flags | | Bit | Player | Description | | 0 | - | Keyframe, set when 820 the Block contains only keyframes | | 1-3 | - | Reserved, set to 821 0 | | 4 | - | Invisible, the codec SHOULD decode this frame but not 822 display it | | 5-6 | MUST | Lacing 824 o 00 : no lacing 826 o 01 : Xiph lacing 828 o 11 : EBML lacing 830 o 10 : fixed-size lacing 832 | | 7 | - | Discardable, the frames of the Block can be discarded 833 during playing if needed | 835 | | Lace (when lacing bit is set) | | 0x00 | MUST* | Number of frames 836 in the lace-1 (uint8) _Only available if bit 5 or bit 6 of the 837 EncryptedBlock flag is set to one. | | 0x01 / 0xXX | MUST_ | Lace- 838 coded size of each frame of the lace, except for the last one 839 (multiple uint8). *This is not used with Fixed-size lacing as it is 840 calculated automatically from (total size of lace) / (number of 841 frames in lace). | | (possibly) Laced Data | | 0x00 | MUST | 842 TransformID (EBML coded integer value). Value 0 = Null Transform | | 843 0x01+ | MUST | Consecutive laced frames | 845 6.2.4.7. Virtual Block 847 The data in matroska is stored in coding order. But that means if 848 you seek to a particular point and a frame has been referenced far 849 away, you won't know while playing and you might miss this frame 850 (true for independent frames and overlapping of dependent frames). 851 So the idea is to have a placeholder for the original frame in the 852 timecode (display) order. 854 The structure is a scaled down version of the normal Block [15]. 856 | Virtual Block Header | | Offset | Player | Description | | 0x00+ | 857 MUST | Track Number (Track Entry). It is coded in EBML like form (1 858 octet if the value is < 0x80, 2 if < 0x4000, etc) (most significant 859 bits set to increase the range). | | 0x01+ | MUST | Timecode 860 (relative to Cluster timecode, signed int16) | | 0x03+ | - | 862 | Flags | | Bit | Player | Description | | 7-0 | - | Reserved, set to 863 0 | 865 | 867 7. Matroska Schema 869 This specification includes an "EBML Schema" which defines the 870 Elements and structure of Matroska as an EBML Document Type. The 871 EBML Schema defines every valid Matroska element in a manner defined 872 by the EBML specification. 874 7.1. Matroska Additions to Schema Element Attributes 876 In addition to the EBML Schema definition provided by the EBML 877 Specification, Matroska adds the following additional attributes: 879 +-----------+----------+--------------------------------------------+ 880 | attribute | required | definition | 881 | name | | | 882 +-----------+----------+--------------------------------------------+ 883 | webm | No | A boolean to express if the Matroska | 884 | | | Element is also supported within version 2 | 885 | | | of the "webm" specification. Please | 886 | | | consider the webm specification [16] as | 887 | | | the authoritative on "webm". | 888 +-----------+----------+--------------------------------------------+ 890 7.2. Matroska Schema 892 Here the definition of each Matroska Element is provided. 894 % concatenate with Matroska EBML Schema converted to markdown % 896 7.2.1. Segment Element 898 name: "Segment" 900 path: "1*1(\Segment)" 902 id: "0x18538067" 904 minOccurs: "1" 906 type: "master" 908 minver: "1" 910 documentation: The Root Element that contains all other Top-Level 911 Elements (Elements defined only at Level 1). A Matroska file is 912 composed of 1 Segment. 914 7.2.2. SeekHead Element 916 name: "SeekHead" 918 path: "0*2(\Segment\SeekHead)" 920 id: "0x114D9B74" 922 maxOccurs: "2" 924 type: "master" 926 minver: "1" 927 documentation: Contains the position of other Top-Level Elements. 929 7.2.3. Seek Element 931 name: "Seek" 933 path: "1*(\Segment\SeekHead\Seek)" 935 id: "0x4DBB" 937 minOccurs: "1" 939 maxOccurs: "unbounded" 941 type: "master" 943 minver: "1" 945 documentation: Contains a single seek entry to an EBML Element. 947 7.2.4. SeekID Element 949 name: "SeekID" 951 path: "1*1(\Segment\SeekHead\Seek\SeekID)" 953 id: "0x53AB" 955 minOccurs: "1" 957 type: "binary" 959 minver: "1" 961 documentation: The binary ID corresponding to the Element name. 963 7.2.5. SeekPosition Element 965 name: "SeekPosition" 967 path: "1*1(\Segment\SeekHead\Seek\SeekPosition)" 969 id: "0x53AC" 971 minOccurs: "1" 973 type: "uinteger" 974 minver: "1" 976 documentation: The position of the Element in the Segment in octets 977 (0 = first level 1 Element). 979 7.2.6. Info Element 981 name: "Info" 983 path: "1*(\Segment\Info)" 985 id: "0x1549A966" 987 minOccurs: "1" 989 maxOccurs: "unbounded" 991 type: "master" 993 minver: "1" 995 definition: Contains general information about the Segment. 997 7.2.7. SegmentUID Element 999 name: "SegmentUID" 1001 path: "0*1(\Segment\Info\SegmentUID)" 1003 id: "0x73A4" 1005 range: "not 0" 1007 size: "16" 1009 type: "binary" 1011 minver: "1" 1013 definition: A randomly generated unique ID to identify the Segment 1014 amongst many others (128 bits). 1016 usage notes: If the Segment is a part of a Linked Segment then this 1017 Element is REQUIRED. 1019 7.2.8. SegmentFilename Element 1021 name: "SegmentFilename" 1023 path: "0*1(\Segment\Info\SegmentFilename)" 1025 id: "0x7384" 1027 type: "utf-8" 1029 minver: "1" 1031 definition: A filename corresponding to this Segment. 1033 7.2.9. PrevUID Element 1035 name: "PrevUID" 1037 path: "0*1(\Segment\Info\PrevUID)" 1039 id: "0x3CB923" 1041 size: "16" 1043 type: "binary" 1045 minver: "1" 1047 definition: A unique ID to identify the previous Segment of a Linked 1048 Segment (128 bits). 1050 usage notes: If the Segment is a part of a Linked Segment that uses 1051 Hard Linking then either the PrevUID or the NextUID Element is 1052 REQUIRED. If a Segment contains a PrevUID but not a NextUID then it 1053 MAY be considered as the last Segment of the Linked Segment. The 1054 PrevUID MUST NOT be equal to the SegmentUID. 1056 7.2.10. PrevFilename Element 1058 name: "PrevFilename" 1060 path: "0*1(\Segment\Info\PrevFilename)" 1062 id: "0x3C83AB" 1064 type: "utf-8" 1066 minver: "1" 1067 definition: A filename corresponding to the file of the previous 1068 Linked Segment. 1070 usage notes: Provision of the previous filename is for display 1071 convenience, but PrevUID SHOULD be considered authoritative for 1072 identifying the previous Segment in a Linked Segment. 1074 7.2.11. NextUID Element 1076 name: "NextUID" 1078 path: "0*1(\Segment\Info\NextUID)" 1080 id: "0x3EB923" 1082 size: "16" 1084 type: "binary" 1086 minver: "1" 1088 definition: A unique ID to identify the next Segment of a Linked 1089 Segment (128 bits). 1091 usage notes: If the Segment is a part of a Linked Segment that uses 1092 Hard Linking then either the PrevUID or the NextUID Element is 1093 REQUIRED. If a Segment contains a NextUID but not a PrevUID then it 1094 MAY be considered as the first Segment of the Linked Segment. The 1095 NextUID MUST NOT be equal to the SegmentUID. 1097 7.2.12. NextFilename Element 1099 name: "NextFilename" 1101 path: "0*1(\Segment\Info\NextFilename)" 1103 id: "0x3E83BB" 1105 type: "utf-8" 1107 minver: "1" 1109 definition: A filename corresponding to the file of the next Linked 1110 Segment. 1112 usage notes: Provision of the next filename is for display 1113 convenience, but NextUID SHOULD be considered authoritative for 1114 identifying the Next Segment. 1116 7.2.13. SegmentFamily Element 1118 name: "SegmentFamily" 1120 path: "0*(\Segment\Info\SegmentFamily)" 1122 id: "0x4444" 1124 maxOccurs: "unbounded" 1126 size: "16" 1128 type: "binary" 1130 minver: "1" 1132 definition: A randomly generated unique ID that all Segments of a 1133 Linked Segment MUST share (128 bits). 1135 usage notes: If the Segment is a part of a Linked Segment that uses 1136 Soft Linking then this Element is REQUIRED. 1138 7.2.14. ChapterTranslate Element 1140 name: "ChapterTranslate" 1142 path: "0*(\Segment\Info\ChapterTranslate)" 1144 id: "0x6924" 1146 maxOccurs: "unbounded" 1148 type: "master" 1150 minver: "1" 1152 documentation: A tuple of corresponding ID used by chapter codecs to 1153 represent this Segment. 1155 7.2.15. ChapterTranslateEditionUID Element 1157 name: "ChapterTranslateEditionUID" 1159 path: "0*(\Segment\Info\ChapterTranslate\ChapterTranslateEditionUID)" 1161 id: "0x69FC" 1163 maxOccurs: "unbounded" 1164 type: "uinteger" 1166 minver: "1" 1168 documentation: Specify an edition UID on which this correspondance 1169 applies. When not specified, it means for all editions found in the 1170 Segment. 1172 7.2.16. ChapterTranslateCodec Element 1174 name: "ChapterTranslateCodec" 1176 path: "1*1(\Segment\Info\ChapterTranslate\ChapterTranslateCodec)" 1178 id: "0x69BF" 1180 minOccurs: "1" 1182 type: "uinteger" 1184 minver: "1" 1186 documentation: The chapter codec using this ID (0: Matroska Script, 1187 1: DVD-menu). 1189 7.2.17. ChapterTranslateID Element 1191 name: "ChapterTranslateID" 1193 path: "1*1(\Segment\Info\ChapterTranslate\ChapterTranslateID)" 1195 id: "0x69A5" 1197 minOccurs: "1" 1199 type: "binary" 1201 minver: "1" 1203 documentation: The binary value used to represent this Segment in the 1204 chapter codec data. The format depends on the ChapProcessCodecID 1205 used. 1207 7.2.18. TimecodeScale Element 1209 name: "TimecodeScale" 1211 path: "1*1(\Segment\Info\TimecodeScale)" 1212 id: "0x2AD7B1" 1214 minOccurs: "1" 1216 default: "1000000" 1218 type: "uinteger" 1220 minver: "1" 1222 documentation: Timestamp scale in nanoseconds (1.000.000 means all 1223 timestamps in the Segment are expressed in milliseconds). 1225 7.2.19. Duration Element 1227 name: "Duration" 1229 path: "0*1(\Segment\Info\Duration)" 1231 id: "0x4489" 1233 range: "> 0x0p+0" 1235 type: "float" 1237 minver: "1" 1239 definition: Duration of the Segment in nanoseconds based on 1240 TimecodeScale. 1242 7.2.20. DateUTC Element 1244 name: "DateUTC" 1246 path: "0*1(\Segment\Info\DateUTC)" 1248 id: "0x4461" 1250 type: "date" 1252 minver: "1" 1254 documentation: The date and time that the Segment was created by the 1255 muxing application or library. 1257 7.2.21. Title Element 1259 name: "Title" 1261 path: "0*1(\Segment\Info\Title)" 1263 id: "0x7BA9" 1265 type: "utf-8" 1267 minver: "1" 1269 documentation: General name of the Segment. 1271 7.2.22. MuxingApp Element 1273 name: "MuxingApp" 1275 path: "1*1(\Segment\Info\MuxingApp)" 1277 id: "0x4D80" 1279 minOccurs: "1" 1281 type: "utf-8" 1283 minver: "1" 1285 definition: Muxing application or library (example: "libmatroska- 1286 0.4.3"). 1288 usage notes: Include the full name of the application or library 1289 followed by the version number. 1291 7.2.23. WritingApp Element 1293 name: "WritingApp" 1295 path: "1*1(\Segment\Info\WritingApp)" 1297 id: "0x5741" 1299 minOccurs: "1" 1301 type: "utf-8" 1303 minver: "1" 1304 definition: Writing application (example: "mkvmerge-0.3.3"). 1306 usage notes: Include the full name of the application followed by the 1307 version number. 1309 7.2.24. Cluster Element 1311 name: "Cluster" 1313 path: "0*(\Segment\Cluster)" 1315 id: "0x1F43B675" 1317 maxOccurs: "unbounded" 1319 type: "master" 1321 minver: "1" 1323 documentation: The Top-Level Element containing the (monolithic) 1324 Block structure. 1326 7.2.25. Timecode Element 1328 name: "Timecode" 1330 path: "1*1(\Segment\Cluster\Timecode)" 1332 id: "0xE7" 1334 minOccurs: "1" 1336 type: "uinteger" 1338 minver: "1" 1340 documentation: Absolute timestamp of the cluster (based on 1341 TimecodeScale). 1343 7.2.26. SilentTracks Element 1345 name: "SilentTracks" 1347 path: "0*1(\Segment\Cluster\SilentTracks)" 1349 id: "0x5854" 1351 type: "master" 1352 minver: "1" 1354 documentation: The list of tracks that are not used in that part of 1355 the stream. It is useful when using overlay tracks on seeking or to 1356 decide what track to use. 1358 7.2.27. SilentTrackNumber Element 1360 name: "SilentTrackNumber" 1362 path: "0*(\Segment\Cluster\SilentTracks\SilentTrackNumber)" 1364 id: "0x58D7" 1366 maxOccurs: "unbounded" 1368 type: "uinteger" 1370 minver: "1" 1372 documentation: One of the track number that are not used from now on 1373 in the stream. It could change later if not specified as silent in a 1374 further Cluster. 1376 7.2.28. Position Element 1378 name: "Position" 1380 path: "0*1(\Segment\Cluster\Position)" 1382 id: "0xA7" 1384 type: "uinteger" 1386 minver: "1" 1388 documentation: The Position of the Cluster in the Segment (0 in live 1389 broadcast streams). It might help to resynchronise offset on damaged 1390 streams. 1392 7.2.29. PrevSize Element 1394 name: "PrevSize" 1396 path: "0*1(\Segment\Cluster\PrevSize)" 1398 id: "0xAB" 1399 type: "uinteger" 1401 minver: "1" 1403 documentation: Size of the previous Cluster, in octets. Can be 1404 useful for backward playing. 1406 7.2.30. SimpleBlock Element 1408 name: "SimpleBlock" 1410 path: "0*(\Segment\Cluster\SimpleBlock)" 1412 id: "0xA3" 1414 maxOccurs: "unbounded" 1416 type: "binary" 1418 minver: "2" 1420 documentation: Similar to Block but without all the extra 1421 information, mostly used to reduced overhead when no extra feature is 1422 needed. (see SimpleBlock Structure) 1424 7.2.31. BlockGroup Element 1426 name: "BlockGroup" 1428 path: "0*(\Segment\Cluster\BlockGroup)" 1430 id: "0xA0" 1432 maxOccurs: "unbounded" 1434 type: "master" 1436 minver: "1" 1438 documentation: Basic container of information containing a single 1439 Block or BlockVirtual, and information specific to that Block/ 1440 VirtualBlock. 1442 7.2.32. Block Element 1444 name: "Block" 1446 path: "1*1(\Segment\Cluster\BlockGroup\Block)" 1447 id: "0xA1" 1449 minOccurs: "1" 1451 type: "binary" 1453 minver: "1" 1455 documentation: Block containing the actual data to be rendered and a 1456 timestamp relative to the Cluster Timecode. (see Block Structure) 1458 7.2.33. BlockVirtual Element 1460 name: "BlockVirtual" 1462 path: "0*1(\Segment\Cluster\BlockGroup\BlockVirtual)" 1464 id: "0xA2" 1466 type: "binary" 1468 minver: "0" 1470 maxver: "0" 1472 documentation: A Block with no data. It MUST be stored in the stream 1473 at the place the real Block would be in display order. (see Block 1474 Virtual) 1476 7.2.34. BlockAdditions Element 1478 name: "BlockAdditions" 1480 path: "0*1(\Segment\Cluster\BlockGroup\BlockAdditions)" 1482 id: "0x75A1" 1484 type: "master" 1486 minver: "1" 1488 documentation: Contain additional blocks to complete the main one. 1489 An EBML parser that has no knowledge of the Block structure could 1490 still see and use/skip these data. 1492 7.2.35. BlockMore Element 1494 name: "BlockMore" 1496 path: "1*(\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore)" 1498 id: "0xA6" 1500 minOccurs: "1" 1502 maxOccurs: "unbounded" 1504 type: "master" 1506 minver: "1" 1508 documentation: Contain the BlockAdditional and some parameters. 1510 7.2.36. BlockAddID Element 1512 name: "BlockAddID" 1514 path: "1*1(\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\Block 1515 AddID)" 1517 id: "0xEE" 1519 minOccurs: "1" 1521 range: "not 0" 1523 default: "1" 1525 type: "uinteger" 1527 minver: "1" 1529 documentation: An ID to identify the BlockAdditional level. 1531 7.2.37. BlockAdditional Element 1533 name: "BlockAdditional" 1535 path: "1*1(\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\Block 1536 Additional)" 1538 id: "0xA5" 1539 minOccurs: "1" 1541 type: "binary" 1543 minver: "1" 1545 documentation: Interpreted by the codec as it wishes (using the 1546 BlockAddID). 1548 7.2.38. BlockDuration Element 1550 name: "BlockDuration" 1552 path: "0*1(\Segment\Cluster\BlockGroup\BlockDuration)" 1554 id: "0x9B" 1556 default: "DefaultDuration" 1558 type: "uinteger" 1560 minver: "1" 1562 documentation: The duration of the Block (based on TimecodeScale). 1563 This Element is mandatory when DefaultDuration is set for the track 1564 (but can be omitted as other default values). When not written and 1565 with no DefaultDuration, the value is assumed to be the difference 1566 between the timestamp of this Block and the timestamp of the next 1567 Block in "display" order (not coding order). This Element can be 1568 useful at the end of a Track (as there is not other Block available), 1569 or when there is a break in a track like for subtitle tracks. When 1570 set to 0 that means the frame is not a keyframe. 1572 7.2.39. ReferencePriority Element 1574 name: "ReferencePriority" 1576 path: "1*1(\Segment\Cluster\BlockGroup\ReferencePriority)" 1578 id: "0xFA" 1580 minOccurs: "1" 1582 default: "0" 1584 type: "uinteger" 1586 minver: "1" 1587 documentation: This frame is referenced and has the specified cache 1588 priority. In cache only a frame of the same or higher priority can 1589 replace this frame. A value of 0 means the frame is not referenced. 1591 7.2.40. ReferenceBlock Element 1593 name: "ReferenceBlock" 1595 path: "0*(\Segment\Cluster\BlockGroup\ReferenceBlock)" 1597 id: "0xFB" 1599 maxOccurs: "unbounded" 1601 type: "integer" 1603 minver: "1" 1605 documentation: Timestamp of another frame used as a reference (ie: B 1606 or P frame). The timestamp is relative to the block it's attached 1607 to. 1609 7.2.41. ReferenceVirtual Element 1611 name: "ReferenceVirtual" 1613 path: "0*1(\Segment\Cluster\BlockGroup\ReferenceVirtual)" 1615 id: "0xFD" 1617 type: "integer" 1619 minver: "0" 1621 maxver: "0" 1623 documentation: Relative position of the data that would otherwise be 1624 in position of the virtual block. 1626 7.2.42. CodecState Element 1628 name: "CodecState" 1630 path: "0*1(\Segment\Cluster\BlockGroup\CodecState)" 1632 id: "0xA4" 1634 type: "binary" 1635 minver: "2" 1637 documentation: The new codec state to use. Data interpretation is 1638 private to the codec. This information SHOULD always be referenced 1639 by a seek entry. 1641 7.2.43. DiscardPadding Element 1643 name: "DiscardPadding" 1645 path: "0*1(\Segment\Cluster\BlockGroup\DiscardPadding)" 1647 id: "0x75A2" 1649 type: "integer" 1651 minver: "4" 1653 documentation: Duration in nanoseconds of the silent data added to 1654 the Block (padding at the end of the Block for positive value, at the 1655 beginning of the Block for negative value). The duration of 1656 DiscardPadding is not calculated in the duration of the TrackEntry 1657 and SHOULD be discarded during playback. 1659 7.2.44. Slices Element 1661 name: "Slices" 1663 path: "0*1(\Segment\Cluster\BlockGroup\Slices)" 1665 id: "0x8E" 1667 type: "master" 1669 minver: "1" 1671 documentation: Contains slices description. 1673 7.2.45. TimeSlice Element 1675 name: "TimeSlice" 1677 path: "0*(\Segment\Cluster\BlockGroup\Slices\TimeSlice)" 1679 id: "0xE8" 1681 maxOccurs: "unbounded" 1682 type: "master" 1684 minver: "1" 1686 documentation: Contains extra time information about the data 1687 contained in the Block. While there are a few files in the wild with 1688 this Element, it is no longer in use and has been deprecated. Being 1689 able to interpret this Element is not REQUIRED for playback. 1691 7.2.46. LaceNumber Element 1693 name: "LaceNumber" 1695 path: "0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\LaceNumber)" 1697 id: "0xCC" 1699 default: "0" 1701 type: "uinteger" 1703 minver: "1" 1705 documentation: The reverse number of the frame in the lace (0 is the 1706 last frame, 1 is the next to last, etc). While there are a few files 1707 in the wild with this Element, it is no longer in use and has been 1708 deprecated. Being able to interpret this Element is not REQUIRED for 1709 playback. 1711 7.2.47. FrameNumber Element 1713 name: "FrameNumber" 1715 path: "0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\FrameNumber)" 1717 id: "0xCD" 1719 default: "0" 1721 type: "uinteger" 1723 minver: "0" 1725 maxver: "0" 1727 documentation: The number of the frame to generate from this lace 1728 with this delay (allow you to generate many frames from the same 1729 Block/Frame). 1731 7.2.48. BlockAdditionID Element 1733 name: "BlockAdditionID" 1735 path: 1736 "0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\BlockAdditionID)" 1738 id: "0xCB" 1740 default: "0" 1742 type: "uinteger" 1744 minver: "0" 1746 maxver: "0" 1748 documentation: The ID of the BlockAdditional Element (0 is the main 1749 Block). 1751 7.2.49. Delay Element 1753 name: "Delay" 1755 path: "0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\Delay)" 1757 id: "0xCE" 1759 default: "0" 1761 type: "uinteger" 1763 minver: "0" 1765 maxver: "0" 1767 documentation: The (scaled) delay to apply to the Element. 1769 7.2.50. SliceDuration Element 1771 name: "SliceDuration" 1773 path: 1774 "0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\SliceDuration)" 1776 id: "0xCF" 1778 default: "0" 1779 type: "uinteger" 1781 minver: "0" 1783 maxver: "0" 1785 documentation: The (scaled) duration to apply to the Element. 1787 7.2.51. ReferenceFrame Element 1789 name: "ReferenceFrame" 1791 path: "0*1(\Segment\Cluster\BlockGroup\ReferenceFrame)" 1793 id: "0xC8" 1795 type: "master" 1797 minver: "0" 1799 maxver: "0" 1801 documentation: DivX trick track extenstions 1803 7.2.52. ReferenceOffset Element 1805 name: "ReferenceOffset" 1807 path: 1808 "1*1(\Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceOffset)" 1810 id: "0xC9" 1812 minOccurs: "1" 1814 type: "uinteger" 1816 minver: "0" 1818 maxver: "0" 1820 documentation: DivX trick track extenstions 1822 7.2.53. ReferenceTimeCode Element 1824 name: "ReferenceTimeCode" 1825 path: 1826 "1*1(\Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceTimeCode)" 1828 id: "0xCA" 1830 minOccurs: "1" 1832 type: "uinteger" 1834 minver: "0" 1836 maxver: "0" 1838 documentation: DivX trick track extenstions 1840 7.2.54. EncryptedBlock Element 1842 name: "EncryptedBlock" 1844 path: "0*(\Segment\Cluster\EncryptedBlock)" 1846 id: "0xAF" 1848 maxOccurs: "unbounded" 1850 type: "binary" 1852 minver: "0" 1854 maxver: "0" 1856 documentation: Similar to SimpleBlock but the data inside the Block 1857 are Transformed (encrypt and/or signed). (see EncryptedBlock 1858 Structure) 1860 7.2.55. Tracks Element 1862 name: "Tracks" 1864 path: "0*(\Segment\Tracks)" 1866 id: "0x1654AE6B" 1868 maxOccurs: "unbounded" 1870 type: "master" 1872 minver: "1" 1873 documentation: A Top-Level Element of information with many tracks 1874 described. 1876 7.2.56. TrackEntry Element 1878 name: "TrackEntry" 1880 path: "1*(\Segment\Tracks\TrackEntry)" 1882 id: "0xAE" 1884 minOccurs: "1" 1886 maxOccurs: "unbounded" 1888 type: "master" 1890 minver: "1" 1892 documentation: Describes a track with all Elements. 1894 7.2.57. TrackNumber Element 1896 name: "TrackNumber" 1898 path: "1*1(\Segment\Tracks\TrackEntry\TrackNumber)" 1900 id: "0xD7" 1902 minOccurs: "1" 1904 range: "not 0" 1906 type: "uinteger" 1908 minver: "1" 1910 documentation: The track number as used in the Block Header (using 1911 more than 127 tracks is not encouraged, though the design allows an 1912 unlimited number). 1914 7.2.58. TrackUID Element 1916 name: "TrackUID" 1918 path: "1*1(\Segment\Tracks\TrackEntry\TrackUID)" 1920 id: "0x73C5" 1921 minOccurs: "1" 1923 range: "not 0" 1925 type: "uinteger" 1927 minver: "1" 1929 documentation: A unique ID to identify the Track. This SHOULD be 1930 kept the same when making a direct stream copy of the Track to 1931 another file. 1933 7.2.59. TrackType Element 1935 name: "TrackType" 1937 path: "1*1(\Segment\Tracks\TrackEntry\TrackType)" 1939 id: "0x83" 1941 minOccurs: "1" 1943 range: "1-254" 1945 type: "uinteger" 1947 minver: "1" 1949 documentation: A set of track types coded on 8 bits (1: video, 2: 1950 audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: 1951 control). 1953 7.2.60. FlagEnabled Element 1955 name: "FlagEnabled" 1957 path: "1*1(\Segment\Tracks\TrackEntry\FlagEnabled)" 1959 id: "0xB9" 1961 minOccurs: "1" 1963 range: "0-1" 1965 default: "1" 1967 type: "uinteger" 1968 minver: "2" 1970 documentation: Set if the track is usable. (1 bit) 1972 7.2.61. FlagDefault Element 1974 name: "FlagDefault" 1976 path: "1*1(\Segment\Tracks\TrackEntry\FlagDefault)" 1978 id: "0x88" 1980 minOccurs: "1" 1982 range: "0-1" 1984 default: "1" 1986 type: "uinteger" 1988 minver: "1" 1990 documentation: Set if that track (audio, video or subs) SHOULD be 1991 active if no language found matches the user preference. (1 bit) 1993 7.2.62. FlagForced Element 1995 name: "FlagForced" 1997 path: "1*1(\Segment\Tracks\TrackEntry\FlagForced)" 1999 id: "0x55AA" 2001 minOccurs: "1" 2003 range: "0-1" 2005 default: "0" 2007 type: "uinteger" 2009 minver: "1" 2011 documentation: Set if that track MUST be active during playback. 2012 There can be many forced track for a kind (audio, video or subs), the 2013 player SHOULD select the one which language matches the user 2014 preference or the default + forced track. Overlay MAY happen between 2015 a forced and non-forced track of the same kind. (1 bit) 2017 7.2.63. FlagLacing Element 2019 name: "FlagLacing" 2021 path: "1*1(\Segment\Tracks\TrackEntry\FlagLacing)" 2023 id: "0x9C" 2025 minOccurs: "1" 2027 range: "0-1" 2029 default: "1" 2031 type: "uinteger" 2033 minver: "1" 2035 documentation: Set if the track MAY contain blocks using lacing. (1 2036 bit) 2038 7.2.64. MinCache Element 2040 name: "MinCache" 2042 path: "1*1(\Segment\Tracks\TrackEntry\MinCache)" 2044 id: "0x6DE7" 2046 minOccurs: "1" 2048 default: "0" 2050 type: "uinteger" 2052 minver: "1" 2054 documentation: The minimum number of frames a player SHOULD be able 2055 to cache during playback. If set to 0, the reference pseudo-cache 2056 system is not used. 2058 7.2.65. MaxCache Element 2060 name: "MaxCache" 2062 path: "0*1(\Segment\Tracks\TrackEntry\MaxCache)" 2064 id: "0x6DF8" 2065 type: "uinteger" 2067 minver: "1" 2069 documentation: The maximum cache size necessary to store referenced 2070 frames in and the current frame. 0 means no cache is needed. 2072 7.2.66. DefaultDuration Element 2074 name: "DefaultDuration" 2076 path: "0*1(\Segment\Tracks\TrackEntry\DefaultDuration)" 2078 id: "0x23E383" 2080 range: "not 0" 2082 type: "uinteger" 2084 minver: "1" 2086 documentation: Number of nanoseconds (not scaled via TimecodeScale) 2087 per frame ('frame' in the Matroska sense -- one Element put into a 2088 (Simple)Block). 2090 7.2.67. DefaultDecodedFieldDuration Element 2092 name: "DefaultDecodedFieldDuration" 2094 path: "0*1(\Segment\Tracks\TrackEntry\DefaultDecodedFieldDuration)" 2096 id: "0x234E7A" 2098 range: "not 0" 2100 type: "uinteger" 2102 minver: "4" 2104 documentation: The period in nanoseconds (not scaled by TimcodeScale) 2105 between two successive fields at the output of the decoding process 2106 (see the notes) 2108 7.2.68. TrackTimecodeScale Element 2110 name: "TrackTimecodeScale" 2112 path: "1*1(\Segment\Tracks\TrackEntry\TrackTimecodeScale)" 2113 id: "0x23314F" 2115 minOccurs: "1" 2117 range: "> 0x0p+0" 2119 default: "0x1p+0" 2121 type: "float" 2123 minver: "0" 2125 maxver: "0" 2127 documentation: DEPRECATED, DO NOT USE. The scale to apply on this 2128 track to work at normal speed in relation with other tracks (mostly 2129 used to adjust video speed when the audio length differs). 2131 7.2.69. TrackOffset Element 2133 name: "TrackOffset" 2135 path: "0*1(\Segment\Tracks\TrackEntry\TrackOffset)" 2137 id: "0x537F" 2139 default: "0" 2141 type: "integer" 2143 minver: "0" 2145 maxver: "0" 2147 documentation: A value to add to the Block's Timestamp. This can be 2148 used to adjust the playback offset of a track. 2150 7.2.70. MaxBlockAdditionID Element 2152 name: "MaxBlockAdditionID" 2154 path: "1*1(\Segment\Tracks\TrackEntry\MaxBlockAdditionID)" 2156 id: "0x55EE" 2158 minOccurs: "1" 2160 default: "0" 2161 type: "uinteger" 2163 minver: "1" 2165 documentation: The maximum value of BlockAddID. A value 0 means 2166 there is no BlockAdditions for this track. 2168 7.2.71. Name Element 2170 name: "Name" 2172 path: "0*1(\Segment\Tracks\TrackEntry\Name)" 2174 id: "0x536E" 2176 type: "utf-8" 2178 minver: "1" 2180 documentation: A human-readable track name. 2182 7.2.72. Language Element 2184 name: "Language" 2186 path: "0*1(\Segment\Tracks\TrackEntry\Language)" 2188 id: "0x22B59C" 2190 default: "eng" 2192 type: "string" 2194 minver: "1" 2196 documentation: Specifies the language of the track in the Matroska 2197 languages form. 2199 7.2.73. CodecID Element 2201 name: "CodecID" 2203 path: "1*1(\Segment\Tracks\TrackEntry\CodecID)" 2205 id: "0x86" 2207 minOccurs: "1" 2208 type: "string" 2210 minver: "1" 2212 documentation: An ID corresponding to the codec, see the codec page 2213 for more info. 2215 7.2.74. CodecPrivate Element 2217 name: "CodecPrivate" 2219 path: "0*1(\Segment\Tracks\TrackEntry\CodecPrivate)" 2221 id: "0x63A2" 2223 type: "binary" 2225 minver: "1" 2227 documentation: Private data only known to the codec. 2229 7.2.75. CodecName Element 2231 name: "CodecName" 2233 path: "0*1(\Segment\Tracks\TrackEntry\CodecName)" 2235 id: "0x258688" 2237 type: "utf-8" 2239 minver: "1" 2241 documentation: A human-readable string specifying the codec. 2243 7.2.76. AttachmentLink Element 2245 name: "AttachmentLink" 2247 path: "0*1(\Segment\Tracks\TrackEntry\AttachmentLink)" 2249 id: "0x7446" 2251 range: "not 0" 2253 type: "uinteger" 2255 minver: "1" 2256 documentation: The UID of an attachment that is used by this codec. 2258 7.2.77. CodecSettings Element 2260 name: "CodecSettings" 2262 path: "0*1(\Segment\Tracks\TrackEntry\CodecSettings)" 2264 id: "0x3A9697" 2266 type: "utf-8" 2268 minver: "0" 2270 maxver: "0" 2272 documentation: A string describing the encoding setting used. 2274 7.2.78. CodecInfoURL Element 2276 name: "CodecInfoURL" 2278 path: "0*(\Segment\Tracks\TrackEntry\CodecInfoURL)" 2280 id: "0x3B4040" 2282 maxOccurs: "unbounded" 2284 type: "string" 2286 minver: "0" 2288 maxver: "0" 2290 documentation: A URL to find information about the codec used. 2292 7.2.79. CodecDownloadURL Element 2294 name: "CodecDownloadURL" 2296 path: "0*(\Segment\Tracks\TrackEntry\CodecDownloadURL)" 2298 id: "0x26B240" 2300 maxOccurs: "unbounded" 2302 type: "string" 2303 minver: "0" 2305 maxver: "0" 2307 documentation: A URL to download about the codec used. 2309 7.2.80. CodecDecodeAll Element 2311 name: "CodecDecodeAll" 2313 path: "1*1(\Segment\Tracks\TrackEntry\CodecDecodeAll)" 2315 id: "0xAA" 2317 minOccurs: "1" 2319 range: "0-1" 2321 default: "1" 2323 type: "uinteger" 2325 minver: "2" 2327 documentation: The codec can decode potentially damaged data (1 bit). 2329 7.2.81. TrackOverlay Element 2331 name: "TrackOverlay" 2333 path: "0*(\Segment\Tracks\TrackEntry\TrackOverlay)" 2335 id: "0x6FAB" 2337 maxOccurs: "unbounded" 2339 type: "uinteger" 2341 minver: "1" 2343 documentation: Specify that this track is an overlay track for the 2344 Track specified (in the u-integer). That means when this track has a 2345 gap (see SilentTracks) the overlay track SHOULD be used instead. The 2346 order of multiple TrackOverlay matters, the first one is the one that 2347 SHOULD be used. If not found it SHOULD be the second, etc. 2349 7.2.82. CodecDelay Element 2351 name: "CodecDelay" 2353 path: "0*1(\Segment\Tracks\TrackEntry\CodecDelay)" 2355 id: "0x56AA" 2357 default: "0" 2359 type: "uinteger" 2361 minver: "4" 2363 documentation: CodecDelay is The codec-built-in delay in nanoseconds. 2364 This value MUST be subtracted from each block timestamp in order to 2365 get the actual timestamp. The value SHOULD be small so the muxing of 2366 tracks with the same actual timestamp are in the same Cluster. 2368 7.2.83. SeekPreRoll Element 2370 name: "SeekPreRoll" 2372 path: "1*1(\Segment\Tracks\TrackEntry\SeekPreRoll)" 2374 id: "0x56BB" 2376 minOccurs: "1" 2378 default: "0" 2380 type: "uinteger" 2382 minver: "4" 2384 documentation: After a discontinuity, SeekPreRoll is the duration in 2385 nanoseconds of the data the decoder MUST decode before the decoded 2386 data is valid. 2388 7.2.84. TrackTranslate Element 2390 name: "TrackTranslate" 2392 path: "0*(\Segment\Tracks\TrackEntry\TrackTranslate)" 2394 id: "0x6624" 2396 maxOccurs: "unbounded" 2397 type: "master" 2399 minver: "1" 2401 documentation: The track identification for the given Chapter Codec. 2403 7.2.85. TrackTranslateEditionUID Element 2405 name: "TrackTranslateEditionUID" 2407 path: "0*(\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateEdi 2408 tionUID)" 2410 id: "0x66FC" 2412 maxOccurs: "unbounded" 2414 type: "uinteger" 2416 minver: "1" 2418 documentation: Specify an edition UID on which this translation 2419 applies. When not specified, it means for all editions found in the 2420 Segment. 2422 7.2.86. TrackTranslateCodec Element 2424 name: "TrackTranslateCodec" 2426 path: 2427 "1*1(\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateCodec)" 2429 id: "0x66BF" 2431 minOccurs: "1" 2433 type: "uinteger" 2435 minver: "1" 2437 documentation: The chapter codec using this ID (0: Matroska Script, 2438 1: DVD-menu). 2440 7.2.87. TrackTranslateTrackID Element 2442 name: "TrackTranslateTrackID" 2443 path: "1*1(\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateTr 2444 ackID)" 2446 id: "0x66A5" 2448 minOccurs: "1" 2450 type: "binary" 2452 minver: "1" 2454 documentation: The binary value used to represent this track in the 2455 chapter codec data. The format depends on the ChapProcessCodecID 2456 used. 2458 7.2.88. Video Element 2460 name: "Video" 2462 path: "0*1(\Segment\Tracks\TrackEntry\Video)" 2464 id: "0xE0" 2466 type: "master" 2468 minver: "1" 2470 documentation: Video settings. 2472 7.2.89. FlagInterlaced Element 2474 name: "FlagInterlaced" 2476 path: "1*1(\Segment\Tracks\TrackEntry\Video\FlagInterlaced)" 2478 id: "0x9A" 2480 minOccurs: "1" 2482 range: "0-2" 2484 default: "0" 2486 type: "uinteger" 2488 minver: "2" 2489 documentation: A flag to declare is the video is known to be 2490 progressive or interlaced and if applicable to declare details about 2491 the interlacement. (0: undetermined, 1: interlaced, 2: progressive) 2493 7.2.90. FieldOrder Element 2495 name: "FieldOrder" 2497 path: "1*1(\Segment\Tracks\TrackEntry\Video\FieldOrder)" 2499 id: "0x9D" 2501 minOccurs: "1" 2503 range: "0-14" 2505 default: "2" 2507 type: "uinteger" 2509 minver: "4" 2511 documentation: Declare the field ordering of the video. If 2512 FlagInterlaced is not set to 1, this Element MUST be ignored. (0: 2513 Progressive, 1: Interlaced with top field display first and top field 2514 stored first, 2: Undetermined field order, 6: Interlaced with bottom 2515 field displayed first and bottom field stored first, 9: Interlaced 2516 with bottom field displayed first and top field stored first, 14: 2517 Interlaced with top field displayed first and bottom field stored 2518 first) 2520 7.2.91. StereoMode Element 2522 name: "StereoMode" 2524 path: "0*1(\Segment\Tracks\TrackEntry\Video\StereoMode)" 2526 id: "0x53B8" 2528 default: "0" 2530 type: "uinteger" 2532 minver: "3" 2534 documentation: Stereo-3D video mode (0: mono, 1: side by side (left 2535 eye is first), 2: top-bottom (right eye is first), 3: top-bottom 2536 (left eye is first), 4: checkboard (right is first), 5: checkboard 2537 (left is first), 6: row interleaved (right is first), 7: row 2538 interleaved (left is first), 8: column interleaved (right is first), 2539 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: 2540 side by side (right eye is first), 12: anaglyph (green/magenta), 13 2541 both eyes laced in one Block (left eye is first), 14 both eyes laced 2542 in one Block (right eye is first)) . There are some more details on 2543 3D support in the Specification Notes. 2545 7.2.92. AlphaMode Element 2547 name: "AlphaMode" 2549 path: "0*1(\Segment\Tracks\TrackEntry\Video\AlphaMode)" 2551 id: "0x53C0" 2553 default: "0" 2555 type: "uinteger" 2557 minver: "3" 2559 documentation: Alpha Video Mode. Presence of this Element indicates 2560 that the BlockAdditional Element could contain Alpha data. 2562 7.2.93. OldStereoMode Element 2564 name: "OldStereoMode" 2566 path: "0*1(\Segment\Tracks\TrackEntry\Video\OldStereoMode)" 2568 id: "0x53B9" 2570 type: "uinteger" 2572 maxver: "0" 2574 documentation: DEPRECATED, DO NOT USE. Bogus StereoMode value used 2575 in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 2576 3: both eyes). 2578 7.2.94. PixelWidth Element 2580 name: "PixelWidth" 2582 path: "1*1(\Segment\Tracks\TrackEntry\Video\PixelWidth)" 2584 id: "0xB0" 2585 minOccurs: "1" 2587 range: "not 0" 2589 type: "uinteger" 2591 minver: "1" 2593 documentation: Width of the encoded video frames in pixels. 2595 7.2.95. PixelHeight Element 2597 name: "PixelHeight" 2599 path: "1*1(\Segment\Tracks\TrackEntry\Video\PixelHeight)" 2601 id: "0xBA" 2603 minOccurs: "1" 2605 range: "not 0" 2607 type: "uinteger" 2609 minver: "1" 2611 documentation: Height of the encoded video frames in pixels. 2613 7.2.96. PixelCropBottom Element 2615 name: "PixelCropBottom" 2617 path: "0*1(\Segment\Tracks\TrackEntry\Video\PixelCropBottom)" 2619 id: "0x54AA" 2621 default: "0" 2623 type: "uinteger" 2625 minver: "1" 2627 documentation: The number of video pixels to remove at the bottom of 2628 the image (for HDTV content). 2630 7.2.97. PixelCropTop Element 2632 name: "PixelCropTop" 2634 path: "0*1(\Segment\Tracks\TrackEntry\Video\PixelCropTop)" 2636 id: "0x54BB" 2638 default: "0" 2640 type: "uinteger" 2642 minver: "1" 2644 documentation: The number of video pixels to remove at the top of the 2645 image. 2647 7.2.98. PixelCropLeft Element 2649 name: "PixelCropLeft" 2651 path: "0*1(\Segment\Tracks\TrackEntry\Video\PixelCropLeft)" 2653 id: "0x54CC" 2655 default: "0" 2657 type: "uinteger" 2659 minver: "1" 2661 documentation: The number of video pixels to remove on the left of 2662 the image. 2664 7.2.99. PixelCropRight Element 2666 name: "PixelCropRight" 2668 path: "0*1(\Segment\Tracks\TrackEntry\Video\PixelCropRight)" 2670 id: "0x54DD" 2672 default: "0" 2674 type: "uinteger" 2676 minver: "1" 2677 documentation: The number of video pixels to remove on the right of 2678 the image. 2680 7.2.100. DisplayWidth Element 2682 name: "DisplayWidth" 2684 path: "0*1(\Segment\Tracks\TrackEntry\Video\DisplayWidth)" 2686 id: "0x54B0" 2688 range: "not 0" 2690 default: "PixelWidth - PixelCropLeft - PixelCropRight" 2692 type: "uinteger" 2694 minver: "1" 2696 documentation: Width of the video frames to display. Applies to the 2697 video frame after cropping (PixelCrop* Elements). The default value 2698 is only valid when DisplayUnit is 0. 2700 7.2.101. DisplayHeight Element 2702 name: "DisplayHeight" 2704 path: "0*1(\Segment\Tracks\TrackEntry\Video\DisplayHeight)" 2706 id: "0x54BA" 2708 range: "not 0" 2710 default: "PixelHeight - PixelCropTop - PixelCropBottom" 2712 type: "uinteger" 2714 minver: "1" 2716 documentation: Height of the video frames to display. Applies to the 2717 video frame after cropping (PixelCrop* Elements). The default value 2718 is only valid when DisplayUnit is 0. 2720 7.2.102. DisplayUnit Element 2722 name: "DisplayUnit" 2724 path: "0*1(\Segment\Tracks\TrackEntry\Video\DisplayUnit)" 2725 id: "0x54B2" 2727 default: "0" 2729 type: "uinteger" 2731 minver: "1" 2733 documentation: How DisplayWidth & DisplayHeight are interpreted (0: 2734 pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio, 4: 2735 Unknown). 2737 7.2.103. AspectRatioType Element 2739 name: "AspectRatioType" 2741 path: "0*1(\Segment\Tracks\TrackEntry\Video\AspectRatioType)" 2743 id: "0x54B3" 2745 default: "0" 2747 type: "uinteger" 2749 minver: "1" 2751 documentation: Specify the possible modifications to the aspect ratio 2752 (0: free resizing, 1: keep aspect ratio, 2: fixed). 2754 7.2.104. ColourSpace Element 2756 name: "ColourSpace" 2758 path: "0*1(\Segment\Tracks\TrackEntry\Video\ColourSpace)" 2760 id: "0x2EB524" 2762 size: "4" 2764 type: "binary" 2766 minver: "1" 2768 documentation: Same value as in AVI (32 bits). 2770 7.2.105. GammaValue Element 2772 name: "GammaValue" 2774 path: "0*1(\Segment\Tracks\TrackEntry\Video\GammaValue)" 2776 id: "0x2FB523" 2778 range: "> 0x0p+0" 2780 type: "float" 2782 minver: "0" 2784 maxver: "0" 2786 documentation: Gamma Value. 2788 7.2.106. FrameRate Element 2790 name: "FrameRate" 2792 path: "0*1(\Segment\Tracks\TrackEntry\Video\FrameRate)" 2794 id: "0x2383E3" 2796 range: "> 0x0p+0" 2798 type: "float" 2800 minver: "0" 2802 maxver: "0" 2804 documentation: Number of frames per second. Informational only. 2806 7.2.107. Colour Element 2808 name: "Colour" 2810 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour)" 2812 id: "0x55B0" 2814 type: "master" 2816 minver: "4" 2817 documentation: Settings describing the colour format. 2819 7.2.108. MatrixCoefficients Element 2821 name: "MatrixCoefficients" 2823 path: 2824 "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MatrixCoefficients)" 2826 id: "0x55B1" 2828 default: "2" 2830 type: "uinteger" 2832 minver: "4" 2834 documentation: The Matrix Coefficients of the video used to derive 2835 luma and chroma values from reg, green, and blue color primaries. 2836 For clarity, the value and meanings for MatrixCoefficients are 2837 adopted from Table 4 of ISO/IEC 23001-8:2013/DCOR1. (0:GBR, 1: BT709, 2838 2: Unspecified, 3: Reserved, 4: FCC, 5: BT470BG, 6: SMPTE 170M, 7: 2839 SMPTE 240M, 8: YCOCG, 9: BT2020 Non-constant Luminance, 10: BT2020 2840 Constant Luminance) 2842 7.2.109. BitsPerChannel Element 2844 name: "BitsPerChannel" 2846 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\BitsPerChannel)" 2848 id: "0x55B2" 2850 default: "0" 2852 type: "uinteger" 2854 minver: "4" 2856 documentation: Number of decoded bits per channel. A value of 0 2857 indicates that the BitsPerChannel is unspecified. 2859 7.2.110. ChromaSubsamplingHorz Element 2861 name: "ChromaSubsamplingHorz" 2863 path: 2864 "0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingHorz)" 2865 id: "0x55B3" 2867 type: "uinteger" 2869 minver: "4" 2871 documentation: The amount of pixels to remove in the Cr and Cb 2872 channels for every pixel not removed horizontally. Example: For 2873 video with 4:2:0 chroma subsampling, the ChromaSubsamplingHorz SHOULD 2874 be set to 1. 2876 7.2.111. ChromaSubsamplingVert Element 2878 name: "ChromaSubsamplingVert" 2880 path: 2881 "0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingVert)" 2883 id: "0x55B4" 2885 type: "uinteger" 2887 minver: "4" 2889 documentation: The amount of pixels to remove in the Cr and Cb 2890 channels for every pixel not removed vertically. Example: For video 2891 with 4:2:0 chroma subsampling, the ChromaSubsamplingVert SHOULD be 2892 set to 1. 2894 7.2.112. CbSubsamplingHorz Element 2896 name: "CbSubsamplingHorz" 2898 path: 2899 "0*1(\Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingHorz)" 2901 id: "0x55B5" 2903 type: "uinteger" 2905 minver: "4" 2907 documentation: The amount of pixels to remove in the Cb channel for 2908 every pixel not removed horizontally. This is additive with 2909 ChromaSubsamplingHorz. Example: For video with 4:2:1 chroma 2910 subsampling, the ChromaSubsamplingHorz SHOULD be set to 1 and 2911 CbSubsamplingHorz SHOULD be set to 1. 2913 7.2.113. CbSubsamplingVert Element 2915 name: "CbSubsamplingVert" 2917 path: 2918 "0*1(\Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingVert)" 2920 id: "0x55B6" 2922 type: "uinteger" 2924 minver: "4" 2926 documentation: The amount of pixels to remove in the Cb channel for 2927 every pixel not removed vertically. This is additive with 2928 ChromaSubsamplingVert. 2930 7.2.114. ChromaSitingHorz Element 2932 name: "ChromaSitingHorz" 2934 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingHorz)" 2936 id: "0x55B7" 2938 default: "0" 2940 type: "uinteger" 2942 minver: "4" 2944 documentation: How chroma is subsampled horizontally. (0: 2945 Unspecified, 1: Left Collocated, 2: Half) 2947 7.2.115. ChromaSitingVert Element 2949 name: "ChromaSitingVert" 2951 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingVert)" 2953 id: "0x55B8" 2955 default: "0" 2957 type: "uinteger" 2959 minver: "4" 2960 documentation: How chroma is subsampled vertically. (0: Unspecified, 2961 1: Top Collocated, 2: Half) 2963 7.2.116. Range Element 2965 name: "Range" 2967 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\Range)" 2969 id: "0x55B9" 2971 default: "0" 2973 type: "uinteger" 2975 minver: "4" 2977 documentation: Clipping of the color ranges. (0: Unspecified, 1: 2978 Broadcast Range, 2: Full range (no clipping), 3: Defined by 2979 MatrixCoefficients/TransferCharacteristics) 2981 7.2.117. TransferCharacteristics Element 2983 name: "TransferCharacteristics" 2985 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\TransferCharacteri 2986 stics)" 2988 id: "0x55BA" 2990 default: "2" 2992 type: "uinteger" 2994 minver: "4" 2996 documentation: The transfer characteristics of the video. For 2997 clarity, the value and meanings for TransferCharacteristics 1-15 are 2998 adopted from Table 3 of ISO/IEC 23001-8:2013/DCOR1. 2999 TransferCharacteristics 16-18 are proposed values. (0: Reserved, 1: 3000 ITU-R BT.709, 2: Unspecified, 3: Reserved, 4: Gamma 2.2 curve, 5: 3001 Gamma 2.8 curve, 6: SMPTE 170M, 7: SMPTE 240M, 8: Linear, 9: Log, 10: 3002 Log Sqrt, 11: IEC 61966-2-4, 12: ITU-R BT.1361 Extended Colour Gamut, 3003 13: IEC 61966-2-1, 14: ITU-R BT.2020 10 bit, 15: ITU-R BT.2020 12 3004 bit, 16: SMPTE ST 2084, 17: SMPTE ST 428-1 18: ARIB STD-B67 (HLG)) 3006 7.2.118. Primaries Element 3008 name: "Primaries" 3010 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\Primaries)" 3012 id: "0x55BB" 3014 default: "2" 3016 type: "uinteger" 3018 minver: "4" 3020 documentation: The colour primaries of the video. For clarity, the 3021 value and meanings for Primaries are adopted from Table 2 of ISO/IEC 3022 23001-8:2013/DCOR1. (0: Reserved, 1: ITU-R BT.709, 2: Unspecified, 3: 3023 Reserved, 4: ITU-R BT.470M, 5: ITU-R BT.470BG, 6: SMPTE 170M, 7: 3024 SMPTE 240M, 8: FILM, 9: ITU-R BT.2020, 10: SMPTE ST 428-1, 22: JEDEC 3025 P22 phosphors) 3027 7.2.119. MaxCLL Element 3029 name: "MaxCLL" 3031 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MaxCLL)" 3033 id: "0x55BC" 3035 type: "uinteger" 3037 minver: "4" 3039 documentation: Maximum brightness of a single pixel (Maximum Content 3040 Light Level) in candelas per square meter (cd/m^2). 3042 7.2.120. MaxFALL Element 3044 name: "MaxFALL" 3046 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MaxFALL)" 3048 id: "0x55BD" 3050 type: "uinteger" 3052 minver: "4" 3053 documentation: Maximum brightness of a single full frame (Maximum 3054 Frame-Average Light Level) in candelas per square meter (cd/m^2). 3056 7.2.121. MasteringMetadata Element 3058 name: "MasteringMetadata" 3060 path: 3061 "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata)" 3063 id: "0x55D0" 3065 type: "master" 3067 minver: "4" 3069 documentation: SMPTE 2086 mastering data. 3071 7.2.122. PrimaryRChromaticityX Element 3073 name: "PrimaryRChromaticityX" 3075 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\PrimaryRChromatici 3076 tyX\PrimaryRChromaticityX)" 3078 id: "0x55D1" 3080 range: "0-1" 3082 type: "float" 3084 minver: "4" 3086 documentation: Red X chromaticity coordinate as defined by CIE 1931. 3088 7.2.123. PrimaryRChromaticityY Element 3090 name: "PrimaryRChromaticityY" 3092 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\PrimaryRChromatici 3093 tyX\PrimaryRChromaticityY)" 3095 id: "0x55D2" 3097 range: "0-1" 3099 type: "float" 3100 minver: "4" 3102 documentation: Red Y chromaticity coordinate as defined by CIE 1931. 3104 7.2.124. PrimaryGChromaticityX Element 3106 name: "PrimaryGChromaticityX" 3108 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\PrimaryRChromatici 3109 tyX\PrimaryGChromaticityX)" 3111 id: "0x55D3" 3113 range: "0-1" 3115 type: "float" 3117 minver: "4" 3119 documentation: Green X chromaticity coordinate as defined by CIE 3120 1931. 3122 7.2.125. PrimaryGChromaticityY Element 3124 name: "PrimaryGChromaticityY" 3126 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\PrimaryRChromatici 3127 tyX\PrimaryGChromaticityY)" 3129 id: "0x55D4" 3131 range: "0-1" 3133 type: "float" 3135 minver: "4" 3137 documentation: Green Y chromaticity coordinate as defined by CIE 3138 1931. 3140 7.2.126. PrimaryBChromaticityX Element 3142 name: "PrimaryBChromaticityX" 3144 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\PrimaryRChromatici 3145 tyX\PrimaryBChromaticityX)" 3147 id: "0x55D5" 3148 range: "0-1" 3150 type: "float" 3152 minver: "4" 3154 documentation: Blue X chromaticity coordinate as defined by CIE 1931. 3156 7.2.127. PrimaryBChromaticityY Element 3158 name: "PrimaryBChromaticityY" 3160 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\PrimaryRChromatici 3161 tyX\PrimaryBChromaticityY)" 3163 id: "0x55D6" 3165 range: "0-1" 3167 type: "float" 3169 minver: "4" 3171 documentation: Blue Y chromaticity coordinate as defined by CIE 1931. 3173 7.2.128. WhitePointChromaticityX Element 3175 name: "WhitePointChromaticityX" 3177 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\PrimaryRChromatici 3178 tyX\WhitePointChromaticityX)" 3180 id: "0x55D7" 3182 range: "0-1" 3184 type: "float" 3186 minver: "4" 3188 documentation: White X chromaticity coordinate as defined by CIE 3189 1931. 3191 7.2.129. WhitePointChromaticityY Element 3193 name: "WhitePointChromaticityY" 3194 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\PrimaryRChromatici 3195 tyX\WhitePointChromaticityY)" 3197 id: "0x55D8" 3199 range: "0-1" 3201 type: "float" 3203 minver: "4" 3205 documentation: White Y chromaticity coordinate as defined by CIE 3206 1931. 3208 7.2.130. LuminanceMax Element 3210 name: "LuminanceMax" 3212 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\PrimaryRChromatici 3213 tyX\LuminanceMax)" 3215 id: "0x55D9" 3217 range: "0-9999.99" 3219 type: "float" 3221 minver: "4" 3223 documentation: Maximum luminance. Represented in candelas per square 3224 meter (cd/m^2). 3226 7.2.131. LuminanceMin Element 3228 name: "LuminanceMin" 3230 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\PrimaryRChromatici 3231 tyX\LuminanceMin)" 3233 id: "0x55DA" 3235 range: "0-999.9999" 3237 type: "float" 3239 minver: "4" 3240 documentation: Mininum luminance. Represented in candelas per square 3241 meter (cd/m^2). 3243 7.2.132. Audio Element 3245 name: "Audio" 3247 path: "0*1(\Segment\Tracks\TrackEntry\Audio)" 3249 id: "0xE1" 3251 type: "master" 3253 minver: "1" 3255 documentation: Audio settings. 3257 7.2.133. SamplingFrequency Element 3259 name: "SamplingFrequency" 3261 path: "1*1(\Segment\Tracks\TrackEntry\Audio\SamplingFrequency)" 3263 id: "0xB5" 3265 minOccurs: "1" 3267 range: "> 0x0p+0" 3269 default: "0x1.f4p+12" 3271 type: "float" 3273 minver: "1" 3275 documentation: Sampling frequency in Hz. 3277 7.2.134. OutputSamplingFrequency Element 3279 name: "OutputSamplingFrequency" 3281 path: "0*1(\Segment\Tracks\TrackEntry\Audio\OutputSamplingFrequency)" 3283 id: "0x78B5" 3285 range: "> 0x0p+0" 3287 default: "SamplingFrequency" 3288 type: "float" 3290 minver: "1" 3292 documentation: Real output sampling frequency in Hz (used for SBR 3293 techniques). 3295 7.2.135. Channels Element 3297 name: "Channels" 3299 path: "1*1(\Segment\Tracks\TrackEntry\Audio\Channels)" 3301 id: "0x9F" 3303 minOccurs: "1" 3305 range: "not 0" 3307 default: "1" 3309 type: "uinteger" 3311 minver: "1" 3313 documentation: Numbers of channels in the track. 3315 7.2.136. ChannelPositions Element 3317 name: "ChannelPositions" 3319 path: "0*1(\Segment\Tracks\TrackEntry\Audio\ChannelPositions)" 3321 id: "0x7D7B" 3323 type: "binary" 3325 minver: "0" 3327 maxver: "0" 3329 documentation: Table of horizontal angles for each successive 3330 channel, see appendix. 3332 7.2.137. BitDepth Element 3334 name: "BitDepth" 3336 path: "0*1(\Segment\Tracks\TrackEntry\Audio\BitDepth)" 3338 id: "0x6264" 3340 range: "not 0" 3342 type: "uinteger" 3344 minver: "1" 3346 documentation: Bits per sample, mostly used for PCM. 3348 7.2.138. TrackOperation Element 3350 name: "TrackOperation" 3352 path: "0*1(\Segment\Tracks\TrackEntry\TrackOperation)" 3354 id: "0xE2" 3356 type: "master" 3358 minver: "3" 3360 documentation: Operation that needs to be applied on tracks to create 3361 this virtual track. For more details look at the Specification Notes 3362 on the subject. 3364 7.2.139. TrackCombinePlanes Element 3366 name: "TrackCombinePlanes" 3368 path: 3369 "0*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes)" 3371 id: "0xE3" 3373 type: "master" 3375 minver: "3" 3377 documentation: Contains the list of all video plane tracks that need 3378 to be combined to create this 3D track 3380 7.2.140. TrackPlane Element 3382 name: "TrackPlane" 3384 path: "1*(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlane 3385 s\TrackPlane)" 3387 id: "0xE4" 3389 minOccurs: "1" 3391 maxOccurs: "unbounded" 3393 type: "master" 3395 minver: "3" 3397 documentation: Contains a video plane track that need to be combined 3398 to create this 3D track 3400 7.2.141. TrackPlaneUID Element 3402 name: "TrackPlaneUID" 3404 path: "1*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlan 3405 es\TrackPlane\TrackPlaneUID)" 3407 id: "0xE5" 3409 minOccurs: "1" 3411 range: "not 0" 3413 type: "uinteger" 3415 minver: "3" 3417 documentation: The trackUID number of the track representing the 3418 plane. 3420 7.2.142. TrackPlaneType Element 3422 name: "TrackPlaneType" 3424 path: "1*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlan 3425 es\TrackPlane\TrackPlaneType)" 3427 id: "0xE6" 3428 minOccurs: "1" 3430 type: "uinteger" 3432 minver: "3" 3434 documentation: The kind of plane this track corresponds to (0: left 3435 eye, 1: right eye, 2: background). 3437 7.2.143. TrackJoinBlocks Element 3439 name: "TrackJoinBlocks" 3441 path: 3442 "0*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks)" 3444 id: "0xE9" 3446 type: "master" 3448 minver: "3" 3450 documentation: Contains the list of all tracks whose Blocks need to 3451 be combined to create this virtual track 3453 7.2.144. TrackJoinUID Element 3455 name: "TrackJoinUID" 3457 path: "1*(\Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks\T 3458 rackJoinUID)" 3460 id: "0xED" 3462 minOccurs: "1" 3464 maxOccurs: "unbounded" 3466 range: "not 0" 3468 type: "uinteger" 3470 minver: "3" 3472 documentation: The trackUID number of a track whose blocks are used 3473 to create this virtual track. 3475 7.2.145. TrickTrackUID Element 3477 name: "TrickTrackUID" 3479 path: "0*1(\Segment\Tracks\TrackEntry\TrickTrackUID)" 3481 id: "0xC0" 3483 type: "uinteger" 3485 minver: "0" 3487 maxver: "0" 3489 documentation: DivX trick track extenstions 3491 7.2.146. TrickTrackSegmentUID Element 3493 name: "TrickTrackSegmentUID" 3495 path: "0*1(\Segment\Tracks\TrackEntry\TrickTrackSegmentUID)" 3497 id: "0xC1" 3499 size: "16" 3501 type: "binary" 3503 minver: "0" 3505 maxver: "0" 3507 documentation: DivX trick track extenstions 3509 7.2.147. TrickTrackFlag Element 3511 name: "TrickTrackFlag" 3513 path: "0*1(\Segment\Tracks\TrackEntry\TrickTrackFlag)" 3515 id: "0xC6" 3517 default: "0" 3519 type: "uinteger" 3521 minver: "0" 3522 maxver: "0" 3524 documentation: DivX trick track extenstions 3526 7.2.148. TrickMasterTrackUID Element 3528 name: "TrickMasterTrackUID" 3530 path: "0*1(\Segment\Tracks\TrackEntry\TrickMasterTrackUID)" 3532 id: "0xC7" 3534 type: "uinteger" 3536 minver: "0" 3538 maxver: "0" 3540 documentation: DivX trick track extenstions 3542 7.2.149. TrickMasterTrackSegmentUID Element 3544 name: "TrickMasterTrackSegmentUID" 3546 path: "0*1(\Segment\Tracks\TrackEntry\TrickMasterTrackSegmentUID)" 3548 id: "0xC4" 3550 size: "16" 3552 type: "binary" 3554 minver: "0" 3556 maxver: "0" 3558 documentation: DivX trick track extenstions 3560 7.2.150. ContentEncodings Element 3562 name: "ContentEncodings" 3564 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings)" 3566 id: "0x6D80" 3568 type: "master" 3569 minver: "1" 3571 documentation: Settings for several content encoding mechanisms like 3572 compression or encryption. 3574 7.2.151. ContentEncoding Element 3576 name: "ContentEncoding" 3578 path: 3579 "1*(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding)" 3581 id: "0x6240" 3583 minOccurs: "1" 3585 maxOccurs: "unbounded" 3587 type: "master" 3589 minver: "1" 3591 documentation: Settings for one content encoding like compression or 3592 encryption. 3594 7.2.152. ContentEncodingOrder Element 3596 name: "ContentEncodingOrder" 3598 path: "1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3599 g\ContentEncodingOrder)" 3601 id: "0x5031" 3603 minOccurs: "1" 3605 default: "0" 3607 type: "uinteger" 3609 minver: "1" 3611 documentation: Tells when this modification was used during encoding/ 3612 muxing starting with 0 and counting upwards. The decoder/demuxer has 3613 to start with the highest order number it finds and work its way 3614 down. This value has to be unique over all ContentEncodingOrder 3615 Elements in the Segment. 3617 7.2.153. ContentEncodingScope Element 3619 name: "ContentEncodingScope" 3621 path: "1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3622 g\ContentEncodingScope)" 3624 id: "0x5032" 3626 minOccurs: "1" 3628 range: "not 0" 3630 default: "1" 3632 type: "uinteger" 3634 minver: "1" 3636 documentation: A bit field that describes which Elements have been 3637 modified in this way. Values (big endian) can be OR'ed. Possible 3638 values: 1 - all frame contents, 2 - the track's private data, 4 - the 3639 next ContentEncoding (next ContentEncodingOrder. Either the data 3640 inside ContentCompression and/or ContentEncryption) 3642 7.2.154. ContentEncodingType Element 3644 name: "ContentEncodingType" 3646 path: "1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3647 g\ContentEncodingType)" 3649 id: "0x5033" 3651 minOccurs: "1" 3653 default: "0" 3655 type: "uinteger" 3657 minver: "1" 3659 documentation: A value describing what kind of transformation has 3660 been done. Possible values: 0 - compression, 1 - encryption 3662 7.2.155. ContentCompression Element 3664 name: "ContentCompression" 3666 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3667 g\ContentCompression)" 3669 id: "0x5034" 3671 type: "master" 3673 minver: "1" 3675 documentation: Settings describing the compression used. This 3676 Element MUST be present if the value of ContentEncodingType is 0 and 3677 absent otherwise. Each block MUST be decompressable even if no 3678 previous block is available in order not to prevent seeking. 3680 7.2.156. ContentCompAlgo Element 3682 name: "ContentCompAlgo" 3684 path: "1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3685 g\ContentCompression\ContentCompAlgo)" 3687 id: "0x4254" 3689 minOccurs: "1" 3691 default: "0" 3693 type: "uinteger" 3695 minver: "1" 3697 documentation: The compression algorithm used. Algorithms that have 3698 been specified so far are: 0 - zlib, 1 - bzlib, 2 - lzo1x 3 - Header 3699 Stripping 3701 7.2.157. ContentCompSettings Element 3703 name: "ContentCompSettings" 3705 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3706 g\ContentCompression\ContentCompSettings)" 3708 id: "0x4255" 3709 type: "binary" 3711 minver: "1" 3713 documentation: Settings that might be needed by the decompressor. 3714 For Header Stripping (ContentCompAlgo=3), the bytes that were removed 3715 from the beggining of each frames of the track. 3717 7.2.158. ContentEncryption Element 3719 name: "ContentEncryption" 3721 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3722 g\ContentEncryption)" 3724 id: "0x5035" 3726 type: "master" 3728 minver: "1" 3730 documentation: Settings describing the encryption used. This Element 3731 MUST be present if the value of ContentEncodingType is 1 and absent 3732 otherwise. 3734 7.2.159. ContentEncAlgo Element 3736 name: "ContentEncAlgo" 3738 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3739 g\ContentEncryption\ContentEncAlgo)" 3741 id: "0x47E1" 3743 default: "0" 3745 type: "uinteger" 3747 minver: "1" 3749 documentation: The encryption algorithm used. The value '0' means 3750 that the contents have not been encrypted but only signed. 3751 Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - 3752 AES 3754 7.2.160. ContentEncKeyID Element 3756 name: "ContentEncKeyID" 3758 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3759 g\ContentEncryption\ContentEncKeyID)" 3761 id: "0x47E2" 3763 type: "binary" 3765 minver: "1" 3767 documentation: For public key algorithms this is the ID of the public 3768 key the the data was encrypted with. 3770 7.2.161. ContentSignature Element 3772 name: "ContentSignature" 3774 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3775 g\ContentEncryption\ContentSignature)" 3777 id: "0x47E3" 3779 type: "binary" 3781 minver: "1" 3783 documentation: A cryptographic signature of the contents. 3785 7.2.162. ContentSigKeyID Element 3787 name: "ContentSigKeyID" 3789 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3790 g\ContentEncryption\ContentSigKeyID)" 3792 id: "0x47E4" 3794 type: "binary" 3796 minver: "1" 3798 documentation: This is the ID of the private key the data was signed 3799 with. 3801 7.2.163. ContentSigAlgo Element 3803 name: "ContentSigAlgo" 3805 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3806 g\ContentEncryption\ContentSigAlgo)" 3808 id: "0x47E5" 3810 default: "0" 3812 type: "uinteger" 3814 minver: "1" 3816 documentation: The algorithm used for the signature. A value of '0' 3817 means that the contents have not been signed but only encrypted. 3818 Predefined values: 1 - RSA 3820 7.2.164. ContentSigHashAlgo Element 3822 name: "ContentSigHashAlgo" 3824 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 3825 g\ContentEncryption\ContentSigHashAlgo)" 3827 id: "0x47E6" 3829 default: "0" 3831 type: "uinteger" 3833 minver: "1" 3835 documentation: The hash algorithm used for the signature. A value of 3836 '0' means that the contents have not been signed but only encrypted. 3837 Predefined values: 1 - SHA1-160 2 - MD5 3839 7.2.165. Cues Element 3841 name: "Cues" 3843 path: "0*1(\Segment\Cues)" 3845 id: "0x1C53BB6B" 3847 type: "master" 3848 minver: "1" 3850 documentation: A Top-Level Element to speed seeking access. All 3851 entries are local to the Segment. This Element SHOULD be mandatory 3852 for non "live" streams. 3854 7.2.166. CuePoint Element 3856 name: "CuePoint" 3858 path: "1*(\Segment\Cues\CuePoint)" 3860 id: "0xBB" 3862 minOccurs: "1" 3864 maxOccurs: "unbounded" 3866 type: "master" 3868 minver: "1" 3870 documentation: Contains all information relative to a seek point in 3871 the Segment. 3873 7.2.167. CueTime Element 3875 name: "CueTime" 3877 path: "1*1(\Segment\Cues\CuePoint\CueTime)" 3879 id: "0xB3" 3881 minOccurs: "1" 3883 type: "uinteger" 3885 minver: "1" 3887 documentation: Absolute timestamp according to the Segment time base. 3889 7.2.168. CueTrackPositions Element 3891 name: "CueTrackPositions" 3893 path: "1*(\Segment\Cues\CuePoint\CueTrackPositions)" 3895 id: "0xB7" 3896 minOccurs: "1" 3898 maxOccurs: "unbounded" 3900 type: "master" 3902 minver: "1" 3904 documentation: Contain positions for different tracks corresponding 3905 to the timestamp. 3907 7.2.169. CueTrack Element 3909 name: "CueTrack" 3911 path: "1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueTrack)" 3913 id: "0xF7" 3915 minOccurs: "1" 3917 range: "not 0" 3919 type: "uinteger" 3921 minver: "1" 3923 documentation: The track for which a position is given. 3925 7.2.170. CueClusterPosition Element 3927 name: "CueClusterPosition" 3929 path: 3930 "1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueClusterPosition)" 3932 id: "0xF1" 3934 minOccurs: "1" 3936 type: "uinteger" 3938 minver: "1" 3940 documentation: The position of the Cluster containing the associated 3941 Block. 3943 7.2.171. CueRelativePosition Element 3945 name: "CueRelativePosition" 3947 path: 3948 "0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueRelativePosition)" 3950 id: "0xF0" 3952 type: "uinteger" 3954 minver: "4" 3956 documentation: The relative position of the referenced block inside 3957 the cluster with 0 being the first possible position for an Element 3958 inside that cluster. 3960 7.2.172. CueDuration Element 3962 name: "CueDuration" 3964 path: "0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueDuration)" 3966 id: "0xB2" 3968 type: "uinteger" 3970 minver: "4" 3972 documentation: The duration of the block according to the Segment 3973 time base. If missing the track's DefaultDuration does not apply and 3974 no duration information is available in terms of the cues. 3976 7.2.173. CueBlockNumber Element 3978 name: "CueBlockNumber" 3980 path: "0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueBlockNumber)" 3982 id: "0x5378" 3984 range: "not 0" 3986 default: "1" 3988 type: "uinteger" 3990 minver: "1" 3991 documentation: Number of the Block in the specified Cluster. 3993 7.2.174. CueCodecState Element 3995 name: "CueCodecState" 3997 path: "0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueCodecState)" 3999 id: "0xEA" 4001 default: "0" 4003 type: "uinteger" 4005 minver: "2" 4007 documentation: The position of the Codec State corresponding to this 4008 Cue Element. 0 means that the data is taken from the initial Track 4009 Entry. 4011 7.2.175. CueReference Element 4013 name: "CueReference" 4015 path: "0*(\Segment\Cues\CuePoint\CueTrackPositions\CueReference)" 4017 id: "0xDB" 4019 maxOccurs: "unbounded" 4021 type: "master" 4023 minver: "2" 4025 documentation: The Clusters containing the referenced Blocks. 4027 7.2.176. CueRefTime Element 4029 name: "CueRefTime" 4031 path: "1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueR 4032 efTime)" 4034 id: "0x96" 4036 minOccurs: "1" 4038 type: "uinteger" 4039 minver: "2" 4041 documentation: Timestamp of the referenced Block. 4043 7.2.177. CueRefCluster Element 4045 name: "CueRefCluster" 4047 path: "1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueR 4048 efCluster)" 4050 id: "0x97" 4052 minOccurs: "1" 4054 type: "uinteger" 4056 minver: "0" 4058 maxver: "0" 4060 documentation: The Position of the Cluster containing the referenced 4061 Block. 4063 7.2.178. CueRefNumber Element 4065 name: "CueRefNumber" 4067 path: "0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueR 4068 efNumber)" 4070 id: "0x535F" 4072 range: "not 0" 4074 default: "1" 4076 type: "uinteger" 4078 minver: "0" 4080 maxver: "0" 4082 documentation: Number of the referenced Block of Track X in the 4083 specified Cluster. 4085 7.2.179. CueRefCodecState Element 4087 name: "CueRefCodecState" 4089 path: "0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueR 4090 efCodecState)" 4092 id: "0xEB" 4094 default: "0" 4096 type: "uinteger" 4098 minver: "0" 4100 maxver: "0" 4102 documentation: The position of the Codec State corresponding to this 4103 referenced Element. 0 means that the data is taken from the initial 4104 Track Entry. 4106 7.2.180. Attachments Element 4108 name: "Attachments" 4110 path: "0*1(\Segment\Attachments)" 4112 id: "0x1941A469" 4114 type: "master" 4116 minver: "1" 4118 documentation: Contain attached files. 4120 7.2.181. AttachedFile Element 4122 name: "AttachedFile" 4124 path: "1*(\Segment\Attachments\AttachedFile)" 4126 id: "0x61A7" 4128 minOccurs: "1" 4130 maxOccurs: "unbounded" 4132 type: "master" 4133 minver: "1" 4135 documentation: An attached file. 4137 7.2.182. FileDescription Element 4139 name: "FileDescription" 4141 path: "0*1(\Segment\Attachments\AttachedFile\FileDescription)" 4143 id: "0x467E" 4145 type: "utf-8" 4147 minver: "1" 4149 documentation: A human-friendly name for the attached file. 4151 7.2.183. FileName Element 4153 name: "FileName" 4155 path: "1*1(\Segment\Attachments\AttachedFile\FileName)" 4157 id: "0x466E" 4159 minOccurs: "1" 4161 type: "utf-8" 4163 minver: "1" 4165 documentation: Filename of the attached file. 4167 7.2.184. FileMimeType Element 4169 name: "FileMimeType" 4171 path: "1*1(\Segment\Attachments\AttachedFile\FileMimeType)" 4173 id: "0x4660" 4175 minOccurs: "1" 4177 type: "string" 4179 minver: "1" 4180 documentation: MIME type of the file. 4182 7.2.185. FileData Element 4184 name: "FileData" 4186 path: "1*1(\Segment\Attachments\AttachedFile\FileData)" 4188 id: "0x465C" 4190 minOccurs: "1" 4192 type: "binary" 4194 minver: "1" 4196 documentation: The data of the file. 4198 7.2.186. FileUID Element 4200 name: "FileUID" 4202 path: "1*1(\Segment\Attachments\AttachedFile\FileUID)" 4204 id: "0x46AE" 4206 minOccurs: "1" 4208 range: "not 0" 4210 type: "uinteger" 4212 minver: "1" 4214 documentation: Unique ID representing the file, as random as 4215 possible. 4217 7.2.187. FileReferral Element 4219 name: "FileReferral" 4221 path: "0*1(\Segment\Attachments\AttachedFile\FileReferral)" 4223 id: "0x4675" 4225 type: "binary" 4227 minver: "0" 4228 maxver: "0" 4230 documentation: A binary value that a track/codec can refer to when 4231 the attachment is needed. 4233 7.2.188. FileUsedStartTime Element 4235 name: "FileUsedStartTime" 4237 path: "0*1(\Segment\Attachments\AttachedFile\FileUsedStartTime)" 4239 id: "0x4661" 4241 type: "uinteger" 4243 minver: "0" 4245 maxver: "0" 4247 documentation: DivX font extension 4249 7.2.189. FileUsedEndTime Element 4251 name: "FileUsedEndTime" 4253 path: "0*1(\Segment\Attachments\AttachedFile\FileUsedEndTime)" 4255 id: "0x4662" 4257 type: "uinteger" 4259 minver: "0" 4261 maxver: "0" 4263 documentation: DivX font extension 4265 7.2.190. Chapters Element 4267 name: "Chapters" 4269 path: "0*1(\Segment\Chapters)" 4271 id: "0x1043A770" 4273 type: "master" 4275 minver: "1" 4276 documentation: A system to define basic menus and partition data. 4277 For more detailed information, look at the Chapters Explanation. 4279 7.2.191. EditionEntry Element 4281 name: "EditionEntry" 4283 path: "1*(\Segment\Chapters\EditionEntry)" 4285 id: "0x45B9" 4287 minOccurs: "1" 4289 maxOccurs: "unbounded" 4291 type: "master" 4293 minver: "1" 4295 documentation: Contains all information about a Segment edition. 4297 7.2.192. EditionUID Element 4299 name: "EditionUID" 4301 path: "0*1(\Segment\Chapters\EditionEntry\EditionUID)" 4303 id: "0x45BC" 4305 range: "not 0" 4307 type: "uinteger" 4309 minver: "1" 4311 documentation: A unique ID to identify the edition. It's useful for 4312 tagging an edition. 4314 7.2.193. EditionFlagHidden Element 4316 name: "EditionFlagHidden" 4318 path: "1*1(\Segment\Chapters\EditionEntry\EditionFlagHidden)" 4320 id: "0x45BD" 4322 minOccurs: "1" 4323 range: "0-1" 4325 default: "0" 4327 type: "uinteger" 4329 minver: "1" 4331 documentation: If an edition is hidden (1), it SHOULD NOT be 4332 available to the user interface (but still to Control Tracks; see 4333 flag notes). (1 bit) 4335 7.2.194. EditionFlagDefault Element 4337 name: "EditionFlagDefault" 4339 path: "1*1(\Segment\Chapters\EditionEntry\EditionFlagDefault)" 4341 id: "0x45DB" 4343 minOccurs: "1" 4345 range: "0-1" 4347 default: "0" 4349 type: "uinteger" 4351 minver: "1" 4353 documentation: If a flag is set (1) the edition SHOULD be used as the 4354 default one. (1 bit) 4356 7.2.195. EditionFlagOrdered Element 4358 name: "EditionFlagOrdered" 4360 path: "0*1(\Segment\Chapters\EditionEntry\EditionFlagOrdered)" 4362 id: "0x45DD" 4364 range: "0-1" 4366 default: "0" 4368 type: "uinteger" 4370 minver: "1" 4371 documentation: Specify if the chapters can be defined multiple times 4372 and the order to play them is enforced. (1 bit) 4374 7.2.196. ChapterAtom Element 4376 name: "ChapterAtom" 4378 path: "1*(\Segment\Chapters\EditionEntry(1*(\ChapterAtom)))" 4380 id: "0xB6" 4382 minOccurs: "1" 4384 maxOccurs: "unbounded" 4386 type: "master" 4388 recursive: "1" 4390 minver: "1" 4392 documentation: Contains the atom information to use as the chapter 4393 atom (apply to all tracks). 4395 7.2.197. ChapterUID Element 4397 name: "ChapterUID" 4399 path: "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterUID)" 4401 id: "0x73C4" 4403 minOccurs: "1" 4405 range: "not 0" 4407 type: "uinteger" 4409 minver: "1" 4411 documentation: A unique ID to identify the Chapter. 4413 7.2.198. ChapterStringUID Element 4415 name: "ChapterStringUID" 4417 path: 4418 "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterStringUID)" 4419 id: "0x5654" 4421 type: "utf-8" 4423 minver: "3" 4425 documentation: A unique string ID to identify the Chapter. Use for 4426 WebVTT cue identifier storage. 4428 7.2.199. ChapterTimeStart Element 4430 name: "ChapterTimeStart" 4432 path: 4433 "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTimeStart)" 4435 id: "0x91" 4437 minOccurs: "1" 4439 type: "uinteger" 4441 minver: "1" 4443 documentation: Timestamp of the start of Chapter (not scaled). 4445 7.2.200. ChapterTimeEnd Element 4447 name: "ChapterTimeEnd" 4449 path: 4450 "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTimeEnd)" 4452 id: "0x92" 4454 type: "uinteger" 4456 minver: "1" 4458 documentation: Timestamp of the end of Chapter (timestamp excluded, 4459 not scaled). 4461 7.2.201. ChapterFlagHidden Element 4463 name: "ChapterFlagHidden" 4465 path: 4466 "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterFlagHidden)" 4467 id: "0x98" 4469 minOccurs: "1" 4471 range: "0-1" 4473 default: "0" 4475 type: "uinteger" 4477 minver: "1" 4479 documentation: If a chapter is hidden (1), it SHOULD NOT be available 4480 to the user interface (but still to Control Tracks; see flag notes). 4481 (1 bit) 4483 7.2.202. ChapterFlagEnabled Element 4485 name: "ChapterFlagEnabled" 4487 path: 4488 "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterFlagEnabled)" 4490 id: "0x4598" 4492 minOccurs: "1" 4494 range: "0-1" 4496 default: "1" 4498 type: "uinteger" 4500 minver: "1" 4502 documentation: Specify wether the chapter is enabled. It can be 4503 enabled/disabled by a Control Track. When disabled, the movie SHOULD 4504 skip all the content between the TimeStart and TimeEnd of this 4505 chapter (see flag notes). (1 bit) 4507 7.2.203. ChapterSegmentUID Element 4509 name: "ChapterSegmentUID" 4511 path: 4512 "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterSegmentUID)" 4514 id: "0x6E67" 4515 range: ">0" 4517 size: "16" 4519 type: "binary" 4521 minver: "1" 4523 documentation: The SegmentUID of another Segment to play during this 4524 chapter. 4526 usage notes: ChapterSegmentUID is mandatory if 4527 ChapterSegmentEditionUID is used. 4529 7.2.204. ChapterSegmentEditionUID Element 4531 name: "ChapterSegmentEditionUID" 4533 path: "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterSegmentE 4534 ditionUID)" 4536 id: "0x6EBC" 4538 range: "not 0" 4540 type: "uinteger" 4542 minver: "1" 4544 documentation: The EditionUID to play from the Segment linked in 4545 ChapterSegmentUID. If ChapterSegmentEditionUID is undeclared then no 4546 Edition of the linked Segment is used. 4548 7.2.205. ChapterPhysicalEquiv Element 4550 name: "ChapterPhysicalEquiv" 4552 path: "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterPhysical 4553 Equiv)" 4555 id: "0x63C3" 4557 type: "uinteger" 4559 minver: "1" 4561 documentation: Specify the physical equivalent of this ChapterAtom 4562 like "DVD" (60) or "SIDE" (50), see complete list of values. 4564 7.2.206. ChapterTrack Element 4566 name: "ChapterTrack" 4568 path: "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTrack)" 4570 id: "0x8F" 4572 type: "master" 4574 minver: "1" 4576 documentation: List of tracks on which the chapter applies. If this 4577 Element is not present, all tracks apply 4579 7.2.207. ChapterTrackNumber Element 4581 name: "ChapterTrackNumber" 4583 path: "1*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTrack\Cha 4584 pterTrackNumber)" 4586 id: "0x89" 4588 minOccurs: "1" 4590 maxOccurs: "unbounded" 4592 range: "not 0" 4594 type: "uinteger" 4596 minver: "1" 4598 documentation: UID of the Track to apply this chapter too. In the 4599 absence of a control track, choosing this chapter will select the 4600 listed Tracks and deselect unlisted tracks. Absence of this Element 4601 indicates that the Chapter SHOULD be applied to any currently used 4602 Tracks. 4604 7.2.208. ChapterDisplay Element 4606 name: "ChapterDisplay" 4608 path: "0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay)" 4610 id: "0x80" 4611 maxOccurs: "unbounded" 4613 type: "master" 4615 minver: "1" 4617 documentation: Contains all possible strings to use for the chapter 4618 display. 4620 7.2.209. ChapString Element 4622 name: "ChapString" 4624 path: "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\ 4625 ChapString)" 4627 id: "0x85" 4629 minOccurs: "1" 4631 type: "utf-8" 4633 minver: "1" 4635 documentation: Contains the string to use as the chapter atom. 4637 7.2.210. ChapLanguage Element 4639 name: "ChapLanguage" 4641 path: "1*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\C 4642 hapLanguage)" 4644 id: "0x437C" 4646 minOccurs: "1" 4648 maxOccurs: "unbounded" 4650 default: "eng" 4652 type: "string" 4654 minver: "1" 4656 documentation: The languages corresponding to the string, in the 4657 bibliographic ISO-639-2 form. 4659 7.2.211. ChapCountry Element 4661 name: "ChapCountry" 4663 path: "0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\C 4664 hapCountry)" 4666 id: "0x437E" 4668 maxOccurs: "unbounded" 4670 type: "string" 4672 minver: "1" 4674 documentation: The countries corresponding to the string, same 2 4675 octets as in Internet domains. 4677 7.2.212. ChapProcess Element 4679 name: "ChapProcess" 4681 path: "0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess)" 4683 id: "0x6944" 4685 maxOccurs: "unbounded" 4687 type: "master" 4689 minver: "1" 4691 documentation: Contains all the commands associated to the Atom. 4693 7.2.213. ChapProcessCodecID Element 4695 name: "ChapProcessCodecID" 4697 path: "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\Cha 4698 pProcessCodecID)" 4700 id: "0x6955" 4702 minOccurs: "1" 4704 default: "0" 4706 type: "uinteger" 4707 minver: "1" 4709 documentation: Contains the type of the codec used for the 4710 processing. A value of 0 means native Matroska processing (to be 4711 defined), a value of 1 means the DVD command set is used. More codec 4712 IDs can be added later. 4714 7.2.214. ChapProcessPrivate Element 4716 name: "ChapProcessPrivate" 4718 path: "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\Cha 4719 pProcessPrivate)" 4721 id: "0x450D" 4723 type: "binary" 4725 minver: "1" 4727 documentation: Some optional data attached to the ChapProcessCodecID 4728 information. For ChapProcessCodecID = 1, it is the "DVD level" 4729 equivalent. 4731 7.2.215. ChapProcessCommand Element 4733 name: "ChapProcessCommand" 4735 path: "0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\Chap 4736 ProcessCommand)" 4738 id: "0x6911" 4740 maxOccurs: "unbounded" 4742 type: "master" 4744 minver: "1" 4746 documentation: Contains all the commands associated to the Atom. 4748 7.2.216. ChapProcessTime Element 4750 name: "ChapProcessTime" 4752 path: "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\Cha 4753 pProcessCommand\ChapProcessTime)" 4754 id: "0x6922" 4756 minOccurs: "1" 4758 type: "uinteger" 4760 minver: "1" 4762 documentation: Defines when the process command SHOULD be handled (0: 4763 during the whole chapter, 1: before starting playback, 2: after 4764 playback of the chapter). 4766 7.2.217. ChapProcessData Element 4768 name: "ChapProcessData" 4770 path: "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\Cha 4771 pProcessCommand\ChapProcessData)" 4773 id: "0x6933" 4775 minOccurs: "1" 4777 type: "binary" 4779 minver: "1" 4781 documentation: Contains the command information. The data SHOULD be 4782 interpreted depending on the ChapProcessCodecID value. For 4783 ChapProcessCodecID = 1, the data correspond to the binary DVD cell 4784 pre/post commands. 4786 7.2.218. Tags Element 4788 name: "Tags" 4790 path: "0*(\Segment\Tags)" 4792 id: "0x1254C367" 4794 maxOccurs: "unbounded" 4796 type: "master" 4798 minver: "1" 4800 documentation: Element containing Elements specific to Tracks/ 4801 Chapters. A list of valid tags can be found here. 4803 7.2.219. Tag Element 4805 name: "Tag" 4807 path: "1*(\Segment\Tags\Tag)" 4809 id: "0x7373" 4811 minOccurs: "1" 4813 maxOccurs: "unbounded" 4815 type: "master" 4817 minver: "1" 4819 documentation: Element containing Elements specific to Tracks/ 4820 Chapters. 4822 7.2.220. Targets Element 4824 name: "Targets" 4826 path: "1*1(\Segment\Tags\Tag\Targets)" 4828 id: "0x63C0" 4830 minOccurs: "1" 4832 type: "master" 4834 minver: "1" 4836 documentation: Contain all UIDs where the specified meta data apply. 4837 It is empty to describe everything in the Segment. 4839 7.2.221. TargetTypeValue Element 4841 name: "TargetTypeValue" 4843 path: "0*1(\Segment\Tags\Tag\Targets\TargetTypeValue)" 4845 id: "0x68CA" 4847 default: "50" 4849 type: "uinteger" 4850 minver: "1" 4852 documentation: A number to indicate the logical level of the target 4853 (see TargetType). 4855 7.2.222. TargetType Element 4857 name: "TargetType" 4859 path: "0*1(\Segment\Tags\Tag\Targets\TargetType)" 4861 id: "0x63CA" 4863 type: "string" 4865 minver: "1" 4867 documentation: An informational string that can be used to display 4868 the logical level of the target like "ALBUM", "TRACK", "MOVIE", 4869 "CHAPTER", etc (see TargetType). 4871 7.2.223. TagTrackUID Element 4873 name: "TagTrackUID" 4875 path: "0*(\Segment\Tags\Tag\Targets\TagTrackUID)" 4877 id: "0x63C5" 4879 maxOccurs: "unbounded" 4881 default: "0" 4883 type: "uinteger" 4885 minver: "1" 4887 documentation: A unique ID to identify the Track(s) the tags belong 4888 to. If the value is 0 at this level, the tags apply to all tracks in 4889 the Segment. 4891 7.2.224. TagEditionUID Element 4893 name: "TagEditionUID" 4895 path: "0*(\Segment\Tags\Tag\Targets\TagEditionUID)" 4897 id: "0x63C9" 4898 maxOccurs: "unbounded" 4900 default: "0" 4902 type: "uinteger" 4904 minver: "1" 4906 documentation: A unique ID to identify the EditionEntry(s) the tags 4907 belong to. If the value is 0 at this level, the tags apply to all 4908 editions in the Segment. 4910 7.2.225. TagChapterUID Element 4912 name: "TagChapterUID" 4914 path: "0*(\Segment\Tags\Tag\Targets\TagChapterUID)" 4916 id: "0x63C4" 4918 maxOccurs: "unbounded" 4920 default: "0" 4922 type: "uinteger" 4924 minver: "1" 4926 documentation: A unique ID to identify the Chapter(s) the tags belong 4927 to. If the value is 0 at this level, the tags apply to all chapters 4928 in the Segment. 4930 7.2.226. TagAttachmentUID Element 4932 name: "TagAttachmentUID" 4934 path: "0*(\Segment\Tags\Tag\Targets\TagAttachmentUID)" 4936 id: "0x63C6" 4938 maxOccurs: "unbounded" 4940 default: "0" 4942 type: "uinteger" 4944 minver: "1" 4945 documentation: A unique ID to identify the Attachment(s) the tags 4946 belong to. If the value is 0 at this level, the tags apply to all 4947 the attachments in the Segment. 4949 7.2.227. SimpleTag Element 4951 name: "SimpleTag" 4953 path: "1*(\Segment\Tags\Tag(1*(\SimpleTag)))" 4955 id: "0x67C8" 4957 minOccurs: "1" 4959 maxOccurs: "unbounded" 4961 type: "master" 4963 recursive: "1" 4965 minver: "1" 4967 documentation: Contains general information about the target. 4969 7.2.228. TagName Element 4971 name: "TagName" 4973 path: "1*1(\Segment\Tags\Tag\SimpleTag\TagName)" 4975 id: "0x45A3" 4977 minOccurs: "1" 4979 type: "utf-8" 4981 minver: "1" 4983 documentation: The name of the Tag that is going to be stored. 4985 7.2.229. TagLanguage Element 4987 name: "TagLanguage" 4989 path: "1*1(\Segment\Tags\Tag\SimpleTag\TagLanguage)" 4991 id: "0x447A" 4992 minOccurs: "1" 4994 default: "und" 4996 type: "string" 4998 minver: "1" 5000 documentation: Specifies the language of the tag specified, in the 5001 Matroska languages form. 5003 7.2.230. TagDefault Element 5005 name: "TagDefault" 5007 path: "1*1(\Segment\Tags\Tag\SimpleTag\TagDefault)" 5009 id: "0x4484" 5011 minOccurs: "1" 5013 range: "0-1" 5015 default: "1" 5017 type: "uinteger" 5019 minver: "1" 5021 documentation: Indication to know if this is the default/original 5022 language to use for the given tag. (1 bit) 5024 7.2.231. TagString Element 5026 name: "TagString" 5028 path: "0*1(\Segment\Tags\Tag\SimpleTag\TagString)" 5030 id: "0x4487" 5032 type: "utf-8" 5034 minver: "1" 5036 documentation: The value of the Tag. 5038 7.2.232. TagBinary Element 5040 name: "TagBinary" 5042 path: "0*1(\Segment\Tags\Tag\SimpleTag\TagBinary)" 5044 id: "0x4485" 5046 type: "binary" 5048 minver: "1" 5050 documentation: The values of the Tag if it is binary. Note that this 5051 cannot be used in the same SimpleTag as TagString. 5053 If you intend to implement a Matroska player, make sure you can 5054 handle all the files in our test suite [17], or at least the features 5055 presented there, not necessarily the same codecs. 5057 8. Beginning of File 5059 An EBML file always starts with 0x1A. The 0x1A makes the DOS command 5060 "type" ends display. That way you can include ASCII text before the 5061 EBML data and it can be displayed. The EBML parser is safe from 5062 false-alarm with these ASCII only codes. 5064 Next the EBML header is stored. This allows the the parser to know 5065 what type of EBML file it is parsing. 5067 9. Block Timecodes 5069 The Block's timecode is signed integer that represents the Raw 5070 Timecode relative to the Cluster's [18] Timecode [19], multiplied by 5071 the TimecodeScale (see the TimecodeScale notes [20]). 5073 The Block's timecode is represented by a 16bit signed integer 5074 (sint16). This means that the Block's timecode has a range of -32768 5075 to +32767 units. When using the default value of TimecodeScale, each 5076 integer represents 1ms. So, the maximum time span of Blocks in a 5077 Cluster using the default TimecodeScale of 1ms is 65536ms. 5079 If a Cluster's [21] Timecode [22] is set to zero, it is possible to 5080 have Blocks with a negative Raw Timecode. Blocks with a negative Raw 5081 Timecode are not valid. 5083 10. Default decoded field duration 5085 The "DefaultDecodedFieldDuration" Element can signal to the 5086 displaying application how often fields of a video sequence will be 5087 available for displaying. It can be used for both interlaced and 5088 progressive content. 5090 If the video sequence is signaled as interlaced, then the period 5091 between two successive fields at the output of the decoding process 5092 equals DefaultDecodedFieldDuration. 5094 For video sequences signaled as progressive it is twice the value of 5095 DefaultDecodedFieldDuration. 5097 These values are valid at the end of the decoding process before 5098 post-processing like deinterlacing or inverse telecine is applied. 5100 Examples: 5102 o Blu-ray movie: 1000000000ns/(48/1.001) = 20854167ns 5104 o PAL broadcast/DVD: 1000000000ns/(50/1.000) = 20000000ns 5106 o N/ATSC broadcast: 1000000000ns/(60/1.001) = 16683333ns 5108 o hard-telecined DVD: 1000000000ns/(60/1.001) = 16683333ns (60 5109 encoded interlaced fields per second) 5111 o soft-telecined DVD: 1000000000ns/(60/1.001) = 16683333ns (48 5112 encoded interlaced fields per second, with "repeat_first_field = 5113 1") 5115 11. Default Values 5117 The default value of an Element is assumed when not present in the 5118 data stream. It is assumed only in the scope of its Parent Element 5119 (for example "Language" in the scope of the "Track" element). If the 5120 "Parent Element" is not present or assumed, then the Element cannot 5121 be assumed. 5123 12. DRM 5125 Digital Rights Management. See Encryption [23]. 5127 13. Encryption 5129 Encryption in Matroska is designed in a very generic style that 5130 allows people to implement whatever form of encryption is best for 5131 them. It is easily possible to use the encryption framework in 5132 Matroska as a type of DRM. 5134 Because the encryption occurs within the Block, it is possible to 5135 manipulate encrypted streams without decrypting them. The streams 5136 could potentially be copied, deleted, cut, appended, or any number of 5137 other possible editing techniques without ever decrypting them. This 5138 means that the data is more useful, without having to expose it, or 5139 go through the intensive process of decrypting. 5141 Encryption can also be layered within Matroska. This means that two 5142 completely different types of encryption can be used, requiring two 5143 seperate keys to be able to decrypt a stream. 5145 Encryption information is stored in the "ContentEncodings" Master- 5146 element under the "ContentEncryption" Element. 5148 14. Image cropping 5150 Thanks to the PixelCropXXX elements, it's possible to crop the image 5151 before being resized. That means the image size follows this path: 5153 PixelXXX (size of the coded image) -> PixelCropXXX (size of the image 5154 to keep) -> DisplayXXX (resized cropped image) 5156 15. Matroska version indicators 5158 The EBML Header each Matroska file starts with contains two version 5159 number fields that inform a reading application about what to expect. 5160 These are "DocTypeVersion" and "DocTypeReadVersion". 5162 "DocTypeVersion" MUST contain the highest Matroska version number of 5163 any Element present in the Matroska file. For example, a file using 5164 the SimpleBlock Element MUST have a "DocTypeVersion" of at least 2 5165 while a file containing "CueRelativePosition" Elements MUST have a 5166 "DocTypeVersion" of at least 4. 5168 The "DocTypeReadVersion" MUST contain the minimum version number a 5169 reading application MUST at least suppost properly in order to play 5170 the file back (optionally with a reduced feature set). For example, 5171 if a file contains only Elements of version 2 or lower except for 5172 "CueRelativePosition" (which is a version 4 Matroska Element) then 5173 "DocTypeReadVersion" SHOULD still be set to 2 and not 4 because 5174 evaluating "CueRelativePosition" is not REQUIRED for standard 5175 playback -- it only makes seeking more precise if used. 5177 "DocTypeVersion" MUST always be equal to or greater than 5178 "DocTypeReadVersion". 5180 A reading application supporting Matroska version "V" MUST NOT refuse 5181 to read an application with "DocReadTypeVersion" equal to or lower 5182 than "V" even if "DocTypeVersion" is greater than "V". See also the 5183 note about Unknown Elements [24]. 5185 16. Mime Types 5187 There is no IETF endorsed MIME type for Matroska files. But you can 5188 use the ones we have defined on our web server: 5190 o .mka : Matroska audio "audio/x-matroska" 5192 o .mkv : Matroska video "video/x-matroska" 5194 o .mk3d : Matroska 3D video "video/x-matroska-3d" 5196 17. Octet 5198 An Octet refers to a byte made of 8 bits. 5200 18. Overlay Track 5202 Overlay tracks SHOULD be rendered in the same 'channel' as the track 5203 it's linked to. When content is found in such a track it is played 5204 on the rendering channel instead of the original track. 5206 19. Position References 5208 The position in some Elements refers to the position, in octets, from 5209 the beginning of an Element. The reference is the beginning of the 5210 first Segment (= its position + the size of its ID and size fields). 5211 0 = first possible position of a level 1 Element in the Segment. 5212 When data is spanned over mutiple Segments within a Section 21 (in 5213 the same file or in different files), the position represents the 5214 accumulated offset of each Segment. For example to reference a 5215 position in the third Segment, the position will be: the first 5216 segment total size + second segment total size + offset of the 5217 Element in the third segment. 5219 20. Raw Timecode 5221 The exact time of an object represented in nanoseconds. To find out 5222 a Block's Raw Timecode, you need the Block's timecode, the Cluster's 5223 [25] Timecode [26], and the TimecodeScale. For calculation, please 5224 see the see the TimecodeScale notes. 5226 21. Linked Segments 5228 Matroska provides several methods to link two or many Segments 5229 together to create a Linked Segment. A Linked Segment is a set of 5230 multiple Segments related together into a single presentation by 5231 using Hard Linking, Soft Linking, or Medium Linking. All Segments 5232 within a Linked Segment MUST utilize the same track numbers and 5233 timescale. All Segments within a Linked Segment MUST be stored 5234 within the same directory. All Segments within a Linked Segment MUST 5235 store a "SegmentUID". 5237 21.1. Hard Linking 5239 Hard Linking (also called splitting) is the process of creating a 5240 Linked Segment by relating multiple Segments using the "PrevUID" and 5241 "NextUID" Elements. Within a Linked Segment the timestamps of each 5242 Segment MUST follow consecutively in linking order. With Hard 5243 Linking, the chapters of any Segment within the Linked Segment MUST 5244 only reference the current Segment. With Hard Linking, the "NextUID" 5245 and "PrevUID" MUST reference the respective "SegmentUID" values of 5246 the next and previous Segments. The first Segment of a Linked 5247 Segment MUST have a "NextUID" Element and MUST NOT have a "PrevUID" 5248 Element. The last Segment of a Linked Segment MUST have a "PrevUID" 5249 Element and MUST NOT have a "NextUID" Element. The middle Segments 5250 of a Linked Segment MUST have both a "NextUID" Element and a 5251 "PrevUID" Element. 5253 As an example four Segments MAY be Hard Linked as a Linked Segment 5254 through cross-referencing each other with "SegmentUID", "PrevUID", 5255 and "NextUID" as in this table. 5257 +--------+------------------+-------------------+-------------------+ 5258 | file | SegmentUID | PrevUID | NextUID | 5259 | name | | | | 5260 +--------+------------------+-------------------+-------------------+ 5261 | "start | "71000c23cd31099 | n/a | "a77b3598941cb803 | 5262 | .mkv" | 853fbc94dd984a5d | | eac0fcdafe44fac9" | 5263 | | d" | | | 5264 | "middl | "a77b3598941cb80 | "71000c23cd310998 | "6c92285fa6d3e827 | 5265 | e.mkv" | 3eac0fcdafe44fac | 53fbc94dd984a5dd" | b198d120ea3ac674" | 5266 | | 9" | | | 5267 | "end.m | "6c92285fa6d3e82 | "a77b3598941cb803 | n/a | 5268 | kv" | 7b198d120ea3ac67 | eac0fcdafe44fac9" | | 5269 | | 4" | | | 5270 +--------+------------------+-------------------+-------------------+ 5272 21.2. Soft Linking 5274 Soft Linking is used by codec chapters. They can reference another 5275 Segment and jump to that Segment. The way the Segments are described 5276 are internal to the chapter codec and unknown to the Matroska level. 5277 But there are Elements within the "Info" Element (such as 5278 "ChapterTranslate") that can translate a value representing a Segment 5279 in the chapter codec and to the current "SegmentUID". All Segments 5280 that could be used in a Linked Segment in this way SHOULD be marked 5281 as members of the same family via the SegmentFamily Element, so that 5282 the player can quickly switch from one to the other. 5284 21.3. Medium Linking 5286 Medium Linking creates relationships between Segments using Ordered 5287 Chapters and the "ChapterSegmentUID" Element. A Segment Edition with 5288 Ordered Chapters MAY contain Chapters that reference timestamp ranges 5289 from other Segments. The Segment referenced by the Ordered Chapter 5290 via the "ChapterSegmentUID" Element SHOULD be played as part of a 5291 Linked Segment. The timestamps of Segment content referenced by 5292 Ordered Chapters MUST be adjusted according to the cumulative 5293 duration of the the previous Ordered Chapters. 5295 As an example a file named "intro.mkv" could have a "SegmentUID" of 5296 "0xb16a58609fc7e60653a60c984fc11ead". Another file called 5297 "program.mkv" could use a Chapter Edition that contains two Ordered 5298 Chapters. The first chapter references the Segment of "intro.mkv" 5299 with the use of a "ChapterSegmentUID", "ChapterSegmentEditionUID", 5300 "ChapterTimeStart" and optionally a "ChapterTimeEnd" element. The 5301 second chapter references content within the Segment of 5302 "program.mkv". A player SHOULD recognize the Linked Segment created 5303 by the use of "ChapterSegmentUID" in an enabled Edition and present 5304 the reference content of the two Segments together. 5306 22. Timecode Types 5308 o Absolute Timecode = Block+Cluster 5310 o Relative Timecode = Block 5312 o Scaled Timecode = Block+Cluster 5314 o Raw Timecode = (Block+Cluster)_TimecodeScale_TrackTimecodeScale 5316 23. TimecodeScale 5318 The TimecodeScale [27] is used to calculate the Raw Timecode of a 5319 Block. The timecode is obtained by adding the Block's timecode to 5320 the Cluster's [28] Timecode [29], and then multiplying that result by 5321 the TimecodeScale. The result will be the Block's Raw Timecode in 5322 nanoseconds. The formula for this would look like: 5324 (a + b) * c 5326 a = [Block's Timecode]({{site.baseurl}}/index.html#block-header) 5327 b = [Cluster's](#cluster) [Timecode](#timecode) 5328 c = [TimeCodeScale]({{site.baseurl}}/index.html#TimeCodeScale) 5330 An example of this is, assume a Cluster's [30] Timecode [31] has a 5331 value of 564264, the Block has a Timecode of 1233, and the 5332 timecodescale is the default of 1000000. 5334 (1233 + 564264) * 1000000 = 565497000000 5336 So, the Block in this example has a specific time of 565497000000 in 5337 nanoseconds. In milliseconds this would be 565497ms. 5339 24. TimecodeScale Rounding 5341 Because the default value of TimecodeScale is 1000000, which makes 5342 each integer in the Cluster and Block timecodes equal 1ms, this is 5343 the most commonly used. When dealing with audio, this causes 5344 innaccuracy with where you are seeking to. When the audio is 5345 combined with video, this is not an issue. For most cases the the 5346 synch of audio to video does not need to be more than 1ms accurate. 5347 This becomes obvious when one considers that sound will take 2-3ms to 5348 travel a single meter, so distance from your speakers will have a 5349 greater effect on audio/visual synch than this. 5351 However, when dealing with audio only files, seeking accuracy can 5352 become critical. For instance, when storing a whole CD in a single 5353 track, you want to be able to seek to the exact sample that a song 5354 begins at. If you seek a few sample ahead or behind then a 'crack' 5355 or 'pop' may result as a few odd samples are rendered. Also, when 5356 performing precise editing, it may be very useful to have the audio 5357 accuracy down to a single sample. 5359 It is usually true that when storing timecodes for an audio stream, 5360 the TimecodeScale MUST have an accuracy of at least that of the audio 5361 samplerate, otherwise there are rounding errors that prevent you from 5362 knowing the precise location of a sample. Here's how a program has 5363 to round each timecode in order to be able to recreate the sample 5364 number accurately. 5366 Let's assume that the application has an audio track with a sample 5367 rate of 44100. As written above the TimecodeScale MUST have at least 5368 the accuracy of the sample rate itself: 1000000000 / 44100 = 5369 22675.7369614512. This value MUST always be truncated. Otherwise 5370 the accuracy will not suffice. So in this example the application 5371 wil use 22675 for the TimecodeScale. The application could even use 5372 some lower value like 22674 which would allow it to be a little bit 5373 imprecise about the original timecodes. But more about that in a 5374 minute. 5376 Next the application wants to write sample number 52340 and 5377 calculates the timecode. This is easy. In order to calculate the 5378 Raw Timecode in ns all it has to do is calculate "RawTimecode = 5379 round(1000000000 * sample_number / sample_rate)". Rounding at this 5380 stage is very important! The application might skip it if it choses 5381 a slightly smaller value for the TimecodeScale factor instead of the 5382 truncated one like shown above. Otherwise it has to round or the 5383 results won't be reversible. For our example we get "RawTimecode = 5384 round(1000000000 * 52340 / 44100) = round(1186848072.56236) = 5385 1186848073". 5387 The next step is to calculate the Absolute Timecode - that is the 5388 timecode that will be stored in the Matroska file. Here the 5389 application has to divide the Raw Timecode from the previous 5390 paragraph by the TimecodeScale factor and round the result: 5391 "AbsoluteTimecode = round(RawTimecode / TimecodeScale_facotr)" which 5392 will result in the following for our example: "AbsoluteTimecode = 5393 round(1186848073 / 22675) = round(52341.7011245866) = 52342". This 5394 number is the one the application has to write to the file. 5396 Now our file is complete, and we want to play it back with another 5397 application. Its task is to find out which sample the first 5398 application wrote into the file. So it starts reading the Matroska 5399 file and finds the TimecodeScale factor 22675 and the audio sample 5400 rate 44100. Later it finds a data block with the Absolute Timecode 5401 of 52342. But how does it get the sample number from these numbers? 5402 First it has to calculate the Raw Timecode of the block it has just 5403 read. Here's no rounding involved, just an integer multiplication: 5404 "RawTimecode = AbsoluteTimecode * TimecodeScale_factor". In our 5405 example: "RawTimecode = 52342 * 22675 = 1186854850". 5407 The conversion from the RawTimecode to the sample number again 5408 requires rounding: "sample_number = round(RawTimecode * sample_rate / 5409 1000000000)". In our example: "sample_number = round(1186854850 * 5410 44100 / 1000000000) = round(52340.298885) = 52340". This is exactly 5411 the sample number that the previous program started with. 5413 Some general notes for a program: 5415 1. Always calculate the timestamps / sample numbers with floating 5416 point numbers of at least 64bit precision (called 'double' in 5417 most modern programming languages). If you're calculating with 5418 integers then make sure they're 64bit long, too. 5420 2. Always round if you divide. Always! If you don't you'll end up 5421 with situations in which you have a timecode in the Matroska file 5422 that does not correspond to the sample number that it started 5423 with. Using a slightly lower timecode scale factor can help here 5424 in that it removes the need for proper rounding in the conversion 5425 from sample number to Raw Timecode. 5427 25. Track Flags 5429 25.1. Default flag 5431 The "default track" flag is a hint for the playback application and 5432 SHOULD always be changeable by the user. If the user wants to see or 5433 hear a track of a certain kind (audio, video, subtitles) and she 5434 hasn't chosen a specific track then the player SHOULD use the first 5435 track of that kind whose "default track" flag is set to "1". If no 5436 such track is found then the first track of this kind SHOULD be 5437 chosen. 5439 Only one track of a kind MAY have its "default track" flag set in a 5440 segment. If a track entry does not contain the "default track" flag 5441 element then its default value "1" is to be used. 5443 25.2. Forced flag 5445 The "forced" flag tells the playback application that it MUST 5446 display/play this track or another track of the same kind that also 5447 has its "forced" flag set. When there are multiple "forced" tracks, 5448 the player SHOULD determined based upon the language of the forced 5449 flag or use the default flag if no track matches the use languages. 5451 Another track of the same kind without the "forced" flag may be use 5452 simultaneously with the "forced" track (like DVD subtitles for 5453 example). 5455 26. TrackTimecodeScale 5457 The TrackTimecodeScale [32] is used align tracks that would otherwise 5458 be played at different speeds. An example of this would be if you 5459 have a film that was originally recorded at 24fps video. When 5460 playing this back through a PAL broadcasting system, it is standard 5461 to speed up the film to 25fps to match the 25fps display speed of the 5462 PAL broadcasting standard. However, when broadcasting the video 5463 through NTSC, it is typical to leave the film at its original speed. 5464 If you wanted to make a single file where there was one video stream, 5465 and an audio stream used from the PAL broadcast, as well as an audio 5466 stream used from the NTSC broadcast, you would have the problem that 5467 the PAL audio stream would be 1/24th faster than the NTSC audio 5468 stream, quickly leading to problems. It is possible to stretch out 5469 the PAL audio track and reencode it at a slower speed, however when 5470 dealing with lossy audio codecs, this often results in a loss of 5471 audio quality and/or larger file sizes. 5473 This is the type of problem that TrackTimecodeScale was designed to 5474 fix. Using it, the video can be played back at a speed that will 5475 synch with either the NTSC or the PAL audio stream, depending on 5476 which is being used for playback. To continue the above example: 5478 Track 1: Video 5479 Track 2: NTSC Audio 5480 Track 3: PAL Audio 5482 Because the NTSC track is at the original speed, it will used as the 5483 default value of 1.0 for its TrackTimecodeScale. The video will also 5484 be aligned to the NTSC track with the default value of 1.0. 5486 The TrackTimecodeScale value to use for the PAL track would be 5487 calculated by determining how much faster the PAL track is than the 5488 NTSC track. In this case, because we know the video for the NTSC 5489 audio is being played back at 24fps and the video for the PAL audio 5490 is being played back at 25fps, the calculation would be: 5492 (25 / 24) = ~ 1.04166666666666666667 5494 When writing a file that uses a non-default TrackTimecodeScale, the 5495 values of the Block's timecode are whatever they would be when 5496 normally storing the track with a default value for the 5497 TrackTimecodeScale. However, the data is interleaved a little 5498 differently. Data SHOULD be interleaved by its Raw Timecode [33] in 5499 the order handed back from the encoder. The Raw Timecode of a Block 5500 from a track using TrackTimecodeScale is calculated using: 5502 "(Block's Timecode + Cluster's Timecode) * TimecodeScale * 5503 TrackTimecodeScale" 5505 So, a Block from the PAL track above that had a Scaled Timecode [34] 5506 of 100 seconds would have a Raw Timecode of 104.66666667 seconds, and 5507 so would be stored in that part of the file. 5509 When playing back a track using the TrackTimecodeScale, if the track 5510 is being played by itself, there is no need to scale it. From the 5511 above example, when playing the Video with the NTSC Audio, neither 5512 are scaled. However, when playing back the Video with the PAL Audio, 5513 the timecodes from the PAL Audio track are scaled using the 5514 TrackTimecodeScale, resulting in the video playing back in synch with 5515 the audio. 5517 It would be possible for a player to also adjust the audio's 5518 samplerate at the same time as adjusting the timecodes if you wanted 5519 to play the two audio streams synchronously. It would also be 5520 possible to adjust the video to match the audio's speed. However, 5521 for playback, the selected track(s) timecodes SHOULD be adjusted if 5522 they need to be scaled. 5524 While the above example deals specifically with audio tracks, this 5525 element can be used to align video, audio, subtitles, or any other 5526 type of track contained in a Matroska file. 5528 27. Unknown elements 5530 Matroska is based upon the principal that a reading application does 5531 not have to support 100% of the specifications in order to be able to 5532 play the file. A Matroska file therefore contains version indicators 5533 [35] that tell a reading application what to expect. 5535 It is possible and valid to have the version fields indicate that the 5536 file contains Matroska Elements from a higher specification version 5537 number while signalling that a reading application MUST only support 5538 a lower version number properly in order to play it back (possibly 5539 with a reduced feature set). This implies that a reading application 5540 supporting at least Matroska version V reading a file whose 5541 DocTypeReadVersion field is equal to or lower than V MUST skip 5542 Matroska/EBML Elements it encounters but which it does not know about 5543 if that unknown element fits into the size constraints set by the 5544 current parent element. 5546 28. Multi-planar and 3D videos 5548 There are 2 different ways to compress 3D videos: have each 'eye' 5549 track in a separate track and have one track have both 'eyes' 5550 combined inside (which is more efficient, compression-wise). 5551 Matroska supports both ways. 5553 For the single track variant, there is the StereoMode [36] Element 5554 which defines how planes are assembled in the track (mono or left- 5555 right combined). Odd values of StereoMode means the left plane comes 5556 first for more convenient reading. The pixel count of the track 5557 (PixelWidth/PixelHeight) is the raw amount of pixels (for example 5558 3840x1080 for full HD side by side) and the DisplayWidth/Height in 5559 pixels is the amount of pixels for one plane (1920x1080 for that full 5560 HD stream). Old stereo 3D were displayed using anaglyph (cyan and 5561 red colours separated). For compatibility with such movies, there is 5562 a value of the StereoMode that corresponds to AnaGlyph. 5564 There is also a "packed" mode (values 13 and 14) which consists of 5565 packing 2 frames together in a Block using lacing. The first frame 5566 is the left eye and the other frame is the right eye (or vice versa). 5567 The frames SHOULD be decoded in that order and are possibly dependent 5568 on each other (P and B frames). 5570 For separate tracks, Matroska needs to define exactly which track 5571 does what. TrackOperation [37] with TrackCombinePlanes [38] do that. 5572 For more details look at how TrackOperation works [39]. 5574 The 3D support is still in infancy and may evolve to support more 5575 features. 5577 /index.html#StereoMode) used to be part of Matroska v2 but it didn't 5578 meet the requirement for multiple tracks. There was also a bug in 5579 libmatroska prior to 0.9.0 that would save/read it as 0x53B9 instead 5580 of 0x53B8. Readers may support these legacy files by checking 5581 Matroska v2 or 0x53B9. The olders values were 0: mono, 1: right eye, 5582 2: left eye, 3: both eyes 5584 29. Track Operation 5586 TrackOperation [40] allows combining multiple tracks to make a 5587 virtual one. It uses 2 separate system to combine tracks. One to 5588 create a 3D "composition" (left/right/background planes) and one to 5589 simplify join 2 tracks together to make a single track. 5591 A track created with TrackOperation is a proper track with a UID and 5592 all its flags. However the codec ID is meaningless because each 5593 "sub" track needs to be decoded by its own decoder before the 5594 "operation" is applied. The Cues corresponding to such a virtual 5595 track SHOULD be the sum of the Cues elements for each of the tracks 5596 it's composed of (when the Cues are defined per track). 5598 In the case of TrackJoinBlocks, the Blocks (from BlockGroup and 5599 SimpleBlock) of all the tracks SHOULD be used as if they were defined 5600 for this new virtual Track. When 2 Blocks have overlapping start or 5601 end timecodes, it's up to the underlying system to either drop some 5602 of these frames or render them the way they overlap. In the end this 5603 situation SHOULD be avoided when creating such tracks as you can 5604 never be sure of the end result on different platforms. 5606 30. Matroska Element Ordering Guidelines 5608 Except for the EBML Header and the CRC-32 Element, the EBML 5609 specification does not require any particular storage order for 5610 Elements. The Matroska specification however defines mandates and 5611 recommendations for ordering certain Elements in order to facilitate 5612 better playback, seeking, and editing efficiency. This section 5613 describes and offers rationale for ordering requirements and 5614 recommendations for Matroska. 5616 30.1. Top-Level Elements 5618 A valid Matroska file requires only one Top-Level Element, the "Info" 5619 Element; however, to be playable Matroska MUST also contain at least 5620 one "Tracks" and "Cluster" Element. The first "Info" Element and the 5621 first "Tracks" Element MUST either be stored before the first 5622 "Cluster" Element or both be referenced by a "SeekHead" Element which 5623 occurs before the first "Cluster" Element. 5625 After a Matroska file has been created it could still be edited. For 5626 example chapters, tags or attachments can be added. When new Top- 5627 Level Elements are added to a Matroska file the "SeekHead" Element(s) 5628 MUST be updated so that the "SeekHead" Element(s) itemize the 5629 identity and position of all Top-Level Elements. Editing, removing, 5630 or adding Elements to a Matroska file often requires that some 5631 existing Elements be voided or extended; therefore, it is RECOMMENDED 5632 to use Void Elements as padding in between Top-Level Elements. 5634 30.2. CRC-32 5636 As noted by the EBML specification, if a "CRC-32" Element is used 5637 then the "CRC-32" Element MUST be the first ordered Element within 5638 its Parent Element. The Matroska specification recommends that "CRC- 5639 32" Elements SHOULD NOT be used as an immediate Child Element of the 5640 "Segment" Element; however all Top-Level Elements of an EBML Document 5641 SHOULD include a CRC-32 Element as a Child Element. 5643 30.3. SeekHead 5645 If used, the first "SeekHead" Element SHOULD be the first non-"CRC- 5646 32" Child Element of the "Segment" Element. If a second "SeekHead" 5647 Element is used then the first "SeekHead" MUST reference the identity 5648 and position of the second "SeekHead", the second "SeekHead" MUST 5649 only reference "Cluster" Elements and not any other Top-Level Element 5650 already contained within the first "SeekHead", and the second 5651 "SeekHead" MAY be stored in any order relative to the other Top-Level 5652 Elements. Whether one or two "SeekHead" Element(s) are used, the 5653 "SeekHead" Element(s) MUST collectively reference the identity and 5654 position of all Top-Level Elements except for the first "SeekHead" 5655 itself. 5657 It is RECOMMENDED that the first "SeekHead" Element be followed by 5658 some padding (a "Void" Element) to allow for the "SeekHead" Element 5659 to be expanded to cover new Top-Level Elements that could be added to 5660 the Matroska file, such as "Tags", "Chapters" and "Attachments" 5661 Elements. 5663 30.4. Cues (index) 5665 The "Cues" Element is RECOMMENDED to optimize seeking access in 5666 Matroska. It is programmatically simpler to add the "Cues" Element 5667 after all of the "Cluster" Elements are written because this does not 5668 require a prediction of how much space to reserve before writing the 5669 "Cluster" Elements. On the other hand, storing the "Cues" Element 5670 before the "Clusters" can provide some seeking advantages. 5672 30.5. Info 5674 The first "Info" Element SHOULD occur before the first "Tracks" and 5675 first "Cluster" Element. 5677 30.6. Chapters 5679 The "Chapters" Element SHOULD be placed before the "Cluster" 5680 Element(s). The "Chapters" Element can be used during playback even 5681 if the user doesn't need to seek. It immediately gives the user 5682 information of what section is being read and what other sections are 5683 available. In the case of Ordered Chapters it RECOMMENDED to 5684 evaluate the logical linking even before starting playing anything. 5685 The "Chapters" Element SHOULD be placed before the first "Tracks" 5686 Element and after the first "Info" Element. 5688 30.7. Attachments 5690 The "Attachments" Element is not meant to use by default when playing 5691 the file, but could contain the cover art and/or fonts. Cover art is 5692 useful even before the file is played and fonts could be needed 5693 before playback starts for initialization of subtitles that could use 5694 them. The "Attachments" Element MAY be placed before the first 5695 "Cluster" Element; however if the "Attachments" Element is likely to 5696 be edited, then it SHOULD be placed after the last "Cluster" Element. 5698 30.8. Tags 5700 The "Tags" Element is the one that is most subject to changes after 5701 the file was originally created. So for easier editing the "Tags" 5702 Element SHOULD be placed at the end of the "Segment" Element, even 5703 after the "Attachments" Element. On the other hand, it is 5704 inconvenient to have to seek in the "Segment" for tags especially for 5705 network streams. So it's better if the "Tags" Element(s) are found 5706 early in the stream. When editing the "Tags" Element(s), the 5707 original "Tags" Element at the beginning can be voided [41] and a new 5708 one written right at the end [42] of the "Segment" Element. The file 5709 size will only marginally change. 5711 30.9. Optimum layout from a muxer 5713 o SeekHead 5715 o Info 5717 o Tracks 5719 o Chapters 5721 o Attachments 5723 o Tags 5725 o Clusters 5727 o Cues 5729 30.10. Optimum layout after editing tags 5731 o SeekHead 5733 o Info 5735 o Tracks 5736 o Chapters 5738 o Attachments 5740 o Void 5742 o Clusters 5744 o Cues 5746 o Tags 5748 30.11. Optimum layout with Cues at the front 5750 o SeekHead 5752 o Info 5754 o Tracks 5756 o Chapters 5758 o Attachments 5760 o Tags 5762 o Cues 5764 o Clusters 5766 30.12. Cluster Timecode 5768 As each "BlockGroup" and "SimpleBlock" of a "Cluster" Element needs 5769 the Cluster "Timecode", the "Timecode" Element MUST occur as the 5770 first Child Element within the "Cluster" Element. 5772 31. CodecID 5774 As an additional resource to this page Haali has created a list of 5775 codec IDs in a PDF [43]. 5777 For each TrackEntry inside matroska [44], there has to be a CodecID 5778 [45] defined. This ID is represent the codec used to encode data in 5779 the Track. The codec works with the coded data in the stream, but 5780 also with some codec initialisation. There are 2 different kind of 5781 codec "initialisation": 5783 o CodecPrivate in the TrackEntry 5784 o CodecState in the BlockGroup 5786 Each of these elements contain the same kind of data. And these data 5787 depend on the codec used. 5789 Important Note: 5791 The intention behind this list is "NOT" to list all existing audio 5792 and video codecs, but rather to list those codecs that are "currently 5793 supported" in Matroska and therefore need a well defined codec ID so 5794 that all developers supporting Matroska will use the same ID. If you 5795 feel we missed support for a very important codec, please tell us on 5796 our development mailing list (matroska-devel at lists.matroska.org). 5798 31.1. Video Codecs 5800 *Codec ID:* "V_MS/VFW/FOURCC" 5801 *Codec Name:* Microsoft (TM) Video Codec Manager (VCM) 5802 *Description:* The private data contains the VCM structure 5803 BITMAPINFOHEADER including the extra private bytes, as defined by 5804 Microsoft [46]. The data are stored in little endian format (like on 5805 IA32 machines). Where is the Huffman table stored in HuffYUV, not 5806 AVISTREAMINFO ??? And the FourCC, not in AVISTREAMINFO.fccHandler ??? 5808 *Codec ID:* V_UNCOMPRESSED 5809 *Codec Name:* Video, raw uncompressed video frames 5810 *Description:* The private data is void, all details about the used 5811 colour specs and bit depth are to be put/read from the 5812 KaxCodecColourSpace elements. 5814 *Codec ID:* V_MPEG4/ISO/??? 5815 *Codec Name:* MPEG4 ISO Profile Video 5816 *Description:* The stream complies with, and uses the CodecID for, 5817 one of the MPEG-4 profiles listed below. 5819 *Codec ID:* V_MPEG4/ISO/SP 5820 *Codec Name:* MPEG4 ISO simple profile (DivX4) 5821 *Description:* Stream was created via improved codec API (UCI) or 5822 even transmuxed from AVI (no b-frames in Simple Profile), frame order 5823 is coding order 5825 *Codec ID:* V_MPEG4/ISO/ASP 5826 *Codec Name:* MPEG4 ISO advanced simple profile (DivX5, XviD, FFMPEG) 5827 *Description:* Stream was created via improved codec API (UCI) or 5828 transmuxed from MP4, not simply transmuxed from AVI! Note there are 5829 differences how b-frames are handled in these native streams, when 5830 being compared to a VfW created stream, as here there are "no" dummy 5831 frames inserted, the frame order is exactly the same as the coding 5832 order, same as in MP4 streams! 5834 *Codec ID:* V_MPEG4/ISO/AP 5835 *Codec Name:* MPEG4 ISO advanced profile 5836 *Description:* (Same as above) 5838 *Codec ID:* V_MPEG4/MS/V3 5839 *Codec Name:* Microsoft (TM) MPEG4 V3 5840 *Description:* and derivates, means DivX3, Angelpotion, SMR, etc.; 5841 stream was created using VfW codec or transmuxed from AVI; note that 5842 V1/V2 are covered in VfW compatibility mode 5844 *Codec ID:* V_MPEG1 5845 *Codec Name:* MPEG 1 5846 *Description:* The matroska video stream will contain a demuxed 5847 Elementary Stream (ES ), where block boundaries are still to be 5848 defined. Its RECOMMENDED to use MPEG2MKV.exe for creating those 5849 files, and to compare the results with selfmade implementations 5851 *Codec ID:* V_MPEG2 5852 *Codec Name:* MPEG 2 5853 *Description:* The matroska video stream will contain a demuxed 5854 Elementary Stream (ES ), where block boundaries are still to be 5855 defined. Its RECOMMENDED to use MPEG2MKV.exe for creating those 5856 files, and to compare the results with selfmade implementations 5858 *Codec ID:* V_REAL/???? 5859 *Codec Name:* Real Video(TM) 5860 *Description:* The stream is one of the Real Video(TM) video streams 5861 listed below. Source for the codec names are from Karl Lillevold on 5862 Doom9 [47]. The CodecPrivate element contains a "real_video_props_t" 5863 structure in Big Endian byte order as found in librmff [48]. 5865 *Codec ID:* V_REAL/RV10 5866 *Codec Name:* RealVideo 1.0 aka RealVideo 5 5867 *Description:* Individual slices from the Real container are combined 5868 into a single frame. 5870 *Codec ID:* V_REAL/RV20 5871 *Codec Name:* RealVideo G2 and RealVideo G2+SVT 5872 *Description:* Individual slices from the Real container are combined 5873 into a single frame. 5875 *Codec ID:* V_REAL/RV30 5876 *Codec Name:* RealVideo 8 5877 *Description:* Individual slices from the Real container are combined 5878 into a single frame. 5880 *Codec ID:* V_REAL/RV40 5881 *Codec Name:* rv40 : RealVideo 9 5882 *Description:* Individual slices from the Real container are combined 5883 into a single frame. 5885 *Codec ID:* V_QUICKTIME 5886 *Codec Name:* Video taken from QuickTime(TM) files 5887 *Description:* Several codecs as stored in QuickTime, e.g. Sorenson 5888 or Cinepak. The CodecPrivate contains all additional data that is 5889 stored in the 'stsd' (sample description) atom in the QuickTime file 5890 *after* the mandatory video descriptor structure (starting with the 5891 size and FourCC fields). For an explanation of the QuickTime file 5892 format read QuickTime File Format Specification [49]. 5894 *Codec ID:* V_THEORA 5895 *Codec Name:* Theora 5896 *Description:* The private data contains the first three Theora 5897 packets in order. The lengths of the packets precedes them. The 5898 actual layout is: 5900 o Byte 1: number of distinct packets '"#p"' minus one inside the 5901 CodecPrivate block. This MUST be '2' for current (as of 5902 2016-07-08) Theora headers. 5904 o Bytes 2..n: lengths of the first '"#p"' packets, coded in Xiph- 5905 style lacing [50]. The length of the last packet is the length of 5906 the CodecPrivate block minus the lengths coded in these bytes 5907 minus one. 5909 o Bytes n+1..: The Theora identification header, followed by the 5910 commend header followed by the codec setup header. Those are 5911 described in the Theora specs [51]. 5913 *Codec ID:* V_PRORES 5914 *Codec Name:* Apple ProRes 5915 *Description:* The private data contains the fourcc as found in MP4 5916 movies: 5918 o apch: ProRes 422 High Quality 5920 o apcn: ProRes 422 Standard Definition 5922 o apcs: ProRes 422 LT 5924 o apco: ProRes 422 Proxy 5926 o ap4h: ProRes 4444 5927 this page for more technical details on ProRes [52] 5929 31.2. Audio 5931 *Codec ID:* A_MPEG/L3 5932 *Codec Name:* MPEG Audio 1, 2, 2.5 Layer III 5933 *Description:* The private data is void. The data contain everything 5934 needed for playback in the MPEG Audio header of each frame. 5935 Corresponding ACM wFormatTag : 0x0055 5937 *Codec ID:* A_MPEG/L2 5938 *Codec Name:* MPEG Audio 1, 2 Layer II 5939 *Description:* The private data is void. The data contain everything 5940 needed for playback in the MPEG Audio header of each frame. 5941 Corresponding ACM wFormatTag : 0x0050 5943 *Codec ID:* A_MPEG/L1 5944 *Codec Name:* MPEG Audio 1, 2 Layer I 5945 *Description:* The private data is void. The data contain everything 5946 needed for playback in the MPEG Audio header of each frame. 5947 Corresponding ACM wFormatTag : 0x0050 5949 *Codec ID:* A_PCM/INT/BIG 5950 *Codec Name:* PCM Integer Big Endian 5951 *Description:* The private data is void. The bitdepth has to be read 5952 and set from KaxAudioBitDepth element. Corresponding ACM wFormatTag 5953 : ??? 5955 *Codec ID:* A_PCM/INT/LIT 5956 *Codec Name:* PCM Integer Little Endian 5957 *Description:* The private data is void. The bitdepth has to be read 5958 and set from KaxAudioBitDepth element. Corresponding ACM wFormatTag 5959 : 0x0001 5961 *Codec ID:* A_PCM/FLOAT/IEEE 5962 *Codec Name:* Floating Point, IEEE compatible 5963 *Description:* The private data is void. The bitdepth has to be read 5964 and set from KaxAudioBitDepth element (32 bit in most cases). The 5965 float are stored in little endian order (most common float format). 5966 Corresponding ACM wFormatTag : 0x0003 5968 *Codec ID:* A_MPC 5969 *Codec Name:* MPC (musepack) SV8 5970 *Description:* The main developer for musepack has requested that we 5971 wait until the SV8 framing has been fully defined for musepack before 5972 defining how to store it in Matroska. 5974 *Codec ID:* A_AC3 5975 *Codec Name:* (Dolby[TM]) AC3 5976 *Description:* BSID <= 8 !! The private data is void ??? 5977 Corresponding ACM wFormatTag : 0x2000 ; channel number have to be 5978 read from the corresponding audio element 5980 *Codec ID:* A_AC3/BSID9 5981 *Codec Name:* (Dolby[TM]) AC3 5982 *Description:* The ac3 frame header has, similar to the mpeg-audio 5983 header a version field. Normal ac3 is defiened as bitstream id 8 (5 5984 Bits, numbers are 0-15). Everything below 8 is still compatible with 5985 all decoders that handle 8 correctly. Everything higher are 5986 additions that break decoder compatibility. For the samplerates 5987 24kHz (00); 22,05kHz (01) and 16kHz (10) the BSID is 9 For the 5988 samplerates 12kHz (00); 11,025kHz (01) and 8kHz (10) the BSID is 10 5990 *Codec ID:* A_AC3/BSID10 5991 *Codec Name:* (Dolby[TM]) AC3 5992 *Description:* (Same as above) 5994 *Codec ID:* A_ALAC 5995 *Codec Name:* ALAC (Apple Lossless Audio Codec) 5996 *Description:* The private data contains ALAC's magic cookie (both 5997 the codec specific configuration as well as the optional channel 5998 layout information). Its format is described in ALAC's official 5999 source code [53]. 6001 *Codec ID:* A_DTS 6002 *Codec Name:* Digital Theatre System 6003 *Description:* Supports DTS, DTS-ES, DTS-96/26, DTS-HD High 6004 Resolution Audio and DTS-HD Master Audio. The private data is void. 6005 Corresponding ACM wFormatTag : 0x2001 6007 *Codec ID:* A_DTS/EXPRESS 6008 *Codec Name:* Digital Theatre System Express 6009 *Description:* DTS Express (a.k.a. LBR) audio streams. The private 6010 data is void. Corresponding ACM wFormatTag : 0x2001 6012 *Codec ID:* A_DTS/LOSSLESS 6013 *Codec Name:* Digital Theatre System Lossless 6014 *Description:* DTS Lossless audio that does not have a core 6015 substream. The private data is void. Corresponding ACM wFormatTag : 6016 0x2001 6018 *Codec ID:* A_VORBIS 6019 *Codec Name:* Vorbis 6020 *Description:* The private data contains the first three Vorbis 6021 packet in order. The lengths of the packets precedes them. The 6022 actual layout is: Byte 1: number of distinct packets '"#p"' minus one 6023 inside the CodecPrivate block. This MUST be '2' for current (as of 6024 2016-07-08) Vorbis headers. Bytes 2..n: lengths of the first '"#p"' 6025 packets, coded in Xiph-style lacing [54]. The length of the last 6026 packet is the length of the CodecPrivate block minus the lengths 6027 coded in these bytes minus one. Bytes n+1..: The Vorbis 6028 identification header [55], followed by the Vorbis comment header 6029 [56] followed by the codec setup header [57]. 6031 *Codec ID:* A_FLAC 6032 *Codec Name:* FLAC (Free Lossless Audio Codec) [58] 6033 *Description:* The private data contains all the header/metadata 6034 packets before the first data packet. These include the first header 6035 packet containing only the word "fLaC" as well as all metadata 6036 packets. 6038 *Codec ID:* A_REAL/???? 6039 *Codec Name:* Realmedia Audio codecs 6040 *Description:* The stream contains one of the following audio codecs. 6041 In each case the CodecPrivate element contains either the 6042 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 6043 (differentiated by their "version" field; Big Endian byte order) as 6044 found in librmff [59]. 6046 *Codec ID:* A_REAL/14_4 6047 *Codec Name:* Real Audio 1 6048 *Description:* 6050 *Codec ID:* A_REAL/28_8 6051 *Codec Name:* Real Audio 2 6052 *Description:* 6054 *Codec ID:* A_REAL/COOK 6055 *Codec Name:* Real Audio Cook Codec (codename: Gecko) 6056 *Description:* 6058 *Codec ID:* A_REAL/SIPR 6059 *Codec Name:* Sipro Voice Codec 6060 *Description:* 6062 *Codec ID:* A_REAL/RALF 6063 *Codec Name:* Real Audio Lossless Format 6064 *Description:* 6066 *Codec ID:* A_REAL/ATRC 6067 *Codec Name:* Sony Atrac3 Codec 6068 *Description:* 6070 *Codec ID:* A_MS/ACM 6071 *Codec Name:* Microsoft(TM) Audio Codec Manager (ACM) 6072 *Description:* The private data contains the ACM structure 6073 WAVEFORMATEX including the extra private bytes, as defined by 6074 Microsoft [60]. The data are stored in little endian format (like on 6075 IA32 machines). 6077 *Codec ID:* A_AAC/?????/??? 6078 *Codec Name:* AAC Profile Audio 6079 *Description:* The stream complies with, and uses the CodecID for, 6080 one of the AAC profiles listed below. AAC audio always uses 6081 wFormatTag 0xFF 6083 *Codec ID:* A_AAC/MPEG2/MAIN 6084 *Codec Name:* MPEG2 Main Profile 6085 *Description:* The private data is void. Channel number and sample 6086 rate have to be read from the corresponding audio element. Audio 6087 stream is stripped from ADTS headers and normal matroska frame based 6088 muxing scheme is applied. 6090 *Codec ID:* A_AAC/MPEG2/LC 6091 *Codec Name:* Low Complexity 6092 *Description:* The private data is void. Channel number and sample 6093 rate have to be read from the corresponding audio element. Audio 6094 stream is stripped from ADTS headers and normal matroska frame based 6095 muxing scheme is applied. 6097 *Codec ID:* A_AAC/MPEG2/LC/SBR 6098 *Codec Name:* Low Complexity with Spectral Band Replication 6099 *Description:* The private data is void. Channel number and sample 6100 rate have to be read from the corresponding audio element. Audio 6101 stream is stripped from ADTS headers and normal matroska frame based 6102 muxing scheme is applied. 6104 *Codec ID:* A_AAC/MPEG2/SSR 6105 *Codec Name:* Scalable Sampling Rate 6106 *Description:* The private data is void. Channel number and sample 6107 rate have to be read from the corresponding audio element. Audio 6108 stream is stripped from ADTS headers and normal matroska frame based 6109 muxing scheme is applied. 6111 *Codec ID:* A_AAC/MPEG4/MAIN 6112 *Codec Name:* MPEG4 Main Profile 6113 *Description:* The private data is void. Channel number and sample 6114 rate have to be read from the corresponding audio element. Audio 6115 stream is stripped from ADTS headers and normal matroska frame based 6116 muxing scheme is applied. 6118 *Codec ID:* A_AAC/MPEG4/LC 6119 *Codec Name:* Low Complexity 6120 *Description:* The private data is void. Channel number and sample 6121 rate have to be read from the corresponding audio element. Audio 6122 stream is stripped from ADTS headers and normal matroska frame based 6123 muxing scheme is applied. 6125 *Codec ID:* A_AAC/MPEG4/LC/SBR 6126 *Codec Name:* Low Complexity with Spectral Band Replication 6127 *Description:* The private data is void. Channel number and sample 6128 rate have to be read from the corresponding audio element. Audio 6129 stream is stripped from ADTS headers and normal matroska frame based 6130 muxing scheme is applied. 6132 *Codec ID:* A_AAC/MPEG4/SSR 6133 *Codec Name:* Scalable Sampling Rate 6134 *Description:* The private data is void. Channel number and sample 6135 rate have to be read from the corresponding audio element. Audio 6136 stream is stripped from ADTS headers and normal matroska frame based 6137 muxing scheme is applied. 6139 *Codec ID:* A_AAC/MPEG4/LTP 6140 *Codec Name:* Long Term Prediction 6141 *Description:* The private data is void. Channel number and sample 6142 rate have to be read from the corresponding audio element. Audio 6143 stream is stripped from ADTS headers and normal matroska frame based 6144 muxing scheme is applied. 6146 *Codec ID:* A_QUICKTIME 6147 *Codec Name:* Audio taken from QuickTime(TM) files 6148 *Description:* Several codecs as stored in QuickTime, e.g. QDesign 6149 Music v1 or v2. The CodecPrivate contains all additional data that 6150 is stored in the 'stsd' (sample description) atom in the QuickTime 6151 file *after* the mandatory sound descriptor structure (starting with 6152 the size and FourCC fields). For an explanation of the QuickTime 6153 file format read QuickTime File Format Specification [61]. 6155 *Codec ID:* A_QUICKTIME/???? 6156 *Codec Name:* QuickTime audio codecs 6157 *Description:* This CodecID is deprecated in favor of A_QUICKTIME 6158 (without a trailing codec name). Otherwise the storage is identical; 6159 see A_QUICKTIME for details. 6161 *Codec ID:* A_QUICKTIME/QDMC 6162 *Codec Name:* QDesign Music 6163 *Description:* 6165 *Codec ID:* A_QUICKTIME/QDM2 6166 *Codec Name:* QDesign Music v2 6167 *Description:* 6169 *Codec ID:* A_TTA1 6170 *Codec Name:* The True Audio [62] lossles audio compressor 6171 *Description:* TTA format description [63] Each frame is kept intact, 6172 including the CRC32. The header and seektable are dropped. The 6173 private data is void. SamplingFrequency, Channels and BitDepth are 6174 used in the TrackEntry. wFormatTag = 0x77A1 6176 *Codec ID:* A_WAVPACK4 6177 *Codec Name:* WavPack [64] lossles audio compressor 6178 *Description:* The Wavpack packets consist of a stripped header 6179 followed by the frame data. For multi-track (> 2 tracks) a frame 6180 consists of many packets. For hybrid files (lossy part + correction 6181 part), the correction part is stored in an additional block (level 6182 1). For more details, check the WavPack muxing description [65]. 6184 31.3. Subtitle 6186 *Codec ID:* S_TEXT/UTF8 6187 *Codec Name:* UTF-8 Plain Text 6188 *Description:* Basic text subtitles. For more information, please 6189 look at the Subtitle specifications [66]. 6191 *Codec ID:* S_TEXT/SSA 6192 *Codec Name:* Subtitles Format 6193 *Description:* The [Script Info] and [V4 Styles] sections are stored 6194 in the codecprivate. Each event is stored in its own Block. For 6195 more information, please read the specs for SSA/ASS [67]. 6197 *Codec ID:* S_TEXT/ASS 6198 *Codec Name:* Advanced Subtitles Format 6199 *Description:* The [Script Info] and [V4 Styles] sections are stored 6200 in the codecprivate. Each event is stored in its own Block. For 6201 more information, please read the specs for SSA/ASS [68]. 6203 *Codec ID:* S_TEXT/USF 6204 *Codec Name:* Universal Subtitle Format 6205 *Description:* This is mostly defined, but not typed out yet. It 6206 will first be available on the USF specs page [69]. 6208 *Codec ID:* S_TEXT/WEBVTT 6209 *Codec Name:* Web Video Text Tracks Format (WebVTT) 6210 *Description:* Advanced text subtitles. For more information about 6211 the storage please look at the WebVTT in Matroska specifications 6212 [70]. 6214 *Codec ID:* S_IMAGE/BMP 6215 *Codec Name:* Bitmap 6216 *Description:* Basic image based subtitle format; The subtitles are 6217 stored as images, like in the DVD. The timestamp in the block header 6218 of matroska indicates the start display time, the duration is set 6219 with the Duration element. The full data for the subtitle bitmap is 6220 stored in the Block's data section. 6222 *Codec ID:* S_VOBSUB 6223 *Codec Name:* VobSub subtitles 6224 *Description:* The same subtitle format used on DVDs. Supoprted is 6225 only format version 7 and newer. VobSubs consist of two files, the 6226 .idx containing information, and the .sub, containing the actual 6227 data. The .idx file is stripped of all empty lines, of all comments 6228 and of lines beginning with "alt:" or "langidx:". The line beginning 6229 with "id:" SHOULD be transformed into the appropriate Matroska track 6230 language element and is discarded. All remaining lines but the ones 6231 containing timestamps and file positions are put into the 6232 "CodecPrivate" element. For each line containing the timestamp and 6233 file position data is read from the appropriate position in the .sub 6234 file. This data consists of a MPEG program stream which in turn 6235 contains SPU packets. The MPEG program stream data is discarded, and 6236 each SPU packet is put into one Matroska frame. 6238 *Codec ID:* S_KATE 6239 *Codec Name:* Karaoke And Text Encapsulation 6240 *Description:* A subtitle format developped for ogg. The mapping for 6241 Matroska is described on the Xiph wiki [71]. As for Theora and 6242 Vorbis, Kate headers are stored in the private data as xiph-laced 6243 packets. 6245 31.4. Buttons 6247 *Codec ID:* B_VOBBTN 6248 *Codec Name:* VobBtn Buttons 6249 *Description:* Based on MPEG/VOB PCI packets [72]. The file contains 6250 a header consisting of the string "butonDVD" followed by the width 6251 and height in pixels (16 bits integer each) and 4 reserved bytes. 6252 The rest is full PCI packets [73]. #Chapters 6254 31.5. Example 1 : basic chaptering 6256 In this example a movie is split in different chapters. It could 6257 also just be an audio file (album) on which each track corresponds to 6258 a chapter. 6260 o 00000ms - 05000ms : Intro 6262 o 05000ms - 25000ms : Before the crime 6263 o 25000ms - 27500ms : The crime 6265 o 27500ms - 38000ms : The killer arrested 6267 o 38000ms - 43000ms : Credits 6269 This would translate in the following matroska form : 6271 | Chapters | EditionEntry | ChapterAtom | ChapterUID | 0x123456 | 6272 ChapterTimeStart | 0 ns | ChapterTimeEnd | 5,000,000 ns | 6273 ChapterDisplay | ChapterString | Intro | ChapterLanguage | eng | 6274 ChapterAtom | ChapterUID | 0x234567 | ChapterTimeStart | 5,000,000 6275 ns | ChapterTimeEnd | 25,000,000 ns | ChapterDisplay | 6276 ChapterString | Before the crime | ChapterLanguage | eng | 6277 ChapterDisplay | ChapterString | Avant le crime | ChapterLanguage | 6278 fra | ChapterAtom | ChapterUID | 0x345678 | ChapterTimeStart | 6279 25,000,000 ns | ChapterTimeEnd | 27,500,000 ns | ChapterDisplay | 6280 ChapterString | The crime | ChapterLanguage | eng | ChapterDisplay | 6281 ChapterString | Le crime | ChapterLanguage | fra | ChapterAtom | 6282 ChapterUID | 0x456789 | ChapterTimeStart | 27,500,000 ns | 6283 ChapterTimeEnd | 38,000,000 ns | ChapterDisplay | ChapterString | 6284 After the crime | ChapterLanguage | eng | ChapterDisplay | 6285 ChapterString | Apres le crime | ChapterLanguage | fra | 6286 ChapterAtom | ChapterUID | 0x456789 | ChapterTimeStart | 38,000,000 6287 ns | ChapterTimeEnd | 43,000,000 ns | ChapterDisplay | 6288 ChapterString | Credits | ChapterLanguage | eng | ChapterDisplay | 6289 ChapterString | Generique | ChapterLanguage | fra | 6291 31.6. Example 2 : nested chapters 6293 In this example an (existing) album is split into different chapters, 6294 and one of them contain another splitting. 6296 31.6.1. The Micronauts "Bleep To Bleep" 6298 o 00:00 - 12:28 : Baby Wants To Bleep/Rock 6300 * 00:00 - 04:38 : Baby wants to bleep (pt.1) 6302 * 04:38 - 07:12 : Baby wants to rock 6304 * 07:12 - 10:33 : Baby wants to bleep (pt.2) 6306 * 10:33 - 12:28 : Baby wants to bleep (pt.3) 6308 o 12:30 - 19:38 : Bleeper_O+2 6310 o 19:40 - 22:20 : Baby wants to bleep (pt.4) 6311 o 22:22 - 25:18 : Bleep to bleep 6313 o 25:20 - 33:35 : Baby wants to bleep (k) 6315 o 33:37 - 44:28 : Bleeper 6317 | Chapters | EditionEntry | ChapterAtom | ChapterUID | 0x654321 | 6318 ChapterTimeStart | 0 ns | ChapterTimeEnd | 748,000,000 ns | 6319 ChapterDisplay | ChapterString | Baby wants to bleep/rock | 6320 ChapterAtom | ChapterUID | 0x123456 | ChapterTimeStart | 0 ns | 6321 ChapterTimeEnd | 278,000,000 ns | ChapterDisplay | ChapterString | 6322 Baby wants to bleep (pt.1) | ChapterAtom | ChapterUID | 0x234567 | 6323 ChapterTimeStart | 278,000,000 ns | ChapterTimeEnd | 432,000,000 ns | 6324 ChapterDisplay | ChapterString | Baby wants to rock | ChapterAtom | 6325 ChapterUID | 0x345678 | ChapterTimeStart | 432,000,000 ns | 6326 ChapterTimeEnd | 633,000,000 ns | ChapterDisplay | ChapterString | 6327 Baby wants to bleep (pt.2) | ChapterAtom | ChapterUID | 0x456789 | 6328 ChapterTimeStart | 633,000,000 ns | ChapterTimeEnd | 748,000,000 ns | 6329 ChapterDisplay | ChapterString | Baby wants to bleep (pt.3) | 6330 ChapterAtom | ChapterUID | 0x567890 | ChapterTimeStart | 750,000,000 6331 ns | ChapterTimeEnd | 1,178,500,000 ns | ChapterDisplay | 6332 ChapterString | Bleeper_O+2 | ChapterAtom | ChapterUID | 0x678901 | 6333 ChapterTimeStart | 1,180,500,000 ns | ChapterTimeEnd | 1,340,000,000 6334 ns | ChapterDisplay | ChapterString | Baby wants to bleep (pt.4) | 6335 ChapterAtom | ChapterUID | 0x789012 | ChapterTimeStart | 6336 1,342,000,000 ns | ChapterTimeEnd | 1,518,000,000 ns | 6337 ChapterDisplay | ChapterString | Bleep to bleep | ChapterAtom | 6338 ChapterUID | 0x890123 | ChapterTimeStart | 1,520,000,000 ns | 6339 ChapterTimeEnd | 2,015,000,000 ns | ChapterDisplay | ChapterString | 6340 Baby wants to bleep (k) | ChapterAtom | ChapterUID | 0x901234 | 6341 ChapterTimeStart | 2,017,000,000 ns | ChapterTimeEnd | 2,668,000,000 6342 ns | ChapterDisplay | ChapterString | Bleeper | 6344 31.7. Edition and chapter flags 6346 31.7.1. Chapter flags 6348 There are two important flags that apply to chapter atoms: _enabled_ 6349 and _hidden_. The effect of those flags always applies to child atoms 6350 of an atom affected by that flag. 6352 For example: Let's assume a parent atom with flag _hidden_ set to 6353 _true_; that parent contains two child atom, the first with _hidden_ 6354 set to _true_ as well and the second child with the flag either set 6355 to _false_ or not present at all (in which case the default value 6356 applies, and that again is _false_). 6358 As the parent is hidden all of its children are initially hidden as 6359 well. However, when a control track toggles the parent's _hidden_ 6360 flag to _false_ then only the the parent and its second child will be 6361 visible. The first child's explicitely set flag retains its value 6362 until its value is toggled to _false_ by a control track. 6364 Corresponding behavior applies to the _enabled_ flag. 6366 31.7.2. Edition flags 6368 The edition's _hidden_ flag behaves much the same as the chapter's 6369 _hidden_ flag: if an edition is hidden then none of its children 6370 SHALL be visible, no matter their own _hidden_ flags. If the edition 6371 is toggled to being visible then the chapter atom's _hidden_ flags 6372 decide whether or not the chapter is visible. 6374 31.8. Menu features 6376 The menu features are handled like a _chapter codec_. That means each 6377 codec has a type, some private data and some data in the chapters. 6379 The type of the menu system is defined by the ChapProcessCodecID 6380 parameter. For now only 2 values are supported : 0 matroska script, 6381 1 menu borrowed from the DVD. The private data depend on the type of 6382 menu system (stored in ChapProcessPrivate), idem for the data in the 6383 chapters (stored in ChapProcessData). 6385 31.8.1. Matroska Script (0) 6387 This is the case when ChapProcessCodecID [74] = 0. This is a script 6388 language build for Matroska purposes. The inspiration comes from 6389 ActionScript, javascript and other similar scripting languages. The 6390 commands are stored as text commands, in UTF-8. The syntax is C 6391 like, with commands spanned on many lines, each terminating with a 6392 ";". You can also include comments at the end of lines with "//" or 6393 comment many lines using "/* */". The scripts are stored in 6394 ChapProcessData. For the moment ChapProcessPrivate is not used. 6396 The one and only command existing for the moment is "GotoAndPlay( 6397 ChapterUID );". As the same suggests, it means that when this 6398 command is encountered, the playback SHOULD jump to the Chapter 6399 specified by the UID and play it. 6401 31.8.2. DVD menu (1) 6403 This is the case when ChapProcessCodecID [75] = 1. Each level of a 6404 chapter corresponds to a logical level in the DVD system that is 6405 stored in the first octet of the ChapProcessPrivate. This DVD 6406 hierarchy is as follows: 6408 | ChapProcessPrivate | DVD Name | Hierarchy | Commands Possible | 6409 Comment | | 0x30 | SS | DVD domain | - | First Play, Video Manager, 6410 Video Title | | 0x2A | LU | Language Unit | - | Contains only 6411 PGCs | | 0x28 | TT | Title | - | Contains only PGCs | | 0x20 | PGC | 6412 Program Group Chain (PGC) | * | | 0x18 | PG | Program 1 | Program 2 | 6413 Program 3 | - | | 0x10 | PTT | Part Of Title 1 | Part Of Title 2 | 6414 - | Equivalent to the chapters on the sleeve. | | 0x08 | CN | Cell 6415 1 | Cell 2 | Cell 3 | Cell 4 | Cell 5 | Cell 6 | - | 6417 You can also recover wether a Segment is a Video Manager (VMG), Video 6418 Title Set (VTS) or Video Title Set Menu (VTSM) from the 6419 ChapterTranslateID [76] element found in the Segment Info. This 6420 field uses 2 octets as follows: 6422 1. Domain Type: 0 for VMG, the domain number for VTS and VTSM 6424 2. Domain Value: 0 for VMG and VTSM, 1 for the VTS source. 6426 For instance, the menu part from VTS_01_0.VOB would be coded [1,0] 6427 and the content part from VTS_02_3.VOB would be [2,1]. The VMG is 6428 always [0,0] 6430 The following octets of ChapProcessPrivate are as follows: 6432 | Octet 1 | DVD Name | Following Octets | | 0x30 | SS | Domain name 6433 code (1: 0x00= First play, 0xC0= VMG, 0x40= VTSM, 0x80= VTS) + VTS(M) 6434 number (2) | | 0x2A | LU | Language code (2) + Language extension 6435 (1) | | 0x28 | TT | global Title number (2) + corresponding TTN of 6436 the VTS (1) | | 0x20 | PGC | PGC number (2) + Playback Type (1) + 6437 Disabled User Operations (4) | | 0x18 | PG | Program number (2) | | 6438 0x10 | PTT | PTT-chapter number (1) | | 0x08 | CN | Cell number [VOB 6439 ID(2)][Cell ID(1)][Angle Num(1)] | 6441 If the level specified in ChapProcessPrivate is a PGC (0x20), there 6442 is an octet called the Playback Type, specifying the kind of PGC 6443 defined: 6445 o 0x00: entry only/basic PGC 6447 o 0x82: Title+Entry Menu (only found in the Video Manager domain) 6449 o 0x83: Root Menu (only found in the VTSM domain) 6451 o 0x84: Subpicture Menu (only found in the VTSM domain) 6452 o 0x85: Audio Menu (only found in the VTSM domain) 6454 o 0x86: Angle Menu (only found in the VTSM domain) 6456 o 0x87: Chapter Menu (only found in the VTSM domain) 6458 The next 4 following octets correspond to the User Operation flags 6459 [77] in the standard PGC. When a bit is set, the command SHOULD be 6460 disabled. 6462 ChapProcessData contains the pre/post/cell commands in binary format 6463 as there are stored on a DVD. There is just an octet preceeding 6464 these data to specify the number of commands in the element. As 6465 follows: [# of commands(1)][command 1 (8)][command 2 (8)][command 3 6466 (8)]. 6468 More information on the DVD commands and format on DVD-replica [78], 6469 where we got most of the info about it. You can also get information 6470 on DVD from the DVDinfo project [79].--- 6472 32. Subtitles 6474 Because Matroska is a general container format, we try to avoid 6475 specifying the formats to store in it. This type of work is really 6476 outside of the scope of a container-only format. However, because 6477 the use of subtitles in A/V containers has been so limited (with the 6478 exception of DVD) we are taking the time to specify how to store some 6479 of the more common subtitle formats in Matroska. This is being done 6480 to help facilitate their growth. Otherwise, incompatabilities could 6481 prevent the standardization and use of subtitle storage. 6483 This page is not meant to be a complete listing of all subtitle 6484 formats that will be used in Matroska, it is only meant to be a guide 6485 for the more common, current formats. It is possible that we will 6486 add future formats to this page as they are created, but it is not 6487 likely as any other new subtitle format designer would likely have 6488 their own specifications. Any specification listed here SHOULD be 6489 strictly adhered to or it SHOULD NOT use the corresponding Codec ID. 6491 Here is a list of pointers for storing subtitles in Matroska: 6493 o Any Matroska file containing only subtitles SHOULD use the 6494 extension ".mks". 6496 o As a general rule of thumb for all codecs, information that is 6497 global to an entire stream SHOULD be stored in the CodecPrivate 6498 element. 6500 o Start and stop timecodes that are used in a timecodes native 6501 storage format SHOULD be removed when being placed in Matroska as 6502 they could interfere if the file is edited afterwards. Instead, 6503 the Blocks timecode and Duration SHOULD be used to say when the 6504 timecode is displayed. 6506 o Because a "subtitle" stream is actually just an overlay stream, 6507 anything with a transparency layer could be use, including video. 6509 33. Images Subtitles 6511 The first image format that is a goal to import into Matroska is the 6512 VobSub subtitle format. This subtitle type is generated by exporting 6513 the subtitles from a DVD. 6515 The requirement for muxing VobSub into Matroska is v7 subtitles (see 6516 first line of the .IDX file). If the version is smaller, you must 6517 remux them using the SubResync utility from VobSub 2.23 (or MPC) into 6518 v7 format. Generally any newly created subs will be in v7 format. 6520 The .IFO file will not be used at all. 6522 If there is more than one subtitle stream in the VobSub set, each 6523 stream will need to be seperated into seperate tracks for storage in 6524 Matroska. E.g. the VobSub file contains streams for both English and 6525 German subtitles. Then the resulting Matroska file SHOULD contain 6526 two tracks. That way the language information can be 'dropped' and 6527 mapped to Matroska's language tags. 6529 The .IDX file is reformatted (see below) and placed in the 6530 CodecPrivate. 6532 Each .BMP will be stored in its own Block. The Timestamp with be 6533 stored in the Blocks Timecode and the duration will be stored in the 6534 Default Duration. 6536 Here is an example .IDX file: 6538 # VobSub index file, v7 (do not modify this line!) 6539 # 6540 # To repair desyncronization, you can insert gaps this way: 6541 # (it usually happens after vob id changes) 6542 # 6543 # delay: [sign]hh:mm:ss:ms 6544 # 6545 # Where: 6546 # [sign]: +, - (optional) 6547 # hh: hours (0 <= hh) 6548 # mm/ss: minutes/seconds (0 <= mm/ss <= 59) 6549 # ms: milliseconds (0 <= ms <= 999) 6550 # 6551 # Note: You can't position a sub before the previous with a negative 6552 # value. 6553 # 6554 # You can also modify timestamps or delete a few subs you don't like. 6555 # Just make sure they stay in increasing order. 6557 # Settings 6559 # Original frame size 6560 size: 720x480 6562 # Origin, relative to the upper-left corner, can be overloaded by 6563 # aligment 6564 org: 0, 0 6566 # Image scaling (hor,ver), origin is at the upper-left corner or at 6567 # the alignment coord (x, y) 6568 scale: 100%, 100% 6570 # Alpha blending 6571 alpha: 100% 6573 # Smoothing for very blocky images (use OLD for no filtering) 6574 smooth: OFF 6576 # In millisecs 6577 fadein/out: 50, 50 6579 # Force subtitle placement relative to (org.x, org.y) 6580 align: OFF at LEFT TOP 6582 # For correcting non-progressive desync. (in millisecs or hh:mm:ss:ms) 6583 # Note: Not effective in DirectVobSub, use "delay: ... " instead. 6584 time offset: 0 6586 # ON: displays only forced subtitles, OFF: shows everything 6587 forced subs: OFF 6589 # The original palette of the DVD 6590 palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, \ 6591 b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, fdfdfd 6593 # Custom colors (transp idxs and the four colors) 6594 custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \ 6595 000000 6596 # Language index in use 6597 langidx: 0 6599 # English 6600 id: en, index: 0 6601 # Decomment next line to activate alternative name in DirectVobSub / 6602 # Windows Media Player 6.x 6603 # alt: English 6604 # Vob/Cell ID: 1, 1 (PTS: 0) 6605 timestamp: 00:00:01:101, filepos: 000000000 6606 timestamp: 00:00:08:708, filepos: 000001000 6608 First, lines beginning with "#" are removed. These are comments to 6609 make text file editing easier, and as this is not a text file, they 6610 aren't needed. 6612 Next remove the "langidx" and "id" lines. These are used to 6613 differenciate the subtitle streams and define the language. As the 6614 streams will be stored seperately anyway, there is no need to 6615 differenciate them here. Also, the language setting will be stored 6616 in the Matroska tags, so there is no need to store it here. 6618 Finally, the "timestamp" will be used to set the Block's timecode. 6619 Once it is set there, there is no need for it to be stored here. 6620 Also, as it may interfere if the file is edited, it SHOULD NOT be 6621 stored here. 6623 Once all of these items are removed, the data to store in the 6624 CodecPrivate SHOULD look like this: 6626 size: 720x480 6627 org: 0, 0 6628 scale: 100%, 100% 6629 alpha: 100% 6630 smooth: OFF 6631 fadein/out: 50, 50 6632 align: OFF at LEFT TOP 6633 time offset: 0 6634 forced subs: OFF 6635 palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, \ 6636 b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, fdfdfd 6637 custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \ 6638 000000 6640 There SHOULD also be two Blocks containing one image each with the 6641 timecodes "00:00:01:101" and "00:00:08:708". 6643 34. SRT Subtitles 6645 SRT is perhaps the most basic of all subtitle formats. 6647 It consists of four parts, all in text.. 6649 1. A number indicating which subtitle it is in the sequence. 2. 6650 The time that the subtitle appears on the screen, and then 6651 disappears. 3. The subtitle itself. 4. A blank line indicating 6652 the start of a new subtitle. 6654 When placing SRT in Matroska, part 3 is converted to UTF-8 (S_TEXT/ 6655 UTF8) and placed in the data portion of the Block. Part 2 is used to 6656 set the timecode of the Block, and BlockDuration element. Nothing 6657 else is used. 6659 Here is an example SRT file: 6661 | 6663 1 00:02:17,440 --> 00:02:20,375 Senator, we're making our final 6664 approach into Coruscant. 6666 2 00:02:20,476 --> 00:02:22,501 Very good, Lieutenant. 6668 | 6670 In this example, the text "Senator, we're making our final approach 6671 into Coruscant." would be converted into UTF-8 and placed in the 6672 Block. The timecode of the block would be set to "00:02:17,440". 6673 And the BlockDuration element would be set to "00:00:02,935". 6675 The same is repeated for the next subtitle. 6677 Because there are no general settings for SRT, the CodecPrivate is 6678 left blank. 6680 35. SSA/ASS Subtitles 6682 SSA stands for Sub Station Alpha. It's the file format used by the 6683 popular subtitle editor, SubStation Alpha [80]. This format is 6684 widely used by fansubbers. 6686 It allows you to do some advanced display features, like positioning, 6687 karaoke, style managements... 6689 For detailed information on SSA/ASS, see the SSA specs [81]. It 6690 includes an SSA specs description and the avanced features added by 6691 ASS format (standing for Advanced SSA). Because SSA and ASS are so 6692 similar, they are treated the same here. 6694 Like SRT, this format is text based with a particular syntax. 6696 A file consists of 4 or 5 parts, declared ala INI file (but it's not 6697 an INI !) 6699 The first, "[Script Info]" contains some information about the 6700 subtitle file, such as it's title, who created it, type of script and 6701 a very important one : "PlayResY". Be carefull of this value, 6702 everything in your script (font size, positioning) is scaled by it. 6703 Sub Station Alpha uses your desktops Y resolution to write this 6704 value, so if a friend with a large monitor and a high screen 6705 resolution gives you an edited script, you can mess everything up by 6706 saving the script in SSA with your low-cost monitor. 6708 The second, "[V4 Styles]", is a list of style definitions. A style 6709 describe how will look a text on the screen. It defines font, font 6710 size, primary/.../outile colour, position, aligment etc ... 6712 For example this : 6714 | 6716 Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, 6717 TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, 6718 Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding 6719 Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0, 6720 1,1,2,2,5,5,30,0,0 6722 | 6724 The third, "[Events]", is the list of text you want to display at the 6725 right timing. You can specify some attribute here. Like the style 6726 to use for this event (MUST be defined in the list), the position of 6727 the text (Left, Right, Vertical Margin), an effect. Name is mostly 6728 used by translator to know who said this sentence. Timing is in 6729 h:mm:ss.cc (centisec). 6731 | 6733 Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, 6734 Effect, Text Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf 6735 main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ? 6736 Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf 6737 main,autre,0000,0000,0000,,Toujours rien. 6739 | 6741 "[Pictures]" or "[Fonts]" part can be found in some SSA file, they 6742 contains UUE-encoded pictures/font but those features are only used 6743 by Sub Station Alpha, i.e. no filter (Vobsub/Avery Lee Subtiler 6744 filter) use them. 6746 Now, how are they stored in Matroska ? 6748 o All text is converted to UTF-8* All the headers are stored in 6749 CodecPrivate ( Script Info and the Styles list)* Start & End field 6750 are used to set TimeStamp and the BlockDuration element. the data 6751 stored is :* Events are stored in the Block in this order: 6752 ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, 6753 Text (Layer comes from ASS specs ... it's empty for SSA.) 6754 "ReadOrder field is needed for the decoder to be able to reorder 6755 the streamed samples as they were placed originally in the file." 6757 Here is an example of an SSA file. 6759 | [Script Info] ; This is a Sub Station Alpha v4 script. ; For Sub 6760 Station Alpha info and downloads, ; go to 6761 http://www.eswat.demon.co.uk/ ; or email kotus@eswat.demon.co.uk [83] 6762 Title: Wolf's rain 2 Original Script: Anime-spirit Ishin-francais 6763 Original Translation: Coolman Original Editing: Spikewolfwood 6764 Original Timing: Lord_alucard Original Script Checking: Spikewolfwood 6765 ScriptType: v4.00 Collisions: Normal PlayResY: 1024 PlayDepth: 0 Wav: 6766 0, 128697,D:\Alex\Anime- Fansub -- TAFF -\Wolf's Rain\WR_-_02_Wav.wav 6767 Wav: 0, 120692,H:\team truc\WR_-_02.wav Wav: 0, 6768 116504,E:\sub\wolf's_rain\WOLF'S RAIN 02.wav LastWav: 3 Timer: 6769 100,0000 6771 [V4 Styles] Format: Name, Fontname, Fontsize, PrimaryColour, 6772 SecondaryColour, TertiaryColour, BackColour, Bold, Italic, 6773 BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, 6774 AlphaLevel, Encoding Style: Default,Arial,20,65535,65535,65535,- 6775 2147483640,-1,0,1,3,0,2,30,30,30,0,0 Style: 6776 Titre_episode,Akbar,140,15724527,65535,65535,986895,- 6777 1,0,1,1,0,3,30,30,30,0,0 Style: Wolf main,Wolf_Rain,56,15724527,15724 6778 527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0 6780 [Events] Format: Marked, Start, End, Style, Name, MarginL, MarginR, 6781 MarginV, Effect, Text Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf 6782 main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ? 6783 Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf 6784 main,autre,0000,0000,0000,,Toujours rien. | 6786 Here is what would be placed into the CodecPrivate element. 6788 | [Script Info] ; This is a Sub Station Alpha v4 script. ; For Sub 6789 Station Alpha info and downloads, ; go to 6790 http://www.eswat.demon.co.uk/ ; or email kotus@eswat.demon.co.uk [85] 6791 Title: Wolf's rain 2 Original Script: Anime-spirit Ishin-francais 6792 Original Translation: Coolman Original Editing: Spikewolfwood 6793 Original Timing: Lord_alucard Original Script Checking: Spikewolfwood 6794 ScriptType: v4.00 Collisions: Normal PlayResY: 1024 PlayDepth: 0 Wav: 6795 0, 128697,D:\Alex\Anime- Fansub -- TAFF -\Wolf's Rain\WR_-_02_Wav.wav 6796 Wav: 0, 120692,H:\team truc\WR_-_02.wav Wav: 0, 6797 116504,E:\sub\wolf's_rain\WOLF'S RAIN 02.wav LastWav: 3 Timer: 6798 100,0000 6800 [V4 Styles] Format: Name, Fontname, Fontsize, PrimaryColour, 6801 SecondaryColour, TertiaryColour, BackColour, Bold, Italic, 6802 BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, 6803 AlphaLevel, Encoding Style: Default,Arial,20,65535,65535,65535,- 6804 2147483640,-1,0,1,3,0,2,30,30,30,0,0 Style: 6805 Titre_episode,Akbar,140,15724527,65535,65535,986895,- 6806 1,0,1,1,0,3,30,30,30,0,0 Style: Wolf main,Wolf_Rain,56,15724527,15724 6807 527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0 | 6809 And here are the two blocks that would be generated. 6811 Block's timecode: 00:02:40.650 BlockDuration: 00:00:01.140 6813 | 1,,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses 6814 ondes delta ? | 6816 Block's timecode: 00:02:42.420 BlockDuration: 00:00:01.730 6818 | 2,,Wolf main,autre,0000,0000,0000,,Toujours rien. | 6820 36. USF Subtitles 6822 Under construction 6824 37. WebVTT 6826 The "Web Video Text Tracks Format" (short: WebVTT) is developed by 6827 the World Wide Web Consortium (W3C) [86]. Its specifications are 6828 freely available [87]. 6830 The guiding principles for the storage of WebVTT in Matroska are: 6832 o Consistency: store data in a similar way to other subtitle codecs 6834 o Simplicity: making decoding and remuxing as easy as possible for 6835 existing infrastructures 6837 o Completeness: keeping as much data as possible from the original 6838 WebVTT file 6840 37.1. Storage of WebVTT in Matroska 6842 37.1.1. CodecID: codec identification 6844 The CodecID to use is S_TEXT/WEBVTT. 6846 37.1.2. CodecPrivate: storage of gloal WebVTT blocks 6848 This element contains all global blocks before the first subtitle 6849 entry. This starts at the "WEBVTT" file identification marker but 6850 excludes the optional byte order mark. 6852 37.1.3. Storage of non-global WebVTT blocks 6854 Non-global WebVTT blocks (e.g. "NOTE") before a WebVTT Cue Text are 6855 stored in Matroska's BlockAddition element together with the Matroska 6856 Block containing the WebVTT Cue Text these blocks precede (see below 6857 for the actual format). 6859 37.1.4. Storage of Cues in Matroska blocks 6861 Each WebVTT Cue Text is stored directly in the Matroska Block. 6863 A muxer MUST change all WebVTT Cue Timestamps present within the Cue 6864 Text to be relative to the Matroska Block's timestamp. 6866 The Cue's start timestamp is used as the Matroska Block's timestamp. 6868 The difference between the Cue's end timestamp and its start 6869 timestamp is used as the Matroska Block's duration. 6871 37.1.5. BlockAdditions: storing non-global WebVTT blocks, Cue Settings 6872 Lists and Cue identifiers 6874 Each Matroska Block may be accompanied by one BlockAdditions element. 6875 Its format is as follows: 6877 1. The first line contains the WebVTT Cue Text's optional Cue 6878 Settings List followed by one line feed character (U+0x000a). 6879 The Cue Settings List may be empty in which case the line 6880 consists of the line feed character only. 6882 2. The second line contains the WebVTT Cue Text's optional Cue 6883 Identifier followed by one line feed character (U+0x000a). The 6884 line may be empty indicating that there was no Cue Identifier in 6885 the source file in which case the line consists of the line feed 6886 character only. 6888 3. The third and all following lines contain all WebVTT Comment 6889 Blocks that precede the current WebVTT Cue Block. These may be 6890 absent. 6892 If there is no Matroska BlockAddition element stored together with 6893 the Matroska Block then all three components (Cue Settings List, Cue 6894 Identifier, Cue Comments) MUST be assumed to be absent. 6896 37.2. Examples of transformation 6898 Here's an example how a WebVTT is transformed. 6900 37.2.1. Example WebVTT file 6902 Let's take the following example file: 6904 37.2.2. CodecPrivate 6906 The resulting CodecPrivate element will look like this: 6908 37.2.3. Storage of Cue 1 6910 Example Cue 1: timestamp 00:00:00.000, duration 00:00:10.000, Block's 6911 content: 6913 BlockAddition's content starts with one empty line as there's no Cue 6914 Settings List: 6916 37.2.4. Storage of Cue 2 6918 Example Cue 2: timestamp 00:00:25.000, duration 00:00:10.000, Block's 6919 content: 6921 BlockAddition's content starts with two empty lines as there's 6922 neither a Cue Settings List nor a Cue Identifier: 6924 37.2.5. Storage of Cue 3 6926 Example Cue 3: timestamp 00:01:03.000, duration 00:00:03.500, Block's 6927 content: 6929 BlockAddition's content ends with an empty line as there's no Cue 6930 Identifier and there were no WebVTT Comment blocks: 6932 37.2.6. Storage of Cue 4 6934 Example Cue 4: timestamp 00:03:10.000, duration 00:00:10.000, Block's 6935 content: 6937 Example entry 4: Entries can even include timestamps. For 6938 example:<00:00:05.000>This becomes visible five seconds after the 6939 first part. 6941 This Block does not need a BlockAddition as the Cue did not contain 6942 an Identifier, nor a Settings List, and it wasn't preceded by Comment 6943 blocks. 6945 37.3. Storage of WebVTT in Matroska vs. WebM 6947 Note: the storage of WebVTT in Matroska is not the same as the design 6948 document for storage of WebVTT in WebM. There are several reasons 6949 for this including but not limited to: the WebM document is old (from 6950 February 2012) and was based on an earlier draft of WebVTT and 6951 ignores several parts that were added to WebVTT later; WebM does 6952 still not support subtitles at all [88]; the proposal suggests 6953 splitting the information across multiple tracks making demuxer's and 6954 remuxer's life very difficult.--- 6956 38. Tagging 6958 When a Tag is nested within another Tag, the nested Tag becomes an 6959 attribute of the base tag. For instance, if you wanted to store the 6960 dates that a singer used certain addresses for, that singer being the 6961 lead singer for a track that included multiple bands simultaneously, 6962 then your tag tree would look something like this: Targets - TrackUID 6963 BAND - LEADPERFORMER -- ADDRESS --- DATE --- DATEEND -- ADDRESS --- 6964 DATE In this way, it becomes possible to store any Tag as attributes 6965 of another tag. Multiple items SHOULD never be stored as a list in a 6966 single TagString. If there is more than one tag of a certain type to 6967 be stored, then more than one SimpleTag SHOULD be used. For 6968 authoring Tags outside of EBML, the following XML syntax is proposed 6969 [89] used in mkvmerge [90]. Binary data SHOULD be stored using 6970 BASE64 encoding if it is being stored at authoring time. 6972 38.1. Why official tags matter 6974 There is a debate between people who think all tags SHOULD be free 6975 and those who think all tags SHOULD be strict. If you look at this 6976 page you will realise we are in between. 6978 Advanced-users application might let you put any tag in your file. 6979 But for the rest of the applications, they usually give you a basic 6980 list of tags you can use. Both have their needs. But it's usually a 6981 bad idea to use custom/exotic tags because you will probably be the 6982 only person to use this information even though everyone else could 6983 benefit from it. So hopefully when someone wants to put information 6984 in one's file, they will find an official one that fit them and 6985 hopefully use it ! If it's not in the list, this person can contact 6986 us any time for addition of such a missing tag. But it doesn't mean 6987 it will be accepted... Matroska files are not meant the become a 6988 whole database of people who made costumes for a film. A website 6989 would be better for that... It's hard to define what SHOULD be in and 6990 what doesn't make sense in a file. So we'll treat each request 6991 carefully. 6993 We also need an official list simply for developpers to be able to 6994 display relevant information in their own design (if they choose to 6995 support a list of meta-information they SHOULD know which tag has the 6996 wanted meaning so that other apps could understand the same meaning). 6998 38.2. Tag translations 7000 To be able to save tags from other systems to Matroska we need to 7001 translate them to our system. There is a translation table on our 7002 site [91]. 7004 38.3. Tag Formatting 7006 o The TagName SHOULD always be written in all capital letters and 7007 contain no space. 7009 o The fields with dates SHOULD have the following format: YYYY-MM-DD 7010 HH:MM:SS.MSS YYYY = Year, -MM = Month, -DD = Days, HH = Hours, :MM 7011 = Minutes, :SS = Seconds, :MSS = Milliseconds. To store less 7012 accuracy, you remove items starting from the right. To store only 7013 the year, you would use, "2004". To store a specific day such as 7014 May 1st, 2003, you would use "2003-05-01". 7016 o Fields that require a Float SHOULD use the "." mark instead of the 7017 "," mark. To display it differently for another local, 7018 applications SHOULD support auto replacement on display. Also, a 7019 thousandths separator SHOULD NOT be used. 7021 o For currency amounts, there SHOULD only be a numeric value in the 7022 Tag. Only numbers, no letters or symbols other than ".". For 7023 instance, you would store "15.59" instead of "$15.59USD". 7025 38.4. Target types 7027 The TargetType element allows tagging of different parts that are 7028 inside or outside a given file. For example in an audio file with 7029 one song you could have information about the album it comes from and 7030 even the CD set even if it's not found in the file. 7032 For application to know what kind of information (like TITLE) relates 7033 to a certain level (CD title or track title), we also need a set of 7034 official TargetType names. For now audio and video will have 7035 different values & names. That also means the same tag name can have 7036 different meanings depending on where it is (otherwise we would end 7037 up with 15 TITLE_ tags). 7039 An upper level value tag applies to the lower level. That means if a 7040 CD has the same artist for all tracks, you just need to set the 7041 ARTIST tag at level 50 (ALBUM) and not to each TRACK (but you can). 7042 That also means that if some parts of the CD have no known ARTIST the 7043 value MUST be set to nothing (a void string ""). 7045 When a level doesn't exist it MUST NOT be specified in the files, so 7046 that the TOTAL_PARTS and PART_NUMBER elements match the same levels. 7048 Here is an example of how these "organizational" tags work: If you 7049 set 10 TOTAL_PARTS to the ALBUM level (40) it means the album 7050 contains 10 lower parts. The lower part in question is the first 7051 lower level that is specified in the file. So if it's TRACK (30) 7052 then that means it contains 10 tracks. If it's MOVEMENT (20) that 7053 means it's 10 movements, etc. 7055 38.5. Official tags 7057 The following is a complete list of the supported Matroska Tags. 7058 While it is possible to use Tag names that are not listed below, this 7059 is not reccommended as compatability will be compromised. If you 7060 find that there is a Tag missing that you would like to use, then 7061 please contact the Matroska team for its inclusion in the 7062 specifications before the format reaches 1.0. 7064 38.6. Notes 7066 o In the Target list, a logicial OR is applied on all tracks, a 7067 logicial OR is applied on all chapters. Then a logical AND is 7068 applied between the Tracks list and the Chapters list to know if 7069 an element belongs to this Target. 7071 39. Attachments 7073 39.1. Introduction 7075 Matroska supports storage of related files and data in the 7076 Attachments Top-Level Element. Attachments can be used to store 7077 related cover art, font files, transcripts, reports, or other 7078 ancilliary files related to the Segment. 7080 39.2. Cover Art 7082 Matroska supports attachments and they can be used for cover arts. 7083 This document defines a set of guidelines to add cover arts correctly 7084 in Matroska files. 7086 The pictures SHOULD only use the JPEG and PNG picture formats. 7088 There can be 2 different cover for a movie/album. A portrait one 7089 (like a DVD case) and a landscape one (like a banner ad for example, 7090 looking better on a wide screen). 7092 There can be 2 versions of the same cover, the normal one and the 7093 small one. The dimension of the normal one SHOULD be 600 on the 7094 smallest side (eg 960x600 for landscape and 600x800 for portrait, 7095 600x600 for square). The dimension of the small one SHOULD be 120 7096 (192x120 or 120x160). 7098 The way to differentiate between all these versions is by the 7099 filename. The default filename is cover.(png/jpg) for backward 7100 compatibility reasons. That is the "big" version of the file (600) 7101 in square or portrait mode. It SHOULD also be the first file in the 7102 attachments. The smaller resolution SHOULD be prefixed with 7103 "small_", ie small_cover.(jpg/png). The landscape variant SHOULD be 7104 suffixed with "_land", ie cover_land.jpg. The filenames are case 7105 sensitive and SHOULD all be lower case. 7107 o cover.jpg (portrait/square 600) 7109 o small_cover.png (portrait/square 120) 7111 o cover_land.png (landscape 600) 7113 o small_cover_land.jpg (landscape 120) 7115 There is a sample file [92] available to test player compatibility or 7116 to demonstrate the use of cover art in Matroska files. 7118 39.3. Font files 7120 40. Matroska Streaming 7122 There exist multiple ways to stream content. The term streaming 7123 itself is very vague. It means reading a file stored on a server. 7124 But the server could be very distant or very close. The transport 7125 system and the protocol used for streaming makes the whole 7126 difference. 7128 In the case of Matroska, there are mostly 2 different kinds of 7129 stream: file access and live streaming. 7131 41. File Access 7133 File access can simply be reading a file located on your computer, 7134 but also accessing it from an HTTP (web) server or CIFS (windows 7135 share) server. All these protocols are usually safe from reading 7136 errors and seeking in the stream is possible. On other hand when the 7137 file is stored far away or on a slow server, seeking can be an 7138 expensive operation and SHOULD be avoided. That's why we set a few 7139 guidelines [93] that, when followed, help reduce the number of 7140 seeking for regular playback and also have the playback start quickly 7141 without a lot of data needed to read first (like the Cues (index), 7142 Attachments or Meta Seek of all the Clusters). 7144 Matroska having a small overhead, it is well suited for storing 7145 music/videos on file servers without having a big impact on the 7146 bandwidth used. It doesn't require to load the index before playing 7147 (the index can be loaded only when seeking is requested the first 7148 time), so playback can start very quickly too. 7150 42. Live Streaming 7152 Live streaming is the equivalent of TV broadcasting on the internet. 7153 There are 2 families of servers for that. The RTP/RTSP ones and the 7154 HTTP servers. Matroska is not meant to be used over RTP. RTP 7155 already has timing and channel mechanisms that would wasted if 7156 doubled in Matroska. On the other hand live streaming of Matroska 7157 over HTTP (or any other plain protocol based on TCP) is very 7158 possible. 7160 A live Matroska stream is different than a file, because it may have 7161 no known end (only when the client disconnects). For that the 7162 Segment MUST use the "unknown" size (all 1s in the size). The other 7163 option would be to concatenate Segments with known sizes one after 7164 the other. This solution allows a change of codec/resolution between 7165 each segment which can be useful in some cases (switch between 4:3 7166 and 16:9 in some TV programs for example). 7168 The Segment(s) being continuous, certain elements like Meta Seek, 7169 Cues, Chapters, Attachments MUST NOT be used in this context. 7171 On the player side, it is possible to detect that a stream is not 7172 seekable. If the stream does not have a Meta Seek list or a Cues 7173 list at the beginning of the stream, it SHOULD be considered as non 7174 seekable. Even though it's still theoretically possible to seek 7175 blindly forward in the stream, if the server supports it. 7177 In the context of a live radio or even web TV it is possible to "Tag" 7178 the content that is currently playing. The Tags level 1 element can 7179 be placed between Clusters each time necessary. In that case, the 7180 new Tags found MUST reset the previously encountered tags and use the 7181 new values instead (be they empty). 7183 43. Menu Specifications 7185 44. Introduction 7187 This document is a _draft of the Menu system_ that will be the 7188 default one in Matroska. As it will just be composed of a Control 7189 Track, it will be seen as a "codec" and could be replaced later by 7190 something else if needed. 7192 A menu is like what you see on DVDs, when you have some screens to 7193 select the audio format, subtitles or scene selection. 7195 45. Requirements 7197 What we'll try to have is a system that can do almost everything done 7198 on a DVD, or more, or better, or drop the unused features if 7199 necessary. 7201 As the name suggests, a Control Track is a track that can control the 7202 playback of the file and/or all the playback features. To make it as 7203 simple as possible for players, the Control Track will just give 7204 orders to the player and get the actions associated with the 7205 highlights/hotspots. 7207 45.1. Highlights/Hotspots 7209 A hightlight is basically a rectangle/key associated with an action 7210 UID. When that rectangle/key is activated, the player send the UID 7211 of the action to the Control Track handler (codec). The fact that it 7212 can also be a key means that even for audio only files, a keyboard 7213 shortcut or button panel could be used for menues. But in that case, 7214 the hotspot will have to be associated with a name to display. 7216 So this hightlight is sent from the Control Track to the Player. 7217 Then the player has to handle that highlight until it's disactivated 7218 (see Playback features [94]) 7220 The hightlight contains a UID of the action, a displayable name (UTF- 7221 8), an associated key (list of keys to be defined, probably 7222 up/down/left/right/select), a screen position/range and an image to 7223 display. The image will be displayed either when the user place the 7224 mouse over the rectangle (or any other shape), or when an option of 7225 the screen is selected (not activated). There could be a second 7226 image used when the option is activated. And there could be a third 7227 image that can serve as background. This way you could have a still 7228 image (like in some DVDs) for the menu and behind that image blank 7229 video (small bitrate). 7231 When a highlight is activated by the user, the player has to send the 7232 UID of the action to the Control Track. Then the Control Track codec 7233 will handle the action and possibly give new orders to the player. 7235 The format used for storing images SHOULD be extensible. For the 7236 moment we'll use PNG and BMP, both with alpha channel. 7238 45.2. Playback features 7240 All the following features will be sent from the Control Track to the 7241 Player : 7243 o Jump to chapter (UID, prev, next, number) 7245 o Disable all tracks of a kind (audio, video, subtitle) 7247 o Enable track UID (the kind doesn't matter) 7249 o Define/Disable a highlight 7251 o Enable/Disable jumping 7253 o Enable/Disable track selection of a kind 7255 o Select Edition ID (see chapters) 7257 o Pause playback 7259 o Stop playback 7260 o Enable/Disable a Chapter UID 7262 o Hide/Unhide a Chapter UID 7264 All the actions will be writen in a normal Matroska track, with a 7265 timecode. A "Menu Frame" SHOULD be able to contain more that one 7266 action/highlight for a given timecode. (to be determined, EBML format 7267 structure) 7269 45.3. Player requirements 7271 Some players might not support the control track. That mean they 7272 will play the active/looped parts as part of the data. So I suggest 7273 putting the active/looped parts of a movie at the end of a movie. 7274 When a Menu-aware player encouter the default Control Track of a 7275 Matroska file, the first order SHOULD be to jump at the start of the 7276 active/looped part of the movie. 7278 46. Working Graph 7280 47. Ideas 7282 48. Data Structure 7284 As a Matroska side project, the obvious choice for storing binary 7285 data is EBML. 7287 49. References 7289 49.1. URIs 7291 [1] http://mukoli.free.fr/mcf/mcf.html 7293 [2] https://github.com/Matroska-Org/ebml-specification/blob/master/ 7294 specification.markdown 7296 [3] https://datatracker.ietf.org/wg/cellar/charter/ 7298 [4] https://matroska.org/files/matroska.pdf 7300 [5] {{site.baseurl}}/diagram.html 7302 [6] https://github.com/Matroska-Org/ebml-specification/blob/master/ 7303 specification.markdown 7305 [7] https://github.com/Matroska-Org/foundation- 7306 source/blob/master/spectool/specdata.xml 7308 [8] https://tools.ietf.org/html/rfc2119 7310 [9] https://github.com/Matroska-Org/ebml-specification/blob/master/ 7311 specification.markdown 7313 [10] https://github.com/Matroska-Org/ebml-specification/blob/master/ 7314 specification.markdown#ebml-element-types 7316 [11] https://github.com/Matroska-Org/ebml-specification/blob/master/ 7317 specification.markdown#ebml-schema 7319 [12] https://github.com/Matroska-Org/ebml-specification/blob/master/ 7320 specification.markdown#structure 7322 [13] http://www.loc.gov/standards/iso639-2/php/English_list.php 7324 [14] http://www.iana.org/cctld/cctld-whois.htm 7326 [15] {{site.baseurl}}/index.html#block 7328 [16] http://www.webmproject.org/docs/container/ 7330 [17] http://www.matroska.org/downloads/test_w1.html 7332 [18] {{site.baseurl}}/index.html#Cluster 7334 [19] {{site.baseurl}}/index.html#Timecode 7336 [20] {{site.baseurl}}/notes.html#TimecodeScale 7338 [21] {{site.baseurl}}/index.html#Cluster 7340 [22] {{site.baseurl}}/index.html#Timecode 7342 [23] {{site.baseurl}}/notes.html#Encryption 7344 [24] {{site.baseurl}}/notes.html#unknown-elements 7346 [25] {{site.baseurl}}/index.html#Cluster 7348 [26] {{site.baseurl}}/index.html#Timecode 7350 [27] {{site.baseurl}}/index.html#TimecodeScale 7352 [28] {{site.baseurl}}/index.html#Cluster 7354 [29] {{site.baseurl}}/index.html#Timecode 7356 [30] {{site.baseurl}}/index.html#Cluster 7358 [31] {{site.baseurl}}/index.html#Timecode 7360 [32] {{site.baseurl}}/index.html#TrackTimeCodeScale 7362 [33] {{site.baseurl}}/notes.html#raw-timecode 7364 [34] {{site.baseurl}}/notes.html#timecode-types 7366 [35] {{site.baseurl}}/notes.html#matroska-version-indicators- 7367 doctypeversion-and-doctypereadversion 7369 [36] {{site.baseurl}}/index.html#StereoMode 7371 [37] {{site.baseurl}}/index.html#TrackOperation 7373 [38] {{site.baseurl}}/index.html#TrackCombinePlanes 7375 [39] {{site.baseurl}}/notes.html#track-operation 7377 [40] {{site.baseurl}}/index.html#TrackOperation 7379 [41] {{site.baseurl}}/index.html#Void 7381 [42] {{site.baseurl}}/order_guidelines.html#tags-end 7383 [43] http://haali.su/mkv/codecs.pdf 7385 [44] {{site.baseurl}}/index.html 7387 [45] {{site.baseurl}}/index.html#CodecID 7389 [46] http://msdn.microsoft.com/library/default.asp?url=/library/en- 7390 us/gdi/bitmaps_1rw2.asp 7392 [47] http://forum.doom9.org/showthread.php?s=&threadid=55773&perpage= 7393 20&pagenumber=2#post331855 7395 [48] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 7396 librmff.h 7398 [49] https://developer.apple.com/library/mac/documentation/QuickTime/ 7399 QTFF/QTFFPreface/qtffPreface.html 7401 [50] {{site.baseurl}}/index.html#lacing 7403 [51] http://www.theora.org/doc/Theora_I_spec.pdf 7405 [52] http://wiki.multimedia.cx/ 7406 index.php?title=Apple_ProRes#Frame_layout 7408 [53] http://alac.macosforge.org/trac/browser/trunk/ 7409 ALACMagicCookieDescription.txt 7411 [54] {{site.baseurl}}/index.html#lacing 7413 [55] http://www.xiph.org/ogg/vorbis/doc/vorbis-spec-ref.html 7415 [56] http://www.xiph.org/ogg/vorbis/doc/v-comment.html 7417 [57] http://www.xiph.org/ogg/vorbis/doc/vorbis-spec-ref.html 7419 [58] http://flac.sourceforge.net/ 7421 [59] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 7422 librmff.h 7424 [60] http://msdn.microsoft.com/library/default.asp?url=/library/en- 7425 us/multimed/mmstr_625u.asp 7427 [61] https://developer.apple.com/library/mac/documentation/QuickTime/ 7428 QTFF/QTFFPreface/qtffPreface.html 7430 [62] http://tausoft.org/ 7432 [63] http://tausoft.org/wiki/True_Audio_Codec_Format 7434 [64] http://www.wavpack.com/ 7436 [65] wavpack.html 7438 [66] {{site.baseurl}}/subtitles.html 7440 [67] {{site.baseurl}}/subtitles.html 7442 [68] {{site.baseurl}}/subtitles.html 7444 [69] {{site.baseurl}}/subtitles.html 7446 [70] {{site.baseurl}}/subtitles.html 7448 [71] http://wiki.xiph.org/index.php/OggKate#Matroska_mapping 7450 [72] http://dvd.sourceforge.net/dvdinfo/pci_pkt.html 7452 [73] http://dvd.sourceforge.net/dvdinfo/pci_pkt.html 7454 [74] {{site.baseurl}}/index.html#ChapProcessCodecID 7456 [75] {{site.baseurl}}/index.html#ChapProcessCodecID 7458 [76] {{site.baseurl}}/index.html#ChapterTranslateID 7460 [77] http://dvd.sourceforge.net/dvdinfo/uops.html 7462 [78] http://www.dvd-replica.com/DVD/ 7464 [79] http://dvd.sourceforge.net/dvdinfo/ 7466 [80] http://wiki.multimedia.cx/index.php?title=SubStation_Alpha 7468 [81] http://moodub.free.fr/video/ass-specs.doc 7470 [83] mailto:kotus@eswat.demon.co.uk 7472 [85] mailto:kotus@eswat.demon.co.uk 7474 [86] https://www.w3.org/ 7476 [87] https://w3c.github.io/webvtt/ 7478 [88] http://www.webmproject.org/docs/container/ 7480 [89] http://www.matroska.org/files/tags/matroskatags.dtd 7482 [90] http://www.bunkus.org/videotools/mkvtoolnix/doc/ 7483 mkvmerge.html#mkvmerge.tags 7485 [91] othertagsystems/comparetable.html 7487 [92] https://sourceforge.net/projects/matroska/files/test_files/ 7488 cover_art.mkv/download 7490 [93] {{site.baseurl}}/index.html 7492 [94] {{site.baseurl}}/chapters/menu.html#playback-features 7494 Authors' Addresses 7496 Steve Lhomme 7498 Moritz Bunkus 7499 Dave Rice