idnits 2.17.1 draft-ietf-cellar-matroska-03.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. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 670 has weird spacing: '...xx xxxx xxxx ...' == Line 671 has weird spacing: '...1x xxxx xxxx ...' == Line 672 has weird spacing: '...01 xxxx xxxx ...' == Line 674 has weird spacing: '...00 1xxx xxxx ...' == Line 675 has weird spacing: '...xx xxxx xxxx ...' == (4 more instances...) == The document seems to use 'NOT RECOMMENDED' as an RFC 2119 keyword, but does not include the phrase in its RFC 2119 key words list. -- 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 timestamps MAY NOT be consecutive. But a frame with a past timestamp 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 timestamps MAY NOT be consecutive. But a frame with a past timestamp MUST reference a frame already known, otherwise it's considered bad/void. -- The document date (July 22, 2019) is 1733 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 7420 looks like a reference -- Missing reference section? '2' on line 7422 looks like a reference -- Missing reference section? '3' on line 7425 looks like a reference -- Missing reference section? '4' on line 7427 looks like a reference -- Missing reference section? '5' on line 7429 looks like a reference -- Missing reference section? '6' on line 7431 looks like a reference -- Missing reference section? '7' on line 7434 looks like a reference -- Missing reference section? '8' on line 7437 looks like a reference -- Missing reference section? '9' on line 7439 looks like a reference -- Missing reference section? '10' on line 7442 looks like a reference -- Missing reference section? '11' on line 7445 looks like a reference -- Missing reference section? '12' on line 7448 looks like a reference -- Missing reference section? '13' on line 7451 looks like a reference -- Missing reference section? '14' on line 7453 looks like a reference -- Missing reference section? '15' on line 7455 looks like a reference -- Missing reference section? '16' on line 7457 looks like a reference -- Missing reference section? '0' on line 6269 looks like a reference -- Missing reference section? '17' on line 7459 looks like a reference -- Missing reference section? '18' on line 7461 looks like a reference -- Missing reference section? '19' on line 7463 looks like a reference -- Missing reference section? '20' on line 7465 looks like a reference Summary: 1 error (**), 0 flaws (~~), 10 warnings (==), 24 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: January 23, 2020 6 D. Rice 7 July 22, 2019 9 Matroska Specifications 10 draft-ietf-cellar-matroska-03 12 Abstract 14 This document defines the Matroska audiovisual container, including 15 definitions of its structural elements, as well as its terminology, 16 vocabulary, and application. 18 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at https://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on January 23, 2020. 35 Copyright Notice 37 Copyright (c) 2019 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 (https://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. Notation and Conventions . . . . . . . . . . . . . . . . . . 10 57 6. Basis in EBML . . . . . . . . . . . . . . . . . . . . . . . . 11 58 6.1. Added Constraints on EBML . . . . . . . . . . . . . . . . 11 59 6.2. Matroska Design . . . . . . . . . . . . . . . . . . . . . 11 60 6.2.1. Language Codes . . . . . . . . . . . . . . . . . . . 11 61 6.2.2. Physical Types . . . . . . . . . . . . . . . . . . . 12 62 6.2.3. Block Structure . . . . . . . . . . . . . . . . . . . 13 63 6.2.3.1. Block Header . . . . . . . . . . . . . . . . . . 13 64 6.2.3.2. Block Header Flags . . . . . . . . . . . . . . . 13 65 6.2.4. Lacing . . . . . . . . . . . . . . . . . . . . . . . 13 66 6.2.4.1. Xiph lacing . . . . . . . . . . . . . . . . . . . 14 67 6.2.4.2. EBML lacing . . . . . . . . . . . . . . . . . . . 14 68 6.2.4.3. Fixed-size lacing . . . . . . . . . . . . . . . . 15 69 6.2.4.4. SimpleBlock Structure . . . . . . . . . . . . . . 16 70 6.2.4.4.1. SimpleBlock Header . . . . . . . . . . . . . 16 71 6.2.4.4.2. SimpleBlock Header Flags . . . . . . . . . . 16 72 6.2.4.5. Laced Data . . . . . . . . . . . . . . . . . . . 17 73 7. Matroska Structure . . . . . . . . . . . . . . . . . . . . . 17 74 8. Matroska Additions to Schema Element Attributes . . . . . . . 26 75 9. Matroska Schema . . . . . . . . . . . . . . . . . . . . . . . 27 76 9.1. EBMLMaxIDLength Element . . . . . . . . . . . . . . . . . 27 77 9.2. EBMLMaxSizeLength Element . . . . . . . . . . . . . . . . 27 78 9.3. Segment Element . . . . . . . . . . . . . . . . . . . . . 28 79 9.3.1. SeekHead Element . . . . . . . . . . . . . . . . . . 28 80 9.3.1.1. Seek Element . . . . . . . . . . . . . . . . . . 28 81 9.3.1.1.1. SeekID Element . . . . . . . . . . . . . . . 29 82 9.3.1.1.2. SeekPosition Element . . . . . . . . . . . . 29 83 9.3.2. Info Element . . . . . . . . . . . . . . . . . . . . 29 84 9.3.2.1. SegmentUID Element . . . . . . . . . . . . . . . 30 85 9.3.2.2. SegmentFilename Element . . . . . . . . . . . . . 30 86 9.3.2.3. PrevUID Element . . . . . . . . . . . . . . . . . 30 87 9.3.2.4. PrevFilename Element . . . . . . . . . . . . . . 31 88 9.3.2.5. NextUID Element . . . . . . . . . . . . . . . . . 31 89 9.3.2.6. NextFilename Element . . . . . . . . . . . . . . 32 90 9.3.2.7. SegmentFamily Element . . . . . . . . . . . . . . 32 91 9.3.2.8. ChapterTranslate Element . . . . . . . . . . . . 32 92 9.3.2.8.1. ChapterTranslateEditionUID Element . . . . . 33 93 9.3.2.8.2. ChapterTranslateCodec Element . . . . . . . . 33 94 9.3.2.8.3. ChapterTranslateID Element . . . . . . . . . 33 95 9.3.2.9. TimestampScale Element . . . . . . . . . . . . . 34 96 9.3.2.10. Duration Element . . . . . . . . . . . . . . . . 34 97 9.3.2.11. DateUTC Element . . . . . . . . . . . . . . . . . 35 98 9.3.2.12. Title Element . . . . . . . . . . . . . . . . . . 35 99 9.3.2.13. MuxingApp Element . . . . . . . . . . . . . . . . 35 100 9.3.2.14. WritingApp Element . . . . . . . . . . . . . . . 36 101 9.3.3. Cluster Element . . . . . . . . . . . . . . . . . . . 36 102 9.3.3.1. Timestamp Element . . . . . . . . . . . . . . . . 36 103 9.3.3.2. SilentTracks Element . . . . . . . . . . . . . . 37 104 9.3.3.2.1. SilentTrackNumber Element . . . . . . . . . . 37 105 9.3.3.3. Position Element . . . . . . . . . . . . . . . . 37 106 9.3.3.4. PrevSize Element . . . . . . . . . . . . . . . . 38 107 9.3.3.5. SimpleBlock Element . . . . . . . . . . . . . . . 38 108 9.3.3.6. BlockGroup Element . . . . . . . . . . . . . . . 38 109 9.3.3.6.1. Block Element . . . . . . . . . . . . . . . . 39 110 9.3.3.6.2. BlockVirtual Element . . . . . . . . . . . . 39 111 9.3.3.6.3. BlockAdditions Element . . . . . . . . . . . 39 112 9.3.3.6.3.1. BlockMore Element . . . . . . . . . . . . 40 113 9.3.3.6.3.2. BlockAddID Element . . . . . . . . . . . 40 114 9.3.3.6.3.3. BlockAdditional Element . . . . . . . . . 40 115 9.3.3.6.4. BlockDuration Element . . . . . . . . . . . . 41 116 9.3.3.6.5. ReferencePriority Element . . . . . . . . . . 41 117 9.3.3.6.6. ReferenceBlock Element . . . . . . . . . . . 42 118 9.3.3.6.7. ReferenceVirtual Element . . . . . . . . . . 42 119 9.3.3.6.8. CodecState Element . . . . . . . . . . . . . 42 120 9.3.3.6.9. DiscardPadding Element . . . . . . . . . . . 43 121 9.3.3.6.10. Slices Element . . . . . . . . . . . . . . . 43 122 9.3.3.6.10.1. TimeSlice Element . . . . . . . . . . . 43 123 9.3.3.6.10.2. LaceNumber Element . . . . . . . . . . . 44 124 9.3.3.6.10.3. FrameNumber Element . . . . . . . . . . 44 125 9.3.3.6.10.4. BlockAdditionID Element . . . . . . . . 45 126 9.3.3.6.10.5. Delay Element . . . . . . . . . . . . . 45 127 9.3.3.6.10.6. SliceDuration Element . . . . . . . . . 46 128 9.3.3.6.11. ReferenceFrame Element . . . . . . . . . . . 46 129 9.3.3.6.11.1. ReferenceOffset Element . . . . . . . . 46 130 9.3.3.6.11.2. ReferenceTimestamp Element . . . . . . . 47 131 9.3.3.7. EncryptedBlock Element . . . . . . . . . . . . . 47 132 9.3.4. Tracks Element . . . . . . . . . . . . . . . . . . . 48 133 9.3.4.1. TrackEntry Element . . . . . . . . . . . . . . . 48 134 9.3.4.1.1. TrackNumber Element . . . . . . . . . . . . . 48 135 9.3.4.1.2. TrackUID Element . . . . . . . . . . . . . . 49 136 9.3.4.1.3. TrackType Element . . . . . . . . . . . . . . 49 137 9.3.4.1.4. FlagEnabled Element . . . . . . . . . . . . . 50 138 9.3.4.1.5. FlagDefault Element . . . . . . . . . . . . . 50 139 9.3.4.1.6. FlagForced Element . . . . . . . . . . . . . 51 140 9.3.4.1.7. FlagLacing Element . . . . . . . . . . . . . 51 141 9.3.4.1.8. MinCache Element . . . . . . . . . . . . . . 52 142 9.3.4.1.9. MaxCache Element . . . . . . . . . . . . . . 52 143 9.3.4.1.10. DefaultDuration Element . . . . . . . . . . . 52 144 9.3.4.1.11. DefaultDecodedFieldDuration Element . . . . . 53 145 9.3.4.1.12. TrackTimestampScale Element . . . . . . . . . 53 146 9.3.4.1.13. TrackOffset Element . . . . . . . . . . . . . 54 147 9.3.4.1.14. MaxBlockAdditionID Element . . . . . . . . . 54 148 9.3.4.1.15. Name Element . . . . . . . . . . . . . . . . 55 149 9.3.4.1.16. Language Element . . . . . . . . . . . . . . 55 150 9.3.4.1.17. LanguageIETF Element . . . . . . . . . . . . 55 151 9.3.4.1.18. CodecID Element . . . . . . . . . . . . . . . 56 152 9.3.4.1.19. CodecPrivate Element . . . . . . . . . . . . 56 153 9.3.4.1.20. CodecName Element . . . . . . . . . . . . . . 56 154 9.3.4.1.21. AttachmentLink Element . . . . . . . . . . . 57 155 9.3.4.1.22. CodecSettings Element . . . . . . . . . . . . 57 156 9.3.4.1.23. CodecInfoURL Element . . . . . . . . . . . . 57 157 9.3.4.1.24. CodecDownloadURL Element . . . . . . . . . . 58 158 9.3.4.1.25. CodecDecodeAll Element . . . . . . . . . . . 58 159 9.3.4.1.26. TrackOverlay Element . . . . . . . . . . . . 58 160 9.3.4.1.27. CodecDelay Element . . . . . . . . . . . . . 59 161 9.3.4.1.28. SeekPreRoll Element . . . . . . . . . . . . . 59 162 9.3.4.1.29. TrackTranslate Element . . . . . . . . . . . 60 163 9.3.4.1.29.1. TrackTranslateEditionUID Element . . . . 60 164 9.3.4.1.29.2. TrackTranslateCodec Element . . . . . . 60 165 9.3.4.1.29.3. TrackTranslateTrackID Element . . . . . 61 166 9.3.4.1.30. Video Element . . . . . . . . . . . . . . . . 61 167 9.3.4.1.30.1. FlagInterlaced Element . . . . . . . . . 61 168 9.3.4.1.30.2. FieldOrder Element . . . . . . . . . . . 62 169 9.3.4.1.30.3. StereoMode Element . . . . . . . . . . . 63 170 9.3.4.1.30.4. AlphaMode Element . . . . . . . . . . . 64 171 9.3.4.1.30.5. OldStereoMode Element . . . . . . . . . 64 172 9.3.4.1.30.6. PixelWidth Element . . . . . . . . . . . 65 173 9.3.4.1.30.7. PixelHeight Element . . . . . . . . . . 65 174 9.3.4.1.30.8. PixelCropBottom Element . . . . . . . . 66 175 9.3.4.1.30.9. PixelCropTop Element . . . . . . . . . . 66 176 9.3.4.1.30.10. PixelCropLeft Element . . . . . . . . . 66 177 9.3.4.1.30.11. PixelCropRight Element . . . . . . . . . 67 178 9.3.4.1.30.12. DisplayWidth Element . . . . . . . . . . 67 179 9.3.4.1.30.13. DisplayHeight Element . . . . . . . . . 68 180 9.3.4.1.30.14. DisplayUnit Element . . . . . . . . . . 68 181 9.3.4.1.30.15. AspectRatioType Element . . . . . . . . 69 182 9.3.4.1.30.16. ColourSpace Element . . . . . . . . . . 69 183 9.3.4.1.30.17. GammaValue Element . . . . . . . . . . . 69 184 9.3.4.1.30.18. FrameRate Element . . . . . . . . . . . 70 185 9.3.4.1.30.19. Colour Element . . . . . . . . . . . . . 70 186 9.3.4.1.30.20. MatrixCoefficients Element . . . . . . . 71 187 9.3.4.1.30.21. BitsPerChannel Element . . . . . . . . . 72 188 9.3.4.1.30.22. ChromaSubsamplingHorz Element . . . . . 72 189 9.3.4.1.30.23. ChromaSubsamplingVert Element . . . . . 72 190 9.3.4.1.30.24. CbSubsamplingHorz Element . . . . . . . 73 191 9.3.4.1.30.25. CbSubsamplingVert Element . . . . . . . 73 192 9.3.4.1.30.26. ChromaSitingHorz Element . . . . . . . . 74 193 9.3.4.1.30.27. ChromaSitingVert Element . . . . . . . . 74 194 9.3.4.1.30.28. Range Element . . . . . . . . . . . . . 75 195 9.3.4.1.30.29. TransferCharacteristics Element . . . . 75 196 9.3.4.1.30.30. Primaries Element . . . . . . . . . . . 76 197 9.3.4.1.30.31. MaxCLL Element . . . . . . . . . . . . . 77 198 9.3.4.1.30.32. MaxFALL Element . . . . . . . . . . . . 78 199 9.3.4.1.30.33. MasteringMetadata Element . . . . . . . 78 200 9.3.4.1.30.34. PrimaryRChromaticityX Element . . . . . 78 201 9.3.4.1.30.35. PrimaryRChromaticityY Element . . . . . 79 202 9.3.4.1.30.36. PrimaryGChromaticityX Element . . . . . 79 203 9.3.4.1.30.37. PrimaryGChromaticityY Element . . . . . 80 204 9.3.4.1.30.38. PrimaryBChromaticityX Element . . . . . 80 205 9.3.4.1.30.39. PrimaryBChromaticityY Element . . . . . 80 206 9.3.4.1.30.40. WhitePointChromaticityX Element . . . . 81 207 9.3.4.1.30.41. WhitePointChromaticityY Element . . . . 81 208 9.3.4.1.30.42. LuminanceMax Element . . . . . . . . . . 82 209 9.3.4.1.30.43. LuminanceMin Element . . . . . . . . . . 82 210 9.3.4.1.30.44. Projection Element . . . . . . . . . . . 82 211 9.3.4.1.30.45. ProjectionType Element . . . . . . . . . 83 212 9.3.4.1.30.46. ProjectionPrivate Element . . . . . . . 83 213 9.3.4.1.30.47. ProjectionPoseYaw Element . . . . . . . 84 214 9.3.4.1.30.48. ProjectionPosePitch Element . . . . . . 85 215 9.3.4.1.30.49. ProjectionPoseRoll Element . . . . . . . 85 216 9.3.4.1.31. Audio Element . . . . . . . . . . . . . . . . 86 217 9.3.4.1.31.1. SamplingFrequency Element . . . . . . . 86 218 9.3.4.1.31.2. OutputSamplingFrequency Element . . . . 86 219 9.3.4.1.31.3. Channels Element . . . . . . . . . . . . 87 220 9.3.4.1.31.4. ChannelPositions Element . . . . . . . . 87 221 9.3.4.1.31.5. BitDepth Element . . . . . . . . . . . . 88 222 9.3.4.1.32. TrackOperation Element . . . . . . . . . . . 88 223 9.3.4.1.32.1. TrackCombinePlanes Element . . . . . . . 88 224 9.3.4.1.32.2. TrackPlane Element . . . . . . . . . . . 89 225 9.3.4.1.32.3. TrackPlaneUID Element . . . . . . . . . 89 226 9.3.4.1.32.4. TrackPlaneType Element . . . . . . . . . 90 227 9.3.4.1.32.5. TrackJoinBlocks Element . . . . . . . . 90 228 9.3.4.1.32.6. TrackJoinUID Element . . . . . . . . . . 91 229 9.3.4.1.33. TrickTrackUID Element . . . . . . . . . . . . 91 230 9.3.4.1.34. TrickTrackSegmentUID Element . . . . . . . . 91 231 9.3.4.1.35. TrickTrackFlag Element . . . . . . . . . . . 92 232 9.3.4.1.36. TrickMasterTrackUID Element . . . . . . . . . 92 233 9.3.4.1.37. TrickMasterTrackSegmentUID Element . . . . . 93 234 9.3.4.1.38. ContentEncodings Element . . . . . . . . . . 93 235 9.3.4.1.38.1. ContentEncoding Element . . . . . . . . 93 236 9.3.4.1.38.2. ContentEncodingOrder Element . . . . . . 94 237 9.3.4.1.38.3. ContentEncodingScope Element . . . . . . 94 238 9.3.4.1.38.4. ContentEncodingType Element . . . . . . 95 239 9.3.4.1.38.5. ContentCompression Element . . . . . . . 95 240 9.3.4.1.38.6. ContentCompAlgo Element . . . . . . . . 96 241 9.3.4.1.38.7. ContentCompSettings Element . . . . . . 96 242 9.3.4.1.38.8. ContentEncryption Element . . . . . . . 97 243 9.3.4.1.38.9. ContentEncAlgo Element . . . . . . . . . 97 244 9.3.4.1.38.10. ContentEncKeyID Element . . . . . . . . 98 245 9.3.4.1.38.11. ContentEncAESSettings Element . . . . . 98 246 9.3.4.1.38.12. AESSettingsCipherMode Element . . . . . 99 247 9.3.4.1.38.13. ContentSignature Element . . . . . . . . 99 248 9.3.4.1.38.14. ContentSigKeyID Element . . . . . . . . 99 249 9.3.4.1.38.15. ContentSigAlgo Element . . . . . . . . . 100 250 9.3.4.1.38.16. ContentSigHashAlgo Element . . . . . . . 100 251 9.3.5. Cues Element . . . . . . . . . . . . . . . . . . . . 101 252 9.3.5.1. CuePoint Element . . . . . . . . . . . . . . . . 101 253 9.3.5.1.1. CueTime Element . . . . . . . . . . . . . . . 102 254 9.3.5.1.2. CueTrackPositions Element . . . . . . . . . . 102 255 9.3.5.1.2.1. CueTrack Element . . . . . . . . . . . . 102 256 9.3.5.1.2.2. CueClusterPosition Element . . . . . . . 103 257 9.3.5.1.2.3. CueRelativePosition Element . . . . . . . 103 258 9.3.5.1.2.4. CueDuration Element . . . . . . . . . . . 103 259 9.3.5.1.2.5. CueBlockNumber Element . . . . . . . . . 104 260 9.3.5.1.2.6. CueCodecState Element . . . . . . . . . . 104 261 9.3.5.1.2.7. CueReference Element . . . . . . . . . . 105 262 9.3.5.1.2.8. CueRefTime Element . . . . . . . . . . . 105 263 9.3.5.1.2.9. CueRefCluster Element . . . . . . . . . . 105 264 9.3.5.1.2.10. CueRefNumber Element . . . . . . . . . . 106 265 9.3.5.1.2.11. CueRefCodecState Element . . . . . . . . 106 266 9.3.6. Attachments Element . . . . . . . . . . . . . . . . . 107 267 9.3.6.1. AttachedFile Element . . . . . . . . . . . . . . 107 268 9.3.6.1.1. FileDescription Element . . . . . . . . . . . 107 269 9.3.6.1.2. FileName Element . . . . . . . . . . . . . . 108 270 9.3.6.1.3. FileMimeType Element . . . . . . . . . . . . 108 271 9.3.6.1.4. FileData Element . . . . . . . . . . . . . . 108 272 9.3.6.1.5. FileUID Element . . . . . . . . . . . . . . . 109 273 9.3.6.1.6. FileReferral Element . . . . . . . . . . . . 109 274 9.3.6.1.7. FileUsedStartTime Element . . . . . . . . . . 109 275 9.3.6.1.8. FileUsedEndTime Element . . . . . . . . . . . 110 276 9.3.7. Chapters Element . . . . . . . . . . . . . . . . . . 110 277 9.3.7.1. EditionEntry Element . . . . . . . . . . . . . . 110 278 9.3.7.1.1. EditionUID Element . . . . . . . . . . . . . 111 279 9.3.7.1.2. EditionFlagHidden Element . . . . . . . . . . 111 280 9.3.7.1.3. EditionFlagDefault Element . . . . . . . . . 112 281 9.3.7.1.4. EditionFlagOrdered Element . . . . . . . . . 112 282 9.3.7.1.5. ChapterAtom Element . . . . . . . . . . . . . 112 283 9.3.7.1.5.1. ChapterUID Element . . . . . . . . . . . 113 284 9.3.7.1.5.2. ChapterStringUID Element . . . . . . . . 113 285 9.3.7.1.5.3. ChapterTimeStart Element . . . . . . . . 113 286 9.3.7.1.5.4. ChapterTimeEnd Element . . . . . . . . . 114 287 9.3.7.1.5.5. ChapterFlagHidden Element . . . . . . . . 114 288 9.3.7.1.5.6. ChapterFlagEnabled Element . . . . . . . 115 289 9.3.7.1.5.7. ChapterSegmentUID Element . . . . . . . . 115 290 9.3.7.1.5.8. ChapterSegmentEditionUID Element . . . . 116 291 9.3.7.1.5.9. ChapterPhysicalEquiv Element . . . . . . 116 292 9.3.7.1.5.10. ChapterTrack Element . . . . . . . . . . 116 293 9.3.7.1.5.11. ChapterTrackNumber Element . . . . . . . 117 294 9.3.7.1.5.12. ChapterDisplay Element . . . . . . . . . 117 295 9.3.7.1.5.13. ChapString Element . . . . . . . . . . . 117 296 9.3.7.1.5.14. ChapLanguage Element . . . . . . . . . . 118 297 9.3.7.1.5.15. ChapLanguageIETF Element . . . . . . . . 118 298 9.3.7.1.5.16. ChapCountry Element . . . . . . . . . . . 119 299 9.3.7.1.5.17. ChapProcess Element . . . . . . . . . . . 119 300 9.3.7.1.5.18. ChapProcessCodecID Element . . . . . . . 119 301 9.3.7.1.5.19. ChapProcessPrivate Element . . . . . . . 120 302 9.3.7.1.5.20. ChapProcessCommand Element . . . . . . . 120 303 9.3.7.1.5.21. ChapProcessTime Element . . . . . . . . . 120 304 9.3.7.1.5.22. ChapProcessData Element . . . . . . . . . 121 305 9.3.8. Tags Element . . . . . . . . . . . . . . . . . . . . 121 306 9.3.8.1. Tag Element . . . . . . . . . . . . . . . . . . . 122 307 9.3.8.1.1. Targets Element . . . . . . . . . . . . . . . 122 308 9.3.8.1.1.1. TargetTypeValue Element . . . . . . . . . 122 309 9.3.8.1.1.2. TargetType Element . . . . . . . . . . . 123 310 9.3.8.1.1.3. TagTrackUID Element . . . . . . . . . . . 124 311 9.3.8.1.1.4. TagEditionUID Element . . . . . . . . . . 124 312 9.3.8.1.1.5. TagChapterUID Element . . . . . . . . . . 125 313 9.3.8.1.1.6. TagAttachmentUID Element . . . . . . . . 125 314 9.3.8.1.2. SimpleTag Element . . . . . . . . . . . . . . 125 315 9.3.8.1.2.1. TagName Element . . . . . . . . . . . . . 126 316 9.3.8.1.2.2. TagLanguage Element . . . . . . . . . . . 126 317 9.3.8.1.2.3. TagLanguageIETF Element . . . . . . . . . 127 318 9.3.8.1.2.4. TagDefault Element . . . . . . . . . . . 127 319 9.3.8.1.2.5. TagString Element . . . . . . . . . . . . 127 320 9.3.8.1.2.6. TagBinary Element . . . . . . . . . . . . 128 321 10. Matroska Element Ordering . . . . . . . . . . . . . . . . . . 128 322 10.1. Top-Level Elements . . . . . . . . . . . . . . . . . . . 128 323 10.2. CRC-32 . . . . . . . . . . . . . . . . . . . . . . . . . 129 324 10.3. SeekHead . . . . . . . . . . . . . . . . . . . . . . . . 129 325 10.4. Cues (index) . . . . . . . . . . . . . . . . . . . . . . 129 326 10.5. Info . . . . . . . . . . . . . . . . . . . . . . . . . . 129 327 10.6. Chapters Element . . . . . . . . . . . . . . . . . . . . 130 328 10.7. Attachments . . . . . . . . . . . . . . . . . . . . . . 130 329 10.8. Tags . . . . . . . . . . . . . . . . . . . . . . . . . . 130 330 10.9. Optimum layout from a muxer . . . . . . . . . . . . . . 130 331 10.10. Optimum layout after editing tags . . . . . . . . . . . 131 332 10.11. Optimum layout with Cues at the front . . . . . . . . . 131 333 10.12. Cluster Timestamp . . . . . . . . . . . . . . . . . . . 131 334 11. Chapters . . . . . . . . . . . . . . . . . . . . . . . . . . 132 335 11.1. Edition and Chapter Flags . . . . . . . . . . . . . . . 132 336 11.1.1. Chapter Flags . . . . . . . . . . . . . . . . . . . 132 337 11.1.2. Edition Flags . . . . . . . . . . . . . . . . . . . 132 338 11.1.2.1. EditionFlagHidden . . . . . . . . . . . . . . . 132 339 11.1.2.2. EditionFlagDefault . . . . . . . . . . . . . . . 133 340 11.1.2.3. EditionFlagOrdered . . . . . . . . . . . . . . . 133 341 11.1.2.3.1. Ordered-Edition and Matroska Segment-Linking 134 342 11.2. Menu features . . . . . . . . . . . . . . . . . . . . . 134 343 11.2.1. Matroska Script (0) . . . . . . . . . . . . . . . . 134 344 11.2.2. DVD menu (1) . . . . . . . . . . . . . . . . . . . . 135 345 11.3. Example 1 : basic chaptering . . . . . . . . . . . . . . 136 346 11.4. Example 2 : nested chapters . . . . . . . . . . . . . . 138 347 11.4.1. The Micronauts "Bleep To Bleep" . . . . . . . . . . 138 348 12. Attachments . . . . . . . . . . . . . . . . . . . . . . . . . 141 349 12.1. Cover Art . . . . . . . . . . . . . . . . . . . . . . . 141 350 13. Cues . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 351 13.1. Recommendations . . . . . . . . . . . . . . . . . . . . 142 352 14. Matroska Streaming . . . . . . . . . . . . . . . . . . . . . 143 353 14.1. File Access . . . . . . . . . . . . . . . . . . . . . . 143 354 14.2. Livestreaming . . . . . . . . . . . . . . . . . . . . . 144 355 15. Menu Specifications . . . . . . . . . . . . . . . . . . . . . 144 356 15.1. Requirements . . . . . . . . . . . . . . . . . . . . . . 145 357 15.1.1. Highlights/Hotspots . . . . . . . . . . . . . . . . 145 358 15.1.2. Playback features . . . . . . . . . . . . . . . . . 146 359 15.1.3. Player requirements . . . . . . . . . . . . . . . . 146 360 15.2. Working Graph . . . . . . . . . . . . . . . . . . . . . 146 361 16. Unknown elements . . . . . . . . . . . . . . . . . . . . . . 147 362 17. Default Values . . . . . . . . . . . . . . . . . . . . . . . 147 363 18. DefaultDecodedFieldDuration . . . . . . . . . . . . . . . . . 147 364 19. Encryption . . . . . . . . . . . . . . . . . . . . . . . . . 148 365 20. Image Presentation . . . . . . . . . . . . . . . . . . . . . 148 366 20.1. Cropping . . . . . . . . . . . . . . . . . . . . . . . . 148 367 20.2. Rotation . . . . . . . . . . . . . . . . . . . . . . . . 149 368 21. Matroska versioning . . . . . . . . . . . . . . . . . . . . . 149 369 22. MIME Types . . . . . . . . . . . . . . . . . . . . . . . . . 150 370 23. Segment Position . . . . . . . . . . . . . . . . . . . . . . 150 371 23.1. Segment Position Exception . . . . . . . . . . . . . . . 150 372 23.2. Example of Segment Position . . . . . . . . . . . . . . 150 373 24. Linked Segments . . . . . . . . . . . . . . . . . . . . . . . 151 374 24.1. Hard Linking . . . . . . . . . . . . . . . . . . . . . . 151 375 24.2. Medium Linking . . . . . . . . . . . . . . . . . . . . . 152 376 24.3. Soft Linking . . . . . . . . . . . . . . . . . . . . . . 152 377 25. Track Flags . . . . . . . . . . . . . . . . . . . . . . . . . 153 378 25.1. Default flag . . . . . . . . . . . . . . . . . . . . . . 153 379 25.2. Forced flag . . . . . . . . . . . . . . . . . . . . . . 153 380 25.3. Track Operation . . . . . . . . . . . . . . . . . . . . 153 381 25.4. Overlay Track . . . . . . . . . . . . . . . . . . . . . 154 382 25.5. Multi-planar and 3D videos . . . . . . . . . . . . . . . 154 383 26. Timestamps . . . . . . . . . . . . . . . . . . . . . . . . . 155 384 26.1. Timestamp Types . . . . . . . . . . . . . . . . . . . . 155 385 26.2. Block Timestamps . . . . . . . . . . . . . . . . . . . . 155 386 26.3. Raw Timestamp . . . . . . . . . . . . . . . . . . . . . 155 387 26.4. TimestampScale . . . . . . . . . . . . . . . . . . . . . 155 388 26.5. TimestampScale Rounding . . . . . . . . . . . . . . . . 156 389 26.6. TrackTimestampScale . . . . . . . . . . . . . . . . . . 158 390 27.1. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 159 391 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 160 393 1. Introduction 395 Matroska aims to become THE standard of multimedia container formats. 396 It was derived from a project called MCF [1], but differentiates from 397 it significantly because it is based on EBML [2] (Extensible Binary 398 Meta Language), a binary derivative of XML. EBML enables significant 399 advantages in terms of future format extensibility, without breaking 400 file support in old parsers. 402 First, it is essential to clarify exactly "What an Audio/Video 403 container is", to avoid any misunderstandings: 405 o It is NOT a video or audio compression format (codec) 407 o It is an envelope for which there can be many audio, video and 408 subtitles streams, allowing the user to store a complete movie or 409 CD in a single file. 411 Matroska is designed with the future in mind. It incorporates 412 features like: 414 o Fast seeking in the file 416 o Chapter entries 418 o Full metadata (tags) support 420 o Selectable subtitle/audio/video streams 422 o Modularly expandable 424 o Error resilience (can recover playback even when the stream is 425 damaged) 427 o Streamable over the internet and local networks (HTTP, CIFS, FTP, 428 etc) 430 o Menus (like DVDs have) 432 Matroska is an open standards project. This means for personal use 433 it is absolutely free to use and that the technical specifications 434 describing the bitstream are open to everybody, even to companies 435 that would like to support it in their products. 437 2. Status of this document 439 This document is a work-in-progress specification defining the 440 Matroska file format as part of the IETF Cellar working group [3]. 441 But since it's quite complete it is used as a reference for the 442 development of libmatroska. Legacy versions of the specification can 443 be found here [4] (PDF doc by Alexander Noe -- outdated). 445 For a simplified diagram of the layout of a Matroska file, see the 446 Diagram page [5]. 448 A more refined and detailed version of the EBML specifications is 449 being worked on here [6]. 451 The table found below is now generated from the "source" of the 452 Matroska specification. This XML file [7] is also used to generate 453 the semantic data used in libmatroska and libmatroska2. We encourage 454 anyone to use and monitor its changes so your code is spec-proof and 455 always up to date. 457 Note that versions 1, 2 and 3 have been finalized. Version 4 is 458 currently work in progress. There MAY be further additions to v4. 460 3. Security Considerations 462 Matroska inherits security considerations from EBML. 464 Attacks on a "Matroska Reader" could include: 466 o Storage of a arbitrary and potentially executable data within an 467 "Attachment Element". "Matroska Readers" that extract or use data 468 from Matroska Attachments SHOULD check that the data adheres to 469 expectations. 471 o A "Matroska Attachment" with an inaccurate mime-type. 473 4. IANA Considerations 475 To be determined. 477 5. Notation and Conventions 479 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 480 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 481 document are to be interpreted as described in RFC 2119 [8]. 483 This document defines specific terms in order to define the format 484 and application of "Matroska". Specific terms are defined below: 486 "Matroska": a multimedia container format based on EBML (Extensible 487 Binary Meta Language) 489 "Matroska Reader": A "Matroska Reader" is a data parser that 490 interprets the semantics of a Matroska document and creates a way for 491 programs to use "Matroska". 493 "Matroska Player": A "Matroska Player" is a "Matroska Reader" with a 494 primary purpose of playing audiovisual files, including "Matroska" 495 documents. 497 6. Basis in EBML 499 Matroska is a Document Type of EBML (Extensible Binary Meta 500 Language). This specification is dependent on the EBML Specification 501 [9]. For an understanding of Matroska's EBML Schema, see in 502 particular the sections of the EBML Specification covering EBML 503 Element Types [10], EBML Schema [11], and EBML Structure [12]. 505 6.1. Added Constraints on EBML 507 As an EBML Document Type, Matroska adds the following constraints to 508 the EBML specification. 510 o The "docType" of the "EBML Header" MUST be 'matroska'. 512 o The "EBMLMaxIDLength" of the "EBML Header" MUST be "4". 514 o The "EBMLMaxSizeLength" of the "EBML Header" MUST be between "1" 515 and "8" inclusive. 517 6.2. Matroska Design 519 All top-levels elements (Segment and direct sub-elements) are coded 520 on 4 octets, i.e. class D elements. 522 6.2.1. Language Codes 524 Matroska from version 1 through 3 uses language codes that can be 525 either the 3 letters bibliographic ISO-639-2 [13] form (like "fre" 526 for french), or such a language code followed by a dash and a country 527 code for specialities in languages (like "fre-ca" for Canadian 528 French). The "ISO 639-2 Language Elements" are "Language Element", 529 "TagLanguage Element", and "ChapLanguage Element". 531 Starting in Matroska version 4, either "ISO 639-2" or BCP 47 [14] MAY 532 be used, although "BCP 47" is RECOMMENDED. The "BCP 47 Language 533 Elements" are "LanguageIETF Element", "TagLanguageIETF Element", and 534 "ChapLanguageIETF Element". If a "BCP 47 Language Element" and an 535 "ISO 639-2 Language Element" are used within the same "Parent 536 Element", then the "ISO 639-2 Language Element" MUST be ignored and 537 precedence given to the "BCP 47 Language Element". 539 Country codes are the same as used for internet domains [15]. 541 6.2.2. Physical Types 543 Each level can have different meanings for audio and video. The 544 ORIGINAL_MEDIUM tag can be used to specify a string for 545 ChapterPhysicalEquiv = 60. Here is the list of possible levels for 546 both audio and video : 548 +----------------------+--------------+-----------+-----------------+ 549 | ChapterPhysicalEquiv | Audio | Video | Comment | 550 +----------------------+--------------+-----------+-----------------+ 551 | 70 | SET / | SET / | the collection | 552 | | PACKAGE | PACKAGE | of different | 553 | | | | media | 554 | 60 | CD / 12" / | DVD / VHS | the physical | 555 | | 10" / 7" / | / | medium like a | 556 | | TAPE / | LASERDISC | CD or a DVD | 557 | | MINIDISC / | | | 558 | | DAT | | | 559 | 50 | SIDE | SIDE | when the | 560 | | | | original medium | 561 | | | | (LP/DVD) has | 562 | | | | different sides | 563 | 40 | - | LAYER | another | 564 | | | | physical level | 565 | | | | on DVDs | 566 | 30 | SESSION | SESSION | as found on CDs | 567 | | | | and DVDs | 568 | 20 | TRACK | - | as found on | 569 | | | | audio CDs | 570 | 10 | INDEX | - | the first | 571 | | | | logical level | 572 | | | | of the | 573 | | | | side/medium | 574 +----------------------+--------------+-----------+-----------------+ 576 6.2.3. Block Structure 578 Bit 0 is the most significant bit. 580 Frames using references SHOULD be stored in "coding order". That 581 means the references first and then the frames referencing them. A 582 consequence is that timestamps MAY NOT be consecutive. But a frame 583 with a past timestamp MUST reference a frame already known, otherwise 584 it's considered bad/void. 586 There can be many Blocks in a BlockGroup provided they all have the 587 same timestamp. It is used with different parts of a frame with 588 different priorities. 590 6.2.3.1. Block Header 592 +--------+--------+-------------------------------------------------+ 593 | Offset | Player | Description | 594 +--------+--------+-------------------------------------------------+ 595 | 0x00+ | MUST | Track Number (Track Entry). It is coded in EBML | 596 | | | like form (1 octet if the value is < 0x80, 2 if | 597 | | | < 0x4000, etc) (most significant bits set to | 598 | | | increase the range). | 599 | 0x01+ | MUST | Timestamp (relative to Cluster timestamp, | 600 | | | signed int16) | 601 +--------+--------+-------------------------------------------------+ 603 6.2.3.2. Block Header Flags 605 +--------+-----+--------+-------------------------------------------+ 606 | Offset | Bit | Player | Description | 607 +--------+-----+--------+-------------------------------------------+ 608 | 0x03+ | 0-3 | - | Reserved, set to 0 | 609 | 0x03+ | 4 | - | Invisible, the codec SHOULD decode this | 610 | | | | frame but not display it | 611 | 0x03+ | 5-6 | MUST | Lacing | 612 | | | | * 00 : no lacing | 613 | | | | * 01 : Xiph lacing | 614 | | | | * 11 : EBML lacing | 615 | | | | * 10 : fixed-size lacing | 616 | 0x03+ | 7 | - | not used | 617 +--------+-----+--------+-------------------------------------------+ 619 6.2.4. Lacing 621 Lacing is a mechanism to save space when storing data. It is 622 typically used for small blocks of data (referred to as frames in 623 Matroska). There are 3 types of lacing: 625 1. Xiph, inspired by what is found in the Ogg container 627 2. EBML, which is the same with sizes coded differently 629 3. fixed-size, where the size is not coded 631 For example, a user wants to store 3 frames of the same track. The 632 first frame is 800 octets long, the second is 500 octets long and the 633 third is 1000 octets long. As these data are small, they can be 634 stored in a lace to save space. They will then be stored in the same 635 block as follows: 637 6.2.4.1. Xiph lacing 639 o Block head (with lacing bits set to 01) 641 o Lacing head: Number of frames in the lace -1, i.e. 2 (the 800 and 642 500 octets one) 644 o Lacing sizes: only the 2 first ones will be coded, 800 gives 645 255;255;255;35, 500 gives 255;245. The size of the last frame is 646 deduced from the total size of the Block. 648 o Data in frame 1 650 o Data in frame 2 652 o Data in frame 3 654 A frame with a size multiple of 255 is coded with a 0 at the end of 655 the size, for example 765 is coded 255;255;255;0. 657 6.2.4.2. EBML lacing 659 In this case, the size is not coded as blocks of 255 bytes, but as a 660 difference with the previous size and this size is coded as in EBML. 661 The first size in the lace is unsigned as in EBML. The others use a 662 range shifting to get a sign on each value: 664 +----------------------------------+--------------------------------+ 665 | Bit Representation | Value | 666 +----------------------------------+--------------------------------+ 667 | 1xxx xxxx | value -(2^6-1) to 2^6-1 (ie 0 | 668 | | to 2^7-2 minus 2^6-1, half of | 669 | | the range) | 670 | 01xx xxxx xxxx xxxx | value -(2^13-1) to 2^13-1 | 671 | 001x xxxx xxxx xxxx xxxx xxxx | value -(2^20-1) to 2^20-1 | 672 | 0001 xxxx xxxx xxxx xxxx xxxx | value -(2^27-1) to 2^27-1 | 673 | xxxx xxxx | | 674 | 0000 1xxx xxxx xxxx xxxx xxxx | value -(2^34-1) to 2^34-1 | 675 | xxxx xxxx xxxx xxxx | | 676 | 0000 01xx xxxx xxxx xxxx xxxx | value -(2^41-1) to 2^41-1 | 677 | xxxx xxxx xxxx xxxx xxxx xxxx | | 678 | 0000 001x xxxx xxxx xxxx xxxx | value -(2^48-1) to 2^48-1 | 679 | xxxx xxxx xxxx xxxx xxxx xxxx | | 680 | xxxx xxxx | | 681 +----------------------------------+--------------------------------+ 683 o Block head (with lacing bits set to 11) 685 o Lacing head: Number of frames in the lace -1, i.e. 2 (the 800 and 686 500 octets one) 688 o Lacing sizes: only the 2 first ones will be coded, 800 gives 0x320 689 0x4000 = 0x4320, 500 is coded as -300 : - 0x12C + 0x1FFF + 0x4000 690 = 0x5ED3. The size of the last frame is deduced from the total 691 size of the Block. 693 o Data in frame 1 695 o Data in frame 2 697 o Data in frame 3 699 6.2.4.3. Fixed-size lacing 701 In this case, only the number of frames in the lace is saved, the 702 size of each frame is deduced from the total size of the Block. For 703 example, for 3 frames of 800 octets each: 705 o Block head (with lacing bits set to 10) 707 o Lacing head: Number of frames in the lace -1, i.e. 2 709 o Data in frame 1 711 o Data in frame 2 712 o Data in frame 3 714 6.2.4.4. SimpleBlock Structure 716 The "SimpleBlock" is inspired by the Section 6.2.3. The main 717 differences are the added Keyframe flag and Discardable flag. 718 Otherwise everything is the same. 720 Bit 0 is the most significant bit. 722 Frames using references SHOULD be stored in "coding order". That 723 means the references first and then the frames referencing them. A 724 consequence is that timestamps MAY NOT be consecutive. But a frame 725 with a past timestamp MUST reference a frame already known, otherwise 726 it's considered bad/void. 728 There can be many "Block Elements" in a "BlockGroup" provided they 729 all have the same timestamp. It is used with different parts of a 730 frame with different priorities. 732 6.2.4.4.1. SimpleBlock Header 734 +--------+--------+-------------------------------------------------+ 735 | Offset | Player | Description | 736 +--------+--------+-------------------------------------------------+ 737 | 0x00+ | MUST | Track Number (Track Entry). It is coded in EBML | 738 | | | like form (1 octet if the value is < 0x80, 2 if | 739 | | | < 0x4000, etc) (most significant bits set to | 740 | | | increase the range). | 741 | 0x01+ | MUST | Timestamp (relative to Cluster timestamp, | 742 | | | signed int16) | 743 +--------+--------+-------------------------------------------------+ 745 6.2.4.4.2. SimpleBlock Header Flags 746 +--------+-----+--------+-------------------------------------------+ 747 | Offset | Bit | Player | Description | 748 +--------+-----+--------+-------------------------------------------+ 749 | 0x03+ | 0 | - | Keyframe, set when the Block contains | 750 | | | | only keyframes | 751 | 0x03+ | 1-3 | - | Reserved, set to 0 | 752 | 0x03+ | 4 | - | Invisible, the codec SHOULD decode this | 753 | | | | frame but not display it | 754 | 0x03+ | 5-6 | MUST | Lacing | 755 | | | | * 00 : no lacing | 756 | | | | * 01 : Xiph lacing | 757 | | | | * 11 : EBML lacing | 758 | | | | * 10 : fixed-size lacing | 759 | 0x03+ | 7 | - | Discardable, the frames of the Block can | 760 | | | | be discarded during playing if needed | 761 +--------+-----+--------+-------------------------------------------+ 763 6.2.4.5. Laced Data 765 When lacing bit is set. 767 +--------+--------+-------------------------------------------------+ 768 | Offset | Player | Description | 769 +--------+--------+-------------------------------------------------+ 770 | 0x00 | MUST | Number of frames in the lace-1 (uint8) | 771 | 0x01 / | MUST* | Lace-coded size of each frame of the lace, | 772 | 0xXX | | except for the last one (multiple uint8). *This | 773 | | | is not used with Fixed-size lacing as it is | 774 | | | calculated automatically from (total size of | 775 | | | lace) / (number of frames in lace). | 776 +--------+--------+-------------------------------------------------+ 778 For (possibly) Laced Data 780 +--------+--------+--------------------------+ 781 | Offset | Player | Description | 782 +--------+--------+--------------------------+ 783 | 0x00 | MUST | Consecutive laced frames | 784 +--------+--------+--------------------------+ 786 7. Matroska Structure 788 A Matroska file MUST be composed of at least one "EBML Document" 789 using the "Matroska Document Type". Each "EBML Document" MUST start 790 with an "EBML Header" and MUST be followed by the "EBML Root 791 Element", defined as "Segment" in Matroska. Matroska defines several 792 "Top Level Elements" which MAY occur within the "Segment". 794 As an example, a simple Matroska file consisting of a single "EBML 795 Document" could be represented like this: 797 o "EBML Header" 799 o "Segment" 801 A more complex Matroska file consisting of an "EBML Stream" 802 (consisting of two "EBML Documents") could be represented like this: 804 o "EBML Header" 806 o "Segment" 808 o "EBML Header" 810 o "Segment" 812 The following diagram represents a simple Matroska file, comprised of 813 an "EBML Document" with an "EBML Header", a "Segment Element" (the 814 "Root Element"), and all eight Matroska "Top Level Elements". In the 815 following diagrams of this section, horizontal spacing expresses a 816 parent-child relationship between Matroska Elements (e.g. the "Info 817 Element" is contained within the "Segment Element") whereas vertical 818 alignment represents the storage order within the file. 820 +-------------+ 821 | EBML Header | 822 +---------------------------+ 823 | Segment | SeekHead | 824 | |-------------| 825 | | Info | 826 | |-------------| 827 | | Tracks | 828 | |-------------| 829 | | Chapters | 830 | |-------------| 831 | | Cluster | 832 | |-------------| 833 | | Cues | 834 | |-------------| 835 | | Attachments | 836 | |-------------| 837 | | Tags | 838 +---------------------------+ 840 The Matroska "EBML Schema" defines eight "Top Level Elements": 841 "SeekHead", "Info", "Tracks", "Chapters", "Cluster", "Cues", 842 "Attachments", and "Tags". 844 The "SeekHead Element" (also known as "MetaSeek") contains an index 845 of "Top Level Elements" locations within the "Segment". Use of the 846 "SeekHead Element" is RECOMMENDED. Without a "SeekHead Element", a 847 Matroska parser would have to search the entire file to find all of 848 the other "Top Level Elements". This is due to Matroska's flexible 849 ordering requirements; for instance, it is acceptable for the 850 "Chapters Element" to be stored after the "Cluster Elements". 852 +--------------------------------+ 853 | SeekHead | Seek | SeekID | 854 | | |--------------| 855 | | | SeekPosition | 856 +--------------------------------+ 858 Representation of a SeekHead Element. 860 The "Info Element" contains vital information for identifying the 861 whole "Segment". This includes the title for the "Segment", a 862 randomly generated unique identifier, and the unique identifier(s) of 863 any linked "Segment Elements". 865 +-------------------------+ 866 | Info | SegmentUID | 867 | |------------------| 868 | | SegmentFilename | 869 | |------------------| 870 | | PrevUID | 871 | |------------------| 872 | | PrevFilename | 873 | |------------------| 874 | | NextUID | 875 | |------------------| 876 | | NextFilename | 877 | |------------------| 878 | | SegmentFamily | 879 | |------------------| 880 | | ChapterTranslate | 881 | |------------------| 882 | | TimestampScale | 883 | |------------------| 884 | | Duration | 885 | |------------------| 886 | | DateUTC | 887 | |------------------| 888 | | Title | 889 | |------------------| 890 | | MuxingApp | 891 | |------------------| 892 | | WritingApp | 893 |-------------------------| 895 Representation of an Info Element and its Child Elements. 897 The "Tracks Element" defines the technical details for each track and 898 can store the name, number, unique identifier, language and type 899 (audio, video, subtitles, etc.) of each track. For example, the 900 "Tracks Element" MAY store information about the resolution of a 901 video track or sample rate of an audio track. 903 The "Tracks Element" MUST identify all the data needed by the codec 904 to decode the data of the specified track. However, the data 905 required is contingent on the codec used for the track. For example, 906 a "Track Element" for uncompressed audio only requires the audio bit 907 rate to be present. A codec such as AC-3 would require that the 908 "CodecID Element" be present for all tracks, as it is the primary way 909 to identify which codec to use to decode the track. 911 +------------------------------------+ 912 | Tracks | TrackEntry | TrackNumber | 913 | | |--------------| 914 | | | TrackUID | 915 | | |--------------| 916 | | | TrackType | 917 | | |--------------| 918 | | | Name | 919 | | |--------------| 920 | | | Language | 921 | | |--------------| 922 | | | CodecID | 923 | | |--------------| 924 | | | CodecPrivate | 925 | | |--------------| 926 | | | CodecName | 927 | | |----------------------------------+ 928 | | | Video | FlagInterlaced | 929 | | | |-------------------| 930 | | | | FieldOrder | 931 | | | |-------------------| 932 | | | | StereoMode | 933 | | | |-------------------| 934 | | | | AlphaMode | 935 | | | |-------------------| 936 | | | | PixelWidth | 937 | | | |-------------------| 938 | | | | PixelHeight | 939 | | | |-------------------| 940 | | | | DisplayWidth | 941 | | | |-------------------| 942 | | | | DisplayHeight | 943 | | | |-------------------| 944 | | | | AspectRatioType | 945 | | | |-------------------| 946 | | | | Color | 947 | | |----------------------------------| 948 | | | Audio | SamplingFrequency | 949 | | | |-------------------| 950 | | | | Channels | 951 | | | |-------------------| 952 | | | | BitDepth | 953 |--------------------------------------------------------| 955 Representation of the Tracks Element and a selection of its 956 Descendant Elements. 958 The "Chapters Element" lists all of the chapters. Chapters are a way 959 to set predefined points to jump to in video or audio. 961 +-----------------------------------------+ 962 | Chapters | Edition | EditionUID | 963 | | Entry |--------------------| 964 | | | EditionFlagHidden | 965 | | |--------------------| 966 | | | EditionFlagDefault | 967 | | |--------------------| 968 | | | EditionFlagOrdered | 969 | | |--------------------------------+ 970 | | | ChapterAtom | ChapterUID | 971 | | | |------------------| 972 | | | | ChapterStringUID | 973 | | | |------------------| 974 | | | | ChapterTimeStart | 975 | | | |------------------| 976 | | | | ChapterTimeEnd | 977 | | | |------------------| 978 | | | | ChapterFlagHidden | 979 | | | |---------------------------------+ 980 | | | | ChapterDisplay | ChapString | 981 | | | | |--------------| 982 | | | | | ChapLanguage | 983 +--------------------------------------------------------------------+ 985 Representation of the Chapters Element and a selection of its 986 Descendant Elements. 988 "Cluster Elements" contain the content for each track, e.g. video 989 frames. A Matroska file SHOULD contain at least one "Cluster 990 Element". The "Cluster Element" helps to break up "SimpleBlock" or 991 "BlockGroup Elements" and helps with seeking and error protection. 992 It is RECOMMENDED that the size of each individual "Cluster Element" 993 be limited to store no more than 5 seconds or 5 megabytes. Every 994 "Cluster Element" MUST contain a "Timestamp Element". This SHOULD be 995 the "Timestamp Element" used to play the first "Block" in the 996 "Cluster Element". There SHOULD be one or more "BlockGroup" or 997 "SimpleBlock Element" in each "Cluster Element". A "BlockGroup 998 Element" MAY contain a "Block" of data and any information relating 999 directly to that "Block". 1001 +--------------------------+ 1002 | Cluster | Timestamp | 1003 | |----------------| 1004 | | SilentTracks | 1005 | |----------------| 1006 | | Position | 1007 | |----------------| 1008 | | PrevSize | 1009 | |----------------| 1010 | | SimpleBlock | 1011 | |----------------| 1012 | | BlockGroup | 1013 | |----------------| 1014 | | EncryptedBlock | 1015 +--------------------------+ 1017 Representation of a Cluster Element and its immediate Child Elements. 1019 +----------------------------------+ 1020 | Block | Portion of | Data Type | 1021 | | a Block | - Bit Flag | 1022 | |--------------------------+ 1023 | | Header | TrackNumber | 1024 | | |-------------| 1025 | | | Timestamp | 1026 | | |-------------| 1027 | | | Flags | 1028 | | | - Gap | 1029 | | | - Lacing | 1030 | | | - Reserved | 1031 | |--------------------------| 1032 | | Optional | FrameSize | 1033 | |--------------------------| 1034 | | Data | Frame | 1035 +----------------------------------+ 1037 Representation of the Block Element structure. 1039 Each "Cluster" MUST contain exactly one "Timestamp Element". The 1040 "Timestamp Element" value MUST be stored once per "Cluster". The 1041 "Timestamp Element" in the "Cluster" is relative to the entire 1042 "Segment". The "Timestamp Element" SHOULD be the first "Element" in 1043 the "Cluster". 1045 Additionally, the "Block" contains an offset that, when added to the 1046 "Cluster"'s "Timestamp Element" value, yields the "Block"'s effective 1047 timestamp. Therefore, timestamp in the "Block" itself is relative to 1048 the "Timestamp Element" in the "Cluster". For example, if the 1049 "Timestamp Element" in the "Cluster" is set to 10 seconds and a 1050 "Block" in that "Cluster" is supposed to be played 12 seconds into 1051 the clip, the timestamp in the "Block" would be set to 2 seconds. 1053 The "ReferenceBlock" in the "BlockGroup" is used instead of the basic 1054 "P-frame"/"B-frame" description. Instead of simply saying that this 1055 "Block" depends on the "Block" directly before, or directly 1056 afterwards, the "Timestamp" of the necessary "Block" is used. 1057 Because there can be as many "ReferenceBlock Elements" as necessary 1058 for a "Block", it allows for some extremely complex referencing. 1060 The "Cues Element" is used to seek when playing back a file by 1061 providing a temporal index for some of the "Tracks". It is similar 1062 to the "SeekHead Element", but used for seeking to a specific time 1063 when playing back the file. It is possible to seek without this 1064 element, but it is much more difficult because a "Matroska Reader" 1065 would have to 'hunt and peck' through the file looking for the 1066 correct timestamp. 1068 The "Cues Element" SHOULD contain at least one "CuePoint Element". 1069 Each "CuePoint Element" stores the position of the "Cluster" that 1070 contains the "BlockGroup" or "SimpleBlock Element". The timestamp is 1071 stored in the "CueTime Element" and location is stored in the 1072 "CueTrackPositions Element". 1074 The "Cues Element" is flexible. For instance, "Cues Element" can be 1075 used to index every single timestamp of every "Block" or they can be 1076 indexed selectively. For video files, it is RECOMMENDED to index at 1077 least the keyframes of the video track. 1079 +-------------------------------------+ 1080 | Cues | CuePoint | CueTime | 1081 | | |-------------------| 1082 | | | CueTrackPositions | 1083 | |------------------------------| 1084 | | CuePoint | CueTime | 1085 | | |-------------------| 1086 | | | CueTrackPositions | 1087 +-------------------------------------+ 1089 Representation of a Cues Element and two levels of its Descendant 1090 Elements. 1092 The "Attachments Element" is for attaching files to a Matroska file 1093 such as pictures, webpages, programs, or even the codec needed to 1094 play back the file. 1096 +------------------------------------------------+ 1097 | Attachments | AttachedFile | FileDescription | 1098 | | |-------------------| 1099 | | | FileName | 1100 | | |-------------------| 1101 | | | FileMimeType | 1102 | | |-------------------| 1103 | | | FileData | 1104 | | |-------------------| 1105 | | | FileUID | 1106 | | |-------------------| 1107 | | | FileName | 1108 | | |-------------------| 1109 | | | FileReferral | 1110 | | |-------------------| 1111 | | | FileUsedStartTime | 1112 | | |-------------------| 1113 | | | FileUsedEndTime | 1114 +------------------------------------------------+ 1116 Representation of a Attachments Element. 1118 The "Tags Element" contains metadata that describes the "Segment" and 1119 potentially its "Tracks", "Chapters", and "Attachments". Each 1120 "Track" or "Chapter" that those tags applies to has its UID listed in 1121 the "Tags". The "Tags" contain all extra information about the file: 1122 scriptwriter, singer, actors, directors, titles, edition, price, 1123 dates, genre, comments, etc. Tags can contain their values in 1124 multiple languages. For example, a movie's "title" "Tag" might 1125 contain both the original English title as well as the title it was 1126 released as in Germany. 1128 +-------------------------------------------+ 1129 | Tags | Tag | Targets | TargetTypeValue | 1130 | | | |------------------| 1131 | | | | TargetType | 1132 | | | |------------------| 1133 | | | | TagTrackUID | 1134 | | | |------------------| 1135 | | | | TagEditionUID | 1136 | | | |------------------| 1137 | | | | TagChapterUID | 1138 | | | |------------------| 1139 | | | | TagAttachmentUID | 1140 | | |------------------------------| 1141 | | | SimpleTag | TagName | 1142 | | | |------------------| 1143 | | | | TagLanguage | 1144 | | | |------------------| 1145 | | | | TagDefault | 1146 | | | |------------------| 1147 | | | | TagString | 1148 | | | |------------------| 1149 | | | | TagBinary | 1150 | | | |------------------| 1151 | | | | SimpleTag | 1152 +-------------------------------------------+ 1154 Representation of a Tags Element and three levels of its Children 1155 Elements. 1157 8. Matroska Additions to Schema Element Attributes 1159 In addition to the EBML Schema definition provided by the EBML 1160 Specification, Matroska adds the following additional attributes: 1162 +-----------+----------+--------------------------------------------+ 1163 | attribute | required | definition | 1164 | name | | | 1165 +-----------+----------+--------------------------------------------+ 1166 | webm | No | A boolean to express if the Matroska | 1167 | | | Element is also supported within version 2 | 1168 | | | of the "webm" specification. Please | 1169 | | | consider the webm specification [16] as | 1170 | | | the authoritative on "webm". | 1171 +-----------+----------+--------------------------------------------+ 1173 9. Matroska Schema 1175 This specification includes an "EBML Schema" which defines the 1176 Elements and structure of Matroska as an EBML Document Type. The 1177 EBML Schema defines every valid Matroska element in a manner defined 1178 by the EBML specification. 1180 Here the definition of each Matroska Element is provided. 1182 9.1. EBMLMaxIDLength Element 1184 name: "EBMLMaxIDLength" 1186 path: "1*1(\EBML\EBMLMaxIDLength)" 1188 id: "0x42F2" 1190 minOccurs: "1" 1192 maxOccurs: "1" 1194 range: "4" 1196 default: "4" 1198 type: "uinteger" 1200 9.2. EBMLMaxSizeLength Element 1202 name: "EBMLMaxSizeLength" 1204 path: "1*1(\EBML\EBMLMaxSizeLength)" 1206 id: "0x42F3" 1208 minOccurs: "1" 1210 maxOccurs: "1" 1212 range: "1-8" 1214 default: "8" 1216 type: "uinteger" 1218 9.3. Segment Element 1220 name: "Segment" 1222 path: "1*1(\Segment)" 1224 id: "0x18538067" 1226 minOccurs: "1" 1228 maxOccurs: "1" 1230 type: "master" 1232 unknownsizeallowed: "1" 1234 definition: The Root Element that contains all other Top-Level 1235 Elements (Elements defined only at Level 1). A Matroska file is 1236 composed of 1 Segment. 1238 9.3.1. SeekHead Element 1240 name: "SeekHead" 1242 path: "0*2(\Segment\SeekHead)" 1244 id: "0x114D9B74" 1246 maxOccurs: "2" 1248 type: "master" 1250 definition: Contains the Segment Position of other Top-Level 1251 Elements. 1253 9.3.1.1. Seek Element 1255 name: "Seek" 1257 path: "1*(\Segment\SeekHead\Seek)" 1259 id: "0x4DBB" 1261 minOccurs: "1" 1263 type: "master" 1265 definition: Contains a single seek entry to an EBML Element. 1267 9.3.1.1.1. SeekID Element 1269 name: "SeekID" 1271 path: "1*1(\Segment\SeekHead\Seek\SeekID)" 1273 id: "0x53AB" 1275 minOccurs: "1" 1277 maxOccurs: "1" 1279 type: "binary" 1281 definition: The binary ID corresponding to the Element name. 1283 9.3.1.1.2. SeekPosition Element 1285 name: "SeekPosition" 1287 path: "1*1(\Segment\SeekHead\Seek\SeekPosition)" 1289 id: "0x53AC" 1291 minOccurs: "1" 1293 maxOccurs: "1" 1295 type: "uinteger" 1297 definition: The Segment Position of the Element. 1299 9.3.2. Info Element 1301 name: "Info" 1303 path: "1*(\Segment\Info)" 1305 id: "0x1549A966" 1307 minOccurs: "1" 1309 type: "master" 1311 recurring: "1" 1313 definition: Contains general information about the Segment. 1315 9.3.2.1. SegmentUID Element 1317 name: "SegmentUID" 1319 path: "0*1(\Segment\Info\SegmentUID)" 1321 id: "0x73A4" 1323 maxOccurs: "1" 1325 range: "not 0" 1327 type: "binary" 1329 definition: A randomly generated unique ID to identify the Segment 1330 amongst many others (128 bits). 1332 usage notes: If the Segment is a part of a Linked Segment then this 1333 Element is REQUIRED. 1335 9.3.2.2. SegmentFilename Element 1337 name: "SegmentFilename" 1339 path: "0*1(\Segment\Info\SegmentFilename)" 1341 id: "0x7384" 1343 maxOccurs: "1" 1345 type: "utf-8" 1347 definition: A filename corresponding to this Segment. 1349 9.3.2.3. PrevUID Element 1351 name: "PrevUID" 1353 path: "0*1(\Segment\Info\PrevUID)" 1355 id: "0x3CB923" 1357 maxOccurs: "1" 1359 type: "binary" 1361 definition: A unique ID to identify the previous Segment of a Linked 1362 Segment (128 bits). 1364 usage notes: If the Segment is a part of a Linked Segment that uses 1365 Hard Linking then either the PrevUID or the NextUID Element is 1366 REQUIRED. If a Segment contains a PrevUID but not a NextUID then it 1367 MAY be considered as the last Segment of the Linked Segment. The 1368 PrevUID MUST NOT be equal to the SegmentUID. 1370 9.3.2.4. PrevFilename Element 1372 name: "PrevFilename" 1374 path: "0*1(\Segment\Info\PrevFilename)" 1376 id: "0x3C83AB" 1378 maxOccurs: "1" 1380 type: "utf-8" 1382 definition: A filename corresponding to the file of the previous 1383 Linked Segment. 1385 usage notes: Provision of the previous filename is for display 1386 convenience, but PrevUID SHOULD be considered authoritative for 1387 identifying the previous Segment in a Linked Segment. 1389 9.3.2.5. NextUID Element 1391 name: "NextUID" 1393 path: "0*1(\Segment\Info\NextUID)" 1395 id: "0x3EB923" 1397 maxOccurs: "1" 1399 type: "binary" 1401 definition: A unique ID to identify the next Segment of a Linked 1402 Segment (128 bits). 1404 usage notes: If the Segment is a part of a Linked Segment that uses 1405 Hard Linking then either the PrevUID or the NextUID Element is 1406 REQUIRED. If a Segment contains a NextUID but not a PrevUID then it 1407 MAY be considered as the first Segment of the Linked Segment. The 1408 NextUID MUST NOT be equal to the SegmentUID. 1410 9.3.2.6. NextFilename Element 1412 name: "NextFilename" 1414 path: "0*1(\Segment\Info\NextFilename)" 1416 id: "0x3E83BB" 1418 maxOccurs: "1" 1420 type: "utf-8" 1422 definition: A filename corresponding to the file of the next Linked 1423 Segment. 1425 usage notes: Provision of the next filename is for display 1426 convenience, but NextUID SHOULD be considered authoritative for 1427 identifying the Next Segment. 1429 9.3.2.7. SegmentFamily Element 1431 name: "SegmentFamily" 1433 path: "0*(\Segment\Info\SegmentFamily)" 1435 id: "0x4444" 1437 type: "binary" 1439 definition: A randomly generated unique ID that all Segments of a 1440 Linked Segment MUST share (128 bits). 1442 usage notes: If the Segment is a part of a Linked Segment that uses 1443 Soft Linking then this Element is REQUIRED. 1445 9.3.2.8. ChapterTranslate Element 1447 name: "ChapterTranslate" 1449 path: "0*(\Segment\Info\ChapterTranslate)" 1451 id: "0x6924" 1453 type: "master" 1455 definition: A tuple of corresponding ID used by chapter codecs to 1456 represent this Segment. 1458 9.3.2.8.1. ChapterTranslateEditionUID Element 1460 name: "ChapterTranslateEditionUID" 1462 path: "0*(\Segment\Info\ChapterTranslate\ChapterTranslateEditionUID)" 1464 id: "0x69FC" 1466 type: "uinteger" 1468 definition: Specify an edition UID on which this correspondence 1469 applies. When not specified, it means for all editions found in the 1470 Segment. 1472 9.3.2.8.2. ChapterTranslateCodec Element 1474 name: "ChapterTranslateCodec" 1476 path: "1*1(\Segment\Info\ChapterTranslate\ChapterTranslateCodec)" 1478 id: "0x69BF" 1480 minOccurs: "1" 1482 maxOccurs: "1" 1484 type: "uinteger" 1486 definition: The chapter codec 1488 restrictions: 1490 +-------+-----------------+ 1491 | value | label | 1492 +-------+-----------------+ 1493 | "0" | Matroska Script | 1494 | "1" | DVD-menu | 1495 +-------+-----------------+ 1497 9.3.2.8.3. ChapterTranslateID Element 1499 name: "ChapterTranslateID" 1501 path: "1*1(\Segment\Info\ChapterTranslate\ChapterTranslateID)" 1503 id: "0x69A5" 1505 minOccurs: "1" 1506 maxOccurs: "1" 1508 type: "binary" 1510 definition: The binary value used to represent this Segment in the 1511 chapter codec data. The format depends on the ChapProcessCodecID 1512 used. 1514 9.3.2.9. TimestampScale Element 1516 name: "TimestampScale" 1518 path: "1*1(\Segment\Info\TimestampScale)" 1520 id: "0x2AD7B1" 1522 minOccurs: "1" 1524 maxOccurs: "1" 1526 range: "not 0" 1528 default: "1000000" 1530 type: "uinteger" 1532 definition: Timestamp scale in nanoseconds (1.000.000 means all 1533 timestamps in the Segment are expressed in milliseconds). 1535 9.3.2.10. Duration Element 1537 name: "Duration" 1539 path: "0*1(\Segment\Info\Duration)" 1541 id: "0x4489" 1543 maxOccurs: "1" 1545 range: "> 0x0p+0" 1547 type: "float" 1549 definition: Duration of the Segment in nanoseconds based on 1550 TimestampScale. 1552 9.3.2.11. DateUTC Element 1554 name: "DateUTC" 1556 path: "0*1(\Segment\Info\DateUTC)" 1558 id: "0x4461" 1560 maxOccurs: "1" 1562 type: "date" 1564 definition: The date and time that the Segment was created by the 1565 muxing application or library. 1567 9.3.2.12. Title Element 1569 name: "Title" 1571 path: "0*1(\Segment\Info\Title)" 1573 id: "0x7BA9" 1575 maxOccurs: "1" 1577 type: "utf-8" 1579 definition: General name of the Segment. 1581 9.3.2.13. MuxingApp Element 1583 name: "MuxingApp" 1585 path: "1*1(\Segment\Info\MuxingApp)" 1587 id: "0x4D80" 1589 minOccurs: "1" 1591 maxOccurs: "1" 1593 type: "utf-8" 1595 definition: Muxing application or library (example: "libmatroska- 1596 0.4.3"). 1598 usage notes: Include the full name of the application or library 1599 followed by the version number. 1601 9.3.2.14. WritingApp Element 1603 name: "WritingApp" 1605 path: "1*1(\Segment\Info\WritingApp)" 1607 id: "0x5741" 1609 minOccurs: "1" 1611 maxOccurs: "1" 1613 type: "utf-8" 1615 definition: Writing application (example: "mkvmerge-0.3.3"). 1617 usage notes: Include the full name of the application followed by the 1618 version number. 1620 9.3.3. Cluster Element 1622 name: "Cluster" 1624 path: "0*(\Segment\Cluster)" 1626 id: "0x1F43B675" 1628 type: "master" 1630 unknownsizeallowed: "1" 1632 definition: The Top-Level Element containing the (monolithic) Block 1633 structure. 1635 9.3.3.1. Timestamp Element 1637 name: "Timestamp" 1639 path: "1*1(\Segment\Cluster\Timestamp)" 1641 id: "0xE7" 1643 minOccurs: "1" 1645 maxOccurs: "1" 1647 type: "uinteger" 1648 definition: Absolute timestamp of the cluster (based on 1649 TimestampScale). 1651 9.3.3.2. SilentTracks Element 1653 name: "SilentTracks" 1655 path: "0*1(\Segment\Cluster\SilentTracks)" 1657 id: "0x5854" 1659 maxOccurs: "1" 1661 type: "master" 1663 definition: The list of tracks that are not used in that part of the 1664 stream. It is useful when using overlay tracks on seeking or to 1665 decide what track to use. 1667 9.3.3.2.1. SilentTrackNumber Element 1669 name: "SilentTrackNumber" 1671 path: "0*(\Segment\Cluster\SilentTracks\SilentTrackNumber)" 1673 id: "0x58D7" 1675 type: "uinteger" 1677 definition: One of the track number that are not used from now on in 1678 the stream. It could change later if not specified as silent in a 1679 further Cluster. 1681 9.3.3.3. Position Element 1683 name: "Position" 1685 path: "0*1(\Segment\Cluster\Position)" 1687 id: "0xA7" 1689 maxOccurs: "1" 1691 type: "uinteger" 1693 definition: The Segment Position of the Cluster in the Segment (0 in 1694 live streams). It might help to resynchronise offset on damaged 1695 streams. 1697 9.3.3.4. PrevSize Element 1699 name: "PrevSize" 1701 path: "0*1(\Segment\Cluster\PrevSize)" 1703 id: "0xAB" 1705 maxOccurs: "1" 1707 type: "uinteger" 1709 definition: Size of the previous Cluster, in octets. Can be useful 1710 for backward playing. 1712 9.3.3.5. SimpleBlock Element 1714 name: "SimpleBlock" 1716 path: "0*(\Segment\Cluster\SimpleBlock)" 1718 id: "0xA3" 1720 type: "binary" 1722 minver: "2" 1724 definition: Similar to Block but without all the extra information, 1725 mostly used to reduced overhead when no extra feature is needed. (see 1726 SimpleBlock Structure) 1728 9.3.3.6. BlockGroup Element 1730 name: "BlockGroup" 1732 path: "0*(\Segment\Cluster\BlockGroup)" 1734 id: "0xA0" 1736 type: "master" 1738 definition: Basic container of information containing a single Block 1739 and information specific to that Block. 1741 9.3.3.6.1. Block Element 1743 name: "Block" 1745 path: "1*1(\Segment\Cluster\BlockGroup\Block)" 1747 id: "0xA1" 1749 minOccurs: "1" 1751 maxOccurs: "1" 1753 type: "binary" 1755 definition: Block containing the actual data to be rendered and a 1756 timestamp relative to the Cluster Timestamp. (see Block Structure) 1758 9.3.3.6.2. BlockVirtual Element 1760 name: "BlockVirtual" 1762 path: "0*1(\Segment\Cluster\BlockGroup\BlockVirtual)" 1764 id: "0xA2" 1766 maxOccurs: "1" 1768 type: "binary" 1770 minver: "0" 1772 maxver: "0" 1774 definition: A Block with no data. It MUST be stored in the stream at 1775 the place the real Block would be in display order. (see Block 1776 Virtual) 1778 9.3.3.6.3. BlockAdditions Element 1780 name: "BlockAdditions" 1782 path: "0*1(\Segment\Cluster\BlockGroup\BlockAdditions)" 1784 id: "0x75A1" 1786 maxOccurs: "1" 1788 type: "master" 1789 definition: Contain additional blocks to complete the main one. An 1790 EBML parser that has no knowledge of the Block structure could still 1791 see and use/skip these data. 1793 9.3.3.6.3.1. BlockMore Element 1795 name: "BlockMore" 1797 path: "1*(\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore)" 1799 id: "0xA6" 1801 minOccurs: "1" 1803 type: "master" 1805 definition: Contain the BlockAdditional and some parameters. 1807 9.3.3.6.3.2. BlockAddID Element 1809 name: "BlockAddID" 1811 path: "1*1(\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\Block 1812 AddID)" 1814 id: "0xEE" 1816 minOccurs: "1" 1818 maxOccurs: "1" 1820 range: "not 0" 1822 default: "1" 1824 type: "uinteger" 1826 definition: An ID to identify the BlockAdditional level. 1828 9.3.3.6.3.3. BlockAdditional Element 1830 name: "BlockAdditional" 1832 path: "1*1(\Segment\Cluster\BlockGroup\BlockAdditions\BlockMore\Block 1833 Additional)" 1835 id: "0xA5" 1836 minOccurs: "1" 1838 maxOccurs: "1" 1840 type: "binary" 1842 definition: Interpreted by the codec as it wishes (using the 1843 BlockAddID). 1845 9.3.3.6.4. BlockDuration Element 1847 name: "BlockDuration" 1849 path: "0*1(\Segment\Cluster\BlockGroup\BlockDuration)" 1851 id: "0x9B" 1853 maxOccurs: "1" 1855 default: "DefaultDuration" 1857 type: "uinteger" 1859 definition: The duration of the Block (based on TimestampScale). 1860 This Element is mandatory when DefaultDuration is set for the track 1861 (but can be omitted as other default values). When not written and 1862 with no DefaultDuration, the value is assumed to be the difference 1863 between the timestamp of this Block and the timestamp of the next 1864 Block in "display" order (not coding order). This Element can be 1865 useful at the end of a Track (as there is no other Block available), 1866 or when there is a break in a track like for subtitle tracks. 1868 9.3.3.6.5. ReferencePriority Element 1870 name: "ReferencePriority" 1872 path: "1*1(\Segment\Cluster\BlockGroup\ReferencePriority)" 1874 id: "0xFA" 1876 minOccurs: "1" 1878 maxOccurs: "1" 1880 default: "0" 1882 type: "uinteger" 1883 definition: This frame is referenced and has the specified cache 1884 priority. In cache only a frame of the same or higher priority can 1885 replace this frame. A value of 0 means the frame is not referenced. 1887 9.3.3.6.6. ReferenceBlock Element 1889 name: "ReferenceBlock" 1891 path: "0*(\Segment\Cluster\BlockGroup\ReferenceBlock)" 1893 id: "0xFB" 1895 type: "integer" 1897 definition: Timestamp of another frame used as a reference (ie: B or 1898 P frame). The timestamp is relative to the block it's attached to. 1900 9.3.3.6.7. ReferenceVirtual Element 1902 name: "ReferenceVirtual" 1904 path: "0*1(\Segment\Cluster\BlockGroup\ReferenceVirtual)" 1906 id: "0xFD" 1908 maxOccurs: "1" 1910 type: "integer" 1912 minver: "0" 1914 maxver: "0" 1916 definition: The Segment Position of the data that would otherwise be 1917 in position of the virtual block. 1919 9.3.3.6.8. CodecState Element 1921 name: "CodecState" 1923 path: "0*1(\Segment\Cluster\BlockGroup\CodecState)" 1925 id: "0xA4" 1927 maxOccurs: "1" 1929 type: "binary" 1930 minver: "2" 1932 definition: The new codec state to use. Data interpretation is 1933 private to the codec. This information SHOULD always be referenced 1934 by a seek entry. 1936 9.3.3.6.9. DiscardPadding Element 1938 name: "DiscardPadding" 1940 path: "0*1(\Segment\Cluster\BlockGroup\DiscardPadding)" 1942 id: "0x75A2" 1944 maxOccurs: "1" 1946 type: "integer" 1948 minver: "4" 1950 definition: Duration in nanoseconds of the silent data added to the 1951 Block (padding at the end of the Block for positive value, at the 1952 beginning of the Block for negative value). The duration of 1953 DiscardPadding is not calculated in the duration of the TrackEntry 1954 and SHOULD be discarded during playback. 1956 9.3.3.6.10. Slices Element 1958 name: "Slices" 1960 path: "0*1(\Segment\Cluster\BlockGroup\Slices)" 1962 id: "0x8E" 1964 maxOccurs: "1" 1966 type: "master" 1968 definition: Contains slices description. 1970 9.3.3.6.10.1. TimeSlice Element 1972 name: "TimeSlice" 1974 path: "0*(\Segment\Cluster\BlockGroup\Slices\TimeSlice)" 1976 id: "0xE8" 1977 type: "master" 1979 maxver: "1" 1981 definition: Contains extra time information about the data contained 1982 in the Block. Being able to interpret this Element is not REQUIRED 1983 for playback. 1985 9.3.3.6.10.2. LaceNumber Element 1987 name: "LaceNumber" 1989 path: "0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\LaceNumber)" 1991 id: "0xCC" 1993 maxOccurs: "1" 1995 default: "0" 1997 type: "uinteger" 1999 maxver: "1" 2001 definition: The reverse number of the frame in the lace (0 is the 2002 last frame, 1 is the next to last, etc). Being able to interpret 2003 this Element is not REQUIRED for playback. 2005 9.3.3.6.10.3. FrameNumber Element 2007 name: "FrameNumber" 2009 path: "0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\FrameNumber)" 2011 id: "0xCD" 2013 maxOccurs: "1" 2015 default: "0" 2017 type: "uinteger" 2019 minver: "0" 2021 maxver: "0" 2022 definition: The number of the frame to generate from this lace with 2023 this delay (allow you to generate many frames from the same Block/ 2024 Frame). 2026 9.3.3.6.10.4. BlockAdditionID Element 2028 name: "BlockAdditionID" 2030 path: 2031 "0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\BlockAdditionID)" 2033 id: "0xCB" 2035 maxOccurs: "1" 2037 default: "0" 2039 type: "uinteger" 2041 minver: "0" 2043 maxver: "0" 2045 definition: The ID of the BlockAdditional Element (0 is the main 2046 Block). 2048 9.3.3.6.10.5. Delay Element 2050 name: "Delay" 2052 path: "0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\Delay)" 2054 id: "0xCE" 2056 maxOccurs: "1" 2058 default: "0" 2060 type: "uinteger" 2062 minver: "0" 2064 maxver: "0" 2066 definition: The (scaled) delay to apply to the Element. 2068 9.3.3.6.10.6. SliceDuration Element 2070 name: "SliceDuration" 2072 path: 2073 "0*1(\Segment\Cluster\BlockGroup\Slices\TimeSlice\SliceDuration)" 2075 id: "0xCF" 2077 maxOccurs: "1" 2079 default: "0" 2081 type: "uinteger" 2083 minver: "0" 2085 maxver: "0" 2087 definition: The (scaled) duration to apply to the Element. 2089 9.3.3.6.11. ReferenceFrame Element 2091 name: "ReferenceFrame" 2093 path: "0*1(\Segment\Cluster\BlockGroup\ReferenceFrame)" 2095 id: "0xC8" 2097 maxOccurs: "1" 2099 type: "master" 2101 minver: "0" 2103 maxver: "0" 2105 definition: DivX trick track extensions 2107 9.3.3.6.11.1. ReferenceOffset Element 2109 name: "ReferenceOffset" 2111 path: 2112 "1*1(\Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceOffset)" 2114 id: "0xC9" 2115 minOccurs: "1" 2117 maxOccurs: "1" 2119 type: "uinteger" 2121 minver: "0" 2123 maxver: "0" 2125 definition: DivX trick track extensions 2127 9.3.3.6.11.2. ReferenceTimestamp Element 2129 name: "ReferenceTimestamp" 2131 path: 2132 "1*1(\Segment\Cluster\BlockGroup\ReferenceFrame\ReferenceTimestamp)" 2134 id: "0xCA" 2136 minOccurs: "1" 2138 maxOccurs: "1" 2140 type: "uinteger" 2142 minver: "0" 2144 maxver: "0" 2146 definition: DivX trick track extensions 2148 9.3.3.7. EncryptedBlock Element 2150 name: "EncryptedBlock" 2152 path: "0*(\Segment\Cluster\EncryptedBlock)" 2154 id: "0xAF" 2156 type: "binary" 2158 minver: "0" 2160 maxver: "0" 2161 definition: Similar to SimpleBlock but the data inside the Block are 2162 Transformed (encrypt and/or signed). (see EncryptedBlock Structure) 2164 9.3.4. Tracks Element 2166 name: "Tracks" 2168 path: "0*(\Segment\Tracks)" 2170 id: "0x1654AE6B" 2172 type: "master" 2174 recurring: "1" 2176 definition: A Top-Level Element of information with many tracks 2177 described. 2179 9.3.4.1. TrackEntry Element 2181 name: "TrackEntry" 2183 path: "1*(\Segment\Tracks\TrackEntry)" 2185 id: "0xAE" 2187 minOccurs: "1" 2189 type: "master" 2191 definition: Describes a track with all Elements. 2193 9.3.4.1.1. TrackNumber Element 2195 name: "TrackNumber" 2197 path: "1*1(\Segment\Tracks\TrackEntry\TrackNumber)" 2199 id: "0xD7" 2201 minOccurs: "1" 2203 maxOccurs: "1" 2205 range: "not 0" 2207 type: "uinteger" 2208 definition: The track number as used in the Block Header (using more 2209 than 127 tracks is not encouraged, though the design allows an 2210 unlimited number). 2212 9.3.4.1.2. TrackUID Element 2214 name: "TrackUID" 2216 path: "1*1(\Segment\Tracks\TrackEntry\TrackUID)" 2218 id: "0x73C5" 2220 minOccurs: "1" 2222 maxOccurs: "1" 2224 range: "not 0" 2226 type: "uinteger" 2228 definition: A unique ID to identify the Track. This SHOULD be kept 2229 the same when making a direct stream copy of the Track to another 2230 file. 2232 9.3.4.1.3. TrackType Element 2234 name: "TrackType" 2236 path: "1*1(\Segment\Tracks\TrackEntry\TrackType)" 2238 id: "0x83" 2240 minOccurs: "1" 2242 maxOccurs: "1" 2244 range: "1-254" 2246 type: "uinteger" 2248 definition: A set of track types coded on 8 bits. 2250 restrictions: 2252 +-------+----------+ 2253 | value | label | 2254 +-------+----------+ 2255 | "1" | video | 2256 | "2" | audio | 2257 | "3" | complex | 2258 | "16" | logo | 2259 | "17" | subtitle | 2260 | "18" | buttons | 2261 | "32" | control | 2262 | "33" | metadata | 2263 +-------+----------+ 2265 9.3.4.1.4. FlagEnabled Element 2267 name: "FlagEnabled" 2269 path: "1*1(\Segment\Tracks\TrackEntry\FlagEnabled)" 2271 id: "0xB9" 2273 minOccurs: "1" 2275 maxOccurs: "1" 2277 range: "0-1" 2279 default: "1" 2281 type: "uinteger" 2283 minver: "2" 2285 definition: Set if the track is usable. (1 bit) 2287 9.3.4.1.5. FlagDefault Element 2289 name: "FlagDefault" 2291 path: "1*1(\Segment\Tracks\TrackEntry\FlagDefault)" 2293 id: "0x88" 2295 minOccurs: "1" 2297 maxOccurs: "1" 2299 range: "0-1" 2300 default: "1" 2302 type: "uinteger" 2304 definition: Set if that track (audio, video or subs) SHOULD be active 2305 if no language found matches the user preference. (1 bit) 2307 9.3.4.1.6. FlagForced Element 2309 name: "FlagForced" 2311 path: "1*1(\Segment\Tracks\TrackEntry\FlagForced)" 2313 id: "0x55AA" 2315 minOccurs: "1" 2317 maxOccurs: "1" 2319 range: "0-1" 2321 default: "0" 2323 type: "uinteger" 2325 definition: Set if that track MUST be active during playback. There 2326 can be many forced track for a kind (audio, video or subs), the 2327 player SHOULD select the one which language matches the user 2328 preference or the default + forced track. Overlay MAY happen between 2329 a forced and non-forced track of the same kind. (1 bit) 2331 9.3.4.1.7. FlagLacing Element 2333 name: "FlagLacing" 2335 path: "1*1(\Segment\Tracks\TrackEntry\FlagLacing)" 2337 id: "0x9C" 2339 minOccurs: "1" 2341 maxOccurs: "1" 2343 range: "0-1" 2345 default: "1" 2347 type: "uinteger" 2348 definition: Set if the track MAY contain blocks using lacing. (1 bit) 2350 9.3.4.1.8. MinCache Element 2352 name: "MinCache" 2354 path: "1*1(\Segment\Tracks\TrackEntry\MinCache)" 2356 id: "0x6DE7" 2358 minOccurs: "1" 2360 maxOccurs: "1" 2362 default: "0" 2364 type: "uinteger" 2366 definition: The minimum number of frames a player SHOULD be able to 2367 cache during playback. If set to 0, the reference pseudo-cache 2368 system is not used. 2370 9.3.4.1.9. MaxCache Element 2372 name: "MaxCache" 2374 path: "0*1(\Segment\Tracks\TrackEntry\MaxCache)" 2376 id: "0x6DF8" 2378 maxOccurs: "1" 2380 type: "uinteger" 2382 definition: The maximum cache size necessary to store referenced 2383 frames in and the current frame. 0 means no cache is needed. 2385 9.3.4.1.10. DefaultDuration Element 2387 name: "DefaultDuration" 2389 path: "0*1(\Segment\Tracks\TrackEntry\DefaultDuration)" 2391 id: "0x23E383" 2393 maxOccurs: "1" 2395 range: "not 0" 2396 type: "uinteger" 2398 definition: Number of nanoseconds (not scaled via TimestampScale) per 2399 frame ('frame' in the Matroska sense -- one Element put into a 2400 (Simple)Block). 2402 9.3.4.1.11. DefaultDecodedFieldDuration Element 2404 name: "DefaultDecodedFieldDuration" 2406 path: "0*1(\Segment\Tracks\TrackEntry\DefaultDecodedFieldDuration)" 2408 id: "0x234E7A" 2410 maxOccurs: "1" 2412 range: "not 0" 2414 type: "uinteger" 2416 minver: "4" 2418 definition: The period in nanoseconds (not scaled by TimestampScale) 2419 between two successive fields at the output of the decoding process 2420 (see the notes) 2422 9.3.4.1.12. TrackTimestampScale Element 2424 name: "TrackTimestampScale" 2426 path: "1*1(\Segment\Tracks\TrackEntry\TrackTimestampScale)" 2428 id: "0x23314F" 2430 minOccurs: "1" 2432 maxOccurs: "1" 2434 range: "> 0x0p+0" 2436 default: "0x1p+0" 2438 type: "float" 2440 maxver: "3" 2441 definition: DEPRECATED, DO NOT USE. The scale to apply on this track 2442 to work at normal speed in relation with other tracks (mostly used to 2443 adjust video speed when the audio length differs). 2445 9.3.4.1.13. TrackOffset Element 2447 name: "TrackOffset" 2449 path: "0*1(\Segment\Tracks\TrackEntry\TrackOffset)" 2451 id: "0x537F" 2453 maxOccurs: "1" 2455 default: "0" 2457 type: "integer" 2459 minver: "0" 2461 maxver: "0" 2463 definition: A value to add to the Block's Timestamp. This can be 2464 used to adjust the playback offset of a track. 2466 9.3.4.1.14. MaxBlockAdditionID Element 2468 name: "MaxBlockAdditionID" 2470 path: "1*1(\Segment\Tracks\TrackEntry\MaxBlockAdditionID)" 2472 id: "0x55EE" 2474 minOccurs: "1" 2476 maxOccurs: "1" 2478 default: "0" 2480 type: "uinteger" 2482 definition: The maximum value of BlockAddID. A value 0 means there 2483 is no BlockAdditions for this track. 2485 9.3.4.1.15. Name Element 2487 name: "Name" 2489 path: "0*1(\Segment\Tracks\TrackEntry\Name)" 2491 id: "0x536E" 2493 maxOccurs: "1" 2495 type: "utf-8" 2497 definition: A human-readable track name. 2499 9.3.4.1.16. Language Element 2501 name: "Language" 2503 path: "0*1(\Segment\Tracks\TrackEntry\Language)" 2505 id: "0x22B59C" 2507 maxOccurs: "1" 2509 default: "eng" 2511 type: "string" 2513 definition: Specifies the language of the track in the Matroska 2514 languages form. This Element MUST be ignored if the LanguageIETF 2515 Element is used in the same TrackEntry. 2517 9.3.4.1.17. LanguageIETF Element 2519 name: "LanguageIETF" 2521 path: "0*1(\Segment\Tracks\TrackEntry\LanguageIETF)" 2523 id: "0x22B59D" 2525 maxOccurs: "1" 2527 type: "string" 2529 minver: "4" 2531 definition: Specifies the language of the track according to BCP 47 2532 and using the IANA Language Subtag Registry. If this Element is 2533 used, then any Language Elements used in the same TrackEntry MUST be 2534 ignored. 2536 9.3.4.1.18. CodecID Element 2538 name: "CodecID" 2540 path: "1*1(\Segment\Tracks\TrackEntry\CodecID)" 2542 id: "0x86" 2544 minOccurs: "1" 2546 maxOccurs: "1" 2548 type: "string" 2550 definition: An ID corresponding to the codec, see the codec page for 2551 more info. 2553 9.3.4.1.19. CodecPrivate Element 2555 name: "CodecPrivate" 2557 path: "0*1(\Segment\Tracks\TrackEntry\CodecPrivate)" 2559 id: "0x63A2" 2561 maxOccurs: "1" 2563 type: "binary" 2565 definition: Private data only known to the codec. 2567 9.3.4.1.20. CodecName Element 2569 name: "CodecName" 2571 path: "0*1(\Segment\Tracks\TrackEntry\CodecName)" 2573 id: "0x258688" 2575 maxOccurs: "1" 2577 type: "utf-8" 2579 definition: A human-readable string specifying the codec. 2581 9.3.4.1.21. AttachmentLink Element 2583 name: "AttachmentLink" 2585 path: "0*1(\Segment\Tracks\TrackEntry\AttachmentLink)" 2587 id: "0x7446" 2589 maxOccurs: "1" 2591 range: "not 0" 2593 type: "uinteger" 2595 maxver: "3" 2597 definition: The UID of an attachment that is used by this codec. 2599 9.3.4.1.22. CodecSettings Element 2601 name: "CodecSettings" 2603 path: "0*1(\Segment\Tracks\TrackEntry\CodecSettings)" 2605 id: "0x3A9697" 2607 maxOccurs: "1" 2609 type: "utf-8" 2611 minver: "0" 2613 maxver: "0" 2615 definition: A string describing the encoding setting used. 2617 9.3.4.1.23. CodecInfoURL Element 2619 name: "CodecInfoURL" 2621 path: "0*(\Segment\Tracks\TrackEntry\CodecInfoURL)" 2623 id: "0x3B4040" 2625 type: "string" 2627 minver: "0" 2628 maxver: "0" 2630 definition: A URL to find information about the codec used. 2632 9.3.4.1.24. CodecDownloadURL Element 2634 name: "CodecDownloadURL" 2636 path: "0*(\Segment\Tracks\TrackEntry\CodecDownloadURL)" 2638 id: "0x26B240" 2640 type: "string" 2642 minver: "0" 2644 maxver: "0" 2646 definition: A URL to download about the codec used. 2648 9.3.4.1.25. CodecDecodeAll Element 2650 name: "CodecDecodeAll" 2652 path: "1*1(\Segment\Tracks\TrackEntry\CodecDecodeAll)" 2654 id: "0xAA" 2656 minOccurs: "1" 2658 maxOccurs: "1" 2660 range: "0-1" 2662 default: "1" 2664 type: "uinteger" 2666 minver: "2" 2668 definition: The codec can decode potentially damaged data (1 bit). 2670 9.3.4.1.26. TrackOverlay Element 2672 name: "TrackOverlay" 2674 path: "0*(\Segment\Tracks\TrackEntry\TrackOverlay)" 2675 id: "0x6FAB" 2677 type: "uinteger" 2679 definition: Specify that this track is an overlay track for the Track 2680 specified (in the u-integer). That means when this track has a gap 2681 (see SilentTracks) the overlay track SHOULD be used instead. The 2682 order of multiple TrackOverlay matters, the first one is the one that 2683 SHOULD be used. If not found it SHOULD be the second, etc. 2685 9.3.4.1.27. CodecDelay Element 2687 name: "CodecDelay" 2689 path: "0*1(\Segment\Tracks\TrackEntry\CodecDelay)" 2691 id: "0x56AA" 2693 maxOccurs: "1" 2695 default: "0" 2697 type: "uinteger" 2699 minver: "4" 2701 definition: CodecDelay is The codec-built-in delay in nanoseconds. 2702 This value MUST be subtracted from each block timestamp in order to 2703 get the actual timestamp. The value SHOULD be small so the muxing of 2704 tracks with the same actual timestamp are in the same Cluster. 2706 9.3.4.1.28. SeekPreRoll Element 2708 name: "SeekPreRoll" 2710 path: "1*1(\Segment\Tracks\TrackEntry\SeekPreRoll)" 2712 id: "0x56BB" 2714 minOccurs: "1" 2716 maxOccurs: "1" 2718 default: "0" 2720 type: "uinteger" 2722 minver: "4" 2723 definition: After a discontinuity, SeekPreRoll is the duration in 2724 nanoseconds of the data the decoder MUST decode before the decoded 2725 data is valid. 2727 9.3.4.1.29. TrackTranslate Element 2729 name: "TrackTranslate" 2731 path: "0*(\Segment\Tracks\TrackEntry\TrackTranslate)" 2733 id: "0x6624" 2735 type: "master" 2737 definition: The track identification for the given Chapter Codec. 2739 9.3.4.1.29.1. TrackTranslateEditionUID Element 2741 name: "TrackTranslateEditionUID" 2743 path: "0*(\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateEdi 2744 tionUID)" 2746 id: "0x66FC" 2748 type: "uinteger" 2750 definition: Specify an edition UID on which this translation applies. 2751 When not specified, it means for all editions found in the Segment. 2753 9.3.4.1.29.2. TrackTranslateCodec Element 2755 name: "TrackTranslateCodec" 2757 path: 2758 "1*1(\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateCodec)" 2760 id: "0x66BF" 2762 minOccurs: "1" 2764 maxOccurs: "1" 2766 type: "uinteger" 2768 definition: The chapter codec. 2770 restrictions: 2772 +-------+-----------------+ 2773 | value | label | 2774 +-------+-----------------+ 2775 | "0" | Matroska Script | 2776 | "1" | DVD-menu | 2777 +-------+-----------------+ 2779 9.3.4.1.29.3. TrackTranslateTrackID Element 2781 name: "TrackTranslateTrackID" 2783 path: "1*1(\Segment\Tracks\TrackEntry\TrackTranslate\TrackTranslateTr 2784 ackID)" 2786 id: "0x66A5" 2788 minOccurs: "1" 2790 maxOccurs: "1" 2792 type: "binary" 2794 definition: The binary value used to represent this track in the 2795 chapter codec data. The format depends on the ChapProcessCodecID 2796 used. 2798 9.3.4.1.30. Video Element 2800 name: "Video" 2802 path: "0*1(\Segment\Tracks\TrackEntry\Video)" 2804 id: "0xE0" 2806 maxOccurs: "1" 2808 type: "master" 2810 definition: Video settings. 2812 9.3.4.1.30.1. FlagInterlaced Element 2814 name: "FlagInterlaced" 2816 path: "1*1(\Segment\Tracks\TrackEntry\Video\FlagInterlaced)" 2818 id: "0x9A" 2819 minOccurs: "1" 2821 maxOccurs: "1" 2823 range: "0-2" 2825 default: "0" 2827 type: "uinteger" 2829 minver: "2" 2831 definition: A flag to declare if the video is known to be progressive 2832 or interlaced and if applicable to declare details about the 2833 interlacement. 2835 restrictions: 2837 +-------+--------------+ 2838 | value | label | 2839 +-------+--------------+ 2840 | "0" | undetermined | 2841 | "1" | interlaced | 2842 | "2" | progressive | 2843 +-------+--------------+ 2845 9.3.4.1.30.2. FieldOrder Element 2847 name: "FieldOrder" 2849 path: "1*1(\Segment\Tracks\TrackEntry\Video\FieldOrder)" 2851 id: "0x9D" 2853 minOccurs: "1" 2855 maxOccurs: "1" 2857 range: "0-14" 2859 default: "2" 2861 type: "uinteger" 2863 minver: "4" 2865 definition: Declare the field ordering of the video. If 2866 FlagInterlaced is not set to 1, this Element MUST be ignored. 2868 restrictions: 2870 +-------+--------------+--------------------------------------------+ 2871 | value | label | documentation | 2872 +-------+--------------+--------------------------------------------+ 2873 | "0" | progressive | | 2874 | "1" | tff | Top field displayed first. Top field | 2875 | | | stored first. | 2876 | "2" | undetermined | | 2877 | "6" | bff | Bottom field displayed first. Bottom field | 2878 | | | stored first. | 2879 | "9" | bff(swapped) | Top field displayed first. Fields are | 2880 | | | interleaved in storage with the top line | 2881 | | | of the top field stored first. | 2882 | "14" | tff(swapped) | Bottom field displayed first. Fields are | 2883 | | | interleaved in storage with the top line | 2884 | | | of the top field stored first. | 2885 +-------+--------------+--------------------------------------------+ 2887 9.3.4.1.30.3. StereoMode Element 2889 name: "StereoMode" 2891 path: "0*1(\Segment\Tracks\TrackEntry\Video\StereoMode)" 2893 id: "0x53B8" 2895 maxOccurs: "1" 2897 default: "0" 2899 type: "uinteger" 2901 minver: "3" 2903 definition: Stereo-3D video mode. There are some more details on 3D 2904 support in the Specification Notes. 2906 restrictions: 2908 +-------+---------------------------------------------------+ 2909 | value | label | 2910 +-------+---------------------------------------------------+ 2911 | "0" | mono | 2912 | "1" | side by side (left eye first) | 2913 | "2" | top - bottom (right eye is first) | 2914 | "3" | top - bottom (left eye is first) | 2915 | "4" | checkboard (right eye is first) | 2916 | "5" | checkboard (left eye is first) | 2917 | "6" | row interleaved (right eye is first) | 2918 | "7" | row interleaved (left eye is first) | 2919 | "8" | column interleaved (right eye is first) | 2920 | "9" | column interleaved (left eye is first) | 2921 | "10" | anaglyph (cyan/red) | 2922 | "11" | side by side (right eye first) | 2923 | "12" | anaglyph (green/magenta) | 2924 | "13" | both eyes laced in one Block (left eye is first) | 2925 | "14" | both eyes laced in one Block (right eye is first) | 2926 +-------+---------------------------------------------------+ 2928 9.3.4.1.30.4. AlphaMode Element 2930 name: "AlphaMode" 2932 path: "0*1(\Segment\Tracks\TrackEntry\Video\AlphaMode)" 2934 id: "0x53C0" 2936 maxOccurs: "1" 2938 default: "0" 2940 type: "uinteger" 2942 minver: "3" 2944 definition: Alpha Video Mode. Presence of this Element indicates 2945 that the BlockAdditional Element could contain Alpha data. 2947 9.3.4.1.30.5. OldStereoMode Element 2949 name: "OldStereoMode" 2951 path: "0*1(\Segment\Tracks\TrackEntry\Video\OldStereoMode)" 2953 id: "0x53B9" 2955 maxOccurs: "1" 2956 type: "uinteger" 2958 maxver: "0" 2960 definition: DEPRECATED, DO NOT USE. Bogus StereoMode value used in 2961 old versions of libmatroska. 2963 restrictions: 2965 +-------+-----------+ 2966 | value | label | 2967 +-------+-----------+ 2968 | "0" | mono | 2969 | "1" | right eye | 2970 | "2" | left eye | 2971 | "3" | both eyes | 2972 +-------+-----------+ 2974 9.3.4.1.30.6. PixelWidth Element 2976 name: "PixelWidth" 2978 path: "1*1(\Segment\Tracks\TrackEntry\Video\PixelWidth)" 2980 id: "0xB0" 2982 minOccurs: "1" 2984 maxOccurs: "1" 2986 range: "not 0" 2988 type: "uinteger" 2990 definition: Width of the encoded video frames in pixels. 2992 9.3.4.1.30.7. PixelHeight Element 2994 name: "PixelHeight" 2996 path: "1*1(\Segment\Tracks\TrackEntry\Video\PixelHeight)" 2998 id: "0xBA" 3000 minOccurs: "1" 3002 maxOccurs: "1" 3003 range: "not 0" 3005 type: "uinteger" 3007 definition: Height of the encoded video frames in pixels. 3009 9.3.4.1.30.8. PixelCropBottom Element 3011 name: "PixelCropBottom" 3013 path: "0*1(\Segment\Tracks\TrackEntry\Video\PixelCropBottom)" 3015 id: "0x54AA" 3017 maxOccurs: "1" 3019 default: "0" 3021 type: "uinteger" 3023 definition: The number of video pixels to remove at the bottom of the 3024 image. 3026 9.3.4.1.30.9. PixelCropTop Element 3028 name: "PixelCropTop" 3030 path: "0*1(\Segment\Tracks\TrackEntry\Video\PixelCropTop)" 3032 id: "0x54BB" 3034 maxOccurs: "1" 3036 default: "0" 3038 type: "uinteger" 3040 definition: The number of video pixels to remove at the top of the 3041 image. 3043 9.3.4.1.30.10. PixelCropLeft Element 3045 name: "PixelCropLeft" 3047 path: "0*1(\Segment\Tracks\TrackEntry\Video\PixelCropLeft)" 3049 id: "0x54CC" 3050 maxOccurs: "1" 3052 default: "0" 3054 type: "uinteger" 3056 definition: The number of video pixels to remove on the left of the 3057 image. 3059 9.3.4.1.30.11. PixelCropRight Element 3061 name: "PixelCropRight" 3063 path: "0*1(\Segment\Tracks\TrackEntry\Video\PixelCropRight)" 3065 id: "0x54DD" 3067 maxOccurs: "1" 3069 default: "0" 3071 type: "uinteger" 3073 definition: The number of video pixels to remove on the right of the 3074 image. 3076 9.3.4.1.30.12. DisplayWidth Element 3078 name: "DisplayWidth" 3080 path: "0*1(\Segment\Tracks\TrackEntry\Video\DisplayWidth)" 3082 id: "0x54B0" 3084 maxOccurs: "1" 3086 range: "not 0" 3088 default: "PixelWidth - PixelCropLeft - PixelCropRight" 3090 type: "uinteger" 3092 definition: Width of the video frames to display. Applies to the 3093 video frame after cropping (PixelCrop* Elements). The default value 3094 is only valid when DisplayUnit is 0. 3096 9.3.4.1.30.13. DisplayHeight Element 3098 name: "DisplayHeight" 3100 path: "0*1(\Segment\Tracks\TrackEntry\Video\DisplayHeight)" 3102 id: "0x54BA" 3104 maxOccurs: "1" 3106 range: "not 0" 3108 default: "PixelHeight - PixelCropTop - PixelCropBottom" 3110 type: "uinteger" 3112 definition: Height of the video frames to display. Applies to the 3113 video frame after cropping (PixelCrop* Elements). The default value 3114 is only valid when DisplayUnit is 0. 3116 9.3.4.1.30.14. DisplayUnit Element 3118 name: "DisplayUnit" 3120 path: "0*1(\Segment\Tracks\TrackEntry\Video\DisplayUnit)" 3122 id: "0x54B2" 3124 maxOccurs: "1" 3126 default: "0" 3128 type: "uinteger" 3130 definition: How DisplayWidth & DisplayHeight are interpreted. 3132 restrictions: 3134 +-------+----------------------+ 3135 | value | label | 3136 +-------+----------------------+ 3137 | "0" | pixels | 3138 | "1" | centimeters | 3139 | "2" | inches | 3140 | "3" | display aspect ratio | 3141 | "4" | unknown | 3142 +-------+----------------------+ 3144 9.3.4.1.30.15. AspectRatioType Element 3146 name: "AspectRatioType" 3148 path: "0*1(\Segment\Tracks\TrackEntry\Video\AspectRatioType)" 3150 id: "0x54B3" 3152 maxOccurs: "1" 3154 default: "0" 3156 type: "uinteger" 3158 definition: Specify the possible modifications to the aspect ratio. 3160 restrictions: 3162 +-------+-------------------+ 3163 | value | label | 3164 +-------+-------------------+ 3165 | "0" | free resizing | 3166 | "1" | keep aspect ratio | 3167 | "2" | fixed | 3168 +-------+-------------------+ 3170 9.3.4.1.30.16. ColourSpace Element 3172 name: "ColourSpace" 3174 path: "0*1(\Segment\Tracks\TrackEntry\Video\ColourSpace)" 3176 id: "0x2EB524" 3178 maxOccurs: "1" 3180 type: "binary" 3182 definition: Specify the pixel format used for the Track's data as a 3183 FourCC. This value is similar in scope to the biCompression value of 3184 AVI's BITMAPINFOHEADER. This Element is MANDATORY in TrackEntry when 3185 the CodecID Element of the TrackEntry is set to "V_UNCOMPRESSED". 3187 9.3.4.1.30.17. GammaValue Element 3189 name: "GammaValue" 3191 path: "0*1(\Segment\Tracks\TrackEntry\Video\GammaValue)" 3192 id: "0x2FB523" 3194 maxOccurs: "1" 3196 range: "> 0x0p+0" 3198 type: "float" 3200 minver: "0" 3202 maxver: "0" 3204 definition: Gamma Value. 3206 9.3.4.1.30.18. FrameRate Element 3208 name: "FrameRate" 3210 path: "0*1(\Segment\Tracks\TrackEntry\Video\FrameRate)" 3212 id: "0x2383E3" 3214 maxOccurs: "1" 3216 range: "> 0x0p+0" 3218 type: "float" 3220 minver: "0" 3222 maxver: "0" 3224 definition: Number of frames per second. Informational only. 3226 9.3.4.1.30.19. Colour Element 3228 name: "Colour" 3230 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour)" 3232 id: "0x55B0" 3234 maxOccurs: "1" 3236 type: "master" 3238 minver: "4" 3239 definition: Settings describing the colour format. 3241 9.3.4.1.30.20. MatrixCoefficients Element 3243 name: "MatrixCoefficients" 3245 path: 3246 "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MatrixCoefficients)" 3248 id: "0x55B1" 3250 maxOccurs: "1" 3252 default: "2" 3254 type: "uinteger" 3256 minver: "4" 3258 definition: The Matrix Coefficients of the video used to derive luma 3259 and chroma values from red, green, and blue color primaries. For 3260 clarity, the value and meanings for MatrixCoefficients are adopted 3261 from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273. 3263 restrictions: 3265 +-------+---------------------------------------+ 3266 | value | label | 3267 +-------+---------------------------------------+ 3268 | "0" | Identity | 3269 | "1" | ITU-R BT.709 | 3270 | "2" | unspecified | 3271 | "3" | reserved | 3272 | "4" | US FCC 73.682 | 3273 | "5" | ITU-R BT.470BG | 3274 | "6" | SMPTE 170M | 3275 | "7" | SMPTE 240M | 3276 | "8" | YCoCg | 3277 | "9" | BT2020 Non-constant Luminance | 3278 | "10" | BT2020 Constant Luminance | 3279 | "11" | SMPTE ST 2085 | 3280 | "12" | Chroma-derived Non-constant Luminance | 3281 | "13" | Chroma-derived Constant Luminance | 3282 | "14" | ITU-R BT.2100-0 | 3283 +-------+---------------------------------------+ 3285 9.3.4.1.30.21. BitsPerChannel Element 3287 name: "BitsPerChannel" 3289 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\BitsPerChannel)" 3291 id: "0x55B2" 3293 maxOccurs: "1" 3295 default: "0" 3297 type: "uinteger" 3299 minver: "4" 3301 definition: Number of decoded bits per channel. A value of 0 3302 indicates that the BitsPerChannel is unspecified. 3304 9.3.4.1.30.22. ChromaSubsamplingHorz Element 3306 name: "ChromaSubsamplingHorz" 3308 path: 3309 "0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingHorz)" 3311 id: "0x55B3" 3313 maxOccurs: "1" 3315 type: "uinteger" 3317 minver: "4" 3319 definition: The amount of pixels to remove in the Cr and Cb channels 3320 for every pixel not removed horizontally. Example: For video with 3321 4:2:0 chroma subsampling, the ChromaSubsamplingHorz SHOULD be set to 3322 1. 3324 9.3.4.1.30.23. ChromaSubsamplingVert Element 3326 name: "ChromaSubsamplingVert" 3328 path: 3329 "0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSubsamplingVert)" 3331 id: "0x55B4" 3332 maxOccurs: "1" 3334 type: "uinteger" 3336 minver: "4" 3338 definition: The amount of pixels to remove in the Cr and Cb channels 3339 for every pixel not removed vertically. Example: For video with 3340 4:2:0 chroma subsampling, the ChromaSubsamplingVert SHOULD be set to 3341 1. 3343 9.3.4.1.30.24. CbSubsamplingHorz Element 3345 name: "CbSubsamplingHorz" 3347 path: 3348 "0*1(\Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingHorz)" 3350 id: "0x55B5" 3352 maxOccurs: "1" 3354 type: "uinteger" 3356 minver: "4" 3358 definition: The amount of pixels to remove in the Cb channel for 3359 every pixel not removed horizontally. This is additive with 3360 ChromaSubsamplingHorz. Example: For video with 4:2:1 chroma 3361 subsampling, the ChromaSubsamplingHorz SHOULD be set to 1 and 3362 CbSubsamplingHorz SHOULD be set to 1. 3364 9.3.4.1.30.25. CbSubsamplingVert Element 3366 name: "CbSubsamplingVert" 3368 path: 3369 "0*1(\Segment\Tracks\TrackEntry\Video\Colour\CbSubsamplingVert)" 3371 id: "0x55B6" 3373 maxOccurs: "1" 3375 type: "uinteger" 3377 minver: "4" 3378 definition: The amount of pixels to remove in the Cb channel for 3379 every pixel not removed vertically. This is additive with 3380 ChromaSubsamplingVert. 3382 9.3.4.1.30.26. ChromaSitingHorz Element 3384 name: "ChromaSitingHorz" 3386 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingHorz)" 3388 id: "0x55B7" 3390 maxOccurs: "1" 3392 default: "0" 3394 type: "uinteger" 3396 minver: "4" 3398 definition: How chroma is subsampled horizontally. 3400 restrictions: 3402 +-------+-----------------+ 3403 | value | label | 3404 +-------+-----------------+ 3405 | "0" | unspecified | 3406 | "1" | left collocated | 3407 | "2" | half | 3408 +-------+-----------------+ 3410 9.3.4.1.30.27. ChromaSitingVert Element 3412 name: "ChromaSitingVert" 3414 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\ChromaSitingVert)" 3416 id: "0x55B8" 3418 maxOccurs: "1" 3420 default: "0" 3422 type: "uinteger" 3424 minver: "4" 3425 definition: How chroma is subsampled vertically. 3427 restrictions: 3429 +-------+----------------+ 3430 | value | label | 3431 +-------+----------------+ 3432 | "0" | unspecified | 3433 | "1" | top collocated | 3434 | "2" | half | 3435 +-------+----------------+ 3437 9.3.4.1.30.28. Range Element 3439 name: "Range" 3441 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\Range)" 3443 id: "0x55B9" 3445 maxOccurs: "1" 3447 default: "0" 3449 type: "uinteger" 3451 minver: "4" 3453 definition: Clipping of the color ranges. 3455 restrictions: 3457 +-------+-------------------------------------------------------+ 3458 | value | label | 3459 +-------+-------------------------------------------------------+ 3460 | "0" | unspecified | 3461 | "1" | broadcast range | 3462 | "2" | full range (no clipping) | 3463 | "3" | defined by MatrixCoefficients/TransferCharacteristics | 3464 +-------+-------------------------------------------------------+ 3466 9.3.4.1.30.29. TransferCharacteristics Element 3468 name: "TransferCharacteristics" 3470 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\TransferCharacteri 3471 stics)" 3472 id: "0x55BA" 3474 maxOccurs: "1" 3476 default: "2" 3478 type: "uinteger" 3480 minver: "4" 3482 definition: The transfer characteristics of the video. For clarity, 3483 the value and meanings for TransferCharacteristics are adopted from 3484 Table 3 of ISO/IEC 23091-4 or ITU-T H.273. 3486 restrictions: 3488 +-------+---------------------------------------+ 3489 | value | label | 3490 +-------+---------------------------------------+ 3491 | "0" | reserved | 3492 | "1" | ITU-R BT.709 | 3493 | "2" | unspecified | 3494 | "3" | reserved | 3495 | "4" | Gamma 2.2 curve - BT.470M | 3496 | "5" | Gamma 2.8 curve - BT.470BG | 3497 | "6" | SMPTE 170M | 3498 | "7" | SMPTE 240M | 3499 | "8" | Linear | 3500 | "9" | Log | 3501 | "10" | Log Sqrt | 3502 | "11" | IEC 61966-2-4 | 3503 | "12" | ITU-R BT.1361 Extended Colour Gamut | 3504 | "13" | IEC 61966-2-1 | 3505 | "14" | ITU-R BT.2020 10 bit | 3506 | "15" | ITU-R BT.2020 12 bit | 3507 | "16" | ITU-R BT.2100 Perceptual Quantization | 3508 | "17" | SMPTE ST 428-1 | 3509 | "18" | ARIB STD-B67 (HLG) | 3510 +-------+---------------------------------------+ 3512 9.3.4.1.30.30. Primaries Element 3514 name: "Primaries" 3516 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\Primaries)" 3518 id: "0x55BB" 3519 maxOccurs: "1" 3521 default: "2" 3523 type: "uinteger" 3525 minver: "4" 3527 definition: The colour primaries of the video. For clarity, the 3528 value and meanings for Primaries are adopted from Table 2 of ISO/IEC 3529 23091-4 or ITU-T H.273. 3531 restrictions: 3533 +-------+----------------------------------------+ 3534 | value | label | 3535 +-------+----------------------------------------+ 3536 | "0" | reserved | 3537 | "1" | ITU-R BT.709 | 3538 | "2" | unspecified | 3539 | "3" | reserved | 3540 | "4" | ITU-R BT.470M | 3541 | "5" | ITU-R BT.470BG - BT.601 625 | 3542 | "6" | ITU-R BT.601 525 - SMPTE 170M | 3543 | "7" | SMPTE 240M | 3544 | "8" | FILM | 3545 | "9" | ITU-R BT.2020 | 3546 | "10" | SMPTE ST 428-1 | 3547 | "11" | SMPTE RP 432-2 | 3548 | "12" | SMPTE EG 432-2 | 3549 | "22" | EBU Tech. 3213-E - JEDEC P22 phosphors | 3550 +-------+----------------------------------------+ 3552 9.3.4.1.30.31. MaxCLL Element 3554 name: "MaxCLL" 3556 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MaxCLL)" 3558 id: "0x55BC" 3560 maxOccurs: "1" 3562 type: "uinteger" 3564 minver: "4" 3565 definition: Maximum brightness of a single pixel (Maximum Content 3566 Light Level) in candelas per square meter (cd/m^2). 3568 9.3.4.1.30.32. MaxFALL Element 3570 name: "MaxFALL" 3572 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MaxFALL)" 3574 id: "0x55BD" 3576 maxOccurs: "1" 3578 type: "uinteger" 3580 minver: "4" 3582 definition: Maximum brightness of a single full frame (Maximum Frame- 3583 Average Light Level) in candelas per square meter (cd/m^2). 3585 9.3.4.1.30.33. MasteringMetadata Element 3587 name: "MasteringMetadata" 3589 path: 3590 "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata)" 3592 id: "0x55D0" 3594 maxOccurs: "1" 3596 type: "master" 3598 minver: "4" 3600 definition: SMPTE 2086 mastering data. 3602 9.3.4.1.30.34. PrimaryRChromaticityX Element 3604 name: "PrimaryRChromaticityX" 3606 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\ 3607 PrimaryRChromaticityX)" 3609 id: "0x55D1" 3611 maxOccurs: "1" 3612 range: "0-1" 3614 type: "float" 3616 minver: "4" 3618 definition: Red X chromaticity coordinate as defined by CIE 1931. 3620 9.3.4.1.30.35. PrimaryRChromaticityY Element 3622 name: "PrimaryRChromaticityY" 3624 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\ 3625 PrimaryRChromaticityY)" 3627 id: "0x55D2" 3629 maxOccurs: "1" 3631 range: "0-1" 3633 type: "float" 3635 minver: "4" 3637 definition: Red Y chromaticity coordinate as defined by CIE 1931. 3639 9.3.4.1.30.36. PrimaryGChromaticityX Element 3641 name: "PrimaryGChromaticityX" 3643 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\ 3644 PrimaryGChromaticityX)" 3646 id: "0x55D3" 3648 maxOccurs: "1" 3650 range: "0-1" 3652 type: "float" 3654 minver: "4" 3656 definition: Green X chromaticity coordinate as defined by CIE 1931. 3658 9.3.4.1.30.37. PrimaryGChromaticityY Element 3660 name: "PrimaryGChromaticityY" 3662 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\ 3663 PrimaryGChromaticityY)" 3665 id: "0x55D4" 3667 maxOccurs: "1" 3669 range: "0-1" 3671 type: "float" 3673 minver: "4" 3675 definition: Green Y chromaticity coordinate as defined by CIE 1931. 3677 9.3.4.1.30.38. PrimaryBChromaticityX Element 3679 name: "PrimaryBChromaticityX" 3681 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\ 3682 PrimaryBChromaticityX)" 3684 id: "0x55D5" 3686 maxOccurs: "1" 3688 range: "0-1" 3690 type: "float" 3692 minver: "4" 3694 definition: Blue X chromaticity coordinate as defined by CIE 1931. 3696 9.3.4.1.30.39. PrimaryBChromaticityY Element 3698 name: "PrimaryBChromaticityY" 3700 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\ 3701 PrimaryBChromaticityY)" 3703 id: "0x55D6" 3705 maxOccurs: "1" 3706 range: "0-1" 3708 type: "float" 3710 minver: "4" 3712 definition: Blue Y chromaticity coordinate as defined by CIE 1931. 3714 9.3.4.1.30.40. WhitePointChromaticityX Element 3716 name: "WhitePointChromaticityX" 3718 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\ 3719 WhitePointChromaticityX)" 3721 id: "0x55D7" 3723 maxOccurs: "1" 3725 range: "0-1" 3727 type: "float" 3729 minver: "4" 3731 definition: White X chromaticity coordinate as defined by CIE 1931. 3733 9.3.4.1.30.41. WhitePointChromaticityY Element 3735 name: "WhitePointChromaticityY" 3737 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\ 3738 WhitePointChromaticityY)" 3740 id: "0x55D8" 3742 maxOccurs: "1" 3744 range: "0-1" 3746 type: "float" 3748 minver: "4" 3750 definition: White Y chromaticity coordinate as defined by CIE 1931. 3752 9.3.4.1.30.42. LuminanceMax Element 3754 name: "LuminanceMax" 3756 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\ 3757 LuminanceMax)" 3759 id: "0x55D9" 3761 maxOccurs: "1" 3763 range: ">= 0x0p+0" 3765 type: "float" 3767 minver: "4" 3769 definition: Maximum luminance. Represented in candelas per square 3770 meter (cd/m^2). 3772 9.3.4.1.30.43. LuminanceMin Element 3774 name: "LuminanceMin" 3776 path: "0*1(\Segment\Tracks\TrackEntry\Video\Colour\MasteringMetadata\ 3777 LuminanceMin)" 3779 id: "0x55DA" 3781 maxOccurs: "1" 3783 range: ">= 0x0p+0" 3785 type: "float" 3787 minver: "4" 3789 definition: Minimum luminance. Represented in candelas per square 3790 meter (cd/m^2). 3792 9.3.4.1.30.44. Projection Element 3794 name: "Projection" 3796 path: "0*1(\Segment\Tracks\TrackEntry\Video\Projection)" 3798 id: "0x7670" 3799 maxOccurs: "1" 3801 type: "master" 3803 minver: "4" 3805 definition: Describes the video projection details. Used to render 3806 spherical and VR videos. 3808 9.3.4.1.30.45. ProjectionType Element 3810 name: "ProjectionType" 3812 path: 3813 "1*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionType)" 3815 id: "0x7671" 3817 minOccurs: "1" 3819 maxOccurs: "1" 3821 range: "0-3" 3823 default: "0" 3825 type: "uinteger" 3827 minver: "4" 3829 definition: Describes the projection used for this video track. 3831 restrictions: 3833 +-------+-----------------+ 3834 | value | label | 3835 +-------+-----------------+ 3836 | "0" | rectangular | 3837 | "1" | equirectangular | 3838 | "2" | cubemap | 3839 | "3" | mesh | 3840 +-------+-----------------+ 3842 9.3.4.1.30.46. ProjectionPrivate Element 3844 name: "ProjectionPrivate" 3845 path: 3846 "0*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPrivate)" 3848 id: "0x7672" 3850 maxOccurs: "1" 3852 type: "binary" 3854 minver: "4" 3856 definition: Private data that only applies to a specific 3857 projection.SemanticsIf ProjectionType equals 0 (Rectangular), then 3858 this element must not be present.If ProjectionType equals 1 3859 (Equirectangular), then this element must be present and contain the 3860 same binary data that would be stored inside an ISOBMFF 3861 Equirectangular Projection Box ('equi').If ProjectionType equals 2 3862 (Cubemap), then this element must be present and contain the same 3863 binary data that would be stored inside an ISOBMFF Cubemap Projection 3864 Box ('cbmp').If ProjectionType equals 3 (Mesh), then this element 3865 must be present and contain the same binary data that would be stored 3866 inside an ISOBMFF Mesh Projection Box ('mshp').Note: ISOBMFF box size 3867 and fourcc fields are not included in the binary data, but the 3868 FullBox version and flag fields are. This is to avoid redundant 3869 framing information while preserving versioning and semantics between 3870 the two container formats. 3872 9.3.4.1.30.47. ProjectionPoseYaw Element 3874 name: "ProjectionPoseYaw" 3876 path: 3877 "1*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPoseYaw)" 3879 id: "0x7673" 3881 minOccurs: "1" 3883 maxOccurs: "1" 3885 default: "0x0p+0" 3887 type: "float" 3889 minver: "4" 3891 definition: Specifies a yaw rotation to the projection.SemanticsValue 3892 represents a clockwise rotation, in degrees, around the up vector. 3894 This rotation must be applied before any ProjectionPosePitch or 3895 ProjectionPoseRoll rotations. The value of this field should be in 3896 the -180 to 180 degree range. 3898 9.3.4.1.30.48. ProjectionPosePitch Element 3900 name: "ProjectionPosePitch" 3902 path: "1*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPose 3903 Pitch)" 3905 id: "0x7674" 3907 minOccurs: "1" 3909 maxOccurs: "1" 3911 default: "0x0p+0" 3913 type: "float" 3915 minver: "4" 3917 definition: Specifies a pitch rotation to the 3918 projection.SemanticsValue represents a counter-clockwise rotation, in 3919 degrees, around the right vector. This rotation must be applied 3920 after the ProjectionPoseYaw rotation and before the 3921 ProjectionPoseRoll rotation. The value of this field should be in 3922 the -90 to 90 degree range. 3924 9.3.4.1.30.49. ProjectionPoseRoll Element 3926 name: "ProjectionPoseRoll" 3928 path: 3929 "1*1(\Segment\Tracks\TrackEntry\Video\Projection\ProjectionPoseRoll)" 3931 id: "0x7675" 3933 minOccurs: "1" 3935 maxOccurs: "1" 3937 default: "0x0p+0" 3939 type: "float" 3941 minver: "4" 3942 definition: Specifies a roll rotation to the 3943 projection.SemanticsValue represents a counter-clockwise rotation, in 3944 degrees, around the forward vector. This rotation must be applied 3945 after the ProjectionPoseYaw and ProjectionPosePitch rotations. The 3946 value of this field should be in the -180 to 180 degree range. 3948 9.3.4.1.31. Audio Element 3950 name: "Audio" 3952 path: "0*1(\Segment\Tracks\TrackEntry\Audio)" 3954 id: "0xE1" 3956 maxOccurs: "1" 3958 type: "master" 3960 definition: Audio settings. 3962 9.3.4.1.31.1. SamplingFrequency Element 3964 name: "SamplingFrequency" 3966 path: "1*1(\Segment\Tracks\TrackEntry\Audio\SamplingFrequency)" 3968 id: "0xB5" 3970 minOccurs: "1" 3972 maxOccurs: "1" 3974 range: "> 0x0p+0" 3976 default: "0x1.f4p+12" 3978 type: "float" 3980 definition: Sampling frequency in Hz. 3982 9.3.4.1.31.2. OutputSamplingFrequency Element 3984 name: "OutputSamplingFrequency" 3986 path: "0*1(\Segment\Tracks\TrackEntry\Audio\OutputSamplingFrequency)" 3988 id: "0x78B5" 3989 maxOccurs: "1" 3991 range: "> 0x0p+0" 3993 default: "SamplingFrequency" 3995 type: "float" 3997 definition: Real output sampling frequency in Hz (used for SBR 3998 techniques). 4000 9.3.4.1.31.3. Channels Element 4002 name: "Channels" 4004 path: "1*1(\Segment\Tracks\TrackEntry\Audio\Channels)" 4006 id: "0x9F" 4008 minOccurs: "1" 4010 maxOccurs: "1" 4012 range: "not 0" 4014 default: "1" 4016 type: "uinteger" 4018 definition: Numbers of channels in the track. 4020 9.3.4.1.31.4. ChannelPositions Element 4022 name: "ChannelPositions" 4024 path: "0*1(\Segment\Tracks\TrackEntry\Audio\ChannelPositions)" 4026 id: "0x7D7B" 4028 maxOccurs: "1" 4030 type: "binary" 4032 minver: "0" 4034 maxver: "0" 4035 definition: Table of horizontal angles for each successive channel, 4036 see appendix. 4038 9.3.4.1.31.5. BitDepth Element 4040 name: "BitDepth" 4042 path: "0*1(\Segment\Tracks\TrackEntry\Audio\BitDepth)" 4044 id: "0x6264" 4046 maxOccurs: "1" 4048 range: "not 0" 4050 type: "uinteger" 4052 definition: Bits per sample, mostly used for PCM. 4054 9.3.4.1.32. TrackOperation Element 4056 name: "TrackOperation" 4058 path: "0*1(\Segment\Tracks\TrackEntry\TrackOperation)" 4060 id: "0xE2" 4062 maxOccurs: "1" 4064 type: "master" 4066 minver: "3" 4068 definition: Operation that needs to be applied on tracks to create 4069 this virtual track. For more details look at the Specification Notes 4070 on the subject. 4072 9.3.4.1.32.1. TrackCombinePlanes Element 4074 name: "TrackCombinePlanes" 4076 path: 4077 "0*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlanes)" 4079 id: "0xE3" 4081 maxOccurs: "1" 4082 type: "master" 4084 minver: "3" 4086 definition: Contains the list of all video plane tracks that need to 4087 be combined to create this 3D track 4089 9.3.4.1.32.2. TrackPlane Element 4091 name: "TrackPlane" 4093 path: "1*(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlane 4094 s\TrackPlane)" 4096 id: "0xE4" 4098 minOccurs: "1" 4100 type: "master" 4102 minver: "3" 4104 definition: Contains a video plane track that need to be combined to 4105 create this 3D track 4107 9.3.4.1.32.3. TrackPlaneUID Element 4109 name: "TrackPlaneUID" 4111 path: "1*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlan 4112 es\TrackPlane\TrackPlaneUID)" 4114 id: "0xE5" 4116 minOccurs: "1" 4118 maxOccurs: "1" 4120 range: "not 0" 4122 type: "uinteger" 4124 minver: "3" 4126 definition: The trackUID number of the track representing the plane. 4128 9.3.4.1.32.4. TrackPlaneType Element 4130 name: "TrackPlaneType" 4132 path: "1*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackCombinePlan 4133 es\TrackPlane\TrackPlaneType)" 4135 id: "0xE6" 4137 minOccurs: "1" 4139 maxOccurs: "1" 4141 type: "uinteger" 4143 minver: "3" 4145 definition: The kind of plane this track corresponds to. 4147 restrictions: 4149 +-------+------------+ 4150 | value | label | 4151 +-------+------------+ 4152 | "0" | left eye | 4153 | "1" | right eye | 4154 | "2" | background | 4155 +-------+------------+ 4157 9.3.4.1.32.5. TrackJoinBlocks Element 4159 name: "TrackJoinBlocks" 4161 path: 4162 "0*1(\Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks)" 4164 id: "0xE9" 4166 maxOccurs: "1" 4168 type: "master" 4170 minver: "3" 4172 definition: Contains the list of all tracks whose Blocks need to be 4173 combined to create this virtual track 4175 9.3.4.1.32.6. TrackJoinUID Element 4177 name: "TrackJoinUID" 4179 path: "1*(\Segment\Tracks\TrackEntry\TrackOperation\TrackJoinBlocks\T 4180 rackJoinUID)" 4182 id: "0xED" 4184 minOccurs: "1" 4186 range: "not 0" 4188 type: "uinteger" 4190 minver: "3" 4192 definition: The trackUID number of a track whose blocks are used to 4193 create this virtual track. 4195 9.3.4.1.33. TrickTrackUID Element 4197 name: "TrickTrackUID" 4199 path: "0*1(\Segment\Tracks\TrackEntry\TrickTrackUID)" 4201 id: "0xC0" 4203 maxOccurs: "1" 4205 type: "uinteger" 4207 minver: "0" 4209 maxver: "0" 4211 definition: DivX trick track extensions 4213 9.3.4.1.34. TrickTrackSegmentUID Element 4215 name: "TrickTrackSegmentUID" 4217 path: "0*1(\Segment\Tracks\TrackEntry\TrickTrackSegmentUID)" 4219 id: "0xC1" 4221 maxOccurs: "1" 4222 type: "binary" 4224 minver: "0" 4226 maxver: "0" 4228 definition: DivX trick track extensions 4230 9.3.4.1.35. TrickTrackFlag Element 4232 name: "TrickTrackFlag" 4234 path: "0*1(\Segment\Tracks\TrackEntry\TrickTrackFlag)" 4236 id: "0xC6" 4238 maxOccurs: "1" 4240 default: "0" 4242 type: "uinteger" 4244 minver: "0" 4246 maxver: "0" 4248 definition: DivX trick track extensions 4250 9.3.4.1.36. TrickMasterTrackUID Element 4252 name: "TrickMasterTrackUID" 4254 path: "0*1(\Segment\Tracks\TrackEntry\TrickMasterTrackUID)" 4256 id: "0xC7" 4258 maxOccurs: "1" 4260 type: "uinteger" 4262 minver: "0" 4264 maxver: "0" 4266 definition: DivX trick track extensions 4268 9.3.4.1.37. TrickMasterTrackSegmentUID Element 4270 name: "TrickMasterTrackSegmentUID" 4272 path: "0*1(\Segment\Tracks\TrackEntry\TrickMasterTrackSegmentUID)" 4274 id: "0xC4" 4276 maxOccurs: "1" 4278 type: "binary" 4280 minver: "0" 4282 maxver: "0" 4284 definition: DivX trick track extensions 4286 9.3.4.1.38. ContentEncodings Element 4288 name: "ContentEncodings" 4290 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings)" 4292 id: "0x6D80" 4294 maxOccurs: "1" 4296 type: "master" 4298 definition: Settings for several content encoding mechanisms like 4299 compression or encryption. 4301 9.3.4.1.38.1. ContentEncoding Element 4303 name: "ContentEncoding" 4305 path: 4306 "1*(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncoding)" 4308 id: "0x6240" 4310 minOccurs: "1" 4312 type: "master" 4314 definition: Settings for one content encoding like compression or 4315 encryption. 4317 9.3.4.1.38.2. ContentEncodingOrder Element 4319 name: "ContentEncodingOrder" 4321 path: "1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4322 g\ContentEncodingOrder)" 4324 id: "0x5031" 4326 minOccurs: "1" 4328 maxOccurs: "1" 4330 default: "0" 4332 type: "uinteger" 4334 definition: Tells when this modification was used during encoding/ 4335 muxing starting with 0 and counting upwards. The decoder/demuxer has 4336 to start with the highest order number it finds and work its way 4337 down. This value has to be unique over all ContentEncodingOrder 4338 Elements in the TrackEntry that contains this ContentEncodingOrder 4339 element. 4341 9.3.4.1.38.3. ContentEncodingScope Element 4343 name: "ContentEncodingScope" 4345 path: "1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4346 g\ContentEncodingScope)" 4348 id: "0x5032" 4350 minOccurs: "1" 4352 maxOccurs: "1" 4354 range: "not 0" 4356 default: "1" 4358 type: "uinteger" 4360 definition: A bit field that describes which Elements have been 4361 modified in this way. Values (big endian) can be OR'ed. 4363 restrictions: 4365 +-------+-----------------------------------------------------------+ 4366 | value | label | 4367 +-------+-----------------------------------------------------------+ 4368 | "1" | All frame contents, excluding lacing data | 4369 | "2" | The track's private data | 4370 | "4" | The next ContentEncoding (next "ContentEncodingOrder". | 4371 | | Either the data inside "ContentCompression" and/or | 4372 | | "ContentEncryption") | 4373 +-------+-----------------------------------------------------------+ 4375 9.3.4.1.38.4. ContentEncodingType Element 4377 name: "ContentEncodingType" 4379 path: "1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4380 g\ContentEncodingType)" 4382 id: "0x5033" 4384 minOccurs: "1" 4386 maxOccurs: "1" 4388 default: "0" 4390 type: "uinteger" 4392 definition: A value describing what kind of transformation is 4393 applied. 4395 restrictions: 4397 +-------+-------------+ 4398 | value | label | 4399 +-------+-------------+ 4400 | "0" | Compression | 4401 | "1" | Encryption | 4402 +-------+-------------+ 4404 9.3.4.1.38.5. ContentCompression Element 4406 name: "ContentCompression" 4408 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4409 g\ContentCompression)" 4411 id: "0x5034" 4412 maxOccurs: "1" 4414 type: "master" 4416 definition: Settings describing the compression used. This Element 4417 MUST be present if the value of ContentEncodingType is 0 and absent 4418 otherwise. Each block MUST be decompressable even if no previous 4419 block is available in order not to prevent seeking. 4421 9.3.4.1.38.6. ContentCompAlgo Element 4423 name: "ContentCompAlgo" 4425 path: "1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4426 g\ContentCompression\ContentCompAlgo)" 4428 id: "0x4254" 4430 minOccurs: "1" 4432 maxOccurs: "1" 4434 default: "0" 4436 type: "uinteger" 4438 definition: The compression algorithm used. 4440 restrictions: 4442 +-------+------------------+ 4443 | value | label | 4444 +-------+------------------+ 4445 | "0" | zlib | 4446 | "1" | bzlib | 4447 | "2" | lzo1x | 4448 | "3" | Header Stripping | 4449 +-------+------------------+ 4451 9.3.4.1.38.7. ContentCompSettings Element 4453 name: "ContentCompSettings" 4455 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4456 g\ContentCompression\ContentCompSettings)" 4458 id: "0x4255" 4459 maxOccurs: "1" 4461 type: "binary" 4463 definition: Settings that might be needed by the decompressor. For 4464 Header Stripping ("ContentCompAlgo"=3), the bytes that were removed 4465 from the beginning of each frames of the track. 4467 9.3.4.1.38.8. ContentEncryption Element 4469 name: "ContentEncryption" 4471 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4472 g\ContentEncryption)" 4474 id: "0x5035" 4476 maxOccurs: "1" 4478 type: "master" 4480 definition: Settings describing the encryption used. This Element 4481 MUST be present if the value of "ContentEncodingType" is 1 4482 (encryption) and MUST be ignored otherwise. 4484 9.3.4.1.38.9. ContentEncAlgo Element 4486 name: "ContentEncAlgo" 4488 path: "1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4489 g\ContentEncryption\ContentEncAlgo)" 4491 id: "0x47E1" 4493 minOccurs: "1" 4495 maxOccurs: "1" 4497 default: "0" 4499 type: "uinteger" 4501 definition: The encryption algorithm used. The value '0' means that 4502 the contents have not been encrypted but only signed. 4504 restrictions: 4506 +-------+-----------------------+ 4507 | value | label | 4508 +-------+-----------------------+ 4509 | "0" | Not encrypted | 4510 | "1" | DES - FIPS 46-3 | 4511 | "2" | Triple DES - RFC 1851 | 4512 | "3" | Twofish | 4513 | "4" | Blowfish | 4514 | "5" | AES - FIPS 187 | 4515 +-------+-----------------------+ 4517 9.3.4.1.38.10. ContentEncKeyID Element 4519 name: "ContentEncKeyID" 4521 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4522 g\ContentEncryption\ContentEncKeyID)" 4524 id: "0x47E2" 4526 maxOccurs: "1" 4528 type: "binary" 4530 definition: For public key algorithms this is the ID of the public 4531 key the the data was encrypted with. 4533 9.3.4.1.38.11. ContentEncAESSettings Element 4535 name: "ContentEncAESSettings" 4537 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4538 g\ContentEncryption\ContentEncAESSettings)" 4540 id: "0x47E7" 4542 maxOccurs: "1" 4544 type: "master" 4546 minver: "4" 4548 definition: Settings describing the encryption algorithm used. If 4549 "ContentEncAlgo" != 5 this MUST be ignored. 4551 9.3.4.1.38.12. AESSettingsCipherMode Element 4553 name: "AESSettingsCipherMode" 4555 path: "1*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4556 g\ContentEncryption\ContentEncAESSettings\AESSettingsCipherMode)" 4558 id: "0x47E8" 4560 minOccurs: "1" 4562 maxOccurs: "1" 4564 type: "uinteger" 4566 minver: "4" 4568 definition: The AES cipher mode used in the encryption. 4570 restrictions: 4572 +-------+--------------------------------------------------+ 4573 | value | label | 4574 +-------+--------------------------------------------------+ 4575 | "1" | AES-CTR / Counter, NIST SP 800-38A | 4576 | "2" | AES-CBC / Cipher Block Chaining, NIST SP 800-38A | 4577 +-------+--------------------------------------------------+ 4579 9.3.4.1.38.13. ContentSignature Element 4581 name: "ContentSignature" 4583 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4584 g\ContentEncryption\ContentSignature)" 4586 id: "0x47E3" 4588 maxOccurs: "1" 4590 type: "binary" 4592 definition: A cryptographic signature of the contents. 4594 9.3.4.1.38.14. ContentSigKeyID Element 4596 name: "ContentSigKeyID" 4597 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4598 g\ContentEncryption\ContentSigKeyID)" 4600 id: "0x47E4" 4602 maxOccurs: "1" 4604 type: "binary" 4606 definition: This is the ID of the private key the data was signed 4607 with. 4609 9.3.4.1.38.15. ContentSigAlgo Element 4611 name: "ContentSigAlgo" 4613 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4614 g\ContentEncryption\ContentSigAlgo)" 4616 id: "0x47E5" 4618 maxOccurs: "1" 4620 default: "0" 4622 type: "uinteger" 4624 definition: The algorithm used for the signature. 4626 restrictions: 4628 +-------+------------+ 4629 | value | label | 4630 +-------+------------+ 4631 | "0" | Not signed | 4632 | "1" | RSA | 4633 +-------+------------+ 4635 9.3.4.1.38.16. ContentSigHashAlgo Element 4637 name: "ContentSigHashAlgo" 4639 path: "0*1(\Segment\Tracks\TrackEntry\ContentEncodings\ContentEncodin 4640 g\ContentEncryption\ContentSigHashAlgo)" 4642 id: "0x47E6" 4644 maxOccurs: "1" 4645 default: "0" 4647 type: "uinteger" 4649 definition: The hash algorithm used for the signature. 4651 restrictions: 4653 +-------+------------+ 4654 | value | label | 4655 +-------+------------+ 4656 | "0" | Not signed | 4657 | "1" | SHA1-160 | 4658 | "2" | MD5 | 4659 +-------+------------+ 4661 9.3.5. Cues Element 4663 name: "Cues" 4665 path: "0*1(\Segment\Cues)" 4667 id: "0x1C53BB6B" 4669 maxOccurs: "1" 4671 type: "master" 4673 definition: A Top-Level Element to speed seeking access. All entries 4674 are local to the Segment. This Element SHOULD be mandatory for non 4675 "live" streams. 4677 9.3.5.1. CuePoint Element 4679 name: "CuePoint" 4681 path: "1*(\Segment\Cues\CuePoint)" 4683 id: "0xBB" 4685 minOccurs: "1" 4687 type: "master" 4689 definition: Contains all information relative to a seek point in the 4690 Segment. 4692 9.3.5.1.1. CueTime Element 4694 name: "CueTime" 4696 path: "1*1(\Segment\Cues\CuePoint\CueTime)" 4698 id: "0xB3" 4700 minOccurs: "1" 4702 maxOccurs: "1" 4704 type: "uinteger" 4706 definition: Absolute timestamp according to the Segment time base. 4708 9.3.5.1.2. CueTrackPositions Element 4710 name: "CueTrackPositions" 4712 path: "1*(\Segment\Cues\CuePoint\CueTrackPositions)" 4714 id: "0xB7" 4716 minOccurs: "1" 4718 type: "master" 4720 definition: Contain positions for different tracks corresponding to 4721 the timestamp. 4723 9.3.5.1.2.1. CueTrack Element 4725 name: "CueTrack" 4727 path: "1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueTrack)" 4729 id: "0xF7" 4731 minOccurs: "1" 4733 maxOccurs: "1" 4735 range: "not 0" 4737 type: "uinteger" 4739 definition: The track for which a position is given. 4741 9.3.5.1.2.2. CueClusterPosition Element 4743 name: "CueClusterPosition" 4745 path: 4746 "1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueClusterPosition)" 4748 id: "0xF1" 4750 minOccurs: "1" 4752 maxOccurs: "1" 4754 type: "uinteger" 4756 definition: The Segment Position of the Cluster containing the 4757 associated Block. 4759 9.3.5.1.2.3. CueRelativePosition Element 4761 name: "CueRelativePosition" 4763 path: 4764 "0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueRelativePosition)" 4766 id: "0xF0" 4768 maxOccurs: "1" 4770 type: "uinteger" 4772 minver: "4" 4774 definition: The relative position inside the Cluster of the 4775 referenced SimpleBlock or BlockGroup with 0 being the first possible 4776 position for an Element inside that Cluster. 4778 9.3.5.1.2.4. CueDuration Element 4780 name: "CueDuration" 4782 path: "0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueDuration)" 4784 id: "0xB2" 4786 maxOccurs: "1" 4788 type: "uinteger" 4789 minver: "4" 4791 definition: The duration of the block according to the Segment time 4792 base. If missing the track's DefaultDuration does not apply and no 4793 duration information is available in terms of the cues. 4795 9.3.5.1.2.5. CueBlockNumber Element 4797 name: "CueBlockNumber" 4799 path: "0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueBlockNumber)" 4801 id: "0x5378" 4803 maxOccurs: "1" 4805 range: "not 0" 4807 default: "1" 4809 type: "uinteger" 4811 definition: Number of the Block in the specified Cluster. 4813 9.3.5.1.2.6. CueCodecState Element 4815 name: "CueCodecState" 4817 path: "0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueCodecState)" 4819 id: "0xEA" 4821 maxOccurs: "1" 4823 default: "0" 4825 type: "uinteger" 4827 minver: "2" 4829 definition: The Segment Position of the Codec State corresponding to 4830 this Cue Element. 0 means that the data is taken from the initial 4831 Track Entry. 4833 9.3.5.1.2.7. CueReference Element 4835 name: "CueReference" 4837 path: "0*(\Segment\Cues\CuePoint\CueTrackPositions\CueReference)" 4839 id: "0xDB" 4841 type: "master" 4843 minver: "2" 4845 definition: The Clusters containing the referenced Blocks. 4847 9.3.5.1.2.8. CueRefTime Element 4849 name: "CueRefTime" 4851 path: "1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueR 4852 efTime)" 4854 id: "0x96" 4856 minOccurs: "1" 4858 maxOccurs: "1" 4860 type: "uinteger" 4862 minver: "2" 4864 definition: Timestamp of the referenced Block. 4866 9.3.5.1.2.9. CueRefCluster Element 4868 name: "CueRefCluster" 4870 path: "1*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueR 4871 efCluster)" 4873 id: "0x97" 4875 minOccurs: "1" 4877 maxOccurs: "1" 4879 type: "uinteger" 4880 minver: "0" 4882 maxver: "0" 4884 definition: The Segment Position of the Cluster containing the 4885 referenced Block. 4887 9.3.5.1.2.10. CueRefNumber Element 4889 name: "CueRefNumber" 4891 path: "0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueR 4892 efNumber)" 4894 id: "0x535F" 4896 maxOccurs: "1" 4898 range: "not 0" 4900 default: "1" 4902 type: "uinteger" 4904 minver: "0" 4906 maxver: "0" 4908 definition: Number of the referenced Block of Track X in the 4909 specified Cluster. 4911 9.3.5.1.2.11. CueRefCodecState Element 4913 name: "CueRefCodecState" 4915 path: "0*1(\Segment\Cues\CuePoint\CueTrackPositions\CueReference\CueR 4916 efCodecState)" 4918 id: "0xEB" 4920 maxOccurs: "1" 4922 default: "0" 4924 type: "uinteger" 4926 minver: "0" 4927 maxver: "0" 4929 definition: The Segment Position of the Codec State corresponding to 4930 this referenced Element. 0 means that the data is taken from the 4931 initial Track Entry. 4933 9.3.6. Attachments Element 4935 name: "Attachments" 4937 path: "0*1(\Segment\Attachments)" 4939 id: "0x1941A469" 4941 maxOccurs: "1" 4943 type: "master" 4945 definition: Contain attached files. 4947 9.3.6.1. AttachedFile Element 4949 name: "AttachedFile" 4951 path: "1*(\Segment\Attachments\AttachedFile)" 4953 id: "0x61A7" 4955 minOccurs: "1" 4957 type: "master" 4959 definition: An attached file. 4961 9.3.6.1.1. FileDescription Element 4963 name: "FileDescription" 4965 path: "0*1(\Segment\Attachments\AttachedFile\FileDescription)" 4967 id: "0x467E" 4969 maxOccurs: "1" 4971 type: "utf-8" 4973 definition: A human-friendly name for the attached file. 4975 9.3.6.1.2. FileName Element 4977 name: "FileName" 4979 path: "1*1(\Segment\Attachments\AttachedFile\FileName)" 4981 id: "0x466E" 4983 minOccurs: "1" 4985 maxOccurs: "1" 4987 type: "utf-8" 4989 definition: Filename of the attached file. 4991 9.3.6.1.3. FileMimeType Element 4993 name: "FileMimeType" 4995 path: "1*1(\Segment\Attachments\AttachedFile\FileMimeType)" 4997 id: "0x4660" 4999 minOccurs: "1" 5001 maxOccurs: "1" 5003 type: "string" 5005 definition: MIME type of the file. 5007 9.3.6.1.4. FileData Element 5009 name: "FileData" 5011 path: "1*1(\Segment\Attachments\AttachedFile\FileData)" 5013 id: "0x465C" 5015 minOccurs: "1" 5017 maxOccurs: "1" 5019 type: "binary" 5021 definition: The data of the file. 5023 9.3.6.1.5. FileUID Element 5025 name: "FileUID" 5027 path: "1*1(\Segment\Attachments\AttachedFile\FileUID)" 5029 id: "0x46AE" 5031 minOccurs: "1" 5033 maxOccurs: "1" 5035 range: "not 0" 5037 type: "uinteger" 5039 definition: Unique ID representing the file, as random as possible. 5041 9.3.6.1.6. FileReferral Element 5043 name: "FileReferral" 5045 path: "0*1(\Segment\Attachments\AttachedFile\FileReferral)" 5047 id: "0x4675" 5049 maxOccurs: "1" 5051 type: "binary" 5053 minver: "0" 5055 maxver: "0" 5057 definition: A binary value that a track/codec can refer to when the 5058 attachment is needed. 5060 9.3.6.1.7. FileUsedStartTime Element 5062 name: "FileUsedStartTime" 5064 path: "0*1(\Segment\Attachments\AttachedFile\FileUsedStartTime)" 5066 id: "0x4661" 5068 maxOccurs: "1" 5070 type: "uinteger" 5071 minver: "0" 5073 maxver: "0" 5075 definition: DivX font extension 5077 9.3.6.1.8. FileUsedEndTime Element 5079 name: "FileUsedEndTime" 5081 path: "0*1(\Segment\Attachments\AttachedFile\FileUsedEndTime)" 5083 id: "0x4662" 5085 maxOccurs: "1" 5087 type: "uinteger" 5089 minver: "0" 5091 maxver: "0" 5093 definition: DivX font extension 5095 9.3.7. Chapters Element 5097 name: "Chapters" 5099 path: "0*1(\Segment\Chapters)" 5101 id: "0x1043A770" 5103 maxOccurs: "1" 5105 type: "master" 5107 recurring: "1" 5109 definition: A system to define basic menus and partition data. For 5110 more detailed information, look at the Chapters Explanation. 5112 9.3.7.1. EditionEntry Element 5114 name: "EditionEntry" 5116 path: "1*(\Segment\Chapters\EditionEntry)" 5118 id: "0x45B9" 5119 minOccurs: "1" 5121 type: "master" 5123 definition: Contains all information about a Segment edition. 5125 9.3.7.1.1. EditionUID Element 5127 name: "EditionUID" 5129 path: "0*1(\Segment\Chapters\EditionEntry\EditionUID)" 5131 id: "0x45BC" 5133 maxOccurs: "1" 5135 range: "not 0" 5137 type: "uinteger" 5139 definition: A unique ID to identify the edition. It's useful for 5140 tagging an edition. 5142 9.3.7.1.2. EditionFlagHidden Element 5144 name: "EditionFlagHidden" 5146 path: "1*1(\Segment\Chapters\EditionEntry\EditionFlagHidden)" 5148 id: "0x45BD" 5150 minOccurs: "1" 5152 maxOccurs: "1" 5154 range: "0-1" 5156 default: "0" 5158 type: "uinteger" 5160 definition: If an edition is hidden (1), it SHOULD NOT be available 5161 to the user interface (but still to Control Tracks; see flag notes). 5162 (1 bit) 5164 9.3.7.1.3. EditionFlagDefault Element 5166 name: "EditionFlagDefault" 5168 path: "1*1(\Segment\Chapters\EditionEntry\EditionFlagDefault)" 5170 id: "0x45DB" 5172 minOccurs: "1" 5174 maxOccurs: "1" 5176 range: "0-1" 5178 default: "0" 5180 type: "uinteger" 5182 definition: If a flag is set (1) the edition SHOULD be used as the 5183 default one. (1 bit) 5185 9.3.7.1.4. EditionFlagOrdered Element 5187 name: "EditionFlagOrdered" 5189 path: "0*1(\Segment\Chapters\EditionEntry\EditionFlagOrdered)" 5191 id: "0x45DD" 5193 maxOccurs: "1" 5195 range: "0-1" 5197 default: "0" 5199 type: "uinteger" 5201 definition: Specify if the chapters can be defined multiple times and 5202 the order to play them is enforced. (1 bit) 5204 9.3.7.1.5. ChapterAtom Element 5206 name: "ChapterAtom" 5208 path: "1*(\Segment\Chapters\EditionEntry(1*(\ChapterAtom)))" 5210 id: "0xB6" 5211 minOccurs: "1" 5213 type: "master" 5215 definition: Contains the atom information to use as the chapter atom 5216 (apply to all tracks). 5218 9.3.7.1.5.1. ChapterUID Element 5220 name: "ChapterUID" 5222 path: "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterUID)" 5224 id: "0x73C4" 5226 minOccurs: "1" 5228 maxOccurs: "1" 5230 range: "not 0" 5232 type: "uinteger" 5234 definition: A unique ID to identify the Chapter. 5236 9.3.7.1.5.2. ChapterStringUID Element 5238 name: "ChapterStringUID" 5240 path: 5241 "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterStringUID)" 5243 id: "0x5654" 5245 maxOccurs: "1" 5247 type: "utf-8" 5249 minver: "3" 5251 definition: A unique string ID to identify the Chapter. Use for 5252 WebVTT cue identifier storage. 5254 9.3.7.1.5.3. ChapterTimeStart Element 5256 name: "ChapterTimeStart" 5257 path: 5258 "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTimeStart)" 5260 id: "0x91" 5262 minOccurs: "1" 5264 maxOccurs: "1" 5266 type: "uinteger" 5268 definition: Timestamp of the start of Chapter (not scaled). 5270 9.3.7.1.5.4. ChapterTimeEnd Element 5272 name: "ChapterTimeEnd" 5274 path: 5275 "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTimeEnd)" 5277 id: "0x92" 5279 maxOccurs: "1" 5281 type: "uinteger" 5283 definition: Timestamp of the end of Chapter (timestamp excluded, not 5284 scaled). 5286 9.3.7.1.5.5. ChapterFlagHidden Element 5288 name: "ChapterFlagHidden" 5290 path: 5291 "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterFlagHidden)" 5293 id: "0x98" 5295 minOccurs: "1" 5297 maxOccurs: "1" 5299 range: "0-1" 5301 default: "0" 5303 type: "uinteger" 5304 definition: If a chapter is hidden (1), it SHOULD NOT be available to 5305 the user interface (but still to Control Tracks; see flag notes). (1 5306 bit) 5308 9.3.7.1.5.6. ChapterFlagEnabled Element 5310 name: "ChapterFlagEnabled" 5312 path: 5313 "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterFlagEnabled)" 5315 id: "0x4598" 5317 minOccurs: "1" 5319 maxOccurs: "1" 5321 range: "0-1" 5323 default: "1" 5325 type: "uinteger" 5327 definition: Specify whether the chapter is enabled. It can be 5328 enabled/disabled by a Control Track. When disabled, the movie SHOULD 5329 skip all the content between the TimeStart and TimeEnd of this 5330 chapter (see flag notes). (1 bit) 5332 9.3.7.1.5.7. ChapterSegmentUID Element 5334 name: "ChapterSegmentUID" 5336 path: 5337 "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterSegmentUID)" 5339 id: "0x6E67" 5341 maxOccurs: "1" 5343 range: ">0" 5345 type: "binary" 5347 definition: The SegmentUID of another Segment to play during this 5348 chapter. 5350 usage notes: ChapterSegmentUID is mandatory if 5351 ChapterSegmentEditionUID is used. 5353 9.3.7.1.5.8. ChapterSegmentEditionUID Element 5355 name: "ChapterSegmentEditionUID" 5357 path: "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterSegmentE 5358 ditionUID)" 5360 id: "0x6EBC" 5362 maxOccurs: "1" 5364 range: "not 0" 5366 type: "uinteger" 5368 definition: The EditionUID to play from the Segment linked in 5369 ChapterSegmentUID. If ChapterSegmentEditionUID is undeclared then no 5370 Edition of the linked Segment is used. 5372 9.3.7.1.5.9. ChapterPhysicalEquiv Element 5374 name: "ChapterPhysicalEquiv" 5376 path: "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterPhysical 5377 Equiv)" 5379 id: "0x63C3" 5381 maxOccurs: "1" 5383 type: "uinteger" 5385 definition: Specify the physical equivalent of this ChapterAtom like 5386 "DVD" (60) or "SIDE" (50), see complete list of values. 5388 9.3.7.1.5.10. ChapterTrack Element 5390 name: "ChapterTrack" 5392 path: "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTrack)" 5394 id: "0x8F" 5396 maxOccurs: "1" 5398 type: "master" 5399 definition: List of tracks on which the chapter applies. If this 5400 Element is not present, all tracks apply 5402 9.3.7.1.5.11. ChapterTrackNumber Element 5404 name: "ChapterTrackNumber" 5406 path: "1*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterTrack\Cha 5407 pterTrackNumber)" 5409 id: "0x89" 5411 minOccurs: "1" 5413 range: "not 0" 5415 type: "uinteger" 5417 definition: UID of the Track to apply this chapter too. In the 5418 absence of a control track, choosing this chapter will select the 5419 listed Tracks and deselect unlisted tracks. Absence of this Element 5420 indicates that the Chapter SHOULD be applied to any currently used 5421 Tracks. 5423 9.3.7.1.5.12. ChapterDisplay Element 5425 name: "ChapterDisplay" 5427 path: "0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay)" 5429 id: "0x80" 5431 type: "master" 5433 definition: Contains all possible strings to use for the chapter 5434 display. 5436 9.3.7.1.5.13. ChapString Element 5438 name: "ChapString" 5440 path: "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\ 5441 ChapString)" 5443 id: "0x85" 5445 minOccurs: "1" 5446 maxOccurs: "1" 5448 type: "utf-8" 5450 definition: Contains the string to use as the chapter atom. 5452 9.3.7.1.5.14. ChapLanguage Element 5454 name: "ChapLanguage" 5456 path: "1*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\C 5457 hapLanguage)" 5459 id: "0x437C" 5461 minOccurs: "1" 5463 default: "eng" 5465 type: "string" 5467 definition: The languages corresponding to the string, in the 5468 bibliographic ISO-639-2 form. This Element MUST be ignored if the 5469 ChapLanguageIETF Element is used within the same ChapterDisplay 5470 Element. 5472 9.3.7.1.5.15. ChapLanguageIETF Element 5474 name: "ChapLanguageIETF" 5476 path: "0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\C 5477 hapLanguageIETF)" 5479 id: "0x437D" 5481 type: "string" 5483 minver: "4" 5485 definition: Specifies the language used in the ChapString according 5486 to BCP 47 and using the IANA Language Subtag Registry. If this 5487 Element is used, then any ChapLanguage Elements used in the same 5488 ChapterDisplay MUST be ignored. 5490 9.3.7.1.5.16. ChapCountry Element 5492 name: "ChapCountry" 5494 path: "0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapterDisplay\C 5495 hapCountry)" 5497 id: "0x437E" 5499 type: "string" 5501 definition: The countries corresponding to the string, same 2 octets 5502 as in Internet domains. This Element MUST be ignored if the 5503 ChapLanguageIETF Element is used within the same ChapterDisplay 5504 Element. 5506 9.3.7.1.5.17. ChapProcess Element 5508 name: "ChapProcess" 5510 path: "0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess)" 5512 id: "0x6944" 5514 type: "master" 5516 definition: Contains all the commands associated to the Atom. 5518 9.3.7.1.5.18. ChapProcessCodecID Element 5520 name: "ChapProcessCodecID" 5522 path: "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\Cha 5523 pProcessCodecID)" 5525 id: "0x6955" 5527 minOccurs: "1" 5529 maxOccurs: "1" 5531 default: "0" 5533 type: "uinteger" 5535 definition: Contains the type of the codec used for the processing. 5536 A value of 0 means native Matroska processing (to be defined), a 5537 value of 1 means the DVD command set is used. More codec IDs can be 5538 added later. 5540 9.3.7.1.5.19. ChapProcessPrivate Element 5542 name: "ChapProcessPrivate" 5544 path: "0*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\Cha 5545 pProcessPrivate)" 5547 id: "0x450D" 5549 maxOccurs: "1" 5551 type: "binary" 5553 definition: Some optional data attached to the ChapProcessCodecID 5554 information. For ChapProcessCodecID = 1, it is the "DVD level" 5555 equivalent. 5557 9.3.7.1.5.20. ChapProcessCommand Element 5559 name: "ChapProcessCommand" 5561 path: "0*(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\Chap 5562 ProcessCommand)" 5564 id: "0x6911" 5566 type: "master" 5568 definition: Contains all the commands associated to the Atom. 5570 9.3.7.1.5.21. ChapProcessTime Element 5572 name: "ChapProcessTime" 5574 path: "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\Cha 5575 pProcessCommand\ChapProcessTime)" 5577 id: "0x6922" 5579 minOccurs: "1" 5581 maxOccurs: "1" 5583 type: "uinteger" 5584 definition: Defines when the process command SHOULD be handled 5586 restrictions: 5588 +-------+-------------------------------+ 5589 | value | label | 5590 +-------+-------------------------------+ 5591 | "0" | during the whole chapter | 5592 | "1" | before starting playback | 5593 | "2" | after playback of the chapter | 5594 +-------+-------------------------------+ 5596 9.3.7.1.5.22. ChapProcessData Element 5598 name: "ChapProcessData" 5600 path: "1*1(\Segment\Chapters\EditionEntry\ChapterAtom\ChapProcess\Cha 5601 pProcessCommand\ChapProcessData)" 5603 id: "0x6933" 5605 minOccurs: "1" 5607 maxOccurs: "1" 5609 type: "binary" 5611 definition: Contains the command information. The data SHOULD be 5612 interpreted depending on the ChapProcessCodecID value. For 5613 ChapProcessCodecID = 1, the data correspond to the binary DVD cell 5614 pre/post commands. 5616 9.3.8. Tags Element 5618 name: "Tags" 5620 path: "0*(\Segment\Tags)" 5622 id: "0x1254C367" 5624 type: "master" 5626 definition: Element containing metadata describing Tracks, Editions, 5627 Chapters, Attachments, or the Segment as a whole. A list of valid 5628 tags can be found here. 5630 9.3.8.1. Tag Element 5632 name: "Tag" 5634 path: "1*(\Segment\Tags\Tag)" 5636 id: "0x7373" 5638 minOccurs: "1" 5640 type: "master" 5642 definition: A single metadata descriptor. 5644 9.3.8.1.1. Targets Element 5646 name: "Targets" 5648 path: "1*1(\Segment\Tags\Tag\Targets)" 5650 id: "0x63C0" 5652 minOccurs: "1" 5654 maxOccurs: "1" 5656 type: "master" 5658 definition: Specifies which other elements the metadata represented 5659 by the Tag applies to. If empty or not present, then the Tag 5660 describes everything in the Segment. 5662 9.3.8.1.1.1. TargetTypeValue Element 5664 name: "TargetTypeValue" 5666 path: "0*1(\Segment\Tags\Tag\Targets\TargetTypeValue)" 5668 id: "0x68CA" 5670 maxOccurs: "1" 5672 default: "50" 5674 type: "uinteger" 5676 definition: A number to indicate the logical level of the target. 5678 restrictions: 5680 +-------+----------------------+------------------------------------+ 5681 | value | label | documentation | 5682 +-------+----------------------+------------------------------------+ 5683 | "70" | COLLECTION | The highest hierarchical level | 5684 | | | that tags can describe. | 5685 | "60" | EDITION / ISSUE / | A list of lower levels grouped | 5686 | | VOLUME / OPUS / | together. | 5687 | | SEASON / SEQUEL | | 5688 | "50" | ALBUM / OPERA / | The most common grouping level of | 5689 | | CONCERT / MOVIE / | music and video (equals to an | 5690 | | EPISODE / CONCERT | episode for TV series). | 5691 | "40" | PART / SESSION | When an album or episode has | 5692 | | | different logical parts. | 5693 | "30" | TRACK / SONG / | The common parts of an album or | 5694 | | CHAPTER | movie. | 5695 | "20" | SUBTRACK / PART / | Corresponds to parts of a track | 5696 | | MOVEMENT / SCENE | for audio (like a movement). | 5697 | "10" | SHOT | The lowest hierarchy found in | 5698 | | | music or movies. | 5699 +-------+----------------------+------------------------------------+ 5701 9.3.8.1.1.2. TargetType Element 5703 name: "TargetType" 5705 path: "0*1(\Segment\Tags\Tag\Targets\TargetType)" 5707 id: "0x63CA" 5709 maxOccurs: "1" 5711 type: "string" 5713 definition: An informational string that can be used to display the 5714 logical level of the target like "ALBUM", "TRACK", "MOVIE", 5715 "CHAPTER", etc (see TargetType). 5717 restrictions: 5719 +--------------+------------+ 5720 | value | label | 5721 +--------------+------------+ 5722 | "COLLECTION" | COLLECTION | 5723 | "EDITION" | EDITION | 5724 | "ISSUE" | ISSUE | 5725 | "VOLUME" | VOLUME | 5726 | "OPUS" | OPUS | 5727 | "SEASON" | SEASON | 5728 | "SEQUEL" | SEQUEL | 5729 | "ALBUM" | ALBUM | 5730 | "OPERA" | OPERA | 5731 | "CONCERT" | CONCERT | 5732 | "MOVIE" | MOVIE | 5733 | "EPISODE" | EPISODE | 5734 | "PART" | PART | 5735 | "SESSION" | SESSION | 5736 | "TRACK" | TRACK | 5737 | "SONG" | SONG | 5738 | "CHAPTER" | CHAPTER | 5739 | "SUBTRACK" | SUBTRACK | 5740 | "PART" | PART | 5741 | "MOVEMENT" | MOVEMENT | 5742 | "SCENE" | SCENE | 5743 | "SHOT" | SHOT | 5744 +--------------+------------+ 5746 9.3.8.1.1.3. TagTrackUID Element 5748 name: "TagTrackUID" 5750 path: "0*(\Segment\Tags\Tag\Targets\TagTrackUID)" 5752 id: "0x63C5" 5754 default: "0" 5756 type: "uinteger" 5758 definition: A unique ID to identify the Track(s) the tags belong to. 5759 If the value is 0 at this level, the tags apply to all tracks in the 5760 Segment. 5762 9.3.8.1.1.4. TagEditionUID Element 5764 name: "TagEditionUID" 5766 path: "0*(\Segment\Tags\Tag\Targets\TagEditionUID)" 5767 id: "0x63C9" 5769 default: "0" 5771 type: "uinteger" 5773 definition: A unique ID to identify the EditionEntry(s) the tags 5774 belong to. If the value is 0 at this level, the tags apply to all 5775 editions in the Segment. 5777 9.3.8.1.1.5. TagChapterUID Element 5779 name: "TagChapterUID" 5781 path: "0*(\Segment\Tags\Tag\Targets\TagChapterUID)" 5783 id: "0x63C4" 5785 default: "0" 5787 type: "uinteger" 5789 definition: A unique ID to identify the Chapter(s) the tags belong 5790 to. If the value is 0 at this level, the tags apply to all chapters 5791 in the Segment. 5793 9.3.8.1.1.6. TagAttachmentUID Element 5795 name: "TagAttachmentUID" 5797 path: "0*(\Segment\Tags\Tag\Targets\TagAttachmentUID)" 5799 id: "0x63C6" 5801 default: "0" 5803 type: "uinteger" 5805 definition: A unique ID to identify the Attachment(s) the tags belong 5806 to. If the value is 0 at this level, the tags apply to all the 5807 attachments in the Segment. 5809 9.3.8.1.2. SimpleTag Element 5811 name: "SimpleTag" 5813 path: "1*(\Segment\Tags\Tag(1*(\SimpleTag)))" 5814 id: "0x67C8" 5816 minOccurs: "1" 5818 type: "master" 5820 definition: Contains general information about the target. 5822 9.3.8.1.2.1. TagName Element 5824 name: "TagName" 5826 path: "1*1(\Segment\Tags\Tag\SimpleTag\TagName)" 5828 id: "0x45A3" 5830 minOccurs: "1" 5832 maxOccurs: "1" 5834 type: "utf-8" 5836 definition: The name of the Tag that is going to be stored. 5838 9.3.8.1.2.2. TagLanguage Element 5840 name: "TagLanguage" 5842 path: "1*1(\Segment\Tags\Tag\SimpleTag\TagLanguage)" 5844 id: "0x447A" 5846 minOccurs: "1" 5848 maxOccurs: "1" 5850 default: "und" 5852 type: "string" 5854 definition: Specifies the language of the tag specified, in the 5855 Matroska languages form. This Element MUST be ignored if the 5856 TagLanguageIETF Element is used within the same SimpleTag Element. 5858 9.3.8.1.2.3. TagLanguageIETF Element 5860 name: "TagLanguageIETF" 5862 path: "0*1(\Segment\Tags\Tag\SimpleTag\TagLanguageIETF)" 5864 id: "0x447B" 5866 maxOccurs: "1" 5868 type: "string" 5870 minver: "4" 5872 definition: Specifies the language used in the TagString according to 5873 BCP 47 and using the IANA Language Subtag Registry. If this Element 5874 is used, then any TagLanguage Elements used in the same SimpleTag 5875 MUST be ignored. 5877 9.3.8.1.2.4. TagDefault Element 5879 name: "TagDefault" 5881 path: "1*1(\Segment\Tags\Tag\SimpleTag\TagDefault)" 5883 id: "0x4484" 5885 minOccurs: "1" 5887 maxOccurs: "1" 5889 range: "0-1" 5891 default: "1" 5893 type: "uinteger" 5895 definition: A boolean value to indicate if this is the default/ 5896 original language to use for the given tag. 5898 9.3.8.1.2.5. TagString Element 5900 name: "TagString" 5902 path: "0*1(\Segment\Tags\Tag\SimpleTag\TagString)" 5904 id: "0x4487" 5905 maxOccurs: "1" 5907 type: "utf-8" 5909 definition: The value of the Tag. 5911 9.3.8.1.2.6. TagBinary Element 5913 name: "TagBinary" 5915 path: "0*1(\Segment\Tags\Tag\SimpleTag\TagBinary)" 5917 id: "0x4485" 5919 maxOccurs: "1" 5921 type: "binary" 5923 definition: The values of the Tag if it is binary. Note that this 5924 cannot be used in the same SimpleTag as TagString. 5926 10. Matroska Element Ordering 5928 Except for the "EBML Header" and the "CRC-32 Element", the EBML 5929 specification does not require any particular storage order for 5930 "Elements". The Matroska specification however defines mandates and 5931 recommendations for ordering certain "Elements" in order to 5932 facilitate better playback, seeking, and editing efficiency. This 5933 section describes and offers rationale for ordering requirements and 5934 recommendations for Matroska. 5936 10.1. Top-Level Elements 5938 The "Info Element" is the only REQUIRED "Top-Level Element" in a 5939 Matroska file. To be playable, Matroska MUST also contain at least 5940 one "Tracks Element" and "Cluster Element". The first "Info Element" 5941 and the first "Tracks Element" MUST either be stored before the first 5942 "Cluster Element" or both SHALL be referenced by a "SeekHead Element" 5943 occurring before the first "Cluster Element". 5945 It is possible to edit a Matroska file after it has been created. 5946 For example, chapters, tags or attachments can be added. When new 5947 "Top-Level Elements" are added to a Matroska file, the "SeekHead" 5948 Element(s) MUST be updated so that the "SeekHead" Element(s) itemize 5949 the identity and position of all "Top-Level Elements". Editing, 5950 removing, or adding "Elements" to a Matroska file often requires that 5951 some existing "Elements" be voided or extended; therefore, it is 5952 RECOMMENDED to use "Void Elements" as padding in between "Top-Level 5953 Elements". 5955 10.2. CRC-32 5957 As noted by the EBML specification, if a "CRC-32 Element" is used 5958 then the "CRC-32 Element" MUST be the first ordered "Element" within 5959 its "Parent Element". The Matroska specification recommends that 5960 "CRC-32 Elements" SHOULD NOT be used as an immediate "Child Element" 5961 of the "Segment Element"; however all "Top-Level Elements" of an 5962 "EBML Document" SHOULD include a "CRC-32 Element" as a "Child 5963 Element". 5965 10.3. SeekHead 5967 If used, the first "SeekHead Element" SHOULD be the first non-"CRC-32 5968 Child Element" of the "Segment Element". If a second "SeekHead 5969 Element" is used, then the first "SeekHead Element" MUST reference 5970 the identity and position of the second "SeekHead". Additionally, 5971 the second "SeekHead Element" MUST only reference "Cluster" Elements 5972 and not any other "Top-Level Element" already contained within the 5973 first "SeekHead Element". The second "SeekHead Element" MAY be 5974 stored in any order relative to the other "Top-Level Elements." 5975 Whether one or two "SeekHead Element(s)" are used, the "SeekHead 5976 Element(s)" MUST collectively reference the identity and position of 5977 all "Top-Level Elements" except for the first "SeekHead Element". 5979 It is RECOMMENDED that the first "SeekHead Element" be followed by a 5980 "Void Element" to allow for the "SeekHead Element" to be expanded to 5981 cover new "Top-Level Elements" that could be added to the Matroska 5982 file, such as "Tags", "Chapters" and "Attachments Elements". 5984 10.4. Cues (index) 5986 The "Cues Element" is RECOMMENDED to optimize seeking access in 5987 Matroska. It is programmatically simpler to add the "Cues Element" 5988 after all "Cluster Elements" have been written because this does not 5989 require a prediction of how much space to reserve before writing the 5990 "Cluster Elements". However, storing the "Cues Element" before the 5991 "Cluster Elements" can provide some seeking advantages. If the "Cues 5992 Element" is present, then it SHOULD either be stored before the first 5993 "Cluster Element" or be referenced by a "SeekHead Element". 5995 10.5. Info 5997 The first "Info Element" SHOULD occur before the first "Tracks 5998 Element" and first "Cluster Element" except when referenced by a 5999 "SeekHead Element". 6001 10.6. Chapters Element 6003 The "Chapters Element" SHOULD be placed before the "Cluster 6004 Element(s)". The "Chapters Element" can be used during playback even 6005 if the user does not need to seek. It immediately gives the user 6006 information about what section is being read and what other sections 6007 are available. In the case of Ordered Chapters it RECOMMENDED to 6008 evaluate the logical linking even before playing. The "Chapters 6009 Element" SHOULD be placed before the first "Tracks Element" and after 6010 the first "Info Element". 6012 10.7. Attachments 6014 The "Attachments Element" is not intended to be used by default when 6015 playing the file, but could contain information relevant to the 6016 content, such as cover art or fonts. Cover art is useful even before 6017 the file is played and fonts could be needed before playback starts 6018 for initialization of subtitles. The "Attachments Element" MAY be 6019 placed before the first "Cluster Element"; however if the 6020 "Attachments Element" is likely to be edited, then it SHOULD be 6021 placed after the last "Cluster Element". 6023 10.8. Tags 6025 The "Tags Element" is most subject to changes after the file was 6026 originally created. For easier editing, the "Tags Element" SHOULD be 6027 placed at the end of the "Segment Element", even after the 6028 "Attachments Element". On the other hand, it is inconvenient to have 6029 to seek in the "Segment" for tags, especially for network streams. 6030 So it's better if the "Tags Element" is found early in the stream. 6031 When editing the "Tags Element", the original "Tags Element" at the 6032 beginning can be overwritten with a "Void Element" and a new "Tags 6033 Element" written at the end of the "Segment Element". The file size 6034 will only marginally change. 6036 10.9. Optimum layout from a muxer 6038 o SeekHead 6040 o Info 6042 o Tracks 6044 o Chapters 6046 o Attachments 6048 o Tags 6049 o Clusters 6051 o Cues 6053 10.10. Optimum layout after editing tags 6055 o SeekHead 6057 o Info 6059 o Tracks 6061 o Chapters 6063 o Attachments 6065 o Void 6067 o Clusters 6069 o Cues 6071 o Tags 6073 10.11. Optimum layout with Cues at the front 6075 o SeekHead 6077 o Info 6079 o Tracks 6081 o Chapters 6083 o Attachments 6085 o Tags 6087 o Cues 6089 o Clusters 6091 10.12. Cluster Timestamp 6093 The "Timestamp Element" MUST occur as in storage order before any 6094 "SimpleBlock", "BlockGroup", or "EncryptedBlock" within the "Cluster 6095 Element". 6097 11. Chapters 6099 11.1. Edition and Chapter Flags 6101 11.1.1. Chapter Flags 6103 Two "Chapter Flags" are defined to describe the behavior of the 6104 "ChapterAtom Element": "ChapterFlagHidden" and "ChapterFlagEnabled". 6106 If a "ChapterAtom Element" is the "Child Element" of another 6107 "ChapterAtom Element" with a "Chapter Flag" set to "true", then the 6108 "Child ChapterAtom Element" MUST be interpreted as having its same 6109 "Chapter Flag" set to "true". If a "ChapterAtom Element" is the 6110 "Child Element" of another "ChapterAtom Element" with a "Chapter 6111 Flag" set to "false" or if the "ChapterAtom Element" does not have a 6112 "ChapterAtom Element" as its "Parent Element", then it MUST be 6113 interpreted according to its own "Chapter Flag". 6115 As an example, consider a "Parent ChapterAtom Element" that has its 6116 "ChapterFlagHidden" set to "true" and also contains two child 6117 "ChapterAtoms", the first with "ChapterFlagHidden" set to "true" and 6118 the second with "ChapterFlagHidden" either set to "false" or not 6119 present at all (in which case the default value of the Element 6120 applies, which is "false"). Since the parent "ChapterAtom" has its 6121 "ChapterFlagHidden" set to "true" then all of its children 6122 "ChapterAtoms" MUST also be interpreted as if their 6123 "ChapterFlagHidden" is also set to "true". However, if a "Control 6124 Track" toggles the parent's "ChapterFlagHidden" flag to "false", then 6125 only the parent "ChapterAtom" and its second child "ChapterAtom" MUST 6126 be interpreted as if "ChapterFlagHidden" is set to "false". The 6127 first child "ChapterAtom" which has the "ChapterFlagHidden" flag set 6128 to "true" retains its value until its value is toggled to "false" by 6129 a "Control Track". 6131 11.1.2. Edition Flags 6133 Three "Edition Flags" are defined to describe the behavior of the 6134 "EditionEntry Element": "EditionFlagHidden", "EditionFlagDefault" and 6135 "EditionFlagOrdered". 6137 11.1.2.1. EditionFlagHidden 6139 The "EditionFlagHidden Flag" behaves similarly to the 6140 "ChapterFlagHidden Flag": if "EditionFlagHidden" is set to "true", 6141 its "Child ChapterAtoms Elements" MUST also be interpreted as if 6142 their "ChapterFlagHidden" is also set to "true", regardless of their 6143 own "ChapterFlagHidden Flags". If "EditionFlagHidden" is toggled by 6144 a "Control Track" to "false", the "ChapterFlagHidden Flags" of the 6145 "Child ChapterAtoms Elements" SHALL determine whether the 6146 "ChapterAtom" is hidden or not. 6148 11.1.2.2. EditionFlagDefault 6150 It is RECOMMENDED that no more than one "Edition" have an 6151 "EditionFlagDefault Flag" set to "true". The first "Edition" with 6152 both the "EditionFlagDefault Flag" set to "true" and the 6153 "EditionFlagHidden Flag" set to "false" is the "Default Edition". 6154 When all "EditionFlagDefault Flags" are set to "false", then the 6155 first "Edition" is the "Default Edition". 6157 11.1.2.3. EditionFlagOrdered 6159 The "EditionFlagOrdered Flag" is a significant feature as it enables 6160 an "Edition" of "Ordered Chapters" which defines and arranges a 6161 virtual timeline rather than simply labeling points within the 6162 timeline. For example, with "Editions" of "Ordered Chapters" a 6163 single "Matroska file" can present multiple edits of a film without 6164 duplicating content. Alternatively if a videotape is digitized in 6165 full, one "Ordered Edition" could present the full content (including 6166 colorbars, countdown, slate, a feature presentation, and black 6167 frames), while another "Edition" of "Ordered Chapters" can use 6168 "Chapters" that only mark the intended presentation with the 6169 colorbars and other ancillary visual information excluded. If an 6170 "Edition" of "Ordered Chapters" is enabled then the "Matroska Player" 6171 MUST play those Chapters in their stored order from the timestamp 6172 marked in the "ChapterTimeStart Element" to the timestamp marked in 6173 to "ChapterTimeEnd Element". 6175 If the "EditionFlagOrdered Flag" is set to "false", "Simple Chapters" 6176 are used and only the "ChapterTimeStart" of a "Chapter" is used as 6177 chapter mark to jump to the predefined point in the timeline. With 6178 "Simple Chapters", a "Matroska Player" MUST ignore certain "Chapter 6179 Elements". All these elements are now informational only. 6181 The following list shows the different usage of "Chapter Elements" 6182 between an ordered and non-ordered "Edition". 6184 Chapter elements / ordered Edition | False | True ChapterUID | X | X 6185 ChapterStringUID | X | X ChapterTimeStart | X | X ChapterTimeEnd | 6186 - | X ChapterFlagHidden | X | X ChapterFlagEnabled | X | X 6187 ChapterSegmentUID | - | X ChapterSegmentEditionUID | - | X 6188 ChapterPhysicalEquiv | X | X ChapterTrack | - | X ChapterDisplay | 6189 X | X ChapProcess | - | X 6191 Furthermore there are other EBML "Elements" which could be used if 6192 the "EditionFlagOrdered Flag" is set to "true". 6194 Other elements / ordered Edition | False | True Info/SegmentFamily | 6195 - | X Info/ChapterTranslate | - | X Track/TrackTranslate | - | X 6197 These other "Elements" belong to the Matroska DVD menu system and are 6198 only used when the "ChapProcessCodecID Element" is set to 1. 6200 11.1.2.3.1. Ordered-Edition and Matroska Segment-Linking 6202 o Hard Linking: "Ordered-Chapters" supersedes the "Hard Linking". 6204 o Soft Linking: In this complex system "Ordered Chapters" are 6205 REQUIRED and a "Chapter CODEC" MUST interpret the "ChapProcess" of 6206 all chapters. 6208 o Medium Linking: "Ordered Chapters" are used in a normal way and 6209 can be combined with the "ChapterSegmentUID" element which 6210 establishes a link to another Matroska file/Segment. 6212 See Section 24) for more information about "Hard Linking", "Soft 6213 Linking" and "Medium Linking". 6215 11.2. Menu features 6217 The menu features are handled like a _chapter codec_. That means each 6218 codec has a type, some private data and some data in the chapters. 6220 The type of the menu system is defined by the "ChapProcessCodecID" 6221 parameter. For now only 2 values are supported : 0 matroska script, 6222 1 menu borrowed from the DVD. The private data depend on the type of 6223 menu system (stored in ChapProcessPrivate), idem for the data in the 6224 chapters (stored in ChapProcessData). 6226 11.2.1. Matroska Script (0) 6228 This is the case when "ChapProcessCodecID" = 0. This is a script 6229 language build for Matroska purposes. The inspiration comes from 6230 ActionScript, javascript and other similar scripting languages. The 6231 commands are stored as text commands, in UTF-8. The syntax is C 6232 like, with commands spanned on many lines, each terminating with a 6233 ";". You can also include comments at the end of lines with "//" or 6234 comment many lines using "/* */". The scripts are stored in 6235 ChapProcessData. For the moment ChapProcessPrivate is not used. 6237 The one and only command existing for the moment is "GotoAndPlay( 6238 ChapterUID );". As the same suggests, it means that when this 6239 command is encountered, the "Matroska Player" SHOULD jump to the 6240 "Chapter" specified by the UID and play it. 6242 11.2.2. DVD menu (1) 6244 This is the case when "ChapProcessCodecID" = 1. Each level of a 6245 chapter corresponds to a logical level in the DVD system that is 6246 stored in the first octet of the ChapProcessPrivate. This DVD 6247 hierarchy is as follows: 6249 ChapProcessPrivate | DVD Name | Hierarchy | Commands Possible | 6250 Comment 0x30 | SS | DVD domain | - | First Play, Video Manager, Video 6251 Title 0x2A | LU | Language Unit | - | Contains only PGCs 0x28 | TT | 6252 Title | - | Contains only PGCs 0x20 | PGC | Program Group Chain 6253 (PGC) | * | 0x18 | PG | Program 1 / Program 2 / Program 3 | - | 6254 0x10 | PTT | Part Of Title 1 / Part Of Title 2 | - | Equivalent to 6255 the chapters on the sleeve. 0x08 | CN | Cell 1 / Cell 2 / Cell 3 / 6256 Cell 4 / Cell 5 / Cell 6 | - | 6258 You can also recover wether a Segment is a Video Manager (VMG), Video 6259 Title Set (VTS) or Video Title Set Menu (VTSM) from the 6260 ChapterTranslateID element found in the Segment Info. This field 6261 uses 2 octets as follows: 6263 1. Domain Type: 0 for VMG, the domain number for VTS and VTSM 6265 2. Domain Value: 0 for VMG and VTSM, 1 for the VTS source. 6267 For instance, the menu part from VTS_01_0.VOB would be coded [1,0] 6268 and the content part from VTS_02_3.VOB would be [2,1]. The VMG is 6269 always [0,0] 6271 The following octets of ChapProcessPrivate are as follows: 6273 Octet 1 | DVD Name | Following Octets 0x30 | SS | Domain name code 6274 (1: 0x00= First play, 0xC0= VMG, 0x40= VTSM, 0x80= VTS) + VTS(M) 6275 number (2) 0x2A | LU | Language code (2) + Language extension (1) 6276 0x28 | TT | global Title number (2) + corresponding TTN of the VTS 6277 (1) 0x20 | PGC | PGC number (2) + Playback Type (1) + Disabled User 6278 Operations (4) 0x18 | PG | Program number (2) 0x10 | PTT | PTT- 6279 chapter number (1) 0x08 | CN | Cell number [VOB ID(2)][Cell 6280 ID(1)][Angle Num(1)] 6282 If the level specified in ChapProcessPrivate is a PGC (0x20), there 6283 is an octet called the Playback Type, specifying the kind of PGC 6284 defined: 6286 o 0x00: entry only/basic PGC 6288 o 0x82: Title+Entry Menu (only found in the Video Manager domain) 6289 o 0x83: Root Menu (only found in the VTSM domain) 6291 o 0x84: Subpicture Menu (only found in the VTSM domain) 6293 o 0x85: Audio Menu (only found in the VTSM domain) 6295 o 0x86: Angle Menu (only found in the VTSM domain) 6297 o 0x87: Chapter Menu (only found in the VTSM domain) 6299 The next 4 following octets correspond to the User Operation flags 6300 [17] in the standard PGC. When a bit is set, the command SHOULD be 6301 disabled. 6303 ChapProcessData contains the pre/post/cell commands in binary format 6304 as there are stored on a DVD. There is just an octet preceding these 6305 data to specify the number of commands in the element. As follows: 6306 [# of commands(1)][command 1 (8)][command 2 (8)][command 3 (8)]. 6308 More information on the DVD commands and format on DVD-replica [18], 6309 where we got most of the info about it. You can also get information 6310 on DVD from the DVDinfo project [19]. 6312 11.3. Example 1 : basic chaptering 6314 In this example a movie is split in different chapters. It could 6315 also just be an audio file (album) on which each track corresponds to 6316 a chapter. 6318 o 00000ms - 05000ms : Intro 6320 o 05000ms - 25000ms : Before the crime 6322 o 25000ms - 27500ms : The crime 6324 o 27500ms - 38000ms : The killer arrested 6326 o 38000ms - 43000ms : Credits 6328 This would translate in the following matroska form : 6330 6331 6332 16603393396715046047 6333 6334 1193046 6335 0 6336 5000000000 6337 6338 Intro 6339 eng 6340 6341 0 6342 1 6343 6344 6345 2311527 6346 5000000000 6347 25000000000 6348 6349 Before the crime 6350 eng 6351 6352 6353 Avant le crime 6354 fra 6355 6356 0 6357 1 6358 6359 6360 3430008 6361 25000000000 6362 27500000000 6363 6364 The crime 6365 eng 6366 6367 6368 Le crime 6369 fra 6370 6371 0 6372 1 6373 6374 6375 4548489 6376 27500000000 6377 38000000000 6378 6379 After the crime 6380 eng 6381 6382 6383 Apres le crime 6384 fra 6386 6387 0 6388 1 6389 6390 6391 5666960 6392 38000000000 6393 43000000000 6394 6395 Credits 6396 eng 6397 6398 6399 Generique 6400 fra 6401 6402 0 6403 1 6404 6405 0 6406 0 6407 6408 6410 11.4. Example 2 : nested chapters 6412 In this example an (existing) album is split into different chapters, 6413 and one of them contain another splitting. 6415 11.4.1. The Micronauts "Bleep To Bleep" 6417 o 00:00 - 12:28 : Baby Wants To Bleep/Rock 6419 * 00:00 - 04:38 : Baby wants to bleep (pt.1) 6421 * 04:38 - 07:12 : Baby wants to rock 6423 * 07:12 - 10:33 : Baby wants to bleep (pt.2) 6425 * 10:33 - 12:28 : Baby wants to bleep (pt.3) 6427 o 12:30 - 19:38 : Bleeper_O+2 6429 o 19:40 - 22:20 : Baby wants to bleep (pt.4) 6431 o 22:22 - 25:18 : Bleep to bleep 6433 o 25:20 - 33:35 : Baby wants to bleep (k) 6434 o 33:37 - 44:28 : Bleeper 6436 6437 6438 1281690858003401414 6439 6440 1 6441 0 6442 748000000 6443 6444 Baby wants to Bleep/Rock 6445 eng 6446 6447 6448 2 6449 0 6450 278000000 6451 6452 Baby wants to bleep (pt.1) 6453 eng 6454 6455 0 6456 1 6457 6458 6459 3 6460 278000000 6461 432000000 6462 6463 Baby wants to rock 6464 eng 6465 6466 0 6467 1 6468 6469 6470 4 6471 432000000 6472 633000000 6473 6474 Baby wants to bleep (pt.2) 6475 eng 6476 6477 0 6478 1 6479 6480 6481 5 6482 633000000 6483 748000000 6484 6485 Baby wants to bleep (pt.3) 6486 eng 6487 6488 0 6489 1 6490 6491 0 6492 1 6493 6494 6495 6 6496 750000000 6497 1178500000 6498 6499 Bleeper_O+2 6500 eng 6501 6502 0 6503 1 6504 6505 6506 7 6507 1180500000 6508 1340000000 6509 6510 Baby wants to bleep (pt.4) 6511 eng 6512 6513 0 6514 1 6515 6516 6517 8 6518 1342000000 6519 1518000000 6520 6521 Bleep to bleep 6522 eng 6523 6524 0 6525 1 6526 6527 6528 9 6529 1520000000 6530 2015000000 6531 6532 Baby wants to bleep (k) 6533 eng 6534 6535 0 6536 1 6537 6538 6539 10 6540 2017000000 6541 2668000000 6542 6543 Bleeper 6544 eng 6545 6546 0 6547 1 6548 6549 0 6550 0 6551 6552 6554 12. Attachments 6556 Matroska supports storage of related files and data in the 6557 "Attachments Element" (a "Top-Level Element"). "Attachment Elements" 6558 can be used to store related cover art, font files, transcripts, 6559 reports, error recovery files, picture or text-based annotations, 6560 copies of specifications, or other ancillary files related to the 6561 "Segment". 6563 "Matroska Readers" MUST NOT execute files stored as "Attachment 6564 Elements". 6566 12.1. Cover Art 6568 This section defines a set of guidelines for the storage of cover art 6569 in Matroska files. A "Matroska Reader" MAY use embedded cover art to 6570 display a representational still-image depiction of the multimedia 6571 contents of the Matroska file. 6573 Only JPEG and PNG image formats SHOULD be used for cover art 6574 pictures. 6576 There can be two different covers for a movie/album: a portrait style 6577 (e.g., a DVD case) and a landscape style (e.g., a wide banner ad). 6579 There can be two versions of the same cover, the "normal cover" and 6580 the "small cover". The dimension of the "normal cover" SHOULD be 600 6581 pixels on the smallest side (for example, 960x600 for landscape, 6582 600x800 for portrait, or 600x600 for square). The dimension of the 6583 "small cover" SHOULD be 120 pixels on the smallest side (for example, 6584 192x120 or 120x160). 6586 Versions of cover art can be differentiated by the filename, which is 6587 stored in the "FileName Element". The default filename of the 6588 "normal cover" in square or portrait mode is "cover.(jpg|png)". When 6589 stored, the "normal cover" SHOULD be the first Attachment in storage 6590 order. The "small cover" SHOULD be prefixed with "small_", such as 6591 "small_cover.(jpg|png)". The landscape variant SHOULD be suffixed 6592 with "_land", such as "cover_land.(jpg|png)". The filenames are case 6593 sensitive. 6595 The following table provides examples of file names for cover art in 6596 Attachments. 6598 FileName | Image Orientation | Pixel Length of Smallest Side 6599 cover.jpg | Portrait or square | 600 small_cover.png | Portrait or 6600 square | 120 cover_land.png | Landscape | 600 small_cover_land.jpg | 6601 Landscape | 120 6603 13. Cues 6605 The "Cues Element" provides an index of certain "Cluster Elements" to 6606 allow for optimized seeking to absolute timestamps within the 6607 "Segment". The "Cues Element" contains one or many "CuePoint 6608 Elements" which each MUST reference an absolute timestamp (via the 6609 "CueTime Element"), a "Track" (via the "CueTrack Element"), and a 6610 "Segment Position" (via the "CueClusterPosition Element"). 6611 Additional non-mandated Elements are part of the "CuePoint Element" 6612 such as "CueDuration", "CueRelativePosition", "CueCodecState" and 6613 others which provide any "Matroska Reader" with additional 6614 information to use in the optimization of seeking performance. 6616 13.1. Recommendations 6618 The following recommendations are provided to optimize Matroska 6619 performance. 6621 o Unless Matroska is used as a live stream, it SHOULD contain a 6622 "Cues Element". 6624 o For each video track, each keyframe SHOULD be referenced by a 6625 "CuePoint Element". 6627 o It is RECOMMENDED to not reference non-keyframes of video tracks 6628 in "Cues" unless it references a "Cluster Element" which contains 6629 a "CodecState Element" but no keyframes. 6631 o For each subtitle track present, each subtitle frame SHOULD be 6632 referenced by a "CuePoint Element" with a "CueDuration Element". 6634 o References to audio tracks MAY be skipped in "CuePoint Elements" 6635 if a video track is present. When included the "CuePoint 6636 Elements" SHOULD reference audio keyframes at most once every 500 6637 milliseconds. 6639 o If the referenced frame is not stored within the first 6640 "SimpleBlock" or first "BlockGroup" within its "Cluster Element", 6641 then the "CueRelativePosition Element" SHOULD be written to 6642 reference where in the "Cluster" the reference frame is stored. 6644 o If a "CuePoint Element" references "Cluster Element" that includes 6645 a "CodecState Element", then that "CuePoint Element" MUST use a 6646 "CueCodecState Element". 6648 o "CuePoint Elements" SHOULD be numerically sorted in storage order 6649 by the value of the "CueTime Element". 6651 14. Matroska Streaming 6653 In Matroska, there are two kinds of streaming: file access and 6654 livestreaming. 6656 14.1. File Access 6658 File access can simply be reading a file located on your computer, 6659 but also includes accessing a file from an HTTP (web) server or CIFS 6660 (Windows share) server. These protocols are usually safe from 6661 reading errors and seeking in the stream is possible. However, when 6662 a file is stored far away or on a slow server, seeking can be an 6663 expensive operation and SHOULD be avoided. The following guidelines, 6664 when followed, help reduce the number of seeking operations for 6665 regular playback and also have the playback start quickly without a 6666 lot of data needed to read first (like a "Cues Element", "Attachment 6667 Element" or "SeekHead Element"). 6669 Matroska, having a small overhead, is well suited for storing music/ 6670 videos on file servers without a big impact on the bandwidth used. 6671 Matroska does not require the index to be loaded before playing, 6672 which allows playback to start very quickly. The index can be loaded 6673 only when seeking is requested the first time. 6675 14.2. Livestreaming 6677 Livestreaming is the equivalent of television broadcasting on the 6678 internet. There are 2 families of servers for livestreaming: RTP/ 6679 RTSP and HTTP. Matroska is not meant to be used over RTP. RTP 6680 already has timing and channel mechanisms that would be wasted if 6681 doubled in Matroska. Additionally, having the same information at 6682 the RTP and Matroska level would be a source of confusion if they do 6683 not match. Livestreaming of Matroska over HTTP (or any other plain 6684 protocol based on TCP) is possible. 6686 A live Matroska stream is different from a file because it usually 6687 has no known end (only ending when the client disconnects). For 6688 this, all bits of the "size" portion of the "Segment Element" MUST be 6689 set to 1. Another option is to concatenate "Segment Elements" with 6690 known sizes, one after the other. This solution allows a change of 6691 codec/resolution between each segment. For example, this allows for 6692 a switch between 4:3 and 16:9 in a television program. 6694 When "Segment Elements" are continuous, certain "Elements", like 6695 "MetaSeek", "Cues", "Chapters", and "Attachments", MUST NOT be used. 6697 It is possible for a "Matroska Player" to detect that a stream is not 6698 seekable. If the stream has neither a "MetaSeek" list or a "Cues" 6699 list at the beginning of the stream, it SHOULD be considered non- 6700 seekable. Even though it is possible to seek blindly forward in the 6701 stream, it is NOT RECOMMENDED. 6703 In the context of live radio or web TV, it is possible to "tag" the 6704 content while it is playing. The "Tags Element" can be placed 6705 between "Clusters" each time it is necessary. In that case, the new 6706 "Tags Element" MUST reset the previously encountered "Tags Elements" 6707 and use the new values instead. 6709 15. Menu Specifications 6711 This document is a _draft of the Menu system_ that will be the 6712 default one in "Matroska". As it will just be composed of a Control 6713 Track, it will be seen as a "codec" and could be replaced later by 6714 something else if needed. 6716 A menu is like what you see on DVDs, when you have some screens to 6717 select the audio format, subtitles or scene selection. 6719 15.1. Requirements 6721 What we'll try to have is a system that can do almost everything done 6722 on a DVD, or more, or better, or drop the unused features if 6723 necessary. 6725 As the name suggests, a Control Track is a track that can control the 6726 playback of the file and/or all the playback features. To make it as 6727 simple as possible for "Matroska Players", the Control Track will 6728 just give orders to the "Matroska Player" and get the actions 6729 associated with the highlights/hotspots. 6731 15.1.1. Highlights/Hotspots 6733 A highlight is basically a rectangle/key associated with an action 6734 UID. When that rectangle/key is activated, the "Matroska Player" 6735 send the UID of the action to the Control Track handler (codec). The 6736 fact that it can also be a key means that even for audio only files, 6737 a keyboard shortcut or button panel could be used for menus. But in 6738 that case, the hotspot will have to be associated with a name to 6739 display. 6741 This highlight is sent from the Control Track to the "Matroska 6742 Player". Then the "Matroska Player" has to handle that highlight 6743 until it's deactivated (see Section 15.1.2). 6745 The highlight contains a UID of the action, a displayable name (UTF- 6746 8), an associated key (list of keys to be defined, probably 6747 up/down/left/right/select), a screen position/range and an image to 6748 display. The image will be displayed either when the user place the 6749 mouse over the rectangle (or any other shape), or when an option of 6750 the screen is selected (not activated). There could be a second 6751 image used when the option is activated. And there could be a third 6752 image that can serve as background. This way you could have a still 6753 image (like in some DVDs) for the menu and behind that image blank 6754 video (small bitrate). 6756 When a highlight is activated by the user, the "Matroska Player" has 6757 to send the UID of the action to the Control Track. Then the Control 6758 Track codec will handle the action and possibly give new orders to 6759 the "Matroska Player". 6761 The format used for storing images SHOULD be extensible. For the 6762 moment we'll use PNG and BMP, both with alpha channel. 6764 15.1.2. Playback features 6766 All the following features will be sent from the Control Track to the 6767 "Matroska Player" : 6769 o Jump to chapter (UID, prev, next, number) 6771 o Disable all tracks of a kind (audio, video, subtitle) 6773 o Enable track UID (the kind doesn't matter) 6775 o Define/Disable a highlight 6777 o Enable/Disable jumping 6779 o Enable/Disable track selection of a kind 6781 o Select Edition ID (see chapters) 6783 o Pause playback 6785 o Stop playback 6787 o Enable/Disable a Chapter UID 6789 o Hide/Unhide a Chapter UID 6791 All the actions will be written in a normal Matroska track, with a 6792 timestamp. A "Menu Frame" SHOULD be able to contain more that one 6793 action/highlight for a given timestamp. (to be determined, EBML 6794 format structure) 6796 15.1.3. Player requirements 6798 Some "Matroska Players" might not support the control track. That 6799 mean they will play the active/looped parts as part of the data. So 6800 I suggest putting the active/looped parts of a movie at the end of a 6801 movie. When a Menu-aware "Matroska Player" encounter the default 6802 Control Track of a "Matroska" file, the first order SHOULD be to jump 6803 at the start of the active/looped part of the movie. 6805 15.2. Working Graph 6807 Matroska Source file -> Control Track <-> Player. 6808 -> other tracks -> rendered 6810 16. Unknown elements 6812 Matroska is based upon the principle that a reading application does 6813 not have to support 100% of the specifications in order to be able to 6814 play the file. A Matroska file therefore contains version indicators 6815 that tell a reading application what to expect. 6817 It is possible and valid to have the version fields indicate that the 6818 file contains Matroska "Elements" from a higher specification version 6819 number while signaling that a reading application MUST only support a 6820 lower version number properly in order to play it back (possibly with 6821 a reduced feature set). For example, a reading application 6822 supporting at least Matroska version "V" reading a file whose 6823 "DocTypeReadVersion" field is equal to or lower than "V" MUST skip 6824 Matroska/EBML "Elements" it encounters but does not know about if 6825 that unknown element fits into the size constraints set by the 6826 current "Parent Element". 6828 17. Default Values 6830 The default value of an "Element" is assumed when not present in the 6831 data stream. It is assumed only in the scope of its "Parent 6832 Element". For example, the "Language Element" is in the scope of the 6833 "Track Element". If the "Parent Element" is not present or assumed, 6834 then the "Child Element" cannot be assumed. 6836 18. DefaultDecodedFieldDuration 6838 The "DefaultDecodedFieldDuration Element" can signal to the 6839 displaying application how often fields of a video sequence will be 6840 available for displaying. It can be used for both interlaced and 6841 progressive content. If the video sequence is signaled as 6842 interlaced, then the period between two successive fields at the 6843 output of the decoding process equals "DefaultDecodedFieldDuration". 6845 For video sequences signaled as progressive, it is twice the value of 6846 "DefaultDecodedFieldDuration". 6848 These values are valid at the end of the decoding process before 6849 post-processing (such as deinterlacing or inverse telecine) is 6850 applied. 6852 Examples: 6854 o Blu-ray movie: 1000000000ns/(48/1.001) = 20854167ns 6856 o PAL broadcast/DVD: 1000000000ns/(50/1.000) = 20000000ns 6857 o N/ATSC broadcast: 1000000000ns/(60/1.001) = 16683333ns 6859 o hard-telecined DVD: 1000000000ns/(60/1.001) = 16683333ns (60 6860 encoded interlaced fields per second) 6862 o soft-telecined DVD: 1000000000ns/(60/1.001) = 16683333ns (48 6863 encoded interlaced fields per second, with "repeat_first_field = 6864 1") 6866 19. Encryption 6868 Encryption in Matroska is designed in a very generic style to allow 6869 people to implement whatever form of encryption is best for them. It 6870 is possible to use the encryption framework in Matroska as a type of 6871 DRM (Digital Rights Management). 6873 Because encryption occurs within the "Block Element", it is possible 6874 to manipulate encrypted streams without decrypting them. The streams 6875 could potentially be copied, deleted, cut, appended, or any number of 6876 other possible editing techniques without decryption. The data can 6877 be used without having to expose it or go through the decrypting 6878 process. 6880 Encryption can also be layered within Matroska. This means that two 6881 completely different types of encryption can be used, requiring two 6882 separate keys to be able to decrypt a stream. 6884 Encryption information is stored in the "ContentEncodings Element" 6885 under the "ContentEncryption Element". 6887 20. Image Presentation 6889 20.1. Cropping 6891 The "PixelCrop Elements" ("PixelCropTop", "PixelCropBottom", 6892 "PixelCropRight" and "PixelCropLeft") indicate when and by how much 6893 encoded videos frames SHOULD be cropped for display. These Elements 6894 allow edges of the frame that are not intended for display, such as 6895 the sprockets of a full-frame film scan or the VANC area of a 6896 digitized analog videotape, to be stored but hidden. "PixelCropTop" 6897 and "PixelCropBottom" store an integer of how many rows of pixels 6898 SHOULD be cropped from the top and bottom of the image 6899 (respectively). "PixelCropLeft" and "PixelCropRight" store an 6900 integer of how many columns of pixels SHOULD be cropped from the left 6901 and right of the image (respectively). For example, a pillar-boxed 6902 video that stores a 1440x1080 visual image within the center of a 6903 padded 1920x1080 encoded image MAY set both "PixelCropLeft" and 6904 "PixelCropRight" to "240", so that a "Matroska Player" SHOULD crop 6905 off 240 columns of pixels from the left and right of the encoded 6906 image to present the image with the pillar-boxes hidden. 6908 20.2. Rotation 6910 The ProjectionPoseRoll Element (see Section 9.3.4.1.30.49) can be 6911 used to indicate that the image from the associated video track 6912 SHOULD be rotated for presentation. For instance, the following 6913 representation of the Projection Element Section 9.3.4.1.30.44) and 6914 the ProjectionPoseRoll Element represents a video track where the 6915 image SHOULD be presentation with a 90 degree counter-clockwise 6916 rotation. 6918 6919 90 6920 6922 21. Matroska versioning 6924 The "EBML Header" of each Matroska document informs the reading 6925 application on what version of Matroska to expect. The "Elements" 6926 within "EBML Header" with jurisdiction over this information are 6927 "DocTypeVersion" and "DocTypeReadVersion". 6929 "DocTypeVersion" MUST be equal to or greater than the highest 6930 Matroska version number of any "Element" present in the Matroska 6931 file. For example, a file using the "SimpleBlock Element" MUST have 6932 a "DocTypeVersion" equal to or greater than 2. A file containing 6933 "CueRelativePosition" Elements MUST have a "DocTypeVersion" equal to 6934 or greater than 4. 6936 The "DocTypeReadVersion" MUST contain the minimum version number that 6937 a reading application can minimally support in order to play the file 6938 back -- optionally with a reduced feature set. For example, if a 6939 file contains only "Elements" of version 2 or lower except for 6940 "CueRelativePosition" (which is a version 4 Matroska "Element"), then 6941 "DocTypeReadVersion" SHOULD still be set to 2 and not 4 because 6942 evaluating "CueRelativePosition" is not necessary for standard 6943 playback -- it makes seeking more precise if used. 6945 "DocTypeVersion" MUST always be equal to or greater than 6946 "DocTypeReadVersion". 6948 A reading application supporting Matroska version "V" MUST NOT refuse 6949 to read an application with "DocReadTypeVersion" equal to or lower 6950 than "V" even if "DocTypeVersion" is greater than "V". See also the 6951 note about Section 16. 6953 22. MIME Types 6955 There is no IETF endorsed MIME type for Matroska files. These 6956 definitions can be used: 6958 o .mka : Matroska audio "audio/x-matroska" 6960 o .mkv : Matroska video "video/x-matroska" 6962 o .mk3d : Matroska 3D video "video/x-matroska-3d" 6964 23. Segment Position 6966 The "Segment Position" of an "Element" refers to the position of the 6967 first octet of the "Element ID" of that "Element", measured in 6968 octets, from the beginning of the "Element Data" section of the 6969 containing "Segment Element". In other words, the "Segment Position" 6970 of an "Element" is the distance in octets from the beginning of its 6971 containing "Segment Element" minus the size of the "Element ID" and 6972 "Element Data Size" of that "Segment Element". The "Segment 6973 Position" of the first "Child Element" of the "Segment Element" is 0. 6974 An "Element" which is not stored within a "Segment Element", such as 6975 the "Elements" of the "EBML Header", do not have a "Segment 6976 Position". 6978 23.1. Segment Position Exception 6980 "Elements" that are defined to store a "Segment Position" MAY define 6981 reserved values to indicate a special meaning. 6983 23.2. Example of Segment Position 6985 This table presents an example of "Segment Position" by showing a 6986 hexadecimal representation of a very small Matroska file with labels 6987 to show the offsets in octets. The file contains a "Segment Element" 6988 with an "Element ID" of "0x18538067" and a "MuxingApp Element" with 6989 an "Element ID" of "0x4D80". 6991 0 1 2 6992 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 6993 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 6994 0 |1A|45|DF|A3|8B|42|82|88|6D|61|74|72|6F|73|6B|61|18|53|80|67| 6995 20 |93|15|49|A9|66|8E|4D|80|84|69|65|74|66|57|41|84|69|65|74|66| 6997 In the above example, the "Element ID" of the "Segment Element" is 6998 stored at offset 16, the "Element Data Size" of the "Segment Element" 6999 is stored at offset 20, and the "Element Data" of the "Segment 7000 Element" is stored at offset 21. 7002 The "MuxingApp Element" is stored at offset 26. Since the "Segment 7003 Position" of an "Element" is calculated by subtracting the position 7004 of the "Element Data" of the containing "Segment Element" from the 7005 position of that "Element", the "Segment Position" of "MuxingApp 7006 Element" in the above example is "26 - 21" or "5". 7008 24. Linked Segments 7010 Matroska provides several methods to link two or many "Segment 7011 Elements" together to create a "Linked Segment". A "Linked Segment" 7012 is a set of multiple "Segments" related together into a single 7013 presentation by using Hard Linking, Medium Linking, or Soft Linking. 7014 All "Segments" within a "Linked Segment" MUST utilize the same track 7015 numbers and timescale. All "Segments" within a "Linked Segment" MUST 7016 be stored within the same directory. All "Segments" within a "Linked 7017 Segment" MUST store a "SegmentUID". 7019 24.1. Hard Linking 7021 Hard Linking (also called splitting) is the process of creating a 7022 "Linked Segment" by relating multiple "Segment Elements" using the 7023 "PrevUID" and "NextUID Elements". Within a "Linked Segment", the 7024 timestamps of each "Segment" MUST follow consecutively in linking 7025 order. With Hard Linking, the chapters of any "Segment" within the 7026 "Linked Segment" MUST only reference the current "Segment". With 7027 Hard Linking, the "NextUID" and "PrevUID" MUST reference the 7028 respective "SegmentUID" values of the next and previous "Segments". 7029 The first "Segment" of a "Linked Segment" MUST have a "NextUID 7030 Element" and MUST NOT have a "PrevUID Element". The last "Segment" 7031 of a "Linked Segment" MUST have a "PrevUID Element" and MUST NOT have 7032 a "NextUID Element". The middle "Segments" of a "Linked Segment" 7033 MUST have both a "NextUID Element" and a "PrevUID Element". 7035 As an example, four "Segments" can be Hard Linked as a "Linked 7036 Segment" through cross-referencing each other with "SegmentUID", 7037 "PrevUID", and "NextUID", as in this table. 7039 +--------+------------------+-------------------+-------------------+ 7040 | file | SegmentUID | PrevUID | NextUID | 7041 | name | | | | 7042 +--------+------------------+-------------------+-------------------+ 7043 | "start | "71000c23cd31099 | n/a | "a77b3598941cb803 | 7044 | .mkv" | 853fbc94dd984a5d | | eac0fcdafe44fac9" | 7045 | | d" | | | 7046 | "middl | "a77b3598941cb80 | "71000c23cd310998 | "6c92285fa6d3e827 | 7047 | e.mkv" | 3eac0fcdafe44fac | 53fbc94dd984a5dd" | b198d120ea3ac674" | 7048 | | 9" | | | 7049 | "end.m | "6c92285fa6d3e82 | "a77b3598941cb803 | n/a | 7050 | kv" | 7b198d120ea3ac67 | eac0fcdafe44fac9" | | 7051 | | 4" | | | 7052 +--------+------------------+-------------------+-------------------+ 7054 24.2. Medium Linking 7056 Medium Linking creates relationships between "Segments" using Ordered 7057 Chapters and the "ChapterSegmentUID Element". A "Segment Edition" 7058 with Ordered Chapters MAY contain "Chapter Elements" that reference 7059 timestamp ranges from other "Segments". The "Segment" referenced by 7060 the Ordered Chapter via the "ChapterSegmentUID Element" SHOULD be 7061 played as part of a Linked Segment. The timestamps of Segment 7062 content referenced by Ordered Chapters MUST be adjusted according to 7063 the cumulative duration of the the previous Ordered Chapters. 7065 As an example a file named "intro.mkv" could have a "SegmentUID" of 7066 "0xb16a58609fc7e60653a60c984fc11ead". Another file called 7067 "program.mkv" could use a Chapter Edition that contains two Ordered 7068 Chapters. The first chapter references the "Segment" of "intro.mkv" 7069 with the use of a "ChapterSegmentUID", "ChapterSegmentEditionUID", 7070 "ChapterTimeStart" and optionally a "ChapterTimeEnd" element. The 7071 second chapter references content within the "Segment" of 7072 "program.mkv". A "Matroska Player" SHOULD recognize the "Linked 7073 Segment" created by the use of "ChapterSegmentUID" in an enabled 7074 "Edition" and present the reference content of the two "Segments" 7075 together. 7077 24.3. Soft Linking 7079 Soft Linking is used by codec chapters. They can reference another 7080 "Segment" and jump to that "Segment". The way the "Segments" are 7081 described are internal to the chapter codec and unknown to the 7082 Matroska level. But there are "Elements" within the "Info Element" 7083 (such as "ChapterTranslate") that can translate a value representing 7084 a "Segment" in the chapter codec and to the current "SegmentUID". 7085 All "Segments" that could be used in a "Linked Segment" in this way 7086 SHOULD be marked as members of the same family via the "SegmentFamily 7087 Element", so that the "Matroska Player" can quickly switch from one 7088 to the other. 7090 25. Track Flags 7092 25.1. Default flag 7094 The "default track" flag is a hint for a "Matroska Player" and SHOULD 7095 always be changeable by the user. If the user wants to see or hear a 7096 track of a certain kind (audio, video, subtitles) and hasn't chosen a 7097 specific track, the "Matroska Player" SHOULD use the first track of 7098 that kind whose "default track" flag is set to "1". If no such track 7099 is found then the first track of this kind SHOULD be chosen. 7101 Only one track of a kind MAY have its "default track" flag set in a 7102 segment. If a track entry does not contain the "default track" flag 7103 element then its default value "1" is to be used. 7105 25.2. Forced flag 7107 The "forced" flag tells the "Matroska Player" that it MUST display/ 7108 play this track or another track of the same kind that also has its 7109 "forced" flag set. When there are multiple "forced" tracks, the 7110 "Matroska Player" SHOULD determine the track based upon the language 7111 of the forced flag or use the default flag if no track matches the 7112 use languages. Another track of the same kind without the "forced" 7113 flag may be use simultaneously with the "forced" track (like DVD 7114 subtitles for example). 7116 25.3. Track Operation 7118 "TrackOperation" allows combining multiple tracks to make a virtual 7119 one. It uses two separate system to combine tracks. One to create a 7120 3D "composition" (left/right/background planes) and one to simplify 7121 join two tracks together to make a single track. 7123 A track created with "TrackOperation" is a proper track with a UID 7124 and all its flags. However the codec ID is meaningless because each 7125 "sub" track needs to be decoded by its own decoder before the 7126 "operation" is applied. The "Cues Elements" corresponding to such a 7127 virtual track SHOULD be the sum of the "Cues Elements" for each of 7128 the tracks it's composed of (when the "Cues" are defined per track). 7130 In the case of "TrackJoinBlocks", the "Block Elements" (from 7131 "BlockGroup" and "SimpleBlock") of all the tracks SHOULD be used as 7132 if they were defined for this new virtual "Track". When two "Block 7133 Elements" have overlapping start or end timestamps, it's up to the 7134 underlying system to either drop some of these frames or render them 7135 the way they overlap. This situation SHOULD be avoided when creating 7136 such tracks as you can never be sure of the end result on different 7137 platforms. 7139 25.4. Overlay Track 7141 Overlay tracks SHOULD be rendered in the same 'channel' as the track 7142 its linked to. When content is found in such a track, it SHOULD be 7143 played on the rendering channel instead of the original track. 7145 25.5. Multi-planar and 3D videos 7147 There are two different ways to compress 3D videos: have each 'eye' 7148 track in a separate track and have one track have both 'eyes' 7149 combined inside (which is more efficient, compression-wise). 7150 Matroska supports both ways. 7152 For the single track variant, there is the "StereoMode Element" which 7153 defines how planes are assembled in the track (mono or left-right 7154 combined). Odd values of StereoMode means the left plane comes first 7155 for more convenient reading. The pixel count of the track 7156 ("PixelWidth"/"PixelHeight") is the raw amount of pixels (for example 7157 3840x1080 for full HD side by side) and the 7158 "DisplayWidth"/"DisplayHeight" in pixels is the amount of pixels for 7159 one plane (1920x1080 for that full HD stream). Old stereo 3D were 7160 displayed using anaglyph (cyan and red colours separated). For 7161 compatibility with such movies, there is a value of the StereoMode 7162 that corresponds to AnaGlyph. 7164 There is also a "packed" mode (values 13 and 14) which consists of 7165 packing two frames together in a "Block" using lacing. The first 7166 frame is the left eye and the other frame is the right eye (or vice 7167 versa). The frames SHOULD be decoded in that order and are possibly 7168 dependent on each other (P and B frames). 7170 For separate tracks, Matroska needs to define exactly which track 7171 does what. "TrackOperation" with "TrackCombinePlanes" do that. For 7172 more details look at Section 25.3. 7174 The 3D support is still in infancy and may evolve to support more 7175 features. 7177 The StereoMode used to be part of Matroska v2 but it didn't meet the 7178 requirement for multiple tracks. There was also a bug in libmatroska 7179 prior to 0.9.0 that would save/read it as 0x53B9 instead of 0x53B8. 7180 "Matroska Readers" may support these legacy files by checking 7181 Matroska v2 or 0x53B9. The older values [20] were 0: mono, 1: right 7182 eye, 2: left eye, 3: both eyes. 7184 26. Timestamps 7186 Historically timestamps in Matroska were mistakenly called timecodes. 7187 The "Timestamp Element" was called Timecode, the "TimestampScale 7188 Element" was called TimecodeScale, the "TrackTimestampScale Element" 7189 was called TrackTimecodeScale and the "ReferenceTimestamp Element" 7190 was called ReferenceTimeCode. 7192 26.1. Timestamp Types 7194 o Absolute Timestamp = Block+Cluster 7196 o Relative Timestamp = Block 7198 o Scaled Timestamp = Block+Cluster 7200 o Raw Timestamp = (Block+Cluster)*TimestampScale*TrackTimestampScale 7202 26.2. Block Timestamps 7204 The "Block Element"'s timestamp MUST be a signed integer that 7205 represents the "Raw Timestamp" relative to the "Cluster"'s "Timestamp 7206 Element", multiplied by the "TimestampScale Element". See 7207 Section 26.4 for more information. 7209 The "Block Element"'s timestamp MUST be represented by a 16bit signed 7210 integer (sint16). The "Block"'s timestamp has a range of -32768 to 7211 +32767 units. When using the default value of the "TimestampScale 7212 Element", each integer represents 1ms. The maximum time span of 7213 "Block Elements" in a "Cluster" using the default "TimestampScale 7214 Element" of 1ms is 65536ms. 7216 If a "Cluster"'s "Timestamp Element" is set to zero, it is possible 7217 to have "Block Elements" with a negative "Raw Timestamp". "Block 7218 Elements" with a negative "Raw Timestamp" are not valid. 7220 26.3. Raw Timestamp 7222 The exact time of an object SHOULD be represented in nanoseconds. To 7223 find out a "Block"'s "Raw Timestamp", you need the "Block"'s 7224 "Timestamp Element", the "Cluster"'s "Timestamp Element", and the 7225 "TimestampScale Element". 7227 26.4. TimestampScale 7229 The "TimestampScale Element" is used to calculate the "Raw Timestamp" 7230 of a "Block". The timestamp is obtained by adding the "Block"'s 7231 timestamp to the "Cluster"'s "Timestamp Element", and then 7232 multiplying that result by the "TimestampScale". The result will be 7233 the "Block"'s "Raw Timestamp" in nanoseconds. The formula for this 7234 would look like: 7236 (a + b) * c 7238 a = `Block`'s Timestamp 7239 b = `Cluster`'s Timestamp 7240 c = `TimestampScale` 7242 For example, assume a "Cluster"'s "Timestamp" has a value of 564264, 7243 the "Block" has a "Timestamp" of 1233, and the "TimestampScale 7244 Element" is the default of 1000000. 7246 (1233 + 564264) * 1000000 = 565497000000 7248 So, the "Block" in this example has a specific time of 565497000000 7249 in nanoseconds. In milliseconds this would be 565497ms. 7251 26.5. TimestampScale Rounding 7253 Because the default value of "TimestampScale" is 1000000, which makes 7254 each integer in the "Cluster" and "Block" "Timestamp Elements" equal 7255 1ms, this is the most commonly used. When dealing with audio, this 7256 causes inaccuracy when seeking. When the audio is combined with 7257 video, this is not an issue. For most cases, the the synch of audio 7258 to video does not need to be more than 1ms accurate. This becomes 7259 obvious when one considers that sound will take 2-3ms to travel a 7260 single meter, so distance from your speakers will have a greater 7261 effect on audio/visual synch than this. 7263 However, when dealing with audio-only files, seeking accuracy can 7264 become critical. For instance, when storing a whole CD in a single 7265 track, a user will want to be able to seek to the exact sample that a 7266 song begins at. If seeking a few sample ahead or behind, a 'crack' 7267 or 'pop' may result as a few odd samples are rendered. Also, when 7268 performing precise editing, it may be very useful to have the audio 7269 accuracy down to a single sample. 7271 When storing timestamps for an audio stream, the "TimestampScale 7272 Element" SHOULD have an accuracy of at least that of the audio sample 7273 rate, otherwise there are rounding errors that prevent users from 7274 knowing the precise location of a sample. Here's how a program has 7275 to round each timestamp in order to be able to recreate the sample 7276 number accurately. 7278 Let's assume that the application has an audio track with a sample 7279 rate of 44100. As written above the "TimestampScale" MUST have at 7280 least the accuracy of the sample rate itself: 1000000000 / 44100 = 7281 22675.7369614512. This value MUST always be truncated. Otherwise 7282 the accuracy will not suffice. So in this example the application 7283 will use 22675 for the "TimestampScale". The application could even 7284 use some lower value like 22674 which would allow it to be a little 7285 bit imprecise about the original timestamps. But more about that in 7286 a minute. 7288 Next the application wants to write sample number 52340 and 7289 calculates the timestamp. This is easy. In order to calculate the 7290 "Raw Timestamp" in ns all it has to do is calculate "Raw Timestamp = 7291 round(1000000000 * sample_number / sample_rate)". Rounding at this 7292 stage is very important! The application might skip it if it choses 7293 a slightly smaller value for the "TimestampScale" factor instead of 7294 the truncated one like shown above. Otherwise it has to round or the 7295 results won't be reversible. For our example we get "Raw Timestamp = 7296 round(1000000000 * 52340 / 44100) = round(1186848072.56236) = 7297 1186848073". 7299 The next step is to calculate the "Absolute Timestamp" - that is the 7300 timestamp that will be stored in the Matroska file. Here the 7301 application has to divide the "Raw Timestamp" from the previous 7302 paragraph by the "TimestampScale" factor and round the result: 7303 "Absolute Timestamp = round(Raw Timestamp / TimestampScale_factor)" 7304 which will result in the following for our example: "Absolute 7305 Timestamp = round(1186848073 / 22675) = round(52341.7011245866) = 7306 52342". This number is the one the application has to write to the 7307 file. 7309 Now our file is complete, and we want to play it back with another 7310 application. Its task is to find out which sample the first 7311 application wrote into the file. So it starts reading the Matroska 7312 file and finds the "TimestampScale" factor 22675 and the audio sample 7313 rate 44100. Later it finds a data block with the "Absolute 7314 Timestamp" of 52342. But how does it get the sample number from 7315 these numbers? 7317 First it has to calculate the "Raw Timestamp" of the block it has 7318 just read. Here's no rounding involved, just an integer 7319 multiplication: "Raw Timestamp = Absolute Timestamp * 7320 TimestampScale_factor". In our example: "Raw Timestamp = 52342 * 7321 22675 = 1186854850". 7323 The conversion from the "Raw Timestamp" to the sample number again 7324 requires rounding: "sample_number = round(Raw Timestamp * sample_rate 7325 / 1000000000)". In our example: "sample_number = round(1186854850 * 7326 44100 / 1000000000) = round(52340.298885) = 52340". This is exactly 7327 the sample number that the previous program started with. 7329 Some general notes for a program: 7331 1. Always calculate the timestamps / sample numbers with floating 7332 point numbers of at least 64bit precision (called 'double' in 7333 most modern programming languages). If you're calculating with 7334 integers then make sure they're 64bit long, too. 7336 2. Always round if you divide. Always! If you don't you'll end up 7337 with situations in which you have a timestamp in the Matroska 7338 file that does not correspond to the sample number that it 7339 started with. Using a slightly lower timestamp scale factor can 7340 help here in that it removes the need for proper rounding in the 7341 conversion from sample number to "Raw Timestamp". 7343 26.6. TrackTimestampScale 7345 The "TrackTimestampScale Element" is used align tracks that would 7346 otherwise be played at different speeds. An example of this would be 7347 if you have a film that was originally recorded at 24fps video. When 7348 playing this back through a PAL broadcasting system, it is standard 7349 to speed up the film to 25fps to match the 25fps display speed of the 7350 PAL broadcasting standard. However, when broadcasting the video 7351 through NTSC, it is typical to leave the film at its original speed. 7352 If you wanted to make a single file where there was one video stream, 7353 and an audio stream used from the PAL broadcast, as well as an audio 7354 stream used from the NTSC broadcast, you would have the problem that 7355 the PAL audio stream would be 1/24th faster than the NTSC audio 7356 stream, quickly leading to problems. It is possible to stretch out 7357 the PAL audio track and re-encode it at a slower speed, however when 7358 dealing with lossy audio codecs, this often results in a loss of 7359 audio quality and/or larger file sizes. 7361 This is the type of problem that "TrackTimestampScale" was designed 7362 to fix. Using it, the video can be played back at a speed that will 7363 synch with either the NTSC or the PAL audio stream, depending on 7364 which is being used for playback. To continue the above example: 7366 Track 1: Video 7367 Track 2: NTSC Audio 7368 Track 3: PAL Audio 7370 Because the NTSC track is at the original speed, it will used as the 7371 default value of 1.0 for its "TrackTimestampScale". The video will 7372 also be aligned to the NTSC track with the default value of 1.0. 7374 The "TrackTimestampScale" value to use for the PAL track would be 7375 calculated by determining how much faster the PAL track is than the 7376 NTSC track. In this case, because we know the video for the NTSC 7377 audio is being played back at 24fps and the video for the PAL audio 7378 is being played back at 25fps, the calculation would be: 7380 25/24 ≈ 1.04166666666666666667 7382 When writing a file that uses a non-default "TrackTimestampScale", 7383 the values of the "Block"'s timestamp are whatever they would be when 7384 normally storing the track with a default value for the 7385 "TrackTimestampScale". However, the data is interleaved a little 7386 differently. Data SHOULD be interleaved by its Section 26.3 in the 7387 order handed back from the encoder. The "Raw Timestamp" of a "Block" 7388 from a track using "TrackTimestampScale" is calculated using: 7390 "(Block's Timestamp + Cluster's Timestamp) * TimestampScale * 7391 TrackTimestampScale" 7393 So, a Block from the PAL track above that had a Section 26.1 of 100 7394 seconds would have a "Raw Timestamp" of 104.66666667 seconds, and so 7395 would be stored in that part of the file. 7397 When playing back a track using the "TrackTimestampScale", if the 7398 track is being played by itself, there is no need to scale it. From 7399 the above example, when playing the Video with the NTSC Audio, 7400 neither are scaled. However, when playing back the Video with the 7401 PAL Audio, the timestamps from the PAL Audio track are scaled using 7402 the "TrackTimestampScale", resulting in the video playing back in 7403 synch with the audio. 7405 It would be possible for a "Matroska Player" to also adjust the 7406 audio's samplerate at the same time as adjusting the timestamps if 7407 you wanted to play the two audio streams synchronously. It would 7408 also be possible to adjust the video to match the audio's speed. 7409 However, for playback, the selected track(s) timestamps SHOULD be 7410 adjusted if they need to be scaled. 7412 While the above example deals specifically with audio tracks, this 7413 element can be used to align video, audio, subtitles, or any other 7414 type of track contained in a Matroska file. 7416 27. References 7418 27.1. URIs 7420 [1] http://mukoli.free.fr/mcf/mcf.html 7422 [2] https://github.com/Matroska-Org/ebml-specification/blob/master/ 7423 specification.markdown 7425 [3] https://datatracker.ietf.org/wg/cellar/charter/ 7427 [4] https://matroska.org/files/matroska.pdf 7429 [5] diagram.md 7431 [6] https://github.com/Matroska-Org/ebml-specification/blob/master/ 7432 specification.markdown 7434 [7] https://github.com/Matroska-Org/foundation- 7435 source/blob/master/spectool/specdata.xml 7437 [8] https://tools.ietf.org/html/rfc2119 7439 [9] https://github.com/Matroska-Org/ebml-specification/blob/master/ 7440 specification.markdown 7442 [10] https://github.com/Matroska-Org/ebml-specification/blob/master/ 7443 specification.markdown#ebml-element-types 7445 [11] https://github.com/Matroska-Org/ebml-specification/blob/master/ 7446 specification.markdown#ebml-schema 7448 [12] https://github.com/Matroska-Org/ebml-specification/blob/master/ 7449 specification.markdown#structure 7451 [13] https://www.loc.gov/standards/iso639-2/php/English_list.php 7453 [14] https://tools.ietf.org/html/bcp47 7455 [15] https://www.iana.org/domains/root/db 7457 [16] http://www.webmproject.org/docs/container/ 7459 [17] http://dvd.sourceforge.net/dvdinfo/uops.html 7461 [18] http://www.dvd-replica.com/DVD/ 7463 [19] http://dvd.sourceforge.net/dvdinfo/ 7465 [20] http://www.matroska.org/node/1/revisions/74/view#StereoMode 7467 Authors' Addresses 7469 Steve Lhomme 7471 Email: slhomme@matroska.org 7472 Moritz Bunkus 7474 Email: moritz@bunkus.org 7476 Dave Rice 7478 Email: dave@dericed.com