idnits 2.17.1 draft-ietf-cellar-codec-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 21 instances of too long lines in the document, the longest one being 124 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (January 9, 2019) is 1927 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) -- Looks like a reference, but probably isn't: '1' on line 1929 -- Looks like a reference, but probably isn't: '2' on line 1931 -- Looks like a reference, but probably isn't: '3' on line 1933 -- Looks like a reference, but probably isn't: '4' on line 1936 -- Looks like a reference, but probably isn't: '5' on line 1939 -- Looks like a reference, but probably isn't: '6' on line 1942 -- Looks like a reference, but probably isn't: '7' on line 1945 -- Looks like a reference, but probably isn't: '8' on line 1948 -- Looks like a reference, but probably isn't: '9' on line 1951 -- Looks like a reference, but probably isn't: '10' on line 1953 -- Looks like a reference, but probably isn't: '11' on line 1956 -- Looks like a reference, but probably isn't: '12' on line 1958 == Missing Reference: 'TM' is mentioned on line 722, but not defined -- Looks like a reference, but probably isn't: '13' on line 1960 -- Looks like a reference, but probably isn't: '14' on line 1963 -- Looks like a reference, but probably isn't: '15' on line 1965 -- Looks like a reference, but probably isn't: '16' on line 1967 -- Looks like a reference, but probably isn't: '17' on line 1969 -- Looks like a reference, but probably isn't: '18' on line 1971 -- Looks like a reference, but probably isn't: '19' on line 1974 -- Looks like a reference, but probably isn't: '20' on line 1977 -- Looks like a reference, but probably isn't: '21' on line 1980 -- Looks like a reference, but probably isn't: '22' on line 1983 -- Looks like a reference, but probably isn't: '23' on line 1986 -- Looks like a reference, but probably isn't: '24' on line 1989 -- Looks like a reference, but probably isn't: '25' on line 1992 -- Looks like a reference, but probably isn't: '26' on line 1995 -- Looks like a reference, but probably isn't: '27' on line 1998 -- Looks like a reference, but probably isn't: '28' on line 2001 -- Looks like a reference, but probably isn't: '29' on line 2003 -- Looks like a reference, but probably isn't: '30' on line 2005 -- Looks like a reference, but probably isn't: '31' on line 2007 -- Looks like a reference, but probably isn't: '32' on line 2009 -- Looks like a reference, but probably isn't: '33' on line 2011 -- Looks like a reference, but probably isn't: '34' on line 2013 -- Looks like a reference, but probably isn't: '35' on line 2015 -- Looks like a reference, but probably isn't: '36' on line 2017 == Missing Reference: 'Events' is mentioned on line 1514, but not defined -- Looks like a reference, but probably isn't: '37' on line 2019 -- Looks like a reference, but probably isn't: '38' on line 2021 -- Looks like a reference, but probably isn't: '39' on line 2023 -- Possible downref: Non-RFC (?) normative reference: ref. 'IEEE.754.1985' ** Downref: Normative reference to an Informational RFC: RFC 6386 Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 42 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: July 13, 2019 6 D. Rice 7 January 9, 2019 9 Matroska Codec 10 draft-ietf-cellar-codec-01 12 Abstract 14 This document defines the Matroska codec mappings, including the 15 codec ID, layout of data in a "Block Element" and in an optional 16 "CodecPrivate Element". 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 July 13, 2019. 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 . . . . . . . . . . . . . . . . . . . . . . . . 4 53 2. Status of this document . . . . . . . . . . . . . . . . . . . 4 54 3. Security Considerations . . . . . . . . . . . . . . . . . . . 5 55 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 56 5. Notations and Conventions . . . . . . . . . . . . . . . . . . 5 57 6. Codec Mappings . . . . . . . . . . . . . . . . . . . . . . . 5 58 6.1. Defining Matroska Codec Support . . . . . . . . . . . . . 5 59 6.1.1. Codec ID . . . . . . . . . . . . . . . . . . . . . . 5 60 6.1.2. Codec Name . . . . . . . . . . . . . . . . . . . . . 6 61 6.1.3. Description . . . . . . . . . . . . . . . . . . . . . 6 62 6.1.4. Initialization . . . . . . . . . . . . . . . . . . . 6 63 6.1.5. Citation . . . . . . . . . . . . . . . . . . . . . . 7 64 6.1.6. Deprecation Date . . . . . . . . . . . . . . . . . . 7 65 6.1.7. Superseded By . . . . . . . . . . . . . . . . . . . . 7 66 6.2. Recommendations for the Creation of New Codec Mappings . 7 67 6.3. Video Codec Mappings . . . . . . . . . . . . . . . . . . 8 68 6.3.1. V_MS/VFW/FOURCC . . . . . . . . . . . . . . . . . . . 8 69 6.3.2. V_UNCOMPRESSED . . . . . . . . . . . . . . . . . . . 8 70 6.3.3. V_MPEG4/ISO/SP . . . . . . . . . . . . . . . . . . . 8 71 6.3.4. V_MPEG4/ISO/ASP . . . . . . . . . . . . . . . . . . . 9 72 6.3.5. V_MPEG4/ISO/AP . . . . . . . . . . . . . . . . . . . 9 73 6.3.6. V_MPEG4/MS/V3 . . . . . . . . . . . . . . . . . . . . 9 74 6.3.7. V_MPEG1 . . . . . . . . . . . . . . . . . . . . . . . 9 75 6.3.8. V_MPEG2 . . . . . . . . . . . . . . . . . . . . . . . 10 76 6.3.9. V_REAL/RV10 . . . . . . . . . . . . . . . . . . . . . 10 77 6.3.10. V_REAL/RV20 . . . . . . . . . . . . . . . . . . . . . 10 78 6.3.11. V_REAL/RV30 . . . . . . . . . . . . . . . . . . . . . 11 79 6.3.12. V_REAL/RV40 . . . . . . . . . . . . . . . . . . . . . 11 80 6.3.13. V_QUICKTIME . . . . . . . . . . . . . . . . . . . . . 11 81 6.3.14. V_THEORA . . . . . . . . . . . . . . . . . . . . . . 11 82 6.3.15. V_PRORES . . . . . . . . . . . . . . . . . . . . . . 12 83 6.3.16. V_VP8 . . . . . . . . . . . . . . . . . . . . . . . . 12 84 6.3.17. V_VP9 . . . . . . . . . . . . . . . . . . . . . . . . 13 85 6.3.18. V_FFV1 . . . . . . . . . . . . . . . . . . . . . . . 13 86 6.4. Audio Codec Mappings . . . . . . . . . . . . . . . . . . 13 87 6.4.1. A_MPEG/L3 . . . . . . . . . . . . . . . . . . . . . . 13 88 6.4.2. A_MPEG/L2 . . . . . . . . . . . . . . . . . . . . . . 14 89 6.4.3. A_MPEG/L1 . . . . . . . . . . . . . . . . . . . . . . 14 90 6.4.4. A_PCM/INT/BIG . . . . . . . . . . . . . . . . . . . . 14 91 6.4.5. A_PCM/INT/LIT . . . . . . . . . . . . . . . . . . . . 14 92 6.4.6. A_PCM/FLOAT/IEEE . . . . . . . . . . . . . . . . . . 15 93 6.4.7. A_MPC . . . . . . . . . . . . . . . . . . . . . . . . 15 94 6.4.8. A_AC3 . . . . . . . . . . . . . . . . . . . . . . . . 15 95 6.4.9. A_AC3/BSID9 . . . . . . . . . . . . . . . . . . . . . 15 96 6.4.10. A_AC3/BSID10 . . . . . . . . . . . . . . . . . . . . 16 97 6.4.11. A_ALAC . . . . . . . . . . . . . . . . . . . . . . . 16 98 6.4.12. A_DTS . . . . . . . . . . . . . . . . . . . . . . . . 16 99 6.4.13. A_DTS/EXPRESS . . . . . . . . . . . . . . . . . . . . 17 100 6.4.14. A_DTS/LOSSLESS . . . . . . . . . . . . . . . . . . . 17 101 6.4.15. A_VORBIS . . . . . . . . . . . . . . . . . . . . . . 17 102 6.4.16. A_FLAC . . . . . . . . . . . . . . . . . . . . . . . 17 103 6.4.17. A_REAL/14_4 . . . . . . . . . . . . . . . . . . . . . 18 104 6.4.18. A_REAL/28_8 . . . . . . . . . . . . . . . . . . . . . 18 105 6.4.19. A_REAL/COOK . . . . . . . . . . . . . . . . . . . . . 18 106 6.4.20. A_REAL/SIPR . . . . . . . . . . . . . . . . . . . . . 18 107 6.4.21. A_REAL/RALF . . . . . . . . . . . . . . . . . . . . . 19 108 6.4.22. A_REAL/ATRC . . . . . . . . . . . . . . . . . . . . . 19 109 6.4.23. A_MS/ACM . . . . . . . . . . . . . . . . . . . . . . 19 110 6.4.24. A_AAC/MPEG2/MAIN . . . . . . . . . . . . . . . . . . 19 111 6.4.25. A_AAC/MPEG2/LC . . . . . . . . . . . . . . . . . . . 20 112 6.4.26. A_AAC/MPEG2/LC/SBR . . . . . . . . . . . . . . . . . 20 113 6.4.27. A_AAC/MPEG2/SSR . . . . . . . . . . . . . . . . . . . 20 114 6.4.28. A_AAC/MPEG4/MAIN . . . . . . . . . . . . . . . . . . 20 115 6.4.29. A_AAC/MPEG4/LC . . . . . . . . . . . . . . . . . . . 21 116 6.4.30. A_AAC/MPEG4/LC/SBR . . . . . . . . . . . . . . . . . 21 117 6.4.31. A_AAC/MPEG4/SSR . . . . . . . . . . . . . . . . . . . 21 118 6.4.32. A_AAC/MPEG4/LTP . . . . . . . . . . . . . . . . . . . 22 119 6.4.33. A_QUICKTIME . . . . . . . . . . . . . . . . . . . . . 22 120 6.4.34. A_QUICKTIME/QDMC . . . . . . . . . . . . . . . . . . 22 121 6.4.35. A_QUICKTIME/QDM2 . . . . . . . . . . . . . . . . . . 23 122 6.4.36. A_TTA1 . . . . . . . . . . . . . . . . . . . . . . . 23 123 6.4.37. A_WAVPACK4 . . . . . . . . . . . . . . . . . . . . . 23 124 6.5. Subtitle Codec Mappings . . . . . . . . . . . . . . . . . 23 125 6.5.1. S_TEXT/UTF8 . . . . . . . . . . . . . . . . . . . . . 24 126 6.5.2. S_TEXT/SSA . . . . . . . . . . . . . . . . . . . . . 24 127 6.5.3. S_TEXT/ASS . . . . . . . . . . . . . . . . . . . . . 24 128 6.5.4. S_TEXT/USF . . . . . . . . . . . . . . . . . . . . . 24 129 6.5.5. S_TEXT/WEBVTT . . . . . . . . . . . . . . . . . . . . 24 130 6.5.6. S_IMAGE/BMP . . . . . . . . . . . . . . . . . . . . . 25 131 6.5.7. S_DVBSUB . . . . . . . . . . . . . . . . . . . . . . 25 132 6.5.8. S_VOBSUB . . . . . . . . . . . . . . . . . . . . . . 25 133 6.5.9. S_HDMV/PGS . . . . . . . . . . . . . . . . . . . . . 26 134 6.5.10. S_HDMV/TEXTST . . . . . . . . . . . . . . . . . . . . 26 135 6.5.11. S_KATE . . . . . . . . . . . . . . . . . . . . . . . 26 136 6.6. Button Codec Mappings . . . . . . . . . . . . . . . . . . 26 137 6.6.1. B_VOBBTN . . . . . . . . . . . . . . . . . . . . . . 26 138 7. Subtitles . . . . . . . . . . . . . . . . . . . . . . . . . . 26 139 7.1. Images Subtitles . . . . . . . . . . . . . . . . . . . . 27 140 7.2. SRT Subtitles . . . . . . . . . . . . . . . . . . . . . . 30 141 7.3. SSA/ASS Subtitles . . . . . . . . . . . . . . . . . . . . 31 142 7.4. USF Subtitles . . . . . . . . . . . . . . . . . . . . . . 34 143 7.5. WebVTT . . . . . . . . . . . . . . . . . . . . . . . . . 34 144 7.5.1. Storage of WebVTT in Matroska . . . . . . . . . . . . 35 145 7.5.1.1. CodecID: codec identification . . . . . . . . . . 35 146 7.5.1.2. CodecPrivate: storage of global WebVTT blocks . . 35 147 7.5.1.3. Storage of non-global WebVTT blocks . . . . . . . 35 148 7.5.1.4. Storage of Cues in Matroska blocks . . . . . . . 35 149 7.5.1.5. BlockAdditions: storing non-global WebVTT blocks, 150 Cue Settings Lists and Cue identifiers . . . . . 35 151 7.5.2. Examples of transformation . . . . . . . . . . . . . 36 152 7.5.2.1. Example WebVTT file . . . . . . . . . . . . . . . 36 153 7.5.2.2. Example of CodecPrivate . . . . . . . . . . . . . 38 154 7.5.2.3. Storage of Cue 1 . . . . . . . . . . . . . . . . 38 155 7.5.2.4. Storage of Cue 2 . . . . . . . . . . . . . . . . 39 156 7.5.2.5. Storage of Cue 3 . . . . . . . . . . . . . . . . 39 157 7.5.2.6. Storage of Cue 4 . . . . . . . . . . . . . . . . 39 158 7.5.3. Storage of WebVTT in Matroska vs. WebM . . . . . . . 39 159 7.6. HDMV presentation graphics subtitles . . . . . . . . . . 40 160 7.6.1. Storage of HDMV presentation graphics subtitles . . . 40 161 7.6.1.1. Storage of HDMV PGS Segments in Matroska Blocks . 40 162 7.7. HDMV text subtitles . . . . . . . . . . . . . . . . . . . 40 163 7.7.1. Storage of HDMV text subtitles . . . . . . . . . . . 40 164 7.7.1.1. Storage of HDMV TextST Dialog Presentation 165 Segments in Matroska Blocks . . . . . . . . . . . 41 166 7.7.1.2. Character set . . . . . . . . . . . . . . . . . . 41 167 7.8. Digital Video Broadcasting (DVB) subtitles . . . . . . . 41 168 7.8.1. Storage of DVB subtitles . . . . . . . . . . . . . . 42 169 7.8.1.1. CodecID . . . . . . . . . . . . . . . . . . . . . 42 170 7.8.1.2. CodecPrivate . . . . . . . . . . . . . . . . . . 42 171 7.8.1.3. Storage of DVB subtitles in Matroska Blocks . . . 42 172 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 42 173 8.1. Normative References . . . . . . . . . . . . . . . . . . 42 174 8.2. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 43 175 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 45 177 1. Introduction 179 Matroska aims to become THE standard of multimedia container formats. 180 It stores interleaved and timestamped audio/video/subtitle data using 181 various codecs. To interpret the codec data, a mapping between the 182 way the data is stored in Matroska and how it is understood by such a 183 codec is necessary. 185 This document intends to define this mapping for many commonly used 186 codecs in Matroska. 188 2. Status of this document 190 This document is a work-in-progress specification defining the 191 Matroska file format as part of the IETF Cellar working group [1]. 192 It uses basic elements and concept already defined in the Matroska 193 specifications defined by this workgroup. 195 3. Security Considerations 197 This document inherits security considerations from the EBML and 198 Matroska documents. 200 4. IANA Considerations 202 To be determined. 204 5. Notations and Conventions 206 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 207 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 208 document are to be interpreted as described in RFC 2119 [2]. 210 6. Codec Mappings 212 A "Codec Mapping" is a set of attributes to identify, name, and 213 contextualize the format and characteristics of encoded data that can 214 be contained within Matroska Clusters. 216 Each TrackEntry used within Matroska MUST reference a defined "Codec 217 Mapping" using the "Codec ID" to identify and describe the format of 218 the encoded data in its associated Clusters. This "Codec ID" is a 219 unique registered identifier that represents the encoding stored 220 within the Track. Certain encodings MAY also require some form of 221 codec initialization in order to provide its decoder with context and 222 technical metadata. 224 The intention behind this list is not to list all existing audio and 225 video codecs, but rather to list those codecs that are currently 226 supported in Matroska and therefore need a well defined "Codec ID" so 227 that all developers supporting Matroska will use the same "Codec ID". 228 If you feel we missed support for a very important codec, please tell 229 us on our development mailing list (cellar at ietf.org). 231 6.1. Defining Matroska Codec Support 233 Support for a codec is defined in Matroska with the following values. 235 6.1.1. Codec ID 237 Each codec supported for storage in Matroska MUST have a unique 238 "Codec ID". Each "Codec ID" MUST be prefixed with the string from 239 the following table according to the associated type of the codec. 240 All characters of a "Codec ID Prefix" MUST be capital letters (A-Z) 241 except for the last character of a "Codec ID Prefix" which MUST be an 242 underscore ("_"). 244 +------------+-----------------+ 245 | Codec Type | Codec ID Prefix | 246 +------------+-----------------+ 247 | Video | "V_" | 248 | Audio | "A_" | 249 | Subtitle | "S_" | 250 | Button | "B_" | 251 +------------+-----------------+ 253 Each "Codec ID" MUST include a "Major Codec ID" immediately following 254 the "Codec ID Prefix". A "Major Codec ID" MAY be followed by an 255 OPTIONAL "Codec ID Suffix" to communicate a refinement of the "Major 256 Codec ID". If a "Codec ID Suffix" is used, then the "Codec ID" MUST 257 include a forward slash ("/") as a separator between the "Major Codec 258 ID" and the "Codec ID Suffix". The "Major Codec ID" MUST be composed 259 of only capital letters (A-Z) and numbers (0-9). The "Codec ID 260 Suffix" MUST be composed of only capital letters (A-Z), numbers 261 (0-9), underscore ("_"), and forward slash ("/"). 263 The following table provides examples of valid "Codec IDs" and their 264 components: 266 +---------+---------+-----------+--------------+--------------------+ 267 | Codec | Major | Separator | Codec ID | Codec ID | 268 | ID | Codec | | Suffix | | 269 | Prefix | ID | | | | 270 +---------+---------+-----------+--------------+--------------------+ 271 | A_ | AAC | / | MPEG2/LC/SBR | A_AAC/MPEG2/LC/SBR | 272 | V_ | MPEG4 | / | ISO/ASP | V_MPEG4/ISO/ASP | 273 | V_ | MPEG1 | | | V_MPEG1 | 274 +---------+---------+-----------+--------------+--------------------+ 276 6.1.2. Codec Name 278 Each encoding supported for storage in Matroska MUST have a "Codec 279 Name". The "Codec Name" provides a readable label for the encoding. 281 6.1.3. Description 283 An optional description for the encoding. This value is only 284 intended for human consumption. 286 6.1.4. Initialization 288 Each encoding supported for storage in Matroska MUST have a defined 289 Initialization. The Initialization MUST describe the storage of data 290 necessary to initialize the decoder, which MUST be stored within the 291 "CodecPrivate Element". When the Initialization is updated within a 292 track then that updated Initialization data MUST be written into the 293 "CodecState Element" of the first "Cluster" to require it. If the 294 encoding does not require any form of Initialization then "none" MUST 295 be used to define the Initialization and the "CodecPrivate Element" 296 SHOULD NOT be written and MUST be ignored. Data that is defined 297 Initialization to be stored in the "CodecPrivate Element" is known as 298 "Private Data". 300 6.1.5. Citation 302 Documentation of the associated normative and informative references 303 for the codec is RECOMMENDED. 305 6.1.6. Deprecation Date 307 A timestamp, expressed in [RFC3339] that notes when support for the 308 "Codec Mapping" within Matroska was deprecated. If a "Codec Mapping" 309 is defined with a "Deprecation Date", then it is RECOMMENDED that 310 Matroska writers SHOULD NOT use the "Codec Mapping" after the 311 "Deprecation Date". 313 6.1.7. Superseded By 315 A "Codec Mapping" MAY only be defined with a "Superseded By" value, 316 if it has an expressed "Deprecation Date". If used, the "Superseded 317 By" value MUST store the "Codec ID" of another "Codec Mapping" that 318 has superseded the "Codec Mapping". 320 6.2. Recommendations for the Creation of New Codec Mappings 322 Creators of new "Codec Mappings" to be used in the context of 323 Matroska: 325 o SHOULD assume that all "Codec Mappings" they create might become 326 standardized, public, commonly deployed, or usable across multiple 327 implementations. 329 o SHOULD employ meaningful values for "Codec ID" and "Codec Name" 330 that they have reason to believe are currently unused. 332 o SHOULD NOT prefix their "Codec ID" with "X_" or similar 333 constructs. 335 These recommendations are based upon Section 3 of [RFC6648]. 337 6.3. Video Codec Mappings 339 6.3.1. V_MS/VFW/FOURCC 341 Codec ID: "V_MS/VFW/FOURCC" 343 Codec Name: Microsoft (TM) Video Codec Manager (VCM) 345 Description: The private data contains the VCM structure 346 BITMAPINFOHEADER including the extra private bytes, as defined by 347 Microsoft [3]. The data are stored in little endian format (like on 348 IA32 machines). Where is the Huffman table stored in HuffYUV, not 349 AVISTREAMINFO ??? And the FourCC, not in AVISTREAMINFO.fccHandler ??? 351 Initialization: "Private Data" contains the VCM structure 352 BITMAPINFOHEADER including the extra private bytes, as defined by 353 Microsoft in . 356 Citation: 359 6.3.2. V_UNCOMPRESSED 361 Codec ID: V_UNCOMPRESSED 363 Codec Name: Video, raw uncompressed video frames 365 Description: All details about the used color specs and bit depth are 366 to be put/read from the KaxCodecColourSpace elements. 368 Initialization: none 370 6.3.3. V_MPEG4/ISO/SP 372 Codec ID: V_MPEG4/ISO/SP 374 Codec Name: MPEG4 ISO simple profile (DivX4) 376 Description: Stream was created via improved codec API (UCI) or even 377 transmuxed from AVI (no b-frames in Simple Profile), frame order is 378 coding order. 380 Initialization: none 382 6.3.4. V_MPEG4/ISO/ASP 384 Codec ID: V_MPEG4/ISO/ASP 386 Codec Name: MPEG4 ISO advanced simple profile (DivX5, XviD, FFMPEG) 388 Description: Stream was created via improved codec API (UCI) or 389 transmuxed from MP4, not simply transmuxed from AVI. Note there are 390 differences how b-frames are handled in these native streams, when 391 being compared to a VfW created stream, as here there are "no" dummy 392 frames inserted, the frame order is exactly the same as the coding 393 order, same as in MP4 streams. 395 Initialization: none 397 6.3.5. V_MPEG4/ISO/AP 399 Codec ID: V_MPEG4/ISO/AP 401 Codec Name: MPEG4 ISO advanced profile 403 Description: Stream was created via improved codec API (UCI) or 404 transmuxed from MP4, not simply transmuxed from AVI. Note there are 405 differences how b-frames are handled in these native streams, when 406 being compared to a VfW created stream, as here there are "no" dummy 407 frames inserted, the frame order is exactly the same as the coding 408 order, same as in MP4 streams. 410 Initialization: none 412 6.3.6. V_MPEG4/MS/V3 414 Codec ID: V_MPEG4/MS/V3 416 Codec Name: Microsoft (TM) MPEG4 V3 418 Description: Microsoft (TM) MPEG4 V3 and derivates, means DivX3, 419 Angelpotion, SMR, etc.; stream was created using VfW codec or 420 transmuxed from AVI; note that V1/V2 are covered in VfW compatibility 421 mode. 423 Initialization: none 425 6.3.7. V_MPEG1 427 Codec ID: V_MPEG1 429 Codec Name: MPEG 1 430 Description: The Matroska video stream will contain a demuxed 431 Elementary Stream (ES), where block boundaries are still to be 432 defined. Its RECOMMENDED to use MPEG2MKV.exe for creating those 433 files, and to compare the results with self-made implementations 435 Initialization: none 437 6.3.8. V_MPEG2 439 Codec ID: V_MPEG2 441 Codec Name: MPEG 2 443 Description: The Matroska video stream will contain a demuxed 444 Elementary Stream (ES), where block boundaries are still to be 445 defined. Its RECOMMENDED to use MPEG2MKV.exe for creating those 446 files, and to compare the results with self-made implementations 448 Initialization: none 450 6.3.9. V_REAL/RV10 452 Codec ID: V_REAL/RV10 454 Codec Name: RealVideo 1.0 aka RealVideo 5 456 Description: Individual slices from the Real container are combined 457 into a single frame. 459 Initialization: The "Private Data" contains a "real_video_props_t" 460 structure in Big Endian byte order as found in librmff [4]. 462 6.3.10. V_REAL/RV20 464 Codec ID: V_REAL/RV20 466 Codec Name: RealVideo G2 and RealVideo G2+SVT 468 Description: Individual slices from the Real container are combined 469 into a single frame. 471 Initialization: The "Private Data" contains a "real_video_props_t" 472 structure in Big Endian byte order as found in librmff [5]. 474 6.3.11. V_REAL/RV30 476 Codec ID: V_REAL/RV30 478 Codec Name: RealVideo 8 480 Description: Individual slices from the Real container are combined 481 into a single frame. 483 Initialization: The "Private Data" contains a "real_video_props_t" 484 structure in Big Endian byte order as found in librmff [6]. 486 6.3.12. V_REAL/RV40 488 Codec ID: V_REAL/RV40 490 Codec Name: rv40 : RealVideo 9 492 Description: Individual slices from the Real container are combined 493 into a single frame. 495 Initialization: The "Private Data" contains a "real_video_props_t" 496 structure in Big Endian byte order as found in librmff [7]. 498 6.3.13. V_QUICKTIME 500 Codec ID: V_QUICKTIME 502 Codec Name: Video taken from QuickTime(TM) files 504 Description: Several codecs as stored in QuickTime, e.g. Sorenson or 505 Cinepak. 507 Initialization: The "Private Data" contains all additional data that 508 is stored in the 'stsd' (sample description) atom in the QuickTime 509 file *after* the mandatory video descriptor structure (starting with 510 the size and FourCC fields). For an explanation of the QuickTime 511 file format read QuickTime File Format Specification [8]. 513 6.3.14. V_THEORA 515 Codec ID: V_THEORA 517 Codec Name: Theora 519 Initialization: The "Private Data" contains the first three Theora 520 packets in order. The lengths of the packets precedes them. The 521 actual layout is: 523 o Byte 1: number of distinct packets '"#p"' minus one inside the 524 CodecPrivate block. This MUST be '2' for current (as of 525 2016-07-08) Theora headers. 527 o Bytes 2..n: lengths of the first '"#p"' packets, coded in Xiph- 528 style lacing. The length of the last packet is the length of the 529 CodecPrivate block minus the lengths coded in these bytes minus 530 one. 532 o Bytes n+1..: The Theora identification header, followed by the 533 commend header followed by the codec setup header. Those are 534 described in the Theora specs [9]. 536 6.3.15. V_PRORES 538 Codec ID: V_PRORES 540 Codec Name: Apple ProRes 542 Initialization: The "Private Data" contains the FourCC as found in 543 MP4 movies: 545 o ap4x: ProRes 4444 XQ 547 o ap4h: ProRes 4444 549 o apch: ProRes 422 High Quality 551 o apcn: ProRes 422 Standard Definition 553 o apcs: ProRes 422 LT 555 o apco: ProRes 422 Proxy 557 o aprh: ProRes RAW High Quality 559 o aprn: ProRes RAW Standard Definition 561 this page for more technical details on ProRes [10] 563 6.3.16. V_VP8 565 Codec ID: V_VP8 567 Codec Name: VP8 Codec format 568 Description: VP8 is an open and royalty free video compression format 569 developed by Google and created by On2 Technologies as a successor to 570 VP7. [RFC6386] 572 Initialization: none 574 6.3.17. V_VP9 576 Codec ID: V_VP9 578 Codec Name: VP9 Codec format 580 Description: VP9 is an open and royalty free video compression format 581 developed by Google as a successor to VP8. Draft VP9 Bitstream and 582 Decoding Process Specification [11] 584 Initialization: none 586 6.3.18. V_FFV1 588 Codec ID: V_FFV1 590 Codec Name: FF Video Codec 1 592 Description: FFV1 is a lossless intra-frame video encoding format 593 designed to efficiently compress video data in a variety of pixel 594 formats. Compared to uncompressed video, FFV1 offers storage 595 compression, frame fixity, and self-description, which makes FFV1 596 useful as a preservation or intermediate video format. Draft FFV1 597 Specification [12] 599 Initialization: For FFV1 versions 0 or 1, "Private Data" SHOULD NOT 600 be written. For FFV1 version 3 or greater, the "Private Data" MUST 601 contain the FFV1 Configuration Record structure, as defined in 602 , 603 and no other data. 605 6.4. Audio Codec Mappings 607 6.4.1. A_MPEG/L3 609 Codec ID: A_MPEG/L3 611 Codec Name: MPEG Audio 1, 2, 2.5 Layer III 613 Description: The data contain everything needed for playback in the 614 MPEG Audio header of each frame. Corresponding ACM wFormatTag : 615 0x0055 616 Initialization: none 618 6.4.2. A_MPEG/L2 620 Codec ID: A_MPEG/L2 622 Codec Name: MPEG Audio 1, 2 Layer II 624 Description: The data contain everything needed for playback in the 625 MPEG Audio header of each frame. Corresponding ACM wFormatTag : 626 0x0050 628 Initialization: none 630 6.4.3. A_MPEG/L1 632 Codec ID: A_MPEG/L1 634 Codec Name: MPEG Audio 1, 2 Layer I 636 Description: The data contain everything needed for playback in the 637 MPEG Audio header of each frame. Corresponding ACM wFormatTag : 638 0x0050 640 Initialization: none 642 6.4.4. A_PCM/INT/BIG 644 Codec ID: A_PCM/INT/BIG 646 Codec Name: PCM Integer Big Endian 648 Description: The audio bit depth MUST be read and set from the 649 "BitDepth Element". Audio samples MUST be considered as signed 650 values, except if the audio bit depth is "8" which MUST be 651 interpreted as unsigned values. Corresponding ACM wFormatTag : ??? 653 Initialization: none 655 6.4.5. A_PCM/INT/LIT 657 Codec ID: A_PCM/INT/LIT 659 Codec Name: PCM Integer Little Endian 661 Description: The audio bit depth MUST be read and set from the 662 "BitDepth Element". Audio samples MUST be considered as signed 663 values, except if the audio bit depth is "8" which MUST be 664 interpreted as unsigned values. Corresponding ACM wFormatTag : 665 0x0001 667 Initialization: none 669 6.4.6. A_PCM/FLOAT/IEEE 671 Codec ID: A_PCM/FLOAT/IEEE 673 Codec Name: Floating Point, IEEE compatible 675 Description: The audio bit depth MUST be read and set from the 676 "BitDepth Element" (32 bit in most cases). The floats are stored as 677 defined in [IEEE.754.1985] and in little endian order. Corresponding 678 ACM wFormatTag : 0x0003 680 Initialization: none 682 6.4.7. A_MPC 684 Codec ID: A_MPC 686 Codec Name: MPC (musepack) SV8 688 Description: The main developer for musepack has requested that we 689 wait until the SV8 framing has been fully defined for musepack before 690 defining how to store it in Matroska. 692 6.4.8. A_AC3 694 Codec ID: A_AC3 696 Codec Name: (Dolby[TM]) AC3 698 Description: BSID <= 8 !! The private data is void ??? Corresponding 699 ACM wFormatTag : 0x2000 ; channel number have to be read from the 700 corresponding audio element 702 6.4.9. A_AC3/BSID9 704 Codec ID: A_AC3/BSID9 706 Codec Name: (Dolby[TM]) AC3 708 Description: The ac3 frame header has, similar to the mpeg-audio 709 header a version field. Normal ac3 is defined as bitstream id 8 (5 710 Bits, numbers are 0-15). Everything below 8 is still compatible with 711 all decoders that handle 8 correctly. Everything higher are 712 additions that break decoder compatibility. For the samplerates 713 24kHz (00); 22,05kHz (01) and 16kHz (10) the BSID is 9 For the 714 samplerates 12kHz (00); 11,025kHz (01) and 8kHz (10) the BSID is 10 716 Initialization: none 718 6.4.10. A_AC3/BSID10 720 Codec ID: A_AC3/BSID10 722 Codec Name: (Dolby[TM]) AC3 724 Description: The ac3 frame header has, similar to the mpeg-audio 725 header a version field. Normal ac3 is defined as bitstream id 8 (5 726 Bits, numbers are 0-15). Everything below 8 is still compatible with 727 all decoders that handle 8 correctly. Everything higher are 728 additions that break decoder compatibility. For the samplerates 729 24kHz (00); 22,05kHz (01) and 16kHz (10) the BSID is 9 For the 730 samplerates 12kHz (00); 11,025kHz (01) and 8kHz (10) the BSID is 10 732 Initialization: none 734 6.4.11. A_ALAC 736 Codec ID: A_ALAC 738 Codec Name: ALAC (Apple Lossless Audio Codec) 740 Initialization: The "Private Data" contains ALAC's magic cookie (both 741 the codec specific configuration as well as the optional channel 742 layout information). Its format is described in ALAC's official 743 source code [13]. 745 6.4.12. A_DTS 747 Codec ID: A_DTS 749 Codec Name: Digital Theatre System 751 Description: Supports DTS, DTS-ES, DTS-96/26, DTS-HD High Resolution 752 Audio and DTS-HD Master Audio. The private data is void. 753 Corresponding ACM wFormatTag : 0x2001 755 Initialization: none 757 6.4.13. A_DTS/EXPRESS 759 Codec ID: A_DTS/EXPRESS 761 Codec Name: Digital Theatre System Express 763 Description: DTS Express (a.k.a. LBR) audio streams. The private 764 data is void. Corresponding ACM wFormatTag : 0x2001 766 Initialization: none 768 6.4.14. A_DTS/LOSSLESS 770 Codec ID: A_DTS/LOSSLESS 772 Codec Name: Digital Theatre System Lossless 774 Description: DTS Lossless audio that does not have a core substream. 775 The private data is void. Corresponding ACM wFormatTag : 0x2001 777 Initialization: none 779 6.4.15. A_VORBIS 781 Codec ID: A_VORBIS 783 Codec Name: Vorbis 785 Initialization: The "Private Data" contains the first three Vorbis 786 packet in order. The lengths of the packets precedes them. The 787 actual layout is: - Byte 1: number of distinct packets '"#p"' minus 788 one inside the CodecPrivate block. This MUST be '2' for current (as 789 of 2016-07-08) Vorbis headers. - Bytes 2..n: lengths of the first 790 '"#p"' packets, coded in Xiph-style lacing. The length of the last 791 packet is the length of the CodecPrivate block minus the lengths 792 coded in these bytes minus one. - Bytes n+1..: The Vorbis 793 identification header [14], followed by the Vorbis comment header 794 [15] followed by the codec setup header [16]. 796 6.4.16. A_FLAC 798 Codec ID: A_FLAC 800 Codec Name: FLAC (Free Lossless Audio Codec) [17] 802 Initialization: The "Private Data" contains all the header/metadata 803 packets before the first data packet. These include the first header 804 packet containing only the word "fLaC" as well as all metadata 805 packets. 807 6.4.17. A_REAL/14_4 809 Codec ID: A_REAL/14_4 811 Codec Name: Real Audio 1 813 Initialization: The "Private Data" contains either the 814 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 815 (differentiated by their "version" field; Big Endian byte order) as 816 found in librmff [18]. 818 6.4.18. A_REAL/28_8 820 Codec ID: A_REAL/28_8 822 Codec Name: Real Audio 2 824 Initialization: The "Private Data" contains either the 825 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 826 (differentiated by their "version" field; Big Endian byte order) as 827 found in librmff [19]. 829 6.4.19. A_REAL/COOK 831 Codec ID: A_REAL/COOK 833 Codec Name: Real Audio Cook Codec (codename: Gecko) 835 Initialization: The "Private Data" contains either the 836 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 837 (differentiated by their "version" field; Big Endian byte order) as 838 found in librmff [20]. 840 6.4.20. A_REAL/SIPR 842 Codec ID: A_REAL/SIPR 844 Codec Name: Sipro Voice Codec 846 Initialization: The "Private Data" contains either the 847 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 848 (differentiated by their "version" field; Big Endian byte order) as 849 found in librmff [21]. 851 6.4.21. A_REAL/RALF 853 Codec ID: A_REAL/RALF 855 Codec Name: Real Audio Lossless Format 857 Initialization: The "Private Data" contains either the 858 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 859 (differentiated by their "version" field; Big Endian byte order) as 860 found in librmff [22]. 862 6.4.22. A_REAL/ATRC 864 Codec ID: A_REAL/ATRC 866 Codec Name: Sony Atrac3 Codec 868 Initialization: The "Private Data" contains either the 869 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 870 (differentiated by their "version" field; Big Endian byte order) as 871 found in librmff [23]. 873 6.4.23. A_MS/ACM 875 Codec ID: A_MS/ACM 877 Codec Name: Microsoft(TM) Audio Codec Manager (ACM) 879 Description: The data are stored in little endian format (like on 880 IA32 machines). 882 Initialization: The "Private Data" contains the ACM structure 883 WAVEFORMATEX including the extra private bytes, as defined by 884 Microsoft [24]. 886 6.4.24. A_AAC/MPEG2/MAIN 888 Codec ID: A_AAC/MPEG2/MAIN 890 Codec Name: MPEG2 Main Profile 892 Description: Channel number and sample rate have to be read from the 893 corresponding audio element. Audio stream is stripped from ADTS 894 headers and normal Matroska frame based muxing scheme is applied. 895 AAC audio always uses wFormatTag 0xFF. 897 Initialization: none 899 6.4.25. A_AAC/MPEG2/LC 901 Codec ID: A_AAC/MPEG2/LC 903 Codec Name: Low Complexity 905 Description: Channel number and sample rate have to be read from the 906 corresponding audio element. Audio stream is stripped from ADTS 907 headers and normal Matroska frame based muxing scheme is applied. 908 AAC audio always uses wFormatTag 0xFF. 910 Initialization: none 912 6.4.26. A_AAC/MPEG2/LC/SBR 914 Codec ID: A_AAC/MPEG2/LC/SBR 916 Codec Name: Low Complexity with Spectral Band Replication 918 Description: Channel number and sample rate have to be read from the 919 corresponding audio element. Audio stream is stripped from ADTS 920 headers and normal Matroska frame based muxing scheme is applied. 921 AAC audio always uses wFormatTag 0xFF. 923 Initialization: none 925 6.4.27. A_AAC/MPEG2/SSR 927 Codec ID: A_AAC/MPEG2/SSR 929 Codec Name: Scalable Sampling Rate 931 Description: Channel number and sample rate have to be read from the 932 corresponding audio element. Audio stream is stripped from ADTS 933 headers and normal Matroska frame based muxing scheme is applied. 934 AAC audio always uses wFormatTag 0xFF. 936 Initialization: none 938 6.4.28. A_AAC/MPEG4/MAIN 940 Codec ID: A_AAC/MPEG4/MAIN 942 Codec Name: MPEG4 Main Profile 944 Description: Channel number and sample rate have to be read from the 945 corresponding audio element. Audio stream is stripped from ADTS 946 headers and normal Matroska frame based muxing scheme is applied. 947 AAC audio always uses wFormatTag 0xFF. 949 Initialization: none 951 6.4.29. A_AAC/MPEG4/LC 953 Codec ID: A_AAC/MPEG4/LC 955 Codec Name: Low Complexity 957 Description: Channel number and sample rate have to be read from the 958 corresponding audio element. Audio stream is stripped from ADTS 959 headers and normal Matroska frame based muxing scheme is applied. 960 AAC audio always uses wFormatTag 0xFF. 962 Initialization: none 964 6.4.30. A_AAC/MPEG4/LC/SBR 966 Codec ID: A_AAC/MPEG4/LC/SBR 968 Codec Name: Low Complexity with Spectral Band Replication 970 Description: Channel number and sample rate have to be read from the 971 corresponding audio element. Audio stream is stripped from ADTS 972 headers and normal Matroska frame based muxing scheme is applied. 973 AAC audio always uses wFormatTag 0xFF. 975 Initialization: none 977 6.4.31. A_AAC/MPEG4/SSR 979 Codec ID: A_AAC/MPEG4/SSR 981 Codec Name: Scalable Sampling Rate 983 Description: Channel number and sample rate have to be read from the 984 corresponding audio element. Audio stream is stripped from ADTS 985 headers and normal Matroska frame based muxing scheme is applied. 986 AAC audio always uses wFormatTag 0xFF. 988 Initialization: none 990 6.4.32. A_AAC/MPEG4/LTP 992 Codec ID: A_AAC/MPEG4/LTP 994 Codec Name: Long Term Prediction 996 Description: Channel number and sample rate have to be read from the 997 corresponding audio element. Audio stream is stripped from ADTS 998 headers and normal Matroska frame based muxing scheme is applied. 999 AAC audio always uses wFormatTag 0xFF. 1001 Initialization: none 1003 6.4.33. A_QUICKTIME 1005 Codec ID: A_QUICKTIME 1007 Codec Name: Audio taken from QuickTime(TM) files 1009 Description: Several codecs as stored in QuickTime, e.g. QDesign 1010 Music v1 or v2. 1012 Initialization: The "Private Data" contains all additional data that 1013 is stored in the 'stsd' (sample description) atom in the QuickTime 1014 file *after* the mandatory sound descriptor structure (starting with 1015 the size and FourCC fields). For an explanation of the QuickTime 1016 file format read QuickTime File Format Specification [25]. 1018 6.4.34. A_QUICKTIME/QDMC 1020 Codec ID: A_QUICKTIME/QDMC 1022 Codec Name: QDesign Music 1024 Description: 1026 Initialization: The "Private Data" contains all additional data that 1027 is stored in the 'stsd' (sample description) atom in the QuickTime 1028 file *after* the mandatory sound descriptor structure (starting with 1029 the size and FourCC fields). For an explanation of the QuickTime 1030 file format read QuickTime File Format Specification [26]. 1032 Superseded By: A_QUICKTIME 1034 6.4.35. A_QUICKTIME/QDM2 1036 Codec ID: A_QUICKTIME/QDM2 1038 Codec Name: QDesign Music v2 1040 Description: 1042 Initialization: The "Private Data" contains all additional data that 1043 is stored in the 'stsd' (sample description) atom in the QuickTime 1044 file *after* the mandatory sound descriptor structure (starting with 1045 the size and FourCC fields). For an explanation of the QuickTime 1046 file format read QuickTime File Format Specification [27]. 1048 Superseded By: A_QUICKTIME 1050 6.4.36. A_TTA1 1052 Codec ID: A_TTA1 1054 Codec Name: The True Audio [28] lossless audio compressor 1056 Description: TTA format description [29] Each frame is kept intact, 1057 including the CRC32. The header and seektable are dropped. 1058 SamplingFrequency, Channels and BitDepth are used in the TrackEntry. 1059 wFormatTag = 0x77A1 1061 Initialization: none 1063 6.4.37. A_WAVPACK4 1065 Codec ID: A_WAVPACK4 1067 Codec Name: WavPack [30] lossless audio compressor 1069 Description: The Wavpack packets consist of a stripped header 1070 followed by the frame data. For multi-track (> 2 tracks) a frame 1071 consists of many packets. For hybrid files (lossy part + correction 1072 part), the correction part is stored in an additional block (level 1073 1). For more details, check the WavPack muxing description [31]. 1075 Initialization: none 1077 6.5. Subtitle Codec Mappings 1078 6.5.1. S_TEXT/UTF8 1080 Codec ID: S_TEXT/UTF8 1082 Codec Name: UTF-8 Plain Text 1084 Description: Basic text subtitles. For more information, please look 1085 at Section 7. 1087 6.5.2. S_TEXT/SSA 1089 Codec ID: S_TEXT/SSA 1091 Codec Name: Subtitles Format 1093 Description: The [Script Info] and [V4 Styles] sections are stored in 1094 the codecprivate. Each event is stored in its own Block. For more 1095 information, see Section 7. 1097 6.5.3. S_TEXT/ASS 1099 Codec ID: S_TEXT/ASS 1101 Codec Name: Advanced Subtitles Format 1103 Description: The [Script Info] and [V4 Styles] sections are stored in 1104 the codecprivate. Each event is stored in its own Block. For more 1105 information, see Section 7. 1107 6.5.4. S_TEXT/USF 1109 Codec ID: S_TEXT/USF 1111 Codec Name: Universal Subtitle Format 1113 Description: This is mostly defined, but not typed out yet. It will 1114 first be available on the USF specification Section 7. 1116 6.5.5. S_TEXT/WEBVTT 1118 Codec ID: S_TEXT/WEBVTT 1120 Codec Name: Web Video Text Tracks Format (WebVTT) 1122 Description: Advanced text subtitles. For more information, see 1123 Section 7. 1125 6.5.6. S_IMAGE/BMP 1127 Codec ID: S_IMAGE/BMP 1129 Codec Name: Bitmap 1131 Description: Basic image based subtitle format; The subtitles are 1132 stored as images, like in the DVD. The timestamp in the block header 1133 of Matroska indicates the start display time, the duration is set 1134 with the Duration element. The full data for the subtitle bitmap is 1135 stored in the Block's data section. 1137 6.5.7. S_DVBSUB 1139 Codec ID: S_DVBSUB 1141 Codec Name: Digital Video Broadcasting (DVB) subtitles 1143 Description: This is the graphical subtitle format used in the 1144 Digital Video Broadcasting standard. For more information, see 1145 Section 7. 1147 6.5.8. S_VOBSUB 1149 Codec ID: S_VOBSUB 1151 Codec Name: VobSub subtitles 1153 Description: The same subtitle format used on DVDs. Supported is 1154 only format version 7 and newer. VobSubs consist of two files, the 1155 .idx containing information, and the .sub, containing the actual 1156 data. The .idx file is stripped of all empty lines, of all comments 1157 and of lines beginning with "alt:" or "langidx:". The line beginning 1158 with "id:" SHOULD be transformed into the appropriate Matroska track 1159 language element and is discarded. All remaining lines but the ones 1160 containing timestamps and file positions are put into the 1161 "CodecPrivate" element. 1163 For each line containing the timestamp and file position data is read 1164 from the appropriate position in the .sub file. This data consists 1165 of a MPEG program stream which in turn contains SPU packets. The 1166 MPEG program stream data is discarded, and each SPU packet is put 1167 into one Matroska frame. 1169 6.5.9. S_HDMV/PGS 1171 Codec ID: S_HDMV/PGS 1173 Codec Name: HDMV presentation graphics subtitles (PGS) 1175 Description: This is the graphical subtitle format used on Blu-rays. 1176 For more information, see Section 7. 1178 6.5.10. S_HDMV/TEXTST 1180 Codec ID: S_HDMV/TEXTST 1182 Codec Name: HDMV text subtitles 1184 Description: This is the textual subtitle format used on Blu-rays. 1185 For more information, see Section 7. 1187 6.5.11. S_KATE 1189 Codec ID: S_KATE 1191 Codec Name: Karaoke And Text Encapsulation 1193 Description: A subtitle format developed for ogg. The mapping for 1194 Matroska is described on the Xiph wiki [32]. As for Theora and 1195 Vorbis, Kate headers are stored in the private data as xiph-laced 1196 packets. 1198 6.6. Button Codec Mappings 1200 6.6.1. B_VOBBTN 1202 Codec ID: B_VOBBTN 1204 Codec Name: VobBtn Buttons 1206 Description: Based on MPEG/VOB PCI packets [33]. The file contains a 1207 header consisting of the string "butonDVD" followed by the width and 1208 height in pixels (16 bits integer each) and 4 reserved bytes. The 1209 rest is full PCI packets [34]. 1211 7. Subtitles 1213 Because Matroska is a general container format, we try to avoid 1214 specifying the formats to store in it. This type of work is really 1215 outside of the scope of a container-only format. However, because 1216 the use of subtitles in A/V containers has been so limited (with the 1217 exception of DVD) we are taking the time to specify how to store some 1218 of the more common subtitle formats in Matroska. This is being done 1219 to help facilitate their growth. Otherwise, incompatibilities could 1220 prevent the standardization and use of subtitle storage. 1222 This page is not meant to be a complete listing of all subtitle 1223 formats that will be used in Matroska, it is only meant to be a guide 1224 for the more common, current formats. It is possible that we will 1225 add future formats to this page as they are created, but it is not 1226 likely as any other new subtitle format designer would likely have 1227 their own specifications. Any specification listed here SHOULD be 1228 strictly adhered to or it SHOULD NOT use the corresponding Codec ID. 1230 Here is a list of pointers for storing subtitles in Matroska: 1232 o Any Matroska file containing only subtitles SHOULD use the 1233 extension ".mks". 1235 o As a general rule of thumb for all codecs, information that is 1236 global to an entire stream SHOULD be stored in the CodecPrivate 1237 element. 1239 o Start and stop timestamps that are used in a timestamps native 1240 storage format SHOULD be removed when being placed in Matroska as 1241 they could interfere if the file is edited afterwards. Instead, 1242 the Blocks timestamp and Duration SHOULD be used to say when the 1243 timestamp is displayed. 1245 o Because a "subtitle" stream is actually just an overlay stream, 1246 anything with a transparency layer could be use, including video. 1248 7.1. Images Subtitles 1250 The first image format that is a goal to import into Matroska is the 1251 VobSub subtitle format. This subtitle type is generated by exporting 1252 the subtitles from a DVD. 1254 The requirement for muxing VobSub into Matroska is v7 subtitles (see 1255 first line of the .IDX file). If the version is smaller, you must 1256 remux them using the SubResync utility from VobSub 2.23 (or MPC) into 1257 v7 format. Generally any newly created subs will be in v7 format. 1259 The .IFO file will not be used at all. 1261 If there is more than one subtitle stream in the VobSub set, each 1262 stream will need to be separated into separate tracks for storage in 1263 Matroska. E.g. the VobSub file contains streams for both English and 1264 German subtitles. Then the resulting Matroska file SHOULD contain 1265 two tracks. That way the language information can be 'dropped' and 1266 mapped to Matroska's language tags. 1268 The .IDX file is reformatted (see below) and placed in the 1269 CodecPrivate. 1271 Each .BMP will be stored in its own Block. The Timestamp with be 1272 stored in the Blocks Timestamp and the duration will be stored in the 1273 Default Duration. 1275 Here is an example .IDX file: 1277 # VobSub index file, v7 (do not modify this line!) 1278 # 1279 # To repair desynchronization, you can insert gaps this way: 1280 # (it usually happens after vob id changes) 1281 # 1282 # delay: [sign]hh:mm:ss:ms 1283 # 1284 # Where: 1285 # [sign]: +, - (optional) 1286 # hh: hours (0 <= hh) 1287 # mm/ss: minutes/seconds (0 <= mm/ss <= 59) 1288 # ms: milliseconds (0 <= ms <= 999) 1289 # 1290 # Note: You can't position a sub before the previous with a negative 1291 # value. 1292 # 1293 # You can also modify timestamps or delete a few subs you don't like. 1294 # Just make sure they stay in increasing order. 1296 # Settings 1298 # Original frame size 1299 size: 720x480 1301 # Origin, relative to the upper-left corner, can be overloaded by 1302 # alignment 1303 org: 0, 0 1305 # Image scaling (hor,ver), origin is at the upper-left corner or at 1306 # the alignment coord (x, y) 1307 scale: 100%, 100% 1309 # Alpha blending 1310 alpha: 100% 1312 # Smoothing for very blocky images (use OLD for no filtering) 1313 smooth: OFF 1315 # In millisecs 1316 fadein/out: 50, 50 1318 # Force subtitle placement relative to (org.x, org.y) 1319 align: OFF at LEFT TOP 1321 # For correcting non-progressive desync. (in millisecs or hh:mm:ss:ms) 1322 # Note: Not effective in DirectVobSub, use "delay: ... " instead. 1323 time offset: 0 1325 # ON: displays only forced subtitles, OFF: shows everything 1326 forced subs: OFF 1328 # The original palette of the DVD 1329 palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, \ 1330 b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, fdfdfd 1332 # Custom colors (transp idxs and the four colors) 1333 custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \ 1334 000000 1336 # Language index in use 1337 langidx: 0 1339 # English 1340 id: en, index: 0 1341 # Uncomment next line to activate alternative name in DirectVobSub / 1342 # Windows Media Player 6.x 1343 # alt: English 1344 # Vob/Cell ID: 1, 1 (PTS: 0) 1345 timestamp: 00:00:01:101, filepos: 000000000 1346 timestamp: 00:00:08:708, filepos: 000001000 1348 First, lines beginning with "#" are removed. These are comments to 1349 make text file editing easier, and as this is not a text file, they 1350 aren't needed. 1352 Next remove the "langidx" and "id" lines. These are used to 1353 differentiate the subtitle streams and define the language. As the 1354 streams will be stored separately anyway, there is no need to 1355 differentiate them here. Also, the language setting will be stored 1356 in the Matroska tags, so there is no need to store it here. 1358 Finally, the "timestamp" will be used to set the Block's timestamp. 1359 Once it is set there, there is no need for it to be stored here. 1361 Also, as it may interfere if the file is edited, it SHOULD NOT be 1362 stored here. 1364 Once all of these items are removed, the data to store in the 1365 CodecPrivate SHOULD look like this: 1367 size: 720x480 1368 org: 0, 0 1369 scale: 100%, 100% 1370 alpha: 100% 1371 smooth: OFF 1372 fadein/out: 50, 50 1373 align: OFF at LEFT TOP 1374 time offset: 0 1375 forced subs: OFF 1376 palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, \ 1377 b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, fdfdfd 1378 custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \ 1379 000000 1381 There SHOULD also be two Blocks containing one image each with the 1382 timestamps "00:00:01:101" and "00:00:08:708". 1384 7.2. SRT Subtitles 1386 SRT is perhaps the most basic of all subtitle formats. 1388 It consists of four parts, all in text.. 1390 1. A number indicating which subtitle it is in the sequence. 2. 1391 The time that the subtitle appears on the screen, and then 1392 disappears. 3. The subtitle itself. 4. A blank line indicating 1393 the start of a new subtitle. 1395 When placing SRT in Matroska, part 3 is converted to UTF-8 (S_TEXT/ 1396 UTF8) and placed in the data portion of the Block. Part 2 is used to 1397 set the timestamp of the Block, and BlockDuration element. Nothing 1398 else is used. 1400 Here is an example SRT file: 1402 1 1403 00:02:17,440 --> 00:02:20,375 1404 Senator, we're making 1405 our final approach into Coruscant. 1407 2 1408 00:02:20,476 --> 00:02:22,501 1409 Very good, Lieutenant. 1411 In this example, the text "Senator, we're making our final approach 1412 into Coruscant." would be converted into UTF-8 and placed in the 1413 Block. The timestamp of the block would be set to "00:02:17,440". 1414 And the BlockDuration element would be set to "00:00:02,935". 1416 The same is repeated for the next subtitle. 1418 Because there are no general settings for SRT, the CodecPrivate is 1419 left blank. 1421 7.3. SSA/ASS Subtitles 1423 SSA stands for Sub Station Alpha. It's the file format used by the 1424 popular subtitle editor, SubStation Alpha [35]. This format is 1425 widely used by fansubbers. 1427 It allows you to do some advanced display features, like positioning, 1428 karaoke, style managements... 1430 For detailed information on SSA/ASS, see the SSA specs [36]. It 1431 includes an SSA specs description and the advanced features added by 1432 ASS format (standing for Advanced SSA). Because SSA and ASS are so 1433 similar, they are treated the same here. 1435 Like SRT, this format is text based with a particular syntax. 1437 A file consists of 4 or 5 parts, declared ala INI file (but it's not 1438 an INI !) 1440 The first, "[Script Info]" contains some information about the 1441 subtitle file, such as it's title, who created it, type of script and 1442 a very important one : "PlayResY". Be careful of this value, 1443 everything in your script (font size, positioning) is scaled by it. 1444 Sub Station Alpha uses your desktops Y resolution to write this 1445 value, so if a friend with a large monitor and a high screen 1446 resolution gives you an edited script, you can mess everything up by 1447 saving the script in SSA with your low-cost monitor. 1449 The second, "[V4 Styles]", is a list of style definitions. A style 1450 describe how will look a text on the screen. It defines font, font 1451 size, primary/.../outile colour, position, alignment, etc. 1453 For example this : 1455 Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding 1456 Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0 1458 The third, "[Events]", is the list of text you want to display at the 1459 right timing. You can specify some attribute here. Like the style 1460 to use for this event (MUST be defined in the list), the position of 1461 the text (Left, Right, Vertical Margin), an effect. Name is mostly 1462 used by translator to know who said this sentence. Timing is in 1463 h:mm:ss.cc (centisec). 1465 Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text 1466 Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ? 1467 Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf main,autre,0000,0000,0000,,Toujours rien. 1469 "[Pictures]" or "[Fonts]" part can be found in some SSA file, they 1470 contains UUE-encoded pictures/font but those features are only used 1471 by Sub Station Alpha, i.e. no filter (Vobsub/Avery Lee Subtiler 1472 filter) use them. 1474 Now, how are they stored in Matroska ? 1476 o All text is converted to UTF-8* All the headers are stored in 1477 CodecPrivate ( Script Info and the Styles list)* Start & End field 1478 are used to set TimeStamp and the BlockDuration element. the data 1479 stored is :* Events are stored in the Block in this order: 1480 ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, 1481 Text (Layer comes from ASS specs ... it's empty for SSA.) 1482 "ReadOrder field is needed for the decoder to be able to reorder 1483 the streamed samples as they were placed originally in the file." 1485 Here is an example of an SSA file. 1487 [Script Info] 1488 ; This is a Sub Station Alpha v4 script. 1489 ; For Sub Station Alpha info and downloads, 1490 ; go to [http://www.eswat.demon.co.uk/](http://www.eswat.demon.co.uk/) 1491 ; or email [kotus@eswat.demon.co.uk](mailto:kotus@eswat.demon.co.uk) 1492 Title: Wolf's rain 2 1493 Original Script: Anime-spirit Ishin-francais 1494 Original Translation: Coolman 1495 Original Editing: Spikewolfwood 1496 Original Timing: Lord_alucard 1497 Original Script Checking: Spikewolfwood 1498 ScriptType: v4.00 1499 Collisions: Normal 1500 PlayResY: 1024 1501 PlayDepth: 0 1502 Wav: 0, 128697,D:\Alex\Anime\- Fansub -\- TAFF -\Wolf's Rain\WR_-_02_Wav.wav 1503 Wav: 0, 120692,H:\team truc\WR_-_02.wav 1504 Wav: 0, 116504,E:\sub\wolf's_rain\WOLF'S RAIN 02.wav 1505 LastWav: 3 1506 Timer: 100,0000 1508 [V4 Styles] 1509 Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding 1510 Style: Default,Arial,20,65535,65535,65535,-2147483640,-1,0,1,3,0,2,30,30,30,0,0 1511 Style: Titre_episode,Akbar,140,15724527,65535,65535,986895,-1,0,1,1,0,3,30,30,30,0,0 1512 Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0 1514 [Events] 1515 Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text 1516 Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ? 1517 Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf main,autre,0000,0000,0000,,Toujours rien. 1519 Here is what would be placed into the CodecPrivate element. 1521 [Script Info] 1522 ; This is a Sub Station Alpha v4 script. 1523 ; For Sub Station Alpha info and downloads, 1524 ; go to [http://www.eswat.demon.co.uk/](http://www.eswat.demon.co.uk/) 1525 ; or email [kotus@eswat.demon.co.uk](mailto:kotus@eswat.demon.co.uk) 1526 Title: Wolf's rain 2 1527 Original Script: Anime-spirit Ishin-francais 1528 Original Translation: Coolman 1529 Original Editing: Spikewolfwood 1530 Original Timing: Lord_alucard 1531 Original Script Checking: Spikewolfwood 1532 ScriptType: v4.00 1533 Collisions: Normal 1534 PlayResY: 1024 1535 PlayDepth: 0 1536 Wav: 0, 128697,D:\Alex\Anime\- Fansub -\- TAFF -\Wolf's Rain\WR_-_02_Wav.wav 1537 Wav: 0, 120692,H:\team truc\WR_-_02.wav 1538 Wav: 0, 116504,E:\sub\wolf's_rain\WOLF'S RAIN 02.wav 1539 LastWav: 3 1540 Timer: 100,0000 1542 [V4 Styles] 1543 Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding 1544 Style: Default,Arial,20,65535,65535,65535,-2147483640,-1,0,1,3,0,2,30,30,30,0,0 1545 Style: Titre_episode,Akbar,140,15724527,65535,65535,986895,-1,0,1,1,0,3,30,30,30,0,0 1546 Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0 1548 And here are the two blocks that would be generated. 1550 Block's timestamp: 00:02:40.650 BlockDuration: 00:00:01.140 1552 1,,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ? 1554 Block's timestamp: 00:02:42.420 BlockDuration: 00:00:01.730 1556 2,,Wolf main,autre,0000,0000,0000,,Toujours rien. 1558 7.4. USF Subtitles 1560 Under construction 1562 7.5. WebVTT 1564 The "Web Video Text Tracks Format" (short: WebVTT) is developed by 1565 the World Wide Web Consortium (W3C) [37]. Its specifications are 1566 freely available [38]. 1568 The guiding principles for the storage of WebVTT in Matroska are: 1570 o Consistency: store data in a similar way to other subtitle codecs 1572 o Simplicity: making decoding and remuxing as easy as possible for 1573 existing infrastructures 1575 o Completeness: keeping as much data as possible from the original 1576 WebVTT file 1578 7.5.1. Storage of WebVTT in Matroska 1580 7.5.1.1. CodecID: codec identification 1582 The CodecID to use is "S_TEXT/WEBVTT". 1584 7.5.1.2. CodecPrivate: storage of global WebVTT blocks 1586 This element contains all global blocks before the first subtitle 1587 entry. This starts at the ""WEBVTT"" file identification marker but 1588 excludes the optional byte order mark. 1590 7.5.1.3. Storage of non-global WebVTT blocks 1592 Non-global WebVTT blocks (e.g. "NOTE") before a WebVTT Cue Text are 1593 stored in Matroska's BlockAddition element together with the Matroska 1594 Block containing the WebVTT Cue Text these blocks precede (see below 1595 for the actual format). 1597 7.5.1.4. Storage of Cues in Matroska blocks 1599 Each WebVTT Cue Text is stored directly in the Matroska Block. 1601 A muxer MUST change all WebVTT Cue Timestamps present within the Cue 1602 Text to be relative to the Matroska Block's timestamp. 1604 The Cue's start timestamp is used as the Matroska Block's timestamp. 1606 The difference between the Cue's end timestamp and its start 1607 timestamp is used as the Matroska Block's duration. 1609 7.5.1.5. BlockAdditions: storing non-global WebVTT blocks, Cue Settings 1610 Lists and Cue identifiers 1612 Each Matroska Block may be accompanied by one BlockAdditions element. 1613 Its format is as follows: 1615 1. The first line contains the WebVTT Cue Text's optional Cue 1616 Settings List followed by one line feed character (U+0x000a). 1618 The Cue Settings List may be empty in which case the line 1619 consists of the line feed character only. 1621 2. The second line contains the WebVTT Cue Text's optional Cue 1622 Identifier followed by one line feed character (U+0x000a). The 1623 line may be empty indicating that there was no Cue Identifier in 1624 the source file in which case the line consists of the line feed 1625 character only. 1627 3. The third and all following lines contain all WebVTT Comment 1628 Blocks that precede the current WebVTT Cue Block. These may be 1629 absent. 1631 If there is no Matroska BlockAddition element stored together with 1632 the Matroska Block then all three components (Cue Settings List, Cue 1633 Identifier, Cue Comments) MUST be assumed to be absent. 1635 7.5.2. Examples of transformation 1637 Here's an example how a WebVTT is transformed. 1639 7.5.2.1. Example WebVTT file 1641 Let's take the following example file: 1643 WEBVTT with text after the signature 1645 STYLE 1646 ::cue { 1647 background-image: linear-gradient(to bottom, dimgray, lightgray); 1648 color: papayawhip; 1649 } 1650 /* Style blocks cannot use blank lines nor "dash dash greater than" */ 1652 NOTE comment blocks can be used between style blocks. 1654 STYLE 1655 ::cue(b) { 1656 color: peachpuff; 1657 } 1659 REGION 1660 id:bill 1661 width:40% 1662 lines:3 1663 regionanchor:0%,100% 1664 viewportanchor:10%,90% 1665 scroll:up 1667 NOTE 1668 Notes always span a whole block and can cover multiple 1669 lines. Like this one. 1670 An empty line ends the block. 1672 hello 1673 00:00:00.000 --> 00:00:10.000 1674 Example entry 1: Hello world. 1676 NOTE style blocks cannot appear after the first cue. 1678 00:00:25.000 --> 00:00:35.000 1679 Example entry 2: Another entry. 1680 This one has multiple lines. 1682 00:01:03.000 --> 00:01:06.500 position:90% align:right size:35% 1683 Example entry 3: That stuff to the right of the timestamps are cue settings. 1685 00:03:10.000 --> 00:03:20.000 1686 Example entry 4: Entries can even include timestamps. 1687 For example:<00:03:15.000>This becomes visible five seconds 1688 after the first part. 1690 7.5.2.2. Example of CodecPrivate 1692 The resulting CodecPrivate element will look like this: 1694 WEBVTT with text after the signature 1696 STYLE 1697 ::cue { 1698 background-image: linear-gradient(to bottom, dimgray, lightgray); 1699 color: papayawhip; 1700 } 1701 /* Style blocks cannot use blank lines nor "dash dash greater than" */ 1703 NOTE comment blocks can be used between style blocks. 1705 STYLE 1706 ::cue(b) { 1707 color: peachpuff; 1708 } 1710 REGION 1711 id:bill 1712 width:40% 1713 lines:3 1714 regionanchor:0%,100% 1715 viewportanchor:10%,90% 1716 scroll:up 1718 NOTE 1719 Notes always span a whole block and can cover multiple 1720 lines. Like this one. 1721 An empty line ends the block. 1723 7.5.2.3. Storage of Cue 1 1725 Example Cue 1: timestamp 00:00:00.000, duration 00:00:10.000, Block's 1726 content: 1728 Example entry 1: Hello world. 1730 BlockAddition's content starts with one empty line as there's no Cue 1731 Settings List: 1733 hello 1735 7.5.2.4. Storage of Cue 2 1737 Example Cue 2: timestamp 00:00:25.000, duration 00:00:10.000, Block's 1738 content: 1740 Example entry 2: Another entry. 1741 This one has multiple lines. 1743 BlockAddition's content starts with two empty lines as there's 1744 neither a Cue Settings List nor a Cue Identifier: 1746 NOTE style blocks cannot appear after the first cue. 1748 7.5.2.5. Storage of Cue 3 1750 Example Cue 3: timestamp 00:01:03.000, duration 00:00:03.500, Block's 1751 content: 1753 Example entry 3: That stuff to the right of the timestamps are cue settings. 1755 BlockAddition's content ends with an empty line as there's no Cue 1756 Identifier and there were no WebVTT Comment blocks: 1758 position:90% align:right size:35% 1760 7.5.2.6. Storage of Cue 4 1762 Example Cue 4: timestamp 00:03:10.000, duration 00:00:10.000, Block's 1763 content: 1765 Example entry 4: Entries can even include timestamps. For 1766 example:<00:00:05.000>This becomes visible five seconds after the 1767 first part. 1769 This Block does not need a BlockAddition as the Cue did not contain 1770 an Identifier, nor a Settings List, and it wasn't preceded by Comment 1771 blocks. 1773 7.5.3. Storage of WebVTT in Matroska vs. WebM 1775 Note: the storage of WebVTT in Matroska is not the same as the design 1776 document for storage of WebVTT in WebM. There are several reasons 1777 for this including but not limited to: the WebM document is old (from 1778 February 2012) and was based on an earlier draft of WebVTT and 1779 ignores several parts that were added to WebVTT later; WebM does 1780 still not support subtitles at all [39]; the proposal suggests 1781 splitting the information across multiple tracks making demuxer's and 1782 remuxer's life very difficult. 1784 7.6. HDMV presentation graphics subtitles 1786 The specifications for the HDMV presentation graphics subtitle format 1787 (short: HDMV PGS) can be found in the document "Blu-ray Disc Read- 1788 Only Format; Part 3 -- Audio Visual Basic Specifications" in section 1789 9.14 "HDMV graphics streams". 1791 7.6.1. Storage of HDMV presentation graphics subtitles 1793 The CodecID to use is "S_HDMV/PGS". A CodecPrivate element is not 1794 used. 1796 7.6.1.1. Storage of HDMV PGS Segments in Matroska Blocks 1798 Each HDMV PGS Segment (short: Segment) will be stored in a Matroska 1799 Block. A Segment is the data structure described in section 9.14.2.1 1800 "Segment coding structure and parameters" of the Blu-ray 1801 specifications. 1803 Each Segment contains a presentation timestamp. This timestamp will 1804 be used as the timestamp for the Matroska Block. 1806 A Segment is normally shown until a subsequent Segment is 1807 encountered. Therefore the Matroska Block MAY have no Duration. In 1808 that case a player MUST display a Segment within a Matroska Block 1809 until the next Segment is encountered. 1811 A muxer MAY use a Duration, e.g. by calculating the distance between 1812 two subsequent Segments. If a Matroska Block has a Duration, a 1813 player MUST display that Segment only for the duration of the Block's 1814 Duration. 1816 7.7. HDMV text subtitles 1818 The specifications for the HDMV text subtitle format (short: HDMV 1819 TextST) can be found in the document "Blu-ray Disc Read-Only Format; 1820 Part 3 -- Audio Visual Basic Specifications" in section 9.15 "HDMV 1821 text subtitle streams". 1823 7.7.1. Storage of HDMV text subtitles 1825 The CodecID to use is "S_HDMV/TEXTST". 1827 A CodecPrivate Element is required. It MUST contain the stream's 1828 Dialog Style Segment as described in section 9.15.4.2 "Dialog Style 1829 Segment" of the Blu-ray specifications. 1831 7.7.1.1. Storage of HDMV TextST Dialog Presentation Segments in 1832 Matroska Blocks 1834 Each HDMV Dialog Presentation Segment (short: Segment) will be stored 1835 in a Matroska Block. A Segment is the data structure described in 1836 section 9.15.4.3 "Dialog presentation segment" of the Blu-ray 1837 specifications. 1839 Each Segment contains a start and an end presentation timestamp 1840 (short: start PTS & end PTS). The start PTS will be used as the 1841 timestamp for the Matroska Block. The Matroska Block MUST have a 1842 Duration, and that Duration is the difference between the end PTS and 1843 the start PTS. 1845 A player MUST use the Matroska Block's timestamp and Duration instead 1846 of the Segment's start and end PTS for determining when and how long 1847 to show the Segment. 1849 7.7.1.2. Character set 1851 When TextST subtitles are stored inside Matroska, the only allowed 1852 character set is UTF-8. 1854 Each HDMV text subtitle stream in a Blu-ray can use one of a handful 1855 of character sets. This information is not stored in the MPEG2 1856 Transport Stream itself but in the accompanying Clip Information 1857 file. 1859 Therefore a muxer MUST parse the accompanying Clip Information file. 1860 If the information indicates a character set other than UTF-8, it 1861 MUST re-encode all text Dialog Presentation Segments from the 1862 indicated character set to UTF-8 prior to storing them in Matroska. 1864 7.8. Digital Video Broadcasting (DVB) subtitles 1866 The specifications for the Digital Video Broadcasting subtitle 1867 bitstream format (short: DVB subtitles) can be found in the document 1868 "ETSI EN 300 743 - Digital Video Broadcasting (DVB); Subtitling 1869 systems". The storage of DVB subtitles in MPEG transport streams is 1870 specified in the document "ETSI EN 300 468 - Digital Video 1871 Broadcasting (DVB); Specification for Service Information (SI) in DVB 1872 systems". 1874 7.8.1. Storage of DVB subtitles 1876 7.8.1.1. CodecID 1878 The CodecID to use is "S_DVBSUB". 1880 7.8.1.2. CodecPrivate 1882 The CodecPrivate element is five bytes long and has the following 1883 structure: 1885 o 2 bytes: composition page ID (bit string, left bit first) 1887 o 2 bytes: ancillary page ID (bit string, left bit first) 1889 o 1 byte: subtitling type (bit string, left bit first) 1891 The semantics of these bytes are the same as the ones described in 1892 section 6.2.41 "Subtitling descriptor" of ETSI EN 300 468. 1894 7.8.1.3. Storage of DVB subtitles in Matroska Blocks 1896 Each Matroska Block consists of one or more DVB Subtitle Segments as 1897 described in segment 7.2 "Syntax and semantics of the subtitling 1898 segment" of ETSI EN 300 743. 1900 Each Matroska Block SHOULD have a Duration indicating how long the 1901 DVB Subtitle Segments in that Block SHOULD be displayed. 1903 8. References 1905 8.1. Normative References 1907 [IEEE.754.1985] 1908 Institute of Electrical and Electronics Engineers, 1909 "Standard for Binary Floating-Point Arithmetic", 1910 IEEE Standard 754, August 1985. 1912 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 1913 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 1914 . 1916 [RFC6386] Bankoski, J., Koleszar, J., Quillio, L., Salonen, J., 1917 Wilkins, P., and Y. Xu, "VP8 Data Format and Decoding 1918 Guide", RFC 6386, DOI 10.17487/RFC6386, November 2011, 1919 . 1921 [RFC6648] Saint-Andre, P., Crocker, D., and M. Nottingham, 1922 "Deprecating the "X-" Prefix and Similar Constructs in 1923 Application Protocols", BCP 178, RFC 6648, 1924 DOI 10.17487/RFC6648, June 2012, 1925 . 1927 8.2. URIs 1929 [1] https://datatracker.ietf.org/wg/cellar/charter/ 1931 [2] https://tools.ietf.org/html/rfc2119 1933 [3] https://msdn.microsoft.com/en-us/library/windows/desktop/ 1934 dd318229(v=vs.85).aspx 1936 [4] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1937 librmff.h 1939 [5] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1940 librmff.h 1942 [6] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1943 librmff.h 1945 [7] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1946 librmff.h 1948 [8] https://developer.apple.com/library/mac/documentation/QuickTime/ 1949 QTFF/QTFFPreface/qtffPreface.html 1951 [9] http://www.theora.org/doc/Theora.pdf 1953 [10] http://wiki.multimedia.cx/ 1954 index.php?title=Apple_ProRes#Frame_layout 1956 [11] https://www.webmproject.org/vp9/ 1958 [12] https://datatracker.ietf.org/doc/draft-ietf-cellar-ffv1/ 1960 [13] http://alac.macosforge.org/trac/browser/trunk/ 1961 ALACMagicCookieDescription.txt 1963 [14] https://xiph.org/vorbis/doc/Vorbis_I_spec.html 1965 [15] https://xiph.org/vorbis/doc/v-comment.html 1967 [16] https://xiph.org/vorbis/doc/Vorbis_I_spec.html 1969 [17] http://flac.sourceforge.net/ 1971 [18] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1972 librmff.h 1974 [19] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1975 librmff.h 1977 [20] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1978 librmff.h 1980 [21] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1981 librmff.h 1983 [22] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1984 librmff.h 1986 [23] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1987 librmff.h 1989 [24] http://msdn.microsoft.com/library/default.asp?url=/library/en- 1990 us/multimed/mmstr_625u.asp 1992 [25] https://developer.apple.com/library/mac/documentation/QuickTime/ 1993 QTFF/QTFFPreface/qtffPreface.html 1995 [26] https://developer.apple.com/library/mac/documentation/QuickTime/ 1996 QTFF/QTFFPreface/qtffPreface.html 1998 [27] https://developer.apple.com/library/mac/documentation/QuickTime/ 1999 QTFF/QTFFPreface/qtffPreface.html 2001 [28] http://tausoft.org/ 2003 [29] http://tausoft.org/wiki/True_Audio_Codec_Format 2005 [30] http://www.wavpack.com/ 2007 [31] wavpack.html 2009 [32] http://wiki.xiph.org/index.php/OggKate#Matroska_mapping 2011 [33] http://dvd.sourceforge.net/dvdinfo/pci_pkt.html 2013 [34] http://dvd.sourceforge.net/dvdinfo/pci_pkt.html 2015 [35] http://wiki.multimedia.cx/index.php?title=SubStation_Alpha 2017 [36] http://moodub.free.fr/video/ass-specs.doc 2019 [37] https://www.w3.org/ 2021 [38] https://w3c.github.io/webvtt/ 2023 [39] http://www.webmproject.org/docs/container/ 2025 Authors' Addresses 2027 Steve Lhomme 2029 Email: slhomme@matroska.org 2031 Moritz Bunkus 2033 Email: moritz@bunkus.org 2035 Dave Rice 2037 Email: dave@dericed.com