idnits 2.17.1 draft-ietf-cellar-codec-00.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 (July 17, 2018) is 2109 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 1901 -- Looks like a reference, but probably isn't: '2' on line 1903 -- Looks like a reference, but probably isn't: '3' on line 1905 -- Looks like a reference, but probably isn't: '4' on line 1908 -- Looks like a reference, but probably isn't: '5' on line 1911 -- Looks like a reference, but probably isn't: '6' on line 1914 -- Looks like a reference, but probably isn't: '7' on line 1917 -- Looks like a reference, but probably isn't: '8' on line 1920 -- Looks like a reference, but probably isn't: '9' on line 1923 -- Looks like a reference, but probably isn't: '10' on line 1925 -- Looks like a reference, but probably isn't: '11' on line 1928 -- Looks like a reference, but probably isn't: '12' on line 1930 == Missing Reference: 'TM' is mentioned on line 700, but not defined -- Looks like a reference, but probably isn't: '13' on line 1932 -- Looks like a reference, but probably isn't: '14' on line 1935 -- Looks like a reference, but probably isn't: '15' on line 1937 -- Looks like a reference, but probably isn't: '16' on line 1939 -- Looks like a reference, but probably isn't: '17' on line 1941 -- Looks like a reference, but probably isn't: '18' on line 1943 -- Looks like a reference, but probably isn't: '19' on line 1946 -- Looks like a reference, but probably isn't: '20' on line 1949 -- Looks like a reference, but probably isn't: '21' on line 1952 -- Looks like a reference, but probably isn't: '22' on line 1955 -- Looks like a reference, but probably isn't: '23' on line 1958 -- Looks like a reference, but probably isn't: '24' on line 1961 -- Looks like a reference, but probably isn't: '25' on line 1964 -- Looks like a reference, but probably isn't: '26' on line 1967 -- Looks like a reference, but probably isn't: '27' on line 1970 -- Looks like a reference, but probably isn't: '28' on line 1973 -- Looks like a reference, but probably isn't: '29' on line 1975 -- Looks like a reference, but probably isn't: '30' on line 1977 -- Looks like a reference, but probably isn't: '31' on line 1979 -- Looks like a reference, but probably isn't: '32' on line 1981 -- Looks like a reference, but probably isn't: '33' on line 1983 -- Looks like a reference, but probably isn't: '34' on line 1985 -- Looks like a reference, but probably isn't: '35' on line 1987 -- Looks like a reference, but probably isn't: '36' on line 1989 == Missing Reference: 'Events' is mentioned on line 1487, but not defined -- Looks like a reference, but probably isn't: '37' on line 1991 -- Looks like a reference, but probably isn't: '38' on line 1993 -- Looks like a reference, but probably isn't: '39' on line 1995 ** Downref: Normative reference to an Informational RFC: RFC 6386 Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 41 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 18, 2019 6 D. Rice 7 July 17, 2018 9 Matroska Codec 10 draft-ietf-cellar-codec-00 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 January 18, 2019. 35 Copyright Notice 37 Copyright (c) 2018 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 . . . . . . . . . . . . . . . . . . . 4 55 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 56 5. Notations and Conventions . . . . . . . . . . . . . . . . . . 4 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. Initialisation . . . . . . . . . . . . . . . . . . . 6 63 6.1.5. Citation . . . . . . . . . . . . . . . . . . . . . . 6 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 . . . . . . . . . . . . . . . . . . 7 68 6.3.1. V_MS/VFW/FOURCC . . . . . . . . . . . . . . . . . . . 7 69 6.3.2. V_UNCOMPRESSED . . . . . . . . . . . . . . . . . . . 8 70 6.3.3. V_MPEG4/ISO/SP . . . . . . . . . . . . . . . . . . . 8 71 6.3.4. V_MPEG4/ISO/ASP . . . . . . . . . . . . . . . . . . . 8 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 . . . . . . . . . . . . . . . . . . . . . . . 9 76 6.3.9. V_REAL/RV10 . . . . . . . . . . . . . . . . . . . . . 10 77 6.3.10. V_REAL/RV20 . . . . . . . . . . . . . . . . . . . . . 10 78 6.3.11. V_REAL/RV30 . . . . . . . . . . . . . . . . . . . . . 10 79 6.3.12. V_REAL/RV40 . . . . . . . . . . . . . . . . . . . . . 10 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 . . . . . . . . . . . . . . . . . . . . . . . . 12 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 . . . . . . . . . . . . . . . . . . . . . . 13 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 . . . . . . . . . . . . . . . . . . 14 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 . . . . . . . . . . . . . . . . . . . . 15 97 6.4.11. A_ALAC . . . . . . . . . . . . . . . . . . . . . . . 16 98 6.4.12. A_DTS . . . . . . . . . . . . . . . . . . . . . . . . 16 99 6.4.13. A_DTS/EXPRESS . . . . . . . . . . . . . . . . . . . . 16 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 . . . . . . . . . . . . . . . . . . . . . 17 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 . . . . . . . . . . . . . . . . . . . . . 18 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 . . . . . . . . . . . . . . . . . . . 19 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 . . . . . . . . . . . . . . . . . . . 20 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 . . . . . . . . . . . . . . . . . . . 21 119 6.4.33. A_QUICKTIME . . . . . . . . . . . . . . . . . . . . . 22 120 6.4.34. A_QUICKTIME/QDMC . . . . . . . . . . . . . . . . . . 22 121 6.4.35. A_QUICKTIME/QDM2 . . . . . . . . . . . . . . . . . . 22 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 . . . . . . . . . . . . . . . . . . . . . 23 126 6.5.2. S_TEXT/SSA . . . . . . . . . . . . . . . . . . . . . 23 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 . . . . . . . . . . . . . . . . . . . . . 24 131 6.5.7. S_DVBSUB . . . . . . . . . . . . . . . . . . . . . . 24 132 6.5.8. S_VOBSUB . . . . . . . . . . . . . . . . . . . . . . 25 133 6.5.9. S_HDMV/PGS . . . . . . . . . . . . . . . . . . . . . 25 134 6.5.10. S_HDMV/TEXTST . . . . . . . . . . . . . . . . . . . . 25 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 . . . . . . . . . . . . . . . . . . . . 30 142 7.4. USF Subtitles . . . . . . . . . . . . . . . . . . . . . . 33 143 7.5. WebVTT . . . . . . . . . . . . . . . . . . . . . . . . . 33 144 7.5.1. Storage of WebVTT in Matroska . . . . . . . . . . . . 34 145 7.5.2. Examples of transformation . . . . . . . . . . . . . 35 146 7.5.3. Storage of WebVTT in Matroska vs. WebM . . . . . . . 38 147 7.6. HDMV presentation graphics subtitles . . . . . . . . . . 39 148 7.6.1. Storage of HDMV presentation graphics subtitles . . . 39 149 7.7. HDMV text subtitles . . . . . . . . . . . . . . . . . . . 39 150 7.7.1. Storage of HDMV text subtitles . . . . . . . . . . . 40 151 7.8. Digital Video Broadcasting (DVB) subtitles . . . . . . . 40 152 7.8.1. Storage of DVB subtitles . . . . . . . . . . . . . . 41 153 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 41 154 8.1. Normative References . . . . . . . . . . . . . . . . . . 41 155 8.2. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 42 156 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 44 158 1. Introduction 160 Matroska aims to become THE standard of multimedia container formats. 161 It stores interleaved and timestamped audio/video/subtitle data using 162 various codecs. To interpret the codec data, a mapping between the 163 way the data is stored in Matroska and how it is understood by such a 164 codec is necessary. 166 This document intends to define this mapping for many commonly used 167 codecs in Matroska. 169 2. Status of this document 171 This document is a work-in-progress specification defining the 172 Matroska file format as part of the IETF Cellar working group [1]. 173 It uses basic elements and concept already defined in the Matroska 174 specifications defined by this workgroup. 176 3. Security Considerations 178 This document inherits security considerations from the EBML and 179 Matroska documents. 181 4. IANA Considerations 183 To be determined. 185 5. Notations and Conventions 187 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 188 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 189 document are to be interpreted as described in RFC 2119 [2]. 191 6. Codec Mappings 193 A "Codec Mapping" is a set of attributes to identify, name, and 194 contextualise the format and characteristics of encoded data that can 195 be contained within Matroska Clusters. 197 Each TrackEntry used within Matroska MUST reference a defined "Codec 198 Mapping" using the "Codec ID" to identify and describe the format of 199 the encoded data in its associated Clusters. This "Codec ID" is a 200 unique registered identifier that represents the encoding stored 201 within the Track. Certain encodings MAY also require some form of 202 codec initialisation in order to provide its decoder with context and 203 technical metadata. 205 The intention behind this list is not to list all existing audio and 206 video codecs, but rather to list those codecs that are currently 207 supported in Matroska and therefore need a well defined "Codec ID" so 208 that all developers supporting Matroska will use the same "Codec ID". 209 If you feel we missed support for a very important codec, please tell 210 us on our development mailing list (cellar at ietf.org). 212 6.1. Defining Matroska Codec Support 214 Support for a codec is defined in Matroska with the following values. 216 6.1.1. Codec ID 218 Each codec supported for storage in Matroska MUST have a unique 219 "Codec ID". Each "Codec ID" MUST be prefixed with the string from 220 the following table according to the associated type of the codec. 221 All characters of a "Codec ID Prefix" MUST be capital letters (A-Z) 222 except for the last character of a "Codec ID Prefix" which MUST be an 223 underscore ("_"). 225 +------------+-----------------+ 226 | Codec Type | Codec ID Prefix | 227 +------------+-----------------+ 228 | Video | "V_" | 229 | Audio | "A_" | 230 | Subtitle | "S_" | 231 | Button | "B_" | 232 +------------+-----------------+ 234 Each "Codec ID" MUST include a "Major Codec ID" immediately following 235 the "Codec ID Prefix". A "Major Codec ID" MAY be followed by an 236 OPTIONAL "Codec ID Suffix" to communicate a refinement of the "Major 237 Codec ID". If a "Codec ID Suffix" is used, then the "Codec ID" MUST 238 include a forward slash ("/") as a separator between the "Major Codec 239 ID" and the "Codec ID Suffix". The "Major Codec ID" MUST be composed 240 of only capital letters (A-Z) and numbers (0-9). The "Codec ID 241 Suffix" MUST be composed of only capital letters (A-Z), numbers 242 (0-9), underscore ("_"), and forward slash ("/"). 244 The following table provides examples of valid "Codec IDs" and their 245 components: 247 +---------+---------+-----------+--------------+--------------------+ 248 | Codec | Major | Separator | Codec ID | Codec ID | 249 | ID | Codec | | Suffix | | 250 | Prefix | ID | | | | 251 +---------+---------+-----------+--------------+--------------------+ 252 | A_ | AAC | / | MPEG2/LC/SBR | A_AAC/MPEG2/LC/SBR | 253 | V_ | MPEG4 | / | ISO/ASP | V_MPEG4/ISO/ASP | 254 | V_ | MPEG1 | | | V_MPEG1 | 255 +---------+---------+-----------+--------------+--------------------+ 257 6.1.2. Codec Name 259 Each encoding supported for storage in Matroska MUST have a "Codec 260 Name". The "Codec Name" provides a readable label for the encoding. 262 6.1.3. Description 264 An optional description for the encoding. This value is only 265 intended for human consumption. 267 6.1.4. Initialisation 269 Each encoding supported for storage in Matroska MUST have a defined 270 Initialisation. The Initialisation MUST describe the storage of data 271 necessary to initialise the decoder, which MUST be stored within the 272 "CodecPrivate Element". When the Initialisation is updated within a 273 track then that updated Initialisation data MUST be written into the 274 "CodecState Element" of the first "Cluster" to require it. If the 275 encoding does not require any form of Initialisation then "none" MUST 276 be used to define the Initialisation and the "CodecPrivate Element" 277 SHOULD NOT be written and MUST be ignored. Data that is defined 278 Initialisation to be stored in the "CodecPrivate Element" is known as 279 "Private Data". 281 6.1.5. Citation 283 Documentation of the associated normative and informative references 284 for the codec is RECOMMENDED. 286 6.1.6. Deprecation Date 288 A timestamp, expressed in [RFC3339] that notes when support for the 289 "Codec Mapping" within Matroska was deprecated. If a "Codec Mapping" 290 is defined with a "Deprecation Date", then it is RECOMMENDED that 291 Matroska writers SHOULD NOT use the "Codec Mapping" after the 292 "Deprecation Date". 294 6.1.7. Superseded By 296 A "Codec Mapping" MAY only be defined with a "Superseded By" value, 297 if it has an expressed "Deprecation Date". If used, the "Superseded 298 By" value MUST store the "Codec ID" of another "Codec Mapping" that 299 has superseded the "Codec Mapping". 301 6.2. Recommendations for the Creation of New Codec Mappings 303 Creators of new "Codec Mappings" to be used in the context of 304 Matroska: 306 o SHOULD assume that all "Codec Mappings" they create might become 307 standardised, public, commonly deployed, or usable across multiple 308 implementations. 310 o SHOULD employ meaningful values for "Codec ID" and "Codec Name" 311 that they have reason to believe are currently unused. 313 o SHOULD NOT prefix their "Codec ID" with "X_" or similar 314 constructs. 316 These recommendations are based upon Section 3 of [RFC6648]. 318 6.3. Video Codec Mappings 320 6.3.1. V_MS/VFW/FOURCC 322 Codec ID: "V_MS/VFW/FOURCC" 324 Codec Name: Microsoft (TM) Video Codec Manager (VCM) 326 Description: The private data contains the VCM structure 327 BITMAPINFOHEADER including the extra private bytes, as defined by 328 Microsoft [3]. The data are stored in little endian format (like on 329 IA32 machines). Where is the Huffman table stored in HuffYUV, not 330 AVISTREAMINFO ??? And the FourCC, not in AVISTREAMINFO.fccHandler ??? 332 Initialisation: "Private Data" contains the VCM structure 333 BITMAPINFOHEADER including the extra private bytes, as defined by 334 Microsoft in . 337 Citation: 340 6.3.2. V_UNCOMPRESSED 342 Codec ID: V_UNCOMPRESSED 344 Codec Name: Video, raw uncompressed video frames 346 Description: All details about the used colour specs and bit depth 347 are to be put/read from the KaxCodecColourSpace elements. 349 Initialisation: none 351 6.3.3. V_MPEG4/ISO/SP 353 Codec ID: V_MPEG4/ISO/SP 355 Codec Name: MPEG4 ISO simple profile (DivX4) 357 Description: Stream was created via improved codec API (UCI) or even 358 transmuxed from AVI (no b-frames in Simple Profile), frame order is 359 coding order. 361 Initialisation: none 363 6.3.4. V_MPEG4/ISO/ASP 365 Codec ID: V_MPEG4/ISO/ASP 367 Codec Name: MPEG4 ISO advanced simple profile (DivX5, XviD, FFMPEG) 369 Description: Stream was created via improved codec API (UCI) or 370 transmuxed from MP4, not simply transmuxed from AVI. Note there are 371 differences how b-frames are handled in these native streams, when 372 being compared to a VfW created stream, as here there are "no" dummy 373 frames inserted, the frame order is exactly the same as the coding 374 order, same as in MP4 streams. 376 Initialisation: none 378 6.3.5. V_MPEG4/ISO/AP 380 Codec ID: V_MPEG4/ISO/AP 382 Codec Name: MPEG4 ISO advanced profile 384 Description: Stream was created via improved codec API (UCI) or 385 transmuxed from MP4, not simply transmuxed from AVI. Note there are 386 differences how b-frames are handled in these native streams, when 387 being compared to a VfW created stream, as here there are "no" dummy 388 frames inserted, the frame order is exactly the same as the coding 389 order, same as in MP4 streams. 391 Initialisation: none 393 6.3.6. V_MPEG4/MS/V3 395 Codec ID: V_MPEG4/MS/V3 397 Codec Name: Microsoft (TM) MPEG4 V3 399 Description: Microsoft (TM) MPEG4 V3 and derivates, means DivX3, 400 Angelpotion, SMR, etc.; stream was created using VfW codec or 401 transmuxed from AVI; note that V1/V2 are covered in VfW compatibility 402 mode. 404 Initialisation: none 406 6.3.7. V_MPEG1 408 Codec ID: V_MPEG1 410 Codec Name: MPEG 1 412 Description: The Matroska video stream will contain a demuxed 413 Elementary Stream (ES), where block boundaries are still to be 414 defined. Its RECOMMENDED to use MPEG2MKV.exe for creating those 415 files, and to compare the results with self-made implementations 417 Initialisation: none 419 6.3.8. V_MPEG2 421 Codec ID: V_MPEG2 423 Codec Name: MPEG 2 424 Description: The Matroska video stream will contain a demuxed 425 Elementary Stream (ES), where block boundaries are still to be 426 defined. Its RECOMMENDED to use MPEG2MKV.exe for creating those 427 files, and to compare the results with self-made implementations 429 Initialisation: none 431 6.3.9. V_REAL/RV10 433 Codec ID: V_REAL/RV10 435 Codec Name: RealVideo 1.0 aka RealVideo 5 437 Description: Individual slices from the Real container are combined 438 into a single frame. 440 Initialisation: The "Private Data" contains a "real_video_props_t" 441 structure in Big Endian byte order as found in librmff [4]. 443 6.3.10. V_REAL/RV20 445 Codec ID: V_REAL/RV20 447 Codec Name: RealVideo G2 and RealVideo G2+SVT 449 Description: Individual slices from the Real container are combined 450 into a single frame. 452 Initialisation: The "Private Data" contains a "real_video_props_t" 453 structure in Big Endian byte order as found in librmff [5]. 455 6.3.11. V_REAL/RV30 457 Codec ID: V_REAL/RV30 459 Codec Name: RealVideo 8 461 Description: Individual slices from the Real container are combined 462 into a single frame. 464 Initialisation: The "Private Data" contains a "real_video_props_t" 465 structure in Big Endian byte order as found in librmff [6]. 467 6.3.12. V_REAL/RV40 469 Codec ID: V_REAL/RV40 471 Codec Name: rv40 : RealVideo 9 472 Description: Individual slices from the Real container are combined 473 into a single frame. 475 Initialisation: The "Private Data" contains a "real_video_props_t" 476 structure in Big Endian byte order as found in librmff [7]. 478 6.3.13. V_QUICKTIME 480 Codec ID: V_QUICKTIME 482 Codec Name: Video taken from QuickTime(TM) files 484 Description: Several codecs as stored in QuickTime, e.g. Sorenson or 485 Cinepak. 487 Initialisation: The "Private Data" contains all additional data that 488 is stored in the 'stsd' (sample description) atom in the QuickTime 489 file *after* the mandatory video descriptor structure (starting with 490 the size and FourCC fields). For an explanation of the QuickTime 491 file format read QuickTime File Format Specification [8]. 493 6.3.14. V_THEORA 495 Codec ID: V_THEORA 497 Codec Name: Theora 499 Initialisation: The "Private Data" contains the first three Theora 500 packets in order. The lengths of the packets precedes them. The 501 actual layout is: 503 o Byte 1: number of distinct packets '"#p"' minus one inside the 504 CodecPrivate block. This MUST be '2' for current (as of 505 2016-07-08) Theora headers. 507 o Bytes 2..n: lengths of the first '"#p"' packets, coded in Xiph- 508 style lacing. The length of the last packet is the length of the 509 CodecPrivate block minus the lengths coded in these bytes minus 510 one. 512 o Bytes n+1..: The Theora identification header, followed by the 513 commend header followed by the codec setup header. Those are 514 described in the Theora specs [9]. 516 6.3.15. V_PRORES 518 Codec ID: V_PRORES 520 Codec Name: Apple ProRes 522 Initialisation: The "Private Data" contains the FourCC as found in 523 MP4 movies: 525 o ap4x: ProRes 4444 XQ 527 o ap4h: ProRes 4444 529 o apch: ProRes 422 High Quality 531 o apcn: ProRes 422 Standard Definition 533 o apcs: ProRes 422 LT 535 o apco: ProRes 422 Proxy 537 this page for more technical details on ProRes [10] 539 6.3.16. V_VP8 541 Codec ID: V_VP8 543 Codec Name: VP8 Codec format 545 Description: VP8 is an open and royalty free video compression format 546 developed by Google and created by On2 Technologies as a successor to 547 VP7. [RFC6386] 549 Initialisation: none 551 6.3.17. V_VP9 553 Codec ID: V_VP9 555 Codec Name: VP9 Codec format 557 Description: VP9 is an open and royalty free video compression format 558 developed by Google as a successor to VP8. Draft VP9 Bitstream and 559 Decoding Process Specification [11] 561 Initialisation: none 563 6.3.18. V_FFV1 565 Codec ID: V_FFV1 567 Codec Name: FF Video Codec 1 569 Description: FFV1 is a lossless intra-frame video encoding format 570 designed to efficiently compress video data in a variety of pixel 571 formats. Compared to uncompressed video, FFV1 offers storage 572 compression, frame fixity, and self-description, which makes FFV1 573 useful as a preservation or intermediate video format. Draft FFV1 574 Specification [12] 576 Initialisation: For FFV1 versions 0 or 1, "Private Data" SHOULD NOT 577 be written. For FFV1 version 3 or greater, the "Private Data" MUST 578 contain the FFV1 Configuration Record structure, as defined in 579 , and no other data. 582 6.4. Audio Codec Mappings 584 6.4.1. A_MPEG/L3 586 Codec ID: A_MPEG/L3 588 Codec Name: MPEG Audio 1, 2, 2.5 Layer III 590 Description: The data contain everything needed for playback in the 591 MPEG Audio header of each frame. Corresponding ACM wFormatTag : 592 0x0055 594 Initialisation: none 596 6.4.2. A_MPEG/L2 598 Codec ID: A_MPEG/L2 600 Codec Name: MPEG Audio 1, 2 Layer II 602 Description: The data contain everything needed for playback in the 603 MPEG Audio header of each frame. Corresponding ACM wFormatTag : 604 0x0050 606 Initialisation: none 608 6.4.3. A_MPEG/L1 610 Codec ID: A_MPEG/L1 612 Codec Name: MPEG Audio 1, 2 Layer I 614 Description: The data contain everything needed for playback in the 615 MPEG Audio header of each frame. Corresponding ACM wFormatTag : 616 0x0050 618 Initialisation: none 620 6.4.4. A_PCM/INT/BIG 622 Codec ID: A_PCM/INT/BIG 624 Codec Name: PCM Integer Big Endian 626 Description: The audio bit depth MUST be read and set from the 627 "BitDepth Element". Audio samples MUST be considered as signed 628 values, except if the audio bit depth is "8" which MUST be 629 interpreted as unsigned values. Corresponding ACM wFormatTag : ??? 631 Initialisation: none 633 6.4.5. A_PCM/INT/LIT 635 Codec ID: A_PCM/INT/LIT 637 Codec Name: PCM Integer Little Endian 639 Description: The audio bit depth MUST be read and set from the 640 "BitDepth Element". Audio samples MUST be considered as signed 641 values, except if the audio bit depth is "8" which MUST be 642 interpreted as unsigned values. Corresponding ACM wFormatTag : 643 0x0001 645 Initialisation: none 647 6.4.6. A_PCM/FLOAT/IEEE 649 Codec ID: A_PCM/FLOAT/IEEE 651 Codec Name: Floating Point, IEEE compatible 653 Description: The audio bit depth MUST be read and set from the 654 "BitDepth Element" (32 bit in most cases). The floats are stored in 655 little endian order (most common float format). Corresponding ACM 656 wFormatTag : 0x0003 658 Initialisation: none 660 6.4.7. A_MPC 662 Codec ID: A_MPC 664 Codec Name: MPC (musepack) SV8 666 Description: The main developer for musepack has requested that we 667 wait until the SV8 framing has been fully defined for musepack before 668 defining how to store it in Matroska. 670 6.4.8. A_AC3 672 Codec ID: A_AC3 674 Codec Name: (Dolby[TM]) AC3 676 Description: BSID <= 8 !! The private data is void ??? Corresponding 677 ACM wFormatTag : 0x2000 ; channel number have to be read from the 678 corresponding audio element 680 6.4.9. A_AC3/BSID9 682 Codec ID: A_AC3/BSID9 684 Codec Name: (Dolby[TM]) AC3 686 Description: The ac3 frame header has, similar to the mpeg-audio 687 header a version field. Normal ac3 is defined as bitstream id 8 (5 688 Bits, numbers are 0-15). Everything below 8 is still compatible with 689 all decoders that handle 8 correctly. Everything higher are 690 additions that break decoder compatibility. For the samplerates 691 24kHz (00); 22,05kHz (01) and 16kHz (10) the BSID is 9 For the 692 samplerates 12kHz (00); 11,025kHz (01) and 8kHz (10) the BSID is 10 694 Initialisation: none 696 6.4.10. A_AC3/BSID10 698 Codec ID: A_AC3/BSID10 700 Codec Name: (Dolby[TM]) AC3 701 Description: The ac3 frame header has, similar to the mpeg-audio 702 header a version field. Normal ac3 is defined as bitstream id 8 (5 703 Bits, numbers are 0-15). Everything below 8 is still compatible with 704 all decoders that handle 8 correctly. Everything higher are 705 additions that break decoder compatibility. For the samplerates 706 24kHz (00); 22,05kHz (01) and 16kHz (10) the BSID is 9 For the 707 samplerates 12kHz (00); 11,025kHz (01) and 8kHz (10) the BSID is 10 709 Initialisation: none 711 6.4.11. A_ALAC 713 Codec ID: A_ALAC 715 Codec Name: ALAC (Apple Lossless Audio Codec) 717 Initialisation: The "Private Data" contains ALAC's magic cookie (both 718 the codec specific configuration as well as the optional channel 719 layout information). Its format is described in ALAC's official 720 source code [13]. 722 6.4.12. A_DTS 724 Codec ID: A_DTS 726 Codec Name: Digital Theatre System 728 Description: Supports DTS, DTS-ES, DTS-96/26, DTS-HD High Resolution 729 Audio and DTS-HD Master Audio. The private data is void. 730 Corresponding ACM wFormatTag : 0x2001 732 Initialisation: none 734 6.4.13. A_DTS/EXPRESS 736 Codec ID: A_DTS/EXPRESS 738 Codec Name: Digital Theatre System Express 740 Description: DTS Express (a.k.a. LBR) audio streams. The private 741 data is void. Corresponding ACM wFormatTag : 0x2001 743 Initialisation: none 745 6.4.14. A_DTS/LOSSLESS 747 Codec ID: A_DTS/LOSSLESS 749 Codec Name: Digital Theatre System Lossless 751 Description: DTS Lossless audio that does not have a core substream. 752 The private data is void. Corresponding ACM wFormatTag : 0x2001 754 Initialisation: none 756 6.4.15. A_VORBIS 758 Codec ID: A_VORBIS 760 Codec Name: Vorbis 762 Initialisation: The "Private Data" contains the first three Vorbis 763 packet in order. The lengths of the packets precedes them. The 764 actual layout is: - Byte 1: number of distinct packets '"#p"' minus 765 one inside the CodecPrivate block. This MUST be '2' for current (as 766 of 2016-07-08) Vorbis headers. - Bytes 2..n: lengths of the first 767 '"#p"' packets, coded in Xiph-style lacing. The length of the last 768 packet is the length of the CodecPrivate block minus the lengths 769 coded in these bytes minus one. - Bytes n+1..: The Vorbis 770 identification header [14], followed by the Vorbis comment header 771 [15] followed by the codec setup header [16]. 773 6.4.16. A_FLAC 775 Codec ID: A_FLAC 777 Codec Name: FLAC (Free Lossless Audio Codec) [17] 779 Initialisation: The "Private Data" contains all the header/metadata 780 packets before the first data packet. These include the first header 781 packet containing only the word "fLaC" as well as all metadata 782 packets. 784 6.4.17. A_REAL/14_4 786 Codec ID: A_REAL/14_4 788 Codec Name: Real Audio 1 790 Initialisation: The "Private Data" contains either the 791 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 792 (differentiated by their "version" field; Big Endian byte order) as 793 found in librmff [18]. 795 6.4.18. A_REAL/28_8 797 Codec ID: A_REAL/28_8 799 Codec Name: Real Audio 2 801 Initialisation: The "Private Data" contains either the 802 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 803 (differentiated by their "version" field; Big Endian byte order) as 804 found in librmff [19]. 806 6.4.19. A_REAL/COOK 808 Codec ID: A_REAL/COOK 810 Codec Name: Real Audio Cook Codec (codename: Gecko) 812 Initialisation: The "Private Data" contains either the 813 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 814 (differentiated by their "version" field; Big Endian byte order) as 815 found in librmff [20]. 817 6.4.20. A_REAL/SIPR 819 Codec ID: A_REAL/SIPR 821 Codec Name: Sipro Voice Codec 823 Initialisation: The "Private Data" contains either the 824 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 825 (differentiated by their "version" field; Big Endian byte order) as 826 found in librmff [21]. 828 6.4.21. A_REAL/RALF 830 Codec ID: A_REAL/RALF 832 Codec Name: Real Audio Lossless Format 834 Initialisation: The "Private Data" contains either the 835 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 836 (differentiated by their "version" field; Big Endian byte order) as 837 found in librmff [22]. 839 6.4.22. A_REAL/ATRC 841 Codec ID: A_REAL/ATRC 843 Codec Name: Sony Atrac3 Codec 845 Initialisation: The "Private Data" contains either the 846 "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure 847 (differentiated by their "version" field; Big Endian byte order) as 848 found in librmff [23]. 850 6.4.23. A_MS/ACM 852 Codec ID: A_MS/ACM 854 Codec Name: Microsoft(TM) Audio Codec Manager (ACM) 856 Description: The data are stored in little endian format (like on 857 IA32 machines). 859 Initialisation: The "Private Data" contains the ACM structure 860 WAVEFORMATEX including the extra private bytes, as defined by 861 Microsoft [24]. 863 6.4.24. A_AAC/MPEG2/MAIN 865 Codec ID: A_AAC/MPEG2/MAIN 867 Codec Name: MPEG2 Main Profile 869 Description: Channel number and sample rate have to be read from the 870 corresponding audio element. Audio stream is stripped from ADTS 871 headers and normal Matroska frame based muxing scheme is applied. 872 AAC audio always uses wFormatTag 0xFF. 874 Initialisation: none 876 6.4.25. A_AAC/MPEG2/LC 878 Codec ID: A_AAC/MPEG2/LC 880 Codec Name: Low Complexity 882 Description: Channel number and sample rate have to be read from the 883 corresponding audio element. Audio stream is stripped from ADTS 884 headers and normal Matroska frame based muxing scheme is applied. 885 AAC audio always uses wFormatTag 0xFF. 887 Initialisation: none 889 6.4.26. A_AAC/MPEG2/LC/SBR 891 Codec ID: A_AAC/MPEG2/LC/SBR 893 Codec Name: Low Complexity with Spectral Band Replication 895 Description: Channel number and sample rate have to be read from the 896 corresponding audio element. Audio stream is stripped from ADTS 897 headers and normal Matroska frame based muxing scheme is applied. 898 AAC audio always uses wFormatTag 0xFF. 900 Initialisation: none 902 6.4.27. A_AAC/MPEG2/SSR 904 Codec ID: A_AAC/MPEG2/SSR 906 Codec Name: Scalable Sampling Rate 908 Description: Channel number and sample rate have to be read from the 909 corresponding audio element. Audio stream is stripped from ADTS 910 headers and normal Matroska frame based muxing scheme is applied. 911 AAC audio always uses wFormatTag 0xFF. 913 Initialisation: none 915 6.4.28. A_AAC/MPEG4/MAIN 917 Codec ID: A_AAC/MPEG4/MAIN 919 Codec Name: MPEG4 Main Profile 921 Description: Channel number and sample rate have to be read from the 922 corresponding audio element. Audio stream is stripped from ADTS 923 headers and normal Matroska frame based muxing scheme is applied. 924 AAC audio always uses wFormatTag 0xFF. 926 Initialisation: none 928 6.4.29. A_AAC/MPEG4/LC 930 Codec ID: A_AAC/MPEG4/LC 932 Codec Name: Low Complexity 933 Description: Channel number and sample rate have to be read from the 934 corresponding audio element. Audio stream is stripped from ADTS 935 headers and normal Matroska frame based muxing scheme is applied. 936 AAC audio always uses wFormatTag 0xFF. 938 Initialisation: none 940 6.4.30. A_AAC/MPEG4/LC/SBR 942 Codec ID: A_AAC/MPEG4/LC/SBR 944 Codec Name: Low Complexity with Spectral Band Replication 946 Description: Channel number and sample rate have to be read from the 947 corresponding audio element. Audio stream is stripped from ADTS 948 headers and normal Matroska frame based muxing scheme is applied. 949 AAC audio always uses wFormatTag 0xFF. 951 Initialisation: none 953 6.4.31. A_AAC/MPEG4/SSR 955 Codec ID: A_AAC/MPEG4/SSR 957 Codec Name: Scalable Sampling Rate 959 Description: Channel number and sample rate have to be read from the 960 corresponding audio element. Audio stream is stripped from ADTS 961 headers and normal Matroska frame based muxing scheme is applied. 962 AAC audio always uses wFormatTag 0xFF. 964 Initialisation: none 966 6.4.32. A_AAC/MPEG4/LTP 968 Codec ID: A_AAC/MPEG4/LTP 970 Codec Name: Long Term Prediction 972 Description: Channel number and sample rate have to be read from the 973 corresponding audio element. Audio stream is stripped from ADTS 974 headers and normal Matroska frame based muxing scheme is applied. 975 AAC audio always uses wFormatTag 0xFF. 977 Initialisation: none 979 6.4.33. A_QUICKTIME 981 Codec ID: A_QUICKTIME 983 Codec Name: Audio taken from QuickTime(TM) files 985 Description: Several codecs as stored in QuickTime, e.g. QDesign 986 Music v1 or v2. 988 Initialisation: The "Private Data" contains all additional data that 989 is stored in the 'stsd' (sample description) atom in the QuickTime 990 file *after* the mandatory sound descriptor structure (starting with 991 the size and FourCC fields). For an explanation of the QuickTime 992 file format read QuickTime File Format Specification [25]. 994 6.4.34. A_QUICKTIME/QDMC 996 Codec ID: A_QUICKTIME/QDMC 998 Codec Name: QDesign Music 1000 Description: 1002 Initialisation: The "Private Data" contains all additional data that 1003 is stored in the 'stsd' (sample description) atom in the QuickTime 1004 file *after* the mandatory sound descriptor structure (starting with 1005 the size and FourCC fields). For an explanation of the QuickTime 1006 file format read QuickTime File Format Specification [26]. 1008 Superseded By: A_QUICKTIME 1010 6.4.35. A_QUICKTIME/QDM2 1012 Codec ID: A_QUICKTIME/QDM2 1014 Codec Name: QDesign Music v2 1016 Description: 1018 Initialisation: The "Private Data" contains all additional data that 1019 is stored in the 'stsd' (sample description) atom in the QuickTime 1020 file *after* the mandatory sound descriptor structure (starting with 1021 the size and FourCC fields). For an explanation of the QuickTime 1022 file format read QuickTime File Format Specification [27]. 1024 Superseded By: A_QUICKTIME 1026 6.4.36. A_TTA1 1028 Codec ID: A_TTA1 1030 Codec Name: The True Audio [28] lossless audio compressor 1032 Description: TTA format description [29] Each frame is kept intact, 1033 including the CRC32. The header and seektable are dropped. 1034 SamplingFrequency, Channels and BitDepth are used in the TrackEntry. 1035 wFormatTag = 0x77A1 1037 Initialisation: none 1039 6.4.37. A_WAVPACK4 1041 Codec ID: A_WAVPACK4 1043 Codec Name: WavPack [30] lossless audio compressor 1045 Description: The Wavpack packets consist of a stripped header 1046 followed by the frame data. For multi-track (> 2 tracks) a frame 1047 consists of many packets. For hybrid files (lossy part + correction 1048 part), the correction part is stored in an additional block (level 1049 1). For more details, check the WavPack muxing description [31]. 1051 Initialisation: none 1053 6.5. Subtitle Codec Mappings 1055 6.5.1. S_TEXT/UTF8 1057 Codec ID: S_TEXT/UTF8 1059 Codec Name: UTF-8 Plain Text 1061 Description: Basic text subtitles. For more information, please look 1062 at Section 7. 1064 6.5.2. S_TEXT/SSA 1066 Codec ID: S_TEXT/SSA 1068 Codec Name: Subtitles Format 1070 Description: The [Script Info] and [V4 Styles] sections are stored in 1071 the codecprivate. Each event is stored in its own Block. For more 1072 information, see Section 7. 1074 6.5.3. S_TEXT/ASS 1076 Codec ID: S_TEXT/ASS 1078 Codec Name: Advanced Subtitles Format 1080 Description: The [Script Info] and [V4 Styles] sections are stored in 1081 the codecprivate. Each event is stored in its own Block. For more 1082 information, see Section 7. 1084 6.5.4. S_TEXT/USF 1086 Codec ID: S_TEXT/USF 1088 Codec Name: Universal Subtitle Format 1090 Description: This is mostly defined, but not typed out yet. It will 1091 first be available on the USF specification Section 7. 1093 6.5.5. S_TEXT/WEBVTT 1095 Codec ID: S_TEXT/WEBVTT 1097 Codec Name: Web Video Text Tracks Format (WebVTT) 1099 Description: Advanced text subtitles. For more information, see 1100 Section 7. 1102 6.5.6. S_IMAGE/BMP 1104 Codec ID: S_IMAGE/BMP 1106 Codec Name: Bitmap 1108 Description: Basic image based subtitle format; The subtitles are 1109 stored as images, like in the DVD. The timestamp in the block header 1110 of Matroska indicates the start display time, the duration is set 1111 with the Duration element. The full data for the subtitle bitmap is 1112 stored in the Block's data section. 1114 6.5.7. S_DVBSUB 1116 Codec ID: S_DVBSUB 1118 Codec Name: Digital Video Broadcasting (DVB) subtitles 1119 Description: This is the graphical subtitle format used in the 1120 Digital Video Broadcasting standard. For more information, see 1121 Section 7. 1123 6.5.8. S_VOBSUB 1125 Codec ID: S_VOBSUB 1127 Codec Name: VobSub subtitles 1129 Description: The same subtitle format used on DVDs. Supported is 1130 only format version 7 and newer. VobSubs consist of two files, the 1131 .idx containing information, and the .sub, containing the actual 1132 data. The .idx file is stripped of all empty lines, of all comments 1133 and of lines beginning with "alt:" or "langidx:". The line beginning 1134 with "id:" SHOULD be transformed into the appropriate Matroska track 1135 language element and is discarded. All remaining lines but the ones 1136 containing timestamps and file positions are put into the 1137 "CodecPrivate" element. 1139 For each line containing the timestamp and file position data is read 1140 from the appropriate position in the .sub file. This data consists 1141 of a MPEG program stream which in turn contains SPU packets. The 1142 MPEG program stream data is discarded, and each SPU packet is put 1143 into one Matroska frame. 1145 6.5.9. S_HDMV/PGS 1147 Codec ID: S_HDMV/PGS 1149 Codec Name: HDMV presentation graphics subtitles (PGS) 1151 Description: This is the graphical subtitle format used on Blu-rays. 1152 For more information, see Section 7. 1154 6.5.10. S_HDMV/TEXTST 1156 Codec ID: S_HDMV/TEXTST 1158 Codec Name: HDMV text subtitles 1160 Description: This is the textual subtitle format used on Blu-rays. 1161 For more information, see Section 7. 1163 6.5.11. S_KATE 1165 Codec ID: S_KATE 1167 Codec Name: Karaoke And Text Encapsulation 1169 Description: A subtitle format developed for ogg. The mapping for 1170 Matroska is described on the Xiph wiki [32]. As for Theora and 1171 Vorbis, Kate headers are stored in the private data as xiph-laced 1172 packets. 1174 6.6. Button Codec Mappings 1176 6.6.1. B_VOBBTN 1178 Codec ID: B_VOBBTN 1180 Codec Name: VobBtn Buttons 1182 Description: Based on MPEG/VOB PCI packets [33]. The file contains a 1183 header consisting of the string "butonDVD" followed by the width and 1184 height in pixels (16 bits integer each) and 4 reserved bytes. The 1185 rest is full PCI packets [34]. 1187 7. Subtitles 1189 Because Matroska is a general container format, we try to avoid 1190 specifying the formats to store in it. This type of work is really 1191 outside of the scope of a container-only format. However, because 1192 the use of subtitles in A/V containers has been so limited (with the 1193 exception of DVD) we are taking the time to specify how to store some 1194 of the more common subtitle formats in Matroska. This is being done 1195 to help facilitate their growth. Otherwise, incompatibilities could 1196 prevent the standardization and use of subtitle storage. 1198 This page is not meant to be a complete listing of all subtitle 1199 formats that will be used in Matroska, it is only meant to be a guide 1200 for the more common, current formats. It is possible that we will 1201 add future formats to this page as they are created, but it is not 1202 likely as any other new subtitle format designer would likely have 1203 their own specifications. Any specification listed here SHOULD be 1204 strictly adhered to or it SHOULD NOT use the corresponding Codec ID. 1206 Here is a list of pointers for storing subtitles in Matroska: 1208 o Any Matroska file containing only subtitles SHOULD use the 1209 extension ".mks". 1211 o As a general rule of thumb for all codecs, information that is 1212 global to an entire stream SHOULD be stored in the CodecPrivate 1213 element. 1215 o Start and stop timecodes that are used in a timecodes native 1216 storage format SHOULD be removed when being placed in Matroska as 1217 they could interfere if the file is edited afterwards. Instead, 1218 the Blocks timecode and Duration SHOULD be used to say when the 1219 timecode is displayed. 1221 o Because a "subtitle" stream is actually just an overlay stream, 1222 anything with a transparency layer could be use, including video. 1224 7.1. Images Subtitles 1226 The first image format that is a goal to import into Matroska is the 1227 VobSub subtitle format. This subtitle type is generated by exporting 1228 the subtitles from a DVD. 1230 The requirement for muxing VobSub into Matroska is v7 subtitles (see 1231 first line of the .IDX file). If the version is smaller, you must 1232 remux them using the SubResync utility from VobSub 2.23 (or MPC) into 1233 v7 format. Generally any newly created subs will be in v7 format. 1235 The .IFO file will not be used at all. 1237 If there is more than one subtitle stream in the VobSub set, each 1238 stream will need to be separated into separate tracks for storage in 1239 Matroska. E.g. the VobSub file contains streams for both English and 1240 German subtitles. Then the resulting Matroska file SHOULD contain 1241 two tracks. That way the language information can be 'dropped' and 1242 mapped to Matroska's language tags. 1244 The .IDX file is reformatted (see below) and placed in the 1245 CodecPrivate. 1247 Each .BMP will be stored in its own Block. The Timestamp with be 1248 stored in the Blocks Timecode and the duration will be stored in the 1249 Default Duration. 1251 Here is an example .IDX file: 1253 # VobSub index file, v7 (do not modify this line!) 1254 # 1255 # To repair desynchronization, you can insert gaps this way: 1256 # (it usually happens after vob id changes) 1257 # 1258 # delay: [sign]hh:mm:ss:ms 1259 # 1260 # Where: 1261 # [sign]: +, - (optional) 1262 # hh: hours (0 <= hh) 1263 # mm/ss: minutes/seconds (0 <= mm/ss <= 59) 1264 # ms: milliseconds (0 <= ms <= 999) 1265 # 1266 # Note: You can't position a sub before the previous with a negative 1267 # value. 1268 # 1269 # You can also modify timestamps or delete a few subs you don't like. 1270 # Just make sure they stay in increasing order. 1272 # Settings 1274 # Original frame size 1275 size: 720x480 1277 # Origin, relative to the upper-left corner, can be overloaded by 1278 # alignment 1279 org: 0, 0 1281 # Image scaling (hor,ver), origin is at the upper-left corner or at 1282 # the alignment coord (x, y) 1283 scale: 100%, 100% 1285 # Alpha blending 1286 alpha: 100% 1288 # Smoothing for very blocky images (use OLD for no filtering) 1289 smooth: OFF 1291 # In millisecs 1292 fadein/out: 50, 50 1294 # Force subtitle placement relative to (org.x, org.y) 1295 align: OFF at LEFT TOP 1297 # For correcting non-progressive desync. (in millisecs or hh:mm:ss:ms) 1298 # Note: Not effective in DirectVobSub, use "delay: ... " instead. 1299 time offset: 0 1301 # ON: displays only forced subtitles, OFF: shows everything 1302 forced subs: OFF 1304 # The original palette of the DVD 1305 palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, \ 1306 b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, fdfdfd 1307 # Custom colors (transp idxs and the four colors) 1308 custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \ 1309 000000 1311 # Language index in use 1312 langidx: 0 1314 # English 1315 id: en, index: 0 1316 # Decomment next line to activate alternative name in DirectVobSub / 1317 # Windows Media Player 6.x 1318 # alt: English 1319 # Vob/Cell ID: 1, 1 (PTS: 0) 1320 timestamp: 00:00:01:101, filepos: 000000000 1321 timestamp: 00:00:08:708, filepos: 000001000 1323 First, lines beginning with "#" are removed. These are comments to 1324 make text file editing easier, and as this is not a text file, they 1325 aren't needed. 1327 Next remove the "langidx" and "id" lines. These are used to 1328 differentiate the subtitle streams and define the language. As the 1329 streams will be stored separately anyway, there is no need to 1330 differentiate them here. Also, the language setting will be stored 1331 in the Matroska tags, so there is no need to store it here. 1333 Finally, the "timestamp" will be used to set the Block's timecode. 1334 Once it is set there, there is no need for it to be stored here. 1335 Also, as it may interfere if the file is edited, it SHOULD NOT be 1336 stored here. 1338 Once all of these items are removed, the data to store in the 1339 CodecPrivate SHOULD look like this: 1341 size: 720x480 1342 org: 0, 0 1343 scale: 100%, 100% 1344 alpha: 100% 1345 smooth: OFF 1346 fadein/out: 50, 50 1347 align: OFF at LEFT TOP 1348 time offset: 0 1349 forced subs: OFF 1350 palette: 000000, 7e7e7e, fbff8b, cb86f1, 7f74b8, e23f06, 0a48ea, \ 1351 b3d65a, 6b92f1, 87f087, c02081, f8d0f4, e3c411, 382201, e8840b, fdfdfd 1352 custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \ 1353 000000 1354 There SHOULD also be two Blocks containing one image each with the 1355 timecodes "00:00:01:101" and "00:00:08:708". 1357 7.2. SRT Subtitles 1359 SRT is perhaps the most basic of all subtitle formats. 1361 It consists of four parts, all in text.. 1363 1. A number indicating which subtitle it is in the sequence. 2. 1364 The time that the subtitle appears on the screen, and then 1365 disappears. 3. The subtitle itself. 4. A blank line indicating 1366 the start of a new subtitle. 1368 When placing SRT in Matroska, part 3 is converted to UTF-8 (S_TEXT/ 1369 UTF8) and placed in the data portion of the Block. Part 2 is used to 1370 set the timecode of the Block, and BlockDuration element. Nothing 1371 else is used. 1373 Here is an example SRT file: 1375 1 1376 00:02:17,440 --> 00:02:20,375 1377 Senator, we're making 1378 our final approach into Coruscant. 1380 2 1381 00:02:20,476 --> 00:02:22,501 1382 Very good, Lieutenant. 1384 In this example, the text "Senator, we're making our final approach 1385 into Coruscant." would be converted into UTF-8 and placed in the 1386 Block. The timecode of the block would be set to "00:02:17,440". 1387 And the BlockDuration element would be set to "00:00:02,935". 1389 The same is repeated for the next subtitle. 1391 Because there are no general settings for SRT, the CodecPrivate is 1392 left blank. 1394 7.3. SSA/ASS Subtitles 1396 SSA stands for Sub Station Alpha. It's the file format used by the 1397 popular subtitle editor, SubStation Alpha [35]. This format is 1398 widely used by fansubbers. 1400 It allows you to do some advanced display features, like positioning, 1401 karaoke, style managements... 1403 For detailed information on SSA/ASS, see the SSA specs [36]. It 1404 includes an SSA specs description and the advanced features added by 1405 ASS format (standing for Advanced SSA). Because SSA and ASS are so 1406 similar, they are treated the same here. 1408 Like SRT, this format is text based with a particular syntax. 1410 A file consists of 4 or 5 parts, declared ala INI file (but it's not 1411 an INI !) 1413 The first, "[Script Info]" contains some information about the 1414 subtitle file, such as it's title, who created it, type of script and 1415 a very important one : "PlayResY". Be careful of this value, 1416 everything in your script (font size, positioning) is scaled by it. 1417 Sub Station Alpha uses your desktops Y resolution to write this 1418 value, so if a friend with a large monitor and a high screen 1419 resolution gives you an edited script, you can mess everything up by 1420 saving the script in SSA with your low-cost monitor. 1422 The second, "[V4 Styles]", is a list of style definitions. A style 1423 describe how will look a text on the screen. It defines font, font 1424 size, primary/.../outile colour, position, alignment, etc. 1426 For example this : 1428 Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding 1429 Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0 1431 The third, "[Events]", is the list of text you want to display at the 1432 right timing. You can specify some attribute here. Like the style 1433 to use for this event (MUST be defined in the list), the position of 1434 the text (Left, Right, Vertical Margin), an effect. Name is mostly 1435 used by translator to know who said this sentence. Timing is in 1436 h:mm:ss.cc (centisec). 1438 Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text 1439 Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ? 1440 Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf main,autre,0000,0000,0000,,Toujours rien. 1442 "[Pictures]" or "[Fonts]" part can be found in some SSA file, they 1443 contains UUE-encoded pictures/font but those features are only used 1444 by Sub Station Alpha, i.e. no filter (Vobsub/Avery Lee Subtiler 1445 filter) use them. 1447 Now, how are they stored in Matroska ? 1449 o All text is converted to UTF-8* All the headers are stored in 1450 CodecPrivate ( Script Info and the Styles list)* Start & End field 1451 are used to set TimeStamp and the BlockDuration element. the data 1452 stored is :* Events are stored in the Block in this order: 1453 ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, 1454 Text (Layer comes from ASS specs ... it's empty for SSA.) 1455 "ReadOrder field is needed for the decoder to be able to reorder 1456 the streamed samples as they were placed originally in the file." 1458 Here is an example of an SSA file. 1460 [Script Info] 1461 ; This is a Sub Station Alpha v4 script. 1462 ; For Sub Station Alpha info and downloads, 1463 ; go to [http://www.eswat.demon.co.uk/](http://www.eswat.demon.co.uk/) 1464 ; or email [kotus@eswat.demon.co.uk](mailto:kotus@eswat.demon.co.uk) 1465 Title: Wolf's rain 2 1466 Original Script: Anime-spirit Ishin-francais 1467 Original Translation: Coolman 1468 Original Editing: Spikewolfwood 1469 Original Timing: Lord_alucard 1470 Original Script Checking: Spikewolfwood 1471 ScriptType: v4.00 1472 Collisions: Normal 1473 PlayResY: 1024 1474 PlayDepth: 0 1475 Wav: 0, 128697,D:\Alex\Anime\- Fansub -\- TAFF -\Wolf's Rain\WR_-_02_Wav.wav 1476 Wav: 0, 120692,H:\team truc\WR_-_02.wav 1477 Wav: 0, 116504,E:\sub\wolf's_rain\WOLF'S RAIN 02.wav 1478 LastWav: 3 1479 Timer: 100,0000 1481 [V4 Styles] 1482 Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding 1483 Style: Default,Arial,20,65535,65535,65535,-2147483640,-1,0,1,3,0,2,30,30,30,0,0 1484 Style: Titre_episode,Akbar,140,15724527,65535,65535,986895,-1,0,1,1,0,3,30,30,30,0,0 1485 Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0 1487 [Events] 1488 Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text 1489 Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ? 1490 Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf main,autre,0000,0000,0000,,Toujours rien. 1492 Here is what would be placed into the CodecPrivate element. 1494 [Script Info] 1495 ; This is a Sub Station Alpha v4 script. 1496 ; For Sub Station Alpha info and downloads, 1497 ; go to [http://www.eswat.demon.co.uk/](http://www.eswat.demon.co.uk/) 1498 ; or email [kotus@eswat.demon.co.uk](mailto:kotus@eswat.demon.co.uk) 1499 Title: Wolf's rain 2 1500 Original Script: Anime-spirit Ishin-francais 1501 Original Translation: Coolman 1502 Original Editing: Spikewolfwood 1503 Original Timing: Lord_alucard 1504 Original Script Checking: Spikewolfwood 1505 ScriptType: v4.00 1506 Collisions: Normal 1507 PlayResY: 1024 1508 PlayDepth: 0 1509 Wav: 0, 128697,D:\Alex\Anime\- Fansub -\- TAFF -\Wolf's Rain\WR_-_02_Wav.wav 1510 Wav: 0, 120692,H:\team truc\WR_-_02.wav 1511 Wav: 0, 116504,E:\sub\wolf's_rain\WOLF'S RAIN 02.wav 1512 LastWav: 3 1513 Timer: 100,0000 1515 [V4 Styles] 1516 Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding 1517 Style: Default,Arial,20,65535,65535,65535,-2147483640,-1,0,1,3,0,2,30,30,30,0,0 1518 Style: Titre_episode,Akbar,140,15724527,65535,65535,986895,-1,0,1,1,0,3,30,30,30,0,0 1519 Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,0,1,1,2,2,5,5,30,0,0 1521 And here are the two blocks that would be generated. 1523 Block's timecode: 00:02:40.650 BlockDuration: 00:00:01.140 1525 1,,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses ondes delta ? 1527 Block's timecode: 00:02:42.420 BlockDuration: 00:00:01.730 1529 2,,Wolf main,autre,0000,0000,0000,,Toujours rien. 1531 7.4. USF Subtitles 1533 Under construction 1535 7.5. WebVTT 1537 The "Web Video Text Tracks Format" (short: WebVTT) is developed by 1538 the World Wide Web Consortium (W3C) [37]. Its specifications are 1539 freely available [38]. 1541 The guiding principles for the storage of WebVTT in Matroska are: 1543 o Consistency: store data in a similar way to other subtitle codecs 1545 o Simplicity: making decoding and remuxing as easy as possible for 1546 existing infrastructures 1548 o Completeness: keeping as much data as possible from the original 1549 WebVTT file 1551 7.5.1. Storage of WebVTT in Matroska 1553 7.5.1.1. CodecID: codec identification 1555 The CodecID to use is "S_TEXT/WEBVTT". 1557 7.5.1.2. CodecPrivate: storage of global WebVTT blocks 1559 This element contains all global blocks before the first subtitle 1560 entry. This starts at the ""WEBVTT"" file identification marker but 1561 excludes the optional byte order mark. 1563 7.5.1.3. Storage of non-global WebVTT blocks 1565 Non-global WebVTT blocks (e.g. "NOTE") before a WebVTT Cue Text are 1566 stored in Matroska's BlockAddition element together with the Matroska 1567 Block containing the WebVTT Cue Text these blocks precede (see below 1568 for the actual format). 1570 7.5.1.4. Storage of Cues in Matroska blocks 1572 Each WebVTT Cue Text is stored directly in the Matroska Block. 1574 A muxer MUST change all WebVTT Cue Timestamps present within the Cue 1575 Text to be relative to the Matroska Block's timestamp. 1577 The Cue's start timestamp is used as the Matroska Block's timestamp. 1579 The difference between the Cue's end timestamp and its start 1580 timestamp is used as the Matroska Block's duration. 1582 7.5.1.5. BlockAdditions: storing non-global WebVTT blocks, Cue Settings 1583 Lists and Cue identifiers 1585 Each Matroska Block may be accompanied by one BlockAdditions element. 1586 Its format is as follows: 1588 1. The first line contains the WebVTT Cue Text's optional Cue 1589 Settings List followed by one line feed character (U+0x000a). 1591 The Cue Settings List may be empty in which case the line 1592 consists of the line feed character only. 1594 2. The second line contains the WebVTT Cue Text's optional Cue 1595 Identifier followed by one line feed character (U+0x000a). The 1596 line may be empty indicating that there was no Cue Identifier in 1597 the source file in which case the line consists of the line feed 1598 character only. 1600 3. The third and all following lines contain all WebVTT Comment 1601 Blocks that precede the current WebVTT Cue Block. These may be 1602 absent. 1604 If there is no Matroska BlockAddition element stored together with 1605 the Matroska Block then all three components (Cue Settings List, Cue 1606 Identifier, Cue Comments) MUST be assumed to be absent. 1608 7.5.2. Examples of transformation 1610 Here's an example how a WebVTT is transformed. 1612 7.5.2.1. Example WebVTT file 1614 Let's take the following example file: 1616 WEBVTT with text after the signature 1618 STYLE 1619 ::cue { 1620 background-image: linear-gradient(to bottom, dimgray, lightgray); 1621 color: papayawhip; 1622 } 1623 /* Style blocks cannot use blank lines nor "dash dash greater than" */ 1625 NOTE comment blocks can be used between style blocks. 1627 STYLE 1628 ::cue(b) { 1629 color: peachpuff; 1630 } 1632 REGION 1633 id:bill 1634 width:40% 1635 lines:3 1636 regionanchor:0%,100% 1637 viewportanchor:10%,90% 1638 scroll:up 1640 NOTE 1641 Notes always span a whole block and can cover multiple 1642 lines. Like this one. 1643 An empty line ends the block. 1645 hello 1646 00:00:00.000 --> 00:00:10.000 1647 Example entry 1: Hello world. 1649 NOTE style blocks cannot appear after the first cue. 1651 00:00:25.000 --> 00:00:35.000 1652 Example entry 2: Another entry. 1653 This one has multiple lines. 1655 00:01:03.000 --> 00:01:06.500 position:90% align:right size:35% 1656 Example entry 3: That stuff to the right of the timestamps are cue settings. 1658 00:03:10.000 --> 00:03:20.000 1659 Example entry 4: Entries can even include timestamps. 1660 For example:<00:03:15.000>This becomes visible five seconds 1661 after the first part. 1663 7.5.2.2. CodecPrivate 1665 The resulting CodecPrivate element will look like this: 1667 WEBVTT with text after the signature 1669 STYLE 1670 ::cue { 1671 background-image: linear-gradient(to bottom, dimgray, lightgray); 1672 color: papayawhip; 1673 } 1674 /* Style blocks cannot use blank lines nor "dash dash greater than" */ 1676 NOTE comment blocks can be used between style blocks. 1678 STYLE 1679 ::cue(b) { 1680 color: peachpuff; 1681 } 1683 REGION 1684 id:bill 1685 width:40% 1686 lines:3 1687 regionanchor:0%,100% 1688 viewportanchor:10%,90% 1689 scroll:up 1691 NOTE 1692 Notes always span a whole block and can cover multiple 1693 lines. Like this one. 1694 An empty line ends the block. 1696 7.5.2.3. Storage of Cue 1 1698 Example Cue 1: timestamp 00:00:00.000, duration 00:00:10.000, Block's 1699 content: 1701 Example entry 1: Hello world. 1703 BlockAddition's content starts with one empty line as there's no Cue 1704 Settings List: 1706 hello 1708 7.5.2.4. Storage of Cue 2 1710 Example Cue 2: timestamp 00:00:25.000, duration 00:00:10.000, Block's 1711 content: 1713 Example entry 2: Another entry. 1714 This one has multiple lines. 1716 BlockAddition's content starts with two empty lines as there's 1717 neither a Cue Settings List nor a Cue Identifier: 1719 NOTE style blocks cannot appear after the first cue. 1721 7.5.2.5. Storage of Cue 3 1723 Example Cue 3: timestamp 00:01:03.000, duration 00:00:03.500, Block's 1724 content: 1726 Example entry 3: That stuff to the right of the timestamps are cue settings. 1728 BlockAddition's content ends with an empty line as there's no Cue 1729 Identifier and there were no WebVTT Comment blocks: 1731 position:90% align:right size:35% 1733 7.5.2.6. Storage of Cue 4 1735 Example Cue 4: timestamp 00:03:10.000, duration 00:00:10.000, Block's 1736 content: 1738 Example entry 4: Entries can even include timestamps. For 1739 example:<00:00:05.000>This becomes visible five seconds after the 1740 first part. 1742 This Block does not need a BlockAddition as the Cue did not contain 1743 an Identifier, nor a Settings List, and it wasn't preceded by Comment 1744 blocks. 1746 7.5.3. Storage of WebVTT in Matroska vs. WebM 1748 Note: the storage of WebVTT in Matroska is not the same as the design 1749 document for storage of WebVTT in WebM. There are several reasons 1750 for this including but not limited to: the WebM document is old (from 1751 February 2012) and was based on an earlier draft of WebVTT and 1752 ignores several parts that were added to WebVTT later; WebM does 1753 still not support subtitles at all [39]; the proposal suggests 1754 splitting the information across multiple tracks making demuxer's and 1755 remuxer's life very difficult. 1757 7.6. HDMV presentation graphics subtitles 1759 The specifications for the HDMV presentation graphics subtitle format 1760 (short: HDMV PGS) can be found in the document "Blu-ray Disc Read- 1761 Only Format; Part 3 -- Audio Visual Basic Specifications" in section 1762 9.14 "HDMV graphics streams". 1764 7.6.1. Storage of HDMV presentation graphics subtitles 1766 7.6.1.1. CodecID & CodecPrivate: codec identification 1768 The CodecID to use is "S_HDMV/PGS". A CodecPrivate element is not 1769 used. 1771 7.6.1.2. Storage of HDMV PGS Segments in Matroska Blocks 1773 Each HDMV PGS Segment (short: Segment) will be stored in a Matroska 1774 Block. A Segment is the data structure described in section 9.14.2.1 1775 "Segment coding structure and parameters" of the Blu-ray 1776 specifications. 1778 Each Segment contains a presentation timestamp. This timestamp will 1779 be used as the timestamp for the Matroska Block. 1781 A Segment is normally shown until a subsequent Segment is 1782 encountered. Therefore the Matroska Block MAY have no Duration. In 1783 that case a player MUST display a Segment within a Matroska Block 1784 until the next Segment is encountered. 1786 A muxer MAY use a Duration, e.g. by calculating the distance between 1787 two subsequent Segments. If a Matroska Block has a Duration, a 1788 player MUST display that Segment only for the duration of the Block's 1789 Duration. 1791 7.7. HDMV text subtitles 1793 The specifications for the HDMV text subtitle format (short: HDMV 1794 TextST) can be found in the document "Blu-ray Disc Read-Only Format; 1795 Part 3 -- Audio Visual Basic Specifications" in section 9.15 "HDMV 1796 text subtitle streams". 1798 7.7.1. Storage of HDMV text subtitles 1800 7.7.1.1. CodecID & CodecPrivate: codec identification 1802 The CodecID to use is "S_HDMV/TEXTST". 1804 A CodecPrivate Element is required. It MUST contain the stream's 1805 Dialog Style Segment as described in section 9.15.4.2 "Dialog Style 1806 Segment" of the Blu-ray specifications. 1808 7.7.1.2. Storage of HDMV TextST Dialog Presentation Segments in 1809 Matroska Blocks 1811 Each HDMV Dialog Presentation Segment (short: Segment) will be stored 1812 in a Matroska Block. A Segment is the data structure described in 1813 section 9.15.4.3 "Dialog presentation segment" of the Blu-ray 1814 specifications. 1816 Each Segment contains a start and an end presentation timestamp 1817 (short: start PTS & end PTS). The start PTS will be used as the 1818 timestamp for the Matroska Block. The Matroska Block MUST have a 1819 Duration, and that Duration is the difference between the end PTS and 1820 the start PTS. 1822 A player MUST use the Matroska Block's timestamp and Duration instead 1823 of the Segment's start and end PTS for determining when and how long 1824 to show the Segment. 1826 7.7.1.3. Character set 1828 When TextST subtitles are stored inside Matroska, the only allowed 1829 character set is UTF-8. 1831 Each HDMV text subtitle stream in a Blu-ray can use one of a handful 1832 of character sets. This information is not stored in the MPEG2 1833 Transport Stream itself but in the accompanying Clip Information 1834 file. 1836 Therefore a muxer MUST parse the accompanying Clip Information file. 1837 If the information indicates a character set other than UTF-8, it 1838 MUST re-encode all text Dialog Presentation Segments from the 1839 indicated character set to UTF-8 prior to storing them in Matroska. 1841 7.8. Digital Video Broadcasting (DVB) subtitles 1843 The specifications for the Digital Video Broadcasting subtitle 1844 bitstream format (short: DVB subtitles) can be found in the document 1845 "ETSI EN 300 743 - Digital Video Broadcasting (DVB); Subtitling 1846 systems". The storage of DVB subtitles in MPEG transport streams is 1847 specified in the document "ETSI EN 300 468 - Digital Video 1848 Broadcasting (DVB); Specification for Service Information (SI) in DVB 1849 systems". 1851 7.8.1. Storage of DVB subtitles 1853 7.8.1.1. CodecID 1855 The CodecID to use is "S_DVBSUB". 1857 7.8.1.2. CodecPrivate 1859 The CodecPrivate element is five bytes long and has the following 1860 structure: 1862 o 2 bytes: composition page ID (bit string, left bit first) 1864 o 2 bytes: ancillary page ID (bit string, left bit first) 1866 o 1 byte: subtitling type (bit string, left bit first) 1868 The semantics of these bytes are the same as the ones described in 1869 section 6.2.41 "Subtitling descriptor" of ETSI EN 300 468. 1871 7.8.1.3. Storage of DVB subtitles in Matroska Blocks 1873 Each Matroska Block consists of one or more DVB Subtitle Segments as 1874 described in segment 7.2 "Syntax and semantics of the subtitling 1875 segment" of ETSI EN 300 743. 1877 Each Matroska Block SHOULD have a Duration indicating how long the 1878 DVB Subtitle Segments in that Block SHOULD be displayed. 1880 8. References 1882 8.1. Normative References 1884 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 1885 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 1886 . 1888 [RFC6386] Bankoski, J., Koleszar, J., Quillio, L., Salonen, J., 1889 Wilkins, P., and Y. Xu, "VP8 Data Format and Decoding 1890 Guide", RFC 6386, DOI 10.17487/RFC6386, November 2011, 1891 . 1893 [RFC6648] Saint-Andre, P., Crocker, D., and M. Nottingham, 1894 "Deprecating the "X-" Prefix and Similar Constructs in 1895 Application Protocols", BCP 178, RFC 6648, 1896 DOI 10.17487/RFC6648, June 2012, 1897 . 1899 8.2. URIs 1901 [1] https://datatracker.ietf.org/wg/cellar/charter/ 1903 [2] https://tools.ietf.org/html/rfc2119 1905 [3] https://msdn.microsoft.com/en-us/library/windows/desktop/ 1906 dd318229(v=vs.85).aspx 1908 [4] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1909 librmff.h 1911 [5] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1912 librmff.h 1914 [6] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1915 librmff.h 1917 [7] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1918 librmff.h 1920 [8] https://developer.apple.com/library/mac/documentation/QuickTime/ 1921 QTFF/QTFFPreface/qtffPreface.html 1923 [9] http://www.theora.org/doc/Theora.pdf 1925 [10] http://wiki.multimedia.cx/ 1926 index.php?title=Apple_ProRes#Frame_layout 1928 [11] https://www.webmproject.org/vp9/ 1930 [12] https://datatracker.ietf.org/doc/draft-niedermayer-cellar-ffv1/ 1932 [13] http://alac.macosforge.org/trac/browser/trunk/ 1933 ALACMagicCookieDescription.txt 1935 [14] https://xiph.org/vorbis/doc/Vorbis_I_spec.html 1937 [15] https://xiph.org/vorbis/doc/v-comment.html 1939 [16] https://xiph.org/vorbis/doc/Vorbis_I_spec.html 1941 [17] http://flac.sourceforge.net/ 1943 [18] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1944 librmff.h 1946 [19] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1947 librmff.h 1949 [20] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1950 librmff.h 1952 [21] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1953 librmff.h 1955 [22] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1956 librmff.h 1958 [23] https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ 1959 librmff.h 1961 [24] http://msdn.microsoft.com/library/default.asp?url=/library/en- 1962 us/multimed/mmstr_625u.asp 1964 [25] https://developer.apple.com/library/mac/documentation/QuickTime/ 1965 QTFF/QTFFPreface/qtffPreface.html 1967 [26] https://developer.apple.com/library/mac/documentation/QuickTime/ 1968 QTFF/QTFFPreface/qtffPreface.html 1970 [27] https://developer.apple.com/library/mac/documentation/QuickTime/ 1971 QTFF/QTFFPreface/qtffPreface.html 1973 [28] http://tausoft.org/ 1975 [29] http://tausoft.org/wiki/True_Audio_Codec_Format 1977 [30] http://www.wavpack.com/ 1979 [31] wavpack.html 1981 [32] http://wiki.xiph.org/index.php/OggKate#Matroska_mapping 1983 [33] http://dvd.sourceforge.net/dvdinfo/pci_pkt.html 1985 [34] http://dvd.sourceforge.net/dvdinfo/pci_pkt.html 1987 [35] http://wiki.multimedia.cx/index.php?title=SubStation_Alpha 1989 [36] http://moodub.free.fr/video/ass-specs.doc 1991 [37] https://www.w3.org/ 1993 [38] https://w3c.github.io/webvtt/ 1995 [39] http://www.webmproject.org/docs/container/ 1997 Authors' Addresses 1999 Steve Lhomme 2001 Email: slhomme@matroska.org 2003 Moritz Bunkus 2005 Email: moritz@bunkus.org 2007 Dave Rice 2009 Email: dave@dericed.com