draft-ietf-cellar-codec-04.txt   draft-ietf-cellar-codec-05.txt 
cellar S. Lhomme cellar S. Lhomme
Internet-Draft Internet-Draft
Intended status: Informational M. Bunkus Intended status: Informational M. Bunkus
Expires: 19 October 2020 Expires: 22 April 2021
D. Rice D. Rice
17 April 2020 19 October 2020
Matroska Media Container Codec Specifications Matroska Media Container Codec Specifications
draft-ietf-cellar-codec-04 draft-ietf-cellar-codec-05
Abstract Abstract
This document defines the Matroska codec mappings, including the This document defines the Matroska codec mappings, including the
codec ID, layout of data in a "Block Element" and in an optional codec ID, layout of data in a "Block Element" and in an optional
"CodecPrivate Element". "CodecPrivate Element".
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
skipping to change at page 1, line 34 skipping to change at page 1, line 34
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 19 October 2020. This Internet-Draft will expire on 22 April 2021.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
and restrictions with respect to this document. Code Components and restrictions with respect to this document. Code Components
extracted from this document must include Simplified BSD License text extracted from this document must include Simplified BSD License text
as described in Section 4.e of the Trust Legal Provisions and are as described in Section 4.e of the Trust Legal Provisions and are
provided without warranty as described in the Simplified BSD License. provided without warranty as described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Status of this document . . . . . . . . . . . . . . . . . . . 4 2. Status of this document . . . . . . . . . . . . . . . . . . . 5
3. Security Considerations . . . . . . . . . . . . . . . . . . . 4 3. Security Considerations . . . . . . . . . . . . . . . . . . . 5
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
5. Notations and Conventions . . . . . . . . . . . . . . . . . . 5 5. Notation and Conventions . . . . . . . . . . . . . . . . . . 5
6. Codec Mappings . . . . . . . . . . . . . . . . . . . . . . . 5 6. Codec Mappings . . . . . . . . . . . . . . . . . . . . . . . 5
6.1. Defining Matroska Codec Support . . . . . . . . . . . . . 5 6.1. Defining Matroska Codec Support . . . . . . . . . . . . . 6
6.1.1. Codec ID . . . . . . . . . . . . . . . . . . . . . . 5 6.1.1. Codec ID . . . . . . . . . . . . . . . . . . . . . . 6
6.1.2. Codec Name . . . . . . . . . . . . . . . . . . . . . 6 6.1.2. Codec Name . . . . . . . . . . . . . . . . . . . . . 7
6.1.3. Description . . . . . . . . . . . . . . . . . . . . . 7 6.1.3. Description . . . . . . . . . . . . . . . . . . . . . 7
6.1.4. Initialization . . . . . . . . . . . . . . . . . . . 7 6.1.4. Initialization . . . . . . . . . . . . . . . . . . . 7
6.1.5. Codec BlockAdditions . . . . . . . . . . . . . . . . 7 6.1.5. Codec BlockAdditions . . . . . . . . . . . . . . . . 7
6.1.6. Citation . . . . . . . . . . . . . . . . . . . . . . 8 6.1.6. Citation . . . . . . . . . . . . . . . . . . . . . . 8
6.1.7. Deprecation Date . . . . . . . . . . . . . . . . . . 8 6.1.7. Deprecation Date . . . . . . . . . . . . . . . . . . 9
6.1.8. Superseded By . . . . . . . . . . . . . . . . . . . . 8 6.1.8. Superseded By . . . . . . . . . . . . . . . . . . . . 9
6.2. Recommendations for the Creation of New Codec Mappings . 8 6.2. Recommendations for the Creation of New Codec Mappings . 9
6.3. Video Codec Mappings . . . . . . . . . . . . . . . . . . 9 6.3. Video Codec Mappings . . . . . . . . . . . . . . . . . . 9
6.3.1. V_MS/VFW/FOURCC . . . . . . . . . . . . . . . . . . . 9 6.3.1. V_MS/VFW/FOURCC . . . . . . . . . . . . . . . . . . . 9
6.3.2. V_UNCOMPRESSED . . . . . . . . . . . . . . . . . . . 9 6.3.2. V_UNCOMPRESSED . . . . . . . . . . . . . . . . . . . 10
6.3.3. V_MPEG4/ISO/SP . . . . . . . . . . . . . . . . . . . 10 6.3.3. V_MPEG4/ISO/SP . . . . . . . . . . . . . . . . . . . 10
6.3.4. V_MPEG4/ISO/ASP . . . . . . . . . . . . . . . . . . . 10 6.3.4. V_MPEG4/ISO/ASP . . . . . . . . . . . . . . . . . . . 10
6.3.5. V_MPEG4/ISO/AP . . . . . . . . . . . . . . . . . . . 10 6.3.5. V_MPEG4/ISO/AP . . . . . . . . . . . . . . . . . . . 11
6.3.6. V_MPEG4/MS/V3 . . . . . . . . . . . . . . . . . . . . 10 6.3.6. V_MPEG4/MS/V3 . . . . . . . . . . . . . . . . . . . . 11
6.3.7. V_MPEG1 . . . . . . . . . . . . . . . . . . . . . . . 11 6.3.7. V_MPEG1 . . . . . . . . . . . . . . . . . . . . . . . 11
6.3.8. V_MPEG2 . . . . . . . . . . . . . . . . . . . . . . . 11 6.3.8. V_MPEG2 . . . . . . . . . . . . . . . . . . . . . . . 11
6.3.9. V_REAL/RV10 . . . . . . . . . . . . . . . . . . . . . 11 6.3.9. V_MPEG4/ISO/AVC . . . . . . . . . . . . . . . . . . . 12
6.3.10. V_REAL/RV20 . . . . . . . . . . . . . . . . . . . . . 12 6.3.10. V_MPEGH/ISO/HEVC . . . . . . . . . . . . . . . . . . 12
6.3.11. V_REAL/RV30 . . . . . . . . . . . . . . . . . . . . . 12 6.3.11. V_AVS2 . . . . . . . . . . . . . . . . . . . . . . . 12
6.3.12. V_REAL/RV40 . . . . . . . . . . . . . . . . . . . . . 12 6.3.12. V_REAL/RV10 . . . . . . . . . . . . . . . . . . . . . 13
6.3.13. V_QUICKTIME . . . . . . . . . . . . . . . . . . . . . 12 6.3.13. V_REAL/RV20 . . . . . . . . . . . . . . . . . . . . . 13
6.3.14. V_THEORA . . . . . . . . . . . . . . . . . . . . . . 13 6.3.14. V_REAL/RV30 . . . . . . . . . . . . . . . . . . . . . 13
6.3.15. V_PRORES . . . . . . . . . . . . . . . . . . . . . . 13 6.3.15. V_REAL/RV40 . . . . . . . . . . . . . . . . . . . . . 14
6.3.16. V_VP8 . . . . . . . . . . . . . . . . . . . . . . . . 14 6.3.16. V_QUICKTIME . . . . . . . . . . . . . . . . . . . . . 14
6.3.17. V_VP9 . . . . . . . . . . . . . . . . . . . . . . . . 14 6.3.17. V_THEORA . . . . . . . . . . . . . . . . . . . . . . 14
6.3.18. V_FFV1 . . . . . . . . . . . . . . . . . . . . . . . 15 6.3.18. V_PRORES . . . . . . . . . . . . . . . . . . . . . . 15
6.4. Audio Codec Mappings . . . . . . . . . . . . . . . . . . 15 6.3.19. V_VP8 . . . . . . . . . . . . . . . . . . . . . . . . 15
6.4.1. A_MPEG/L3 . . . . . . . . . . . . . . . . . . . . . . 15 6.3.20. V_VP9 . . . . . . . . . . . . . . . . . . . . . . . . 16
6.4.2. A_MPEG/L2 . . . . . . . . . . . . . . . . . . . . . . 15 6.3.21. V_FFV1 . . . . . . . . . . . . . . . . . . . . . . . 16
6.4.3. A_MPEG/L1 . . . . . . . . . . . . . . . . . . . . . . 16 6.4. Audio Codec Mappings . . . . . . . . . . . . . . . . . . 17
6.4.4. A_PCM/INT/BIG . . . . . . . . . . . . . . . . . . . . 16 6.4.1. A_MPEG/L3 . . . . . . . . . . . . . . . . . . . . . . 17
6.4.5. A_PCM/INT/LIT . . . . . . . . . . . . . . . . . . . . 16 6.4.2. A_MPEG/L2 . . . . . . . . . . . . . . . . . . . . . . 17
6.4.6. A_PCM/FLOAT/IEEE . . . . . . . . . . . . . . . . . . 16 6.4.3. A_MPEG/L1 . . . . . . . . . . . . . . . . . . . . . . 17
6.4.7. A_MPC . . . . . . . . . . . . . . . . . . . . . . . . 17 6.4.4. A_PCM/INT/BIG . . . . . . . . . . . . . . . . . . . . 17
6.4.8. A_AC3 . . . . . . . . . . . . . . . . . . . . . . . . 17 6.4.5. A_PCM/INT/LIT . . . . . . . . . . . . . . . . . . . . 18
6.4.9. A_AC3/BSID9 . . . . . . . . . . . . . . . . . . . . . 17 6.4.6. A_PCM/FLOAT/IEEE . . . . . . . . . . . . . . . . . . 18
6.4.10. A_AC3/BSID10 . . . . . . . . . . . . . . . . . . . . 17 6.4.7. A_MPC . . . . . . . . . . . . . . . . . . . . . . . . 18
6.4.11. A_ALAC . . . . . . . . . . . . . . . . . . . . . . . 18 6.4.8. A_AC3 . . . . . . . . . . . . . . . . . . . . . . . . 18
6.4.12. A_DTS . . . . . . . . . . . . . . . . . . . . . . . . 18 6.4.9. A_AC3/BSID9 . . . . . . . . . . . . . . . . . . . . . 19
6.4.13. A_DTS/EXPRESS . . . . . . . . . . . . . . . . . . . . 18 6.4.10. A_AC3/BSID10 . . . . . . . . . . . . . . . . . . . . 19
6.4.14. A_DTS/LOSSLESS . . . . . . . . . . . . . . . . . . . 19 6.4.11. A_ALAC . . . . . . . . . . . . . . . . . . . . . . . 19
6.4.15. A_VORBIS . . . . . . . . . . . . . . . . . . . . . . 19 6.4.12. A_DTS . . . . . . . . . . . . . . . . . . . . . . . . 19
6.4.16. A_FLAC . . . . . . . . . . . . . . . . . . . . . . . 19 6.4.13. A_DTS/EXPRESS . . . . . . . . . . . . . . . . . . . . 20
6.4.17. A_REAL/14_4 . . . . . . . . . . . . . . . . . . . . . 19 6.4.14. A_DTS/LOSSLESS . . . . . . . . . . . . . . . . . . . 20
6.4.18. A_REAL/28_8 . . . . . . . . . . . . . . . . . . . . . 20 6.4.15. A_VORBIS . . . . . . . . . . . . . . . . . . . . . . 20
6.4.19. A_REAL/COOK . . . . . . . . . . . . . . . . . . . . . 20 6.4.16. A_FLAC . . . . . . . . . . . . . . . . . . . . . . . 21
6.4.20. A_REAL/SIPR . . . . . . . . . . . . . . . . . . . . . 20 6.4.17. A_REAL/14_4 . . . . . . . . . . . . . . . . . . . . . 21
6.4.21. A_REAL/RALF . . . . . . . . . . . . . . . . . . . . . 21 6.4.18. A_REAL/28_8 . . . . . . . . . . . . . . . . . . . . . 21
6.4.22. A_REAL/ATRC . . . . . . . . . . . . . . . . . . . . . 21 6.4.19. A_REAL/COOK . . . . . . . . . . . . . . . . . . . . . 21
6.4.23. A_MS/ACM . . . . . . . . . . . . . . . . . . . . . . 21 6.4.20. A_REAL/SIPR . . . . . . . . . . . . . . . . . . . . . 22
6.4.24. A_AAC/MPEG2/MAIN . . . . . . . . . . . . . . . . . . 21 6.4.21. A_REAL/RALF . . . . . . . . . . . . . . . . . . . . . 22
6.4.25. A_AAC/MPEG2/LC . . . . . . . . . . . . . . . . . . . 22 6.4.22. A_REAL/ATRC . . . . . . . . . . . . . . . . . . . . . 22
6.4.26. A_AAC/MPEG2/LC/SBR . . . . . . . . . . . . . . . . . 22 6.4.23. A_MS/ACM . . . . . . . . . . . . . . . . . . . . . . 23
6.4.27. A_AAC/MPEG2/SSR . . . . . . . . . . . . . . . . . . . 22 6.4.24. A_AAC/MPEG2/MAIN . . . . . . . . . . . . . . . . . . 23
6.4.28. A_AAC/MPEG4/MAIN . . . . . . . . . . . . . . . . . . 23 6.4.25. A_AAC/MPEG2/LC . . . . . . . . . . . . . . . . . . . 23
6.4.29. A_AAC/MPEG4/LC . . . . . . . . . . . . . . . . . . . 23 6.4.26. A_AAC/MPEG2/LC/SBR . . . . . . . . . . . . . . . . . 23
6.4.30. A_AAC/MPEG4/LC/SBR . . . . . . . . . . . . . . . . . 23 6.4.27. A_AAC/MPEG2/SSR . . . . . . . . . . . . . . . . . . . 24
6.4.31. A_AAC/MPEG4/SSR . . . . . . . . . . . . . . . . . . . 23 6.4.28. A_AAC/MPEG4/MAIN . . . . . . . . . . . . . . . . . . 24
6.4.32. A_AAC/MPEG4/LTP . . . . . . . . . . . . . . . . . . . 24 6.4.29. A_AAC/MPEG4/LC . . . . . . . . . . . . . . . . . . . 24
6.4.33. A_QUICKTIME . . . . . . . . . . . . . . . . . . . . . 24 6.4.30. A_AAC/MPEG4/LC/SBR . . . . . . . . . . . . . . . . . 25
6.4.34. A_QUICKTIME/QDMC . . . . . . . . . . . . . . . . . . 24 6.4.31. A_AAC/MPEG4/SSR . . . . . . . . . . . . . . . . . . . 25
6.4.35. A_QUICKTIME/QDM2 . . . . . . . . . . . . . . . . . . 25 6.4.32. A_AAC/MPEG4/LTP . . . . . . . . . . . . . . . . . . . 25
6.4.36. A_TTA1 . . . . . . . . . . . . . . . . . . . . . . . 25 6.4.33. A_QUICKTIME . . . . . . . . . . . . . . . . . . . . . 25
6.4.37. A_WAVPACK4 . . . . . . . . . . . . . . . . . . . . . 25 6.4.34. A_QUICKTIME/QDMC . . . . . . . . . . . . . . . . . . 26
6.5. Subtitle Codec Mappings . . . . . . . . . . . . . . . . . 26 6.4.35. A_QUICKTIME/QDM2 . . . . . . . . . . . . . . . . . . 26
6.5.1. S_TEXT/UTF8 . . . . . . . . . . . . . . . . . . . . . 26 6.4.36. A_TTA1 . . . . . . . . . . . . . . . . . . . . . . . 26
6.5.2. S_TEXT/SSA . . . . . . . . . . . . . . . . . . . . . 26 6.4.37. A_WAVPACK4 . . . . . . . . . . . . . . . . . . . . . 27
6.5.3. S_TEXT/ASS . . . . . . . . . . . . . . . . . . . . . 26 6.5. Subtitle Codec Mappings . . . . . . . . . . . . . . . . . 27
6.5.4. S_TEXT/USF . . . . . . . . . . . . . . . . . . . . . 26 6.5.1. S_TEXT/UTF8 . . . . . . . . . . . . . . . . . . . . . 27
6.5.5. S_TEXT/WEBVTT . . . . . . . . . . . . . . . . . . . . 27 6.5.2. S_TEXT/SSA . . . . . . . . . . . . . . . . . . . . . 27
6.5.6. S_IMAGE/BMP . . . . . . . . . . . . . . . . . . . . . 27 6.5.3. S_TEXT/ASS . . . . . . . . . . . . . . . . . . . . . 28
6.5.7. S_DVBSUB . . . . . . . . . . . . . . . . . . . . . . 27 6.5.4. S_TEXT/WEBVTT . . . . . . . . . . . . . . . . . . . . 28
6.5.8. S_VOBSUB . . . . . . . . . . . . . . . . . . . . . . 27 6.5.5. S_IMAGE/BMP . . . . . . . . . . . . . . . . . . . . . 28
6.5.9. S_HDMV/PGS . . . . . . . . . . . . . . . . . . . . . 28 6.5.6. S_DVBSUB . . . . . . . . . . . . . . . . . . . . . . 28
6.5.10. S_HDMV/TEXTST . . . . . . . . . . . . . . . . . . . . 28 6.5.7. S_VOBSUB . . . . . . . . . . . . . . . . . . . . . . 29
6.5.11. S_KATE . . . . . . . . . . . . . . . . . . . . . . . 28 6.5.8. S_HDMV/PGS . . . . . . . . . . . . . . . . . . . . . 29
6.6. Button Codec Mappings . . . . . . . . . . . . . . . . . . 29 6.5.9. S_HDMV/TEXTST . . . . . . . . . . . . . . . . . . . . 29
6.6.1. B_VOBBTN . . . . . . . . . . . . . . . . . . . . . . 29 6.5.10. S_KATE . . . . . . . . . . . . . . . . . . . . . . . 29
7. Subtitles . . . . . . . . . . . . . . . . . . . . . . . . . . 29 6.6. Button Codec Mappings . . . . . . . . . . . . . . . . . . 30
7.1. Images Subtitles . . . . . . . . . . . . . . . . . . . . 30 6.6.1. B_VOBBTN . . . . . . . . . . . . . . . . . . . . . . 30
7.2. SRT Subtitles . . . . . . . . . . . . . . . . . . . . . . 33 6.7. Block Addition Mappings . . . . . . . . . . . . . . . . . 30
7.3. SSA/ASS Subtitles . . . . . . . . . . . . . . . . . . . . 33 6.7.1. Use BlockAddIDValue . . . . . . . . . . . . . . . . . 30
7.4. USF Subtitles . . . . . . . . . . . . . . . . . . . . . . 38 6.7.2. Opaque data . . . . . . . . . . . . . . . . . . . . . 30
7.5. WebVTT . . . . . . . . . . . . . . . . . . . . . . . . . 38 6.7.3. ITU T.35 metadata . . . . . . . . . . . . . . . . . . 31
7.5.1. Storage of WebVTT in Matroska . . . . . . . . . . . . 38 6.7.4. avcE . . . . . . . . . . . . . . . . . . . . . . . . 31
7.5.2. Examples of transformation . . . . . . . . . . . . . 39 6.7.5. dvcC . . . . . . . . . . . . . . . . . . . . . . . . 31
7.5.3. Storage of WebVTT in Matroska vs. WebM . . . . . . . 42 6.7.6. dvvC . . . . . . . . . . . . . . . . . . . . . . . . 31
7.6. HDMV presentation graphics subtitles . . . . . . . . . . 43 6.7.7. hvcE . . . . . . . . . . . . . . . . . . . . . . . . 31
7.6.1. Storage of HDMV presentation graphics subtitles . . . 43 6.7.8. mvcC . . . . . . . . . . . . . . . . . . . . . . . . 32
7.7. HDMV text subtitles . . . . . . . . . . . . . . . . . . . 43 6.8. This extension MUST NOT be used if "Codec ID" is not
7.7.1. Storage of HDMV text subtitles . . . . . . . . . . . 43 "V_MPEG4/ISO/AVC". . . . . . . . . . . . . . . . . . . . 32
7.8. Digital Video Broadcasting (DVB) subtitles . . . . . . . 44 6.9. title: Subtitles . . . . . . . . . . . . . . . . . . . . 32
7.8.1. Storage of DVB subtitles . . . . . . . . . . . . . . 45 7. Subtitles . . . . . . . . . . . . . . . . . . . . . . . . . . 32
8. Block Additional Mapping . . . . . . . . . . . . . . . . . . 45 7.1. Images Subtitles . . . . . . . . . . . . . . . . . . . . 33
8.1. Summary of Assigned BlockAddIDType Values . . . . . . . . 47 7.2. SRT Subtitles . . . . . . . . . . . . . . . . . . . . . . 36
8.2. SMPTE ST 12-1 Timecode . . . . . . . . . . . . . . . . . 47 7.3. SSA/ASS Subtitles . . . . . . . . . . . . . . . . . . . . 36
8.2.1. Timecode Description . . . . . . . . . . . . . . . . 47 7.4. WebVTT . . . . . . . . . . . . . . . . . . . . . . . . . 41
8.2.2. BlockAddIDType . . . . . . . . . . . . . . . . . . . 48 7.4.1. Storage of WebVTT in Matroska . . . . . . . . . . . . 41
8.2.3. BlockAddIDName . . . . . . . . . . . . . . . . . . . 48 7.4.2. Examples of transformation . . . . . . . . . . . . . 42
8.2.4. BlockAddIDExtraData . . . . . . . . . . . . . . . . . 49 7.4.3. Storage of WebVTT in Matroska vs. WebM . . . . . . . 45
9. Normative References . . . . . . . . . . . . . . . . . . . . 49 7.5. HDMV presentation graphics subtitles . . . . . . . . . . 46
10. Informative References . . . . . . . . . . . . . . . . . . . 49 7.5.1. Storage of HDMV presentation graphics subtitles . . . 46
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 50 7.6. HDMV text subtitles . . . . . . . . . . . . . . . . . . . 46
7.6.1. Storage of HDMV text subtitles . . . . . . . . . . . 46
7.7. Digital Video Broadcasting (DVB) subtitles . . . . . . . 47
7.7.1. Storage of DVB subtitles . . . . . . . . . . . . . . 48
7.8. in that Block SHOULD be displayed. . . . . . . . . . . . 48
7.9. title: Block Additional Mapping . . . . . . . . . . . . . 48
8. Block Additional Mapping . . . . . . . . . . . . . . . . . . 48
8.1. Summary of Assigned BlockAddIDType Values . . . . . . . . 50
8.2. SMPTE ST 12-1 Timecode . . . . . . . . . . . . . . . . . 50
8.2.1. Timecode Description . . . . . . . . . . . . . . . . 50
8.2.2. BlockAddIDType . . . . . . . . . . . . . . . . . . . 51
8.2.3. BlockAddIDName . . . . . . . . . . . . . . . . . . . 51
8.2.4. BlockAddIDExtraData . . . . . . . . . . . . . . . . . 52
9. Normative References . . . . . . . . . . . . . . . . . . . . 52
10. Informative References . . . . . . . . . . . . . . . . . . . 53
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 53
1. Introduction 1. Introduction
Matroska aims to become THE standard of multimedia container formats. Matroska aims to become THE standard of multimedia container formats.
It stores interleaved and timestamped audio/video/subtitle data using It stores interleaved and timestamped audio/video/subtitle data using
various codecs. To interpret the codec data, a mapping between the various codecs. To interpret the codec data, a mapping between the
way the data is stored in Matroska and how it is understood by such a way the data is stored in Matroska and how it is understood by such a
codec is necessary. codec is necessary.
This document intends to define this mapping for many commonly used This document intends to define this mapping for many commonly used
skipping to change at page 5, line 5 skipping to change at page 5, line 22
3. Security Considerations 3. Security Considerations
This document inherits security considerations from the EBML and This document inherits security considerations from the EBML and
Matroska documents. Matroska documents.
4. IANA Considerations 4. IANA Considerations
To be determined. To be determined.
5. Notations and Conventions 5. Notation and Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
6. Codec Mappings 6. Codec Mappings
A "Codec Mapping" is a set of attributes to identify, name, and A "Codec Mapping" is a set of attributes to identify, name, and
skipping to change at page 6, line 5 skipping to change at page 6, line 18
6.1.1. Codec ID 6.1.1. Codec ID
Each codec supported for storage in Matroska MUST have a unique Each codec supported for storage in Matroska MUST have a unique
"Codec ID". Each "Codec ID" MUST be prefixed with the string from "Codec ID". Each "Codec ID" MUST be prefixed with the string from
the following table according to the associated type of the codec. the following table according to the associated type of the codec.
All characters of a "Codec ID Prefix" MUST be capital letters (A-Z) All characters of a "Codec ID Prefix" MUST be capital letters (A-Z)
except for the last character of a "Codec ID Prefix" which MUST be an except for the last character of a "Codec ID Prefix" which MUST be an
underscore ("_"). underscore ("_").
+------------+-----------------+ +============+=================+
| Codec Type | Codec ID Prefix | | Codec Type | Codec ID Prefix |
+============+=================+ +============+=================+
| Video | "V_" | | Video | "V_" |
+------------+-----------------+ +------------+-----------------+
| Audio | "A_" | | Audio | "A_" |
+------------+-----------------+ +------------+-----------------+
| Subtitle | "S_" | | Subtitle | "S_" |
+------------+-----------------+ +------------+-----------------+
| Button | "B_" | | Button | "B_" |
+------------+-----------------+ +------------+-----------------+
skipping to change at page 6, line 32 skipping to change at page 7, line 5
Codec ID". If a "Codec ID Suffix" is used, then the "Codec ID" MUST Codec ID". If a "Codec ID Suffix" is used, then the "Codec ID" MUST
include a forward slash ("/") as a separator between the "Major Codec include a forward slash ("/") as a separator between the "Major Codec
ID" and the "Codec ID Suffix". The "Major Codec ID" MUST be composed ID" and the "Codec ID Suffix". The "Major Codec ID" MUST be composed
of only capital letters (A-Z) and numbers (0-9). The "Codec ID of only capital letters (A-Z) and numbers (0-9). The "Codec ID
Suffix" MUST be composed of only capital letters (A-Z), numbers Suffix" MUST be composed of only capital letters (A-Z), numbers
(0-9), underscore ("_"), and forward slash ("/"). (0-9), underscore ("_"), and forward slash ("/").
The following table provides examples of valid "Codec IDs" and their The following table provides examples of valid "Codec IDs" and their
components: components:
+----------+----------+-----------+-----------+-----------------+ +==========+==========+===========+===========+=================+
| Codec ID | Major | Separator | Codec ID | Codec ID | | Codec ID | Major | Separator | Codec ID | Codec ID |
| Prefix | Codec ID | | Suffix | | | Prefix | Codec ID | | Suffix | |
+==========+==========+===========+===========+=================+ +==========+==========+===========+===========+=================+
| A_ | AAC | / | MPEG2/LC/ | A_AAC/MPEG2/LC/ | | A_ | AAC | / | MPEG2/LC/ | A_AAC/MPEG2/LC/ |
| | | | SBR | SBR | | | | | SBR | SBR |
+----------+----------+-----------+-----------+-----------------+ +----------+----------+-----------+-----------+-----------------+
| V_ | MPEG4 | / | ISO/ASP | V_MPEG4/ISO/ASP | | V_ | MPEG4 | / | ISO/ASP | V_MPEG4/ISO/ASP |
+----------+----------+-----------+-----------+-----------------+ +----------+----------+-----------+-----------+-----------------+
| V_ | MPEG1 | | | V_MPEG1 | | V_ | MPEG1 | | | V_MPEG1 |
+----------+----------+-----------+-----------+-----------------+ +----------+----------+-----------+-----------+-----------------+
skipping to change at page 7, line 16 skipping to change at page 7, line 35
An optional description for the encoding. This value is only An optional description for the encoding. This value is only
intended for human consumption. intended for human consumption.
6.1.4. Initialization 6.1.4. Initialization
Each encoding supported for storage in Matroska MUST have a defined Each encoding supported for storage in Matroska MUST have a defined
Initialization. The Initialization MUST describe the storage of data Initialization. The Initialization MUST describe the storage of data
necessary to initialize the decoder, which MUST be stored within the necessary to initialize the decoder, which MUST be stored within the
"CodecPrivate Element". When the Initialization is updated within a "CodecPrivate Element". When the Initialization is updated within a
track then that updated Initialization data MUST be written into the track, then that updated Initialization data MUST be written into the
"CodecState Element" of the first "Cluster" to require it. If the "CodecState Element" of the first "Cluster" to require it. If the
encoding does not require any form of Initialization then "none" MUST encoding does not require any form of Initialization, then "none"
be used to define the Initialization and the "CodecPrivate Element" MUST be used to define the Initialization and the "CodecPrivate
SHOULD NOT be written and MUST be ignored. Data that is defined Element" SHOULD NOT be written and MUST be ignored. Data that is
Initialization to be stored in the "CodecPrivate Element" is known as defined Initialization to be stored in the "CodecPrivate Element" is
"Private Data". known as "Private Data".
6.1.5. Codec BlockAdditions 6.1.5. Codec BlockAdditions
Additional data that contextualizes or supplements a "Block" can be Additional data that contextualizes or supplements a "Block" can be
stored within the "BlockAdditional Element" of a "BlockMore Element". stored within the "BlockAdditional Element" of a "BlockMore Element".
This "BlockAdditional" data MAY be passed to the associated decoder This "BlockAdditional" data MAY be passed to the associated decoder
along with the content of the "Block Element". Each along with the content of the "Block Element". Each
"BlockAdditional" is coupled with a "BlockAddID" that identifies the "BlockAdditional" is coupled with a "BlockAddID" that identifies the
kind of data it contains. The following table defines the meanings kind of data it contains. The following table defines the meanings
of "BlockAddID" values. of "BlockAddID" values.
+------------+-------------------------------------------------+ +============+=================================================+
| BlockAddID | Definition | | BlockAddID | Definition |
| Value | | | Value | |
+============+=================================================+ +============+=================================================+
| 0 | Invalid. | | 0 | Invalid. |
+------------+-------------------------------------------------+ +------------+-------------------------------------------------+
| 1 | Indicates that the context of the | | 1 | Indicates that the context of the |
| | "BlockAdditional" data is defined by the | | | "BlockAdditional" data is defined by the |
| | corresponding "Codec Mapping". | | | corresponding "Codec Mapping". |
+------------+-------------------------------------------------+ +------------+-------------------------------------------------+
| 2 or | "BlockAddID" values of 2 and greater are mapped | | 2 or | "BlockAddID" values of 2 and greater are mapped |
| greater | to the "BlockAddIDValue" of the | | greater | to the "BlockAddIDValue" of the |
| | "BlockAdditionMapping" of the associated Track. | | | "BlockAdditionMapping" of the associated Track. |
+------------+-------------------------------------------------+ +------------+-------------------------------------------------+
Table 3 Table 3
The values of "BlockAddID" that are 2 of greater have no semantic The values of "BlockAddID" that are 2 of greater have no semantic
meaning, but simply associate the "BlockMore Element" with a meaning, but simply associate the "BlockMore Element" with a
"BlockAdditionMapping" of the associated Track. See the section on "BlockAdditionMapping" of the associated Track. See Section 8 on
Block Additional Mappings (#block-additional-mapping) for more Block Additional Mappings for more information.
information.
The following XML depicts the nested Elements of a "BlockGroup The following XML depicts the nested Elements of a "BlockGroup
Element" with an example of BlockAdditions: Element" with an example of BlockAdditions:
<BlockGroup> <BlockGroup>
<Block>{Binary data of a VP9 video frame in YUV}</Block> <Block>{Binary data of a VP9 video frame in YUV}</Block>
<BlockAdditions> <BlockAdditions>
<BlockMore> <BlockMore>
<BlockAddID>1</BlockAddID> <BlockAddID>1</BlockAddID>
<BlockAdditional> <BlockAdditional>
skipping to change at page 9, line 28 skipping to change at page 9, line 48
6.3.1. V_MS/VFW/FOURCC 6.3.1. V_MS/VFW/FOURCC
Codec ID: "V_MS/VFW/FOURCC" Codec ID: "V_MS/VFW/FOURCC"
Codec Name: Microsoft (TM) Video Codec Manager (VCM) Codec Name: Microsoft (TM) Video Codec Manager (VCM)
Description: The private data contains the VCM structure Description: The private data contains the VCM structure
BITMAPINFOHEADER including the extra private bytes, as defined by BITMAPINFOHEADER including the extra private bytes, as defined by
Microsoft (https://msdn.microsoft.com/en-us/library/windows/desktop/ Microsoft (https://msdn.microsoft.com/en-us/library/windows/desktop/
dd318229(v=vs.85).aspx). The data are stored in little endian format dd318229(v=vs.85).aspx). The data are stored in little-endian format
(like on IA32 machines). Where is the Huffman table stored in (like on IA32 machines). Where is the Huffman table stored in
HuffYUV, not AVISTREAMINFO ??? And the FourCC, not in HuffYUV, not AVISTREAMINFO ??? And the FourCC, not in
AVISTREAMINFO.fccHandler ??? AVISTREAMINFO.fccHandler ???
Initialization: "Private Data" contains the VCM structure Initialization: "Private Data" contains the VCM structure
BITMAPINFOHEADER including the extra private bytes, as defined by BITMAPINFOHEADER including the extra private bytes, as defined by
Microsoft in https://msdn.microsoft.com/en- Microsoft in https://msdn.microsoft.com/en-
us/library/windows/desktop/dd183376(v=vs.85).aspx us/library/windows/desktop/dd183376(v=vs.85).aspx
(https://msdn.microsoft.com/en-us/library/windows/desktop/ (https://msdn.microsoft.com/en-us/library/windows/desktop/
dd183376(v=vs.85).aspx). dd183376(v=vs.85).aspx).
Citation: https://msdn.microsoft.com/en-us/library/windows/desktop/ Citation: https://msdn.microsoft.com/en-us/library/windows/desktop/
dd183376(v=vs.85).aspx (https://msdn.microsoft.com/en- dd183376(v=vs.85).aspx (https://msdn.microsoft.com/en-
us/library/windows/desktop/dd183376(v=vs.85).aspx) us/library/windows/desktop/dd183376(v=vs.85).aspx)
skipping to change at page 11, line 31 skipping to change at page 12, line 4
defined. Its RECOMMENDED to use MPEG2MKV.exe for creating those defined. Its RECOMMENDED to use MPEG2MKV.exe for creating those
files, and to compare the results with self-made implementations files, and to compare the results with self-made implementations
Initialization: none Initialization: none
6.3.8. V_MPEG2 6.3.8. V_MPEG2
Codec ID: V_MPEG2 Codec ID: V_MPEG2
Codec Name: MPEG 2 Codec Name: MPEG 2
Description: The Matroska video stream will contain a demuxed Description: The Matroska video stream will contain a demuxed
Elementary Stream (ES), where block boundaries are still to be Elementary Stream (ES), where block boundaries are still to be
defined. Its RECOMMENDED to use MPEG2MKV.exe for creating those defined. Its RECOMMENDED to use MPEG2MKV.exe for creating those
files, and to compare the results with self-made implementations files, and to compare the results with self-made implementations
Initialization: none Initialization: none
6.3.9. V_REAL/RV10 6.3.9. V_MPEG4/ISO/AVC
Codec ID: V_MPEG4/ISO/AVC
Codec Name: AVC/H.264
Description: Individual pictures (which could be a frame, a field, or
2 fields having the same timestamp) of AVC/H.264 stored as described
in [ISO.14496-15].
Initialization: The "Private Data" contains a
"AVCDecoderConfigurationRecord" structure, as defined in
[ISO.14496-15]. For legacy reasons, because Block Addition Mappings
are preferred, see Section 6.7, the "AVCDecoderConfigurationRecord"
structure MAY be followed by an extension block beginning with a
4-byte extension block size field in big-endian byte order which is
the size of the extension block minus 4 (excluding the size of the
extension block size field) and a 4-byte field corresponding to a
"BlockAddIDType" of "mvcC" followed by a content corresponding to the
content of "BlockAddIDExtraData" for "mvcC"; see Section 6.7.8.
6.3.10. V_MPEGH/ISO/HEVC
Codec ID: V_MPEGH/ISO/HEVC
Codec Name: HEVC/H.265
Description: Individual pictures (which could be a frame, a field, or
2 fields having the same timestamp) of HEVC/H.265 stored as described
in [ISO.14496-15].
Initialization: The "Private Data" contains a
"HEVCDecoderConfigurationRecord" structure, as defined in
[ISO.14496-15].
6.3.11. V_AVS2
Codec ID: V_AVS2
Codec Name: AVS2-P2/IEEE.1857.4
Description: Individual pictures of AVS2-P2 stored as described in
the second part of [IEEE.1857-4].
Initialization: none.
6.3.12. V_REAL/RV10
Codec ID: V_REAL/RV10 Codec ID: V_REAL/RV10
Codec Name: RealVideo 1.0 aka RealVideo 5 Codec Name: RealVideo 1.0 aka RealVideo 5
Description: Individual slices from the Real container are combined Description: Individual slices from the Real container are combined
into a single frame. into a single frame.
Initialization: The "Private Data" contains a "real_video_props_t" Initialization: The "Private Data" contains a "real_video_props_t"
structure in Big Endian byte order as found in librmff structure in big-endian byte order as found in librmff
(https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ (https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/
librmff.h). librmff.h).
6.3.10. V_REAL/RV20 6.3.13. V_REAL/RV20
Codec ID: V_REAL/RV20 Codec ID: V_REAL/RV20
Codec Name: RealVideo G2 and RealVideo G2+SVT Codec Name: RealVideo G2 and RealVideo G2+SVT
Description: Individual slices from the Real container are combined Description: Individual slices from the Real container are combined
into a single frame. into a single frame.
Initialization: The "Private Data" contains a "real_video_props_t" Initialization: The "Private Data" contains a "real_video_props_t"
structure in Big Endian byte order as found in librmff structure in big-endian byte order as found in librmff
(https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ (https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/
librmff.h). librmff.h).
6.3.11. V_REAL/RV30 6.3.14. V_REAL/RV30
Codec ID: V_REAL/RV30 Codec ID: V_REAL/RV30
Codec Name: RealVideo 8 Codec Name: RealVideo 8
Description: Individual slices from the Real container are combined Description: Individual slices from the Real container are combined
into a single frame. into a single frame.
Initialization: The "Private Data" contains a "real_video_props_t" Initialization: The "Private Data" contains a "real_video_props_t"
structure in Big Endian byte order as found in librmff structure in big-endian byte order as found in librmff
(https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ (https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/
librmff.h). librmff.h).
6.3.12. V_REAL/RV40 6.3.15. V_REAL/RV40
Codec ID: V_REAL/RV40 Codec ID: V_REAL/RV40
Codec Name: rv40 : RealVideo 9 Codec Name: rv40 : RealVideo 9
Description: Individual slices from the Real container are combined Description: Individual slices from the Real container are combined
into a single frame. into a single frame.
Initialization: The "Private Data" contains a "real_video_props_t" Initialization: The "Private Data" contains a "real_video_props_t"
structure in Big Endian byte order as found in librmff structure in big-endian byte order as found in librmff
(https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ (https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/
librmff.h). librmff.h).
6.3.13. V_QUICKTIME 6.3.16. V_QUICKTIME
Codec ID: V_QUICKTIME Codec ID: V_QUICKTIME
Codec Name: Video taken from QuickTime(TM) files Codec Name: Video taken from QuickTime(TM) files
Description: Several codecs as stored in QuickTime, e.g. Sorenson or
Description: Several codecs as stored in QuickTime, e.g., Sorenson or
Cinepak. Cinepak.
Initialization: The "Private Data" contains all additional data that Initialization: The "Private Data" contains all additional data that
is stored in the 'stsd' (sample description) atom in the QuickTime is stored in the 'stsd' (sample description) atom in the QuickTime
file *after* the mandatory video descriptor structure (starting with file *after* the mandatory video descriptor structure (starting with
the size and FourCC fields). For an explanation of the QuickTime the size and FourCC fields). For an explanation of the QuickTime
file format read QuickTime File Format Specification file format read QuickTime File Format Specification
(https://developer.apple.com/library/mac/documentation/QuickTime/ (https://developer.apple.com/library/mac/documentation/QuickTime/
QTFF/QTFFPreface/qtffPreface.html). QTFF/QTFFPreface/qtffPreface.html).
6.3.14. V_THEORA 6.3.17. V_THEORA
Codec ID: V_THEORA Codec ID: V_THEORA
Codec Name: Theora Codec Name: Theora
Initialization: The "Private Data" contains the first three Theora Initialization: The "Private Data" contains the first three Theora
packets in order. The lengths of the packets precedes them. The packets in order. The lengths of the packets precedes them. The
actual layout is: actual layout is:
* Byte 1: number of distinct packets '"#p"' minus one inside the * Byte 1: number of distinct packets "#p" minus one inside the
CodecPrivate block. This MUST be '2' for current (as of CodecPrivate block. This MUST be "2" for current (as of
2016-07-08) Theora headers. 2016-07-08) Theora headers.
* Bytes 2..n: lengths of the first '"#p"' packets, coded in Xiph- * Bytes 2..n: lengths of the first "#p" packets, coded in Xiph-style
style lacing. The length of the last packet is the length of the lacing. The length of the last packet is the length of the
CodecPrivate block minus the lengths coded in these bytes minus CodecPrivate block minus the lengths coded in these bytes minus
one. one.
* Bytes n+1..: The Theora identification header, followed by the * Bytes n+1..: The Theora identification header, followed by the
commend header followed by the codec setup header. Those are commend header followed by the codec setup header. Those are
described in the Theora specs (http://www.theora.org/doc/ described in the Theora specs (http://www.theora.org/doc/
Theora.pdf). Theora.pdf).
6.3.15. V_PRORES 6.3.18. V_PRORES
Codec ID: V_PRORES Codec ID: V_PRORES
Codec Name: Apple ProRes Codec Name: Apple ProRes
Initialization: The "Private Data" contains the FourCC as found in Initialization: The "Private Data" contains the FourCC as found in
MP4 movies: MP4 movies:
* ap4x: ProRes 4444 XQ * ap4x: ProRes 4444 XQ
skipping to change at page 14, line 19 skipping to change at page 15, line 43
* apco: ProRes 422 Proxy * apco: ProRes 422 Proxy
* aprh: ProRes RAW High Quality * aprh: ProRes RAW High Quality
* aprn: ProRes RAW Standard Definition * aprn: ProRes RAW Standard Definition
this page for more technical details on ProRes this page for more technical details on ProRes
(http://wiki.multimedia.cx/index.php?title=Apple_ProRes#Frame_layout) (http://wiki.multimedia.cx/index.php?title=Apple_ProRes#Frame_layout)
6.3.16. V_VP8 6.3.19. V_VP8
Codec ID: V_VP8 Codec ID: V_VP8
Codec Name: VP8 Codec format Codec Name: VP8 Codec format
Description: VP8 is an open and royalty free video compression format Description: VP8 is an open and royalty free video compression format
developed by Google and created by On2 Technologies as a successor to developed by Google and created by On2 Technologies as a successor to
VP7. [RFC6386] VP7. [RFC6386]
Codec BlockAdditions: A single-channel encoding of an alpha channel Codec BlockAdditions: A single-channel encoding of an alpha channel
MAY be stored in "BlockAdditions". The "BlockAddId" of the MAY be stored in "BlockAdditions". The "BlockAddId" of the
"BlockMore" containing these data MUST be 1. "BlockMore" containing these data MUST be 1.
Initialization: none Initialization: none
6.3.17. V_VP9 6.3.20. V_VP9
Codec ID: V_VP9 Codec ID: V_VP9
Codec Name: VP9 Codec format Codec Name: VP9 Codec format
Description: VP9 is an open and royalty free video compression format Description: VP9 is an open and royalty free video compression format
developed by Google as a successor to VP8. Draft VP9 Bitstream and developed by Google as a successor to VP8. Draft VP9 Bitstream and
Decoding Process Specification (https://www.webmproject.org/vp9/) Decoding Process Specification (https://www.webmproject.org/vp9/)
Codec BlockAdditions: A single-channel encoding of an alpha channel Codec BlockAdditions: A single-channel encoding of an alpha channel
MAY be stored in "BlockAdditions". The "BlockAddId" of the MAY be stored in "BlockAdditions". The "BlockAddId" of the
"BlockMore" containing these data MUST be 1. "BlockMore" containing these data MUST be 1.
Initialization: none Initialization: none
6.3.18. V_FFV1 6.3.21. V_FFV1
Codec ID: V_FFV1 Codec ID: V_FFV1
Codec Name: FF Video Codec 1 Codec Name: FF Video Codec 1
Description: FFV1 is a lossless intra-frame video encoding format Description: FFV1 is a lossless intra-frame video encoding format
designed to efficiently compress video data in a variety of pixel designed to efficiently compress video data in a variety of pixel
formats. Compared to uncompressed video, FFV1 offers storage formats. Compared to uncompressed video, FFV1 offers storage
compression, frame fixity, and self-description, which makes FFV1 compression, frame fixity, and self-description, which makes FFV1
useful as a preservation or intermediate video format. Draft FFV1 useful as a preservation or intermediate video format. Draft FFV1
skipping to change at page 16, line 25 skipping to change at page 17, line 51
Initialization: none Initialization: none
6.4.4. A_PCM/INT/BIG 6.4.4. A_PCM/INT/BIG
Codec ID: A_PCM/INT/BIG Codec ID: A_PCM/INT/BIG
Codec Name: PCM Integer Big Endian Codec Name: PCM Integer Big Endian
Description: The audio bit depth MUST be read and set from the Description: The audio bit depth MUST be read and set from the
"BitDepth Element". Audio samples MUST be considered as signed "BitDepth Element". Audio samples MUST be considered as signed
values, except if the audio bit depth is "8" which MUST be values, except if the audio bit depth is 8 which MUST be interpreted
interpreted as unsigned values. Corresponding ACM wFormatTag : ??? as unsigned values. Corresponding ACM wFormatTag : ???
Initialization: none Initialization: none
6.4.5. A_PCM/INT/LIT 6.4.5. A_PCM/INT/LIT
Codec ID: A_PCM/INT/LIT Codec ID: A_PCM/INT/LIT
Codec Name: PCM Integer Little Endian Codec Name: PCM Integer Little Endian
Description: The audio bit depth MUST be read and set from the Description: The audio bit depth MUST be read and set from the
"BitDepth Element". Audio samples MUST be considered as signed "BitDepth Element". Audio samples MUST be considered as signed
values, except if the audio bit depth is "8" which MUST be values, except if the audio bit depth is 8 which MUST be interpreted
interpreted as unsigned values. Corresponding ACM wFormatTag : as unsigned values. Corresponding ACM wFormatTag : 0x0001
0x0001
Initialization: none Initialization: none
6.4.6. A_PCM/FLOAT/IEEE 6.4.6. A_PCM/FLOAT/IEEE
Codec ID: A_PCM/FLOAT/IEEE Codec ID: A_PCM/FLOAT/IEEE
Codec Name: Floating Point, IEEE compatible Codec Name: Floating Point, IEEE compatible
Description: The audio bit depth MUST be read and set from the Description: The audio bit depth MUST be read and set from the
"BitDepth Element" (32 bit in most cases). The floats are stored as "BitDepth Element" (32 bit in most cases). The floats are stored as
defined in [IEEE.754.1985] and in little endian order. Corresponding defined in [IEEE.754] and in little-endian order. Corresponding ACM
ACM wFormatTag : 0x0003 wFormatTag : 0x0003
Initialization: none Initialization: none
6.4.7. A_MPC 6.4.7. A_MPC
Codec ID: A_MPC Codec ID: A_MPC
Codec Name: MPC (musepack) SV8 Codec Name: MPC (musepack) SV8
Description: The main developer for musepack has requested that we Description: The main developer for musepack has requested that we
skipping to change at page 19, line 24 skipping to change at page 20, line 42
Initialization: none Initialization: none
6.4.15. A_VORBIS 6.4.15. A_VORBIS
Codec ID: A_VORBIS Codec ID: A_VORBIS
Codec Name: Vorbis Codec Name: Vorbis
Initialization: The "Private Data" contains the first three Vorbis Initialization: The "Private Data" contains the first three Vorbis
packet in order. The lengths of the packets precedes them. The packet in order. The lengths of the packets precedes them. The
actual layout is: - Byte 1: number of distinct packets '"#p"' minus actual layout is: - Byte 1: number of distinct packets "#p" minus one
one inside the CodecPrivate block. This MUST be '2' for current (as inside the CodecPrivate block. This MUST be "2" for current (as of
of 2016-07-08) Vorbis headers. - Bytes 2..n: lengths of the first 2016-07-08) Vorbis headers. - Bytes 2..n: lengths of the first "#p"
'"#p"' packets, coded in Xiph-style lacing. The length of the last packets, coded in Xiph-style lacing. The length of the last packet
packet is the length of the CodecPrivate block minus the lengths is the length of the CodecPrivate block minus the lengths coded in
coded in these bytes minus one. - Bytes n+1..: The Vorbis these bytes minus one. - Bytes n+1..: The Vorbis identification
identification header (https://xiph.org/vorbis/doc/ header (https://xiph.org/vorbis/doc/Vorbis_I_spec.html), followed by
Vorbis_I_spec.html), followed by the Vorbis comment header the Vorbis comment header (https://xiph.org/vorbis/doc/
(https://xiph.org/vorbis/doc/v-comment.html) followed by the codec v-comment.html) followed by the codec setup header
setup header (https://xiph.org/vorbis/doc/Vorbis_I_spec.html). (https://xiph.org/vorbis/doc/Vorbis_I_spec.html).
6.4.16. A_FLAC 6.4.16. A_FLAC
Codec ID: A_FLAC Codec ID: A_FLAC
Codec Name: FLAC (Free Lossless Audio Codec) Codec Name: FLAC (Free Lossless Audio Codec)
(http://flac.sourceforge.net/) (http://flac.sourceforge.net/)
Initialization: The "Private Data" contains all the header/metadata Initialization: The "Private Data" contains all the header/metadata
packets before the first data packet. These include the first header packets before the first data packet. These include the first header
skipping to change at page 20, line 4 skipping to change at page 21, line 22
Initialization: The "Private Data" contains all the header/metadata Initialization: The "Private Data" contains all the header/metadata
packets before the first data packet. These include the first header packets before the first data packet. These include the first header
packet containing only the word "fLaC" as well as all metadata packet containing only the word "fLaC" as well as all metadata
packets. packets.
6.4.17. A_REAL/14_4 6.4.17. A_REAL/14_4
Codec ID: A_REAL/14_4 Codec ID: A_REAL/14_4
Codec Name: Real Audio 1 Codec Name: Real Audio 1
Initialization: The "Private Data" contains either the Initialization: The "Private Data" contains either the
"real_audio_v4_props_t" or the "real_audio_v5_props_t" structure "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure
(differentiated by their "version" field; Big Endian byte order) as (differentiated by their "version" field; big-endian byte order) as
found in librmff found in librmff
(https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ (https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/
librmff.h). librmff.h).
6.4.18. A_REAL/28_8 6.4.18. A_REAL/28_8
Codec ID: A_REAL/28_8 Codec ID: A_REAL/28_8
Codec Name: Real Audio 2 Codec Name: Real Audio 2
Initialization: The "Private Data" contains either the Initialization: The "Private Data" contains either the
"real_audio_v4_props_t" or the "real_audio_v5_props_t" structure "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure
(differentiated by their "version" field; Big Endian byte order) as (differentiated by their "version" field; big-endian byte order) as
found in librmff found in librmff
(https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ (https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/
librmff.h). librmff.h).
6.4.19. A_REAL/COOK 6.4.19. A_REAL/COOK
Codec ID: A_REAL/COOK Codec ID: A_REAL/COOK
Codec Name: Real Audio Cook Codec (codename: Gecko) Codec Name: Real Audio Cook Codec (codename: Gecko)
Initialization: The "Private Data" contains either the Initialization: The "Private Data" contains either the
"real_audio_v4_props_t" or the "real_audio_v5_props_t" structure "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure
(differentiated by their "version" field; Big Endian byte order) as (differentiated by their "version" field; big-endian byte order) as
found in librmff found in librmff
(https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ (https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/
librmff.h). librmff.h).
6.4.20. A_REAL/SIPR 6.4.20. A_REAL/SIPR
Codec ID: A_REAL/SIPR Codec ID: A_REAL/SIPR
Codec Name: Sipro Voice Codec Codec Name: Sipro Voice Codec
Initialization: The "Private Data" contains either the Initialization: The "Private Data" contains either the
"real_audio_v4_props_t" or the "real_audio_v5_props_t" structure "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure
(differentiated by their "version" field; Big Endian byte order) as (differentiated by their "version" field; big-endian byte order) as
found in librmff found in librmff
(https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ (https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/
librmff.h). librmff.h).
6.4.21. A_REAL/RALF 6.4.21. A_REAL/RALF
Codec ID: A_REAL/RALF Codec ID: A_REAL/RALF
Codec Name: Real Audio Lossless Format Codec Name: Real Audio Lossless Format
Initialization: The "Private Data" contains either the Initialization: The "Private Data" contains either the
"real_audio_v4_props_t" or the "real_audio_v5_props_t" structure "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure
(differentiated by their "version" field; Big Endian byte order) as (differentiated by their "version" field; big-endian byte order) as
found in librmff found in librmff
(https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ (https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/
librmff.h). librmff.h).
6.4.22. A_REAL/ATRC 6.4.22. A_REAL/ATRC
Codec ID: A_REAL/ATRC Codec ID: A_REAL/ATRC
Codec Name: Sony Atrac3 Codec Codec Name: Sony Atrac3 Codec
Initialization: The "Private Data" contains either the Initialization: The "Private Data" contains either the
"real_audio_v4_props_t" or the "real_audio_v5_props_t" structure "real_audio_v4_props_t" or the "real_audio_v5_props_t" structure
(differentiated by their "version" field; Big Endian byte order) as (differentiated by their "version" field; big-endian byte order) as
found in librmff found in librmff
(https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/ (https://github.com/mbunkus/mkvtoolnix/blob/master/lib/librmff/
librmff.h). librmff.h).
6.4.23. A_MS/ACM 6.4.23. A_MS/ACM
Codec ID: A_MS/ACM Codec ID: A_MS/ACM
Codec Name: Microsoft(TM) Audio Codec Manager (ACM) Codec Name: Microsoft(TM) Audio Codec Manager (ACM)
Description: The data are stored in little endian format (like on Description: The data are stored in little-endian format (like on
IA32 machines). IA32 machines).
Initialization: The "Private Data" contains the ACM structure Initialization: The "Private Data" contains the ACM structure
WAVEFORMATEX including the extra private bytes, as defined by WAVEFORMATEX including the extra private bytes, as defined by
Microsoft Microsoft
(http://msdn.microsoft.com/library/default.asp?url=/library/en- (http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/multimed/mmstr_625u.asp). us/multimed/mmstr_625u.asp).
6.4.24. A_AAC/MPEG2/MAIN 6.4.24. A_AAC/MPEG2/MAIN
skipping to change at page 24, line 30 skipping to change at page 25, line 50
AAC audio always uses wFormatTag 0xFF. AAC audio always uses wFormatTag 0xFF.
Initialization: none Initialization: none
6.4.33. A_QUICKTIME 6.4.33. A_QUICKTIME
Codec ID: A_QUICKTIME Codec ID: A_QUICKTIME
Codec Name: Audio taken from QuickTime(TM) files Codec Name: Audio taken from QuickTime(TM) files
Description: Several codecs as stored in QuickTime, e.g. QDesign Description: Several codecs as stored in QuickTime, e.g., QDesign
Music v1 or v2. Music v1 or v2.
Initialization: The "Private Data" contains all additional data that Initialization: The "Private Data" contains all additional data that
is stored in the 'stsd' (sample description) atom in the QuickTime is stored in the 'stsd' (sample description) atom in the QuickTime
file *after* the mandatory sound descriptor structure (starting with file *after* the mandatory sound descriptor structure (starting with
the size and FourCC fields). For an explanation of the QuickTime the size and FourCC fields). For an explanation of the QuickTime
file format read QuickTime File Format Specification file format read QuickTime File Format Specification
(https://developer.apple.com/library/mac/documentation/QuickTime/ (https://developer.apple.com/library/mac/documentation/QuickTime/
QTFF/QTFFPreface/qtffPreface.html). QTFF/QTFFPreface/qtffPreface.html).
skipping to change at page 26, line 24 skipping to change at page 27, line 41
Initialization: none Initialization: none
6.5. Subtitle Codec Mappings 6.5. Subtitle Codec Mappings
6.5.1. S_TEXT/UTF8 6.5.1. S_TEXT/UTF8
Codec ID: S_TEXT/UTF8 Codec ID: S_TEXT/UTF8
Codec Name: UTF-8 Plain Text Codec Name: UTF-8 Plain Text
Description: Basic text subtitles. For more information, please look Description: Basic text subtitles. For more information, see
at the Subtitles section (#subtitles). Section 7 on Subtitles.
6.5.2. S_TEXT/SSA 6.5.2. S_TEXT/SSA
Codec ID: S_TEXT/SSA Codec ID: S_TEXT/SSA
Codec Name: Subtitles Format Codec Name: Subtitles Format
Description: The [Script Info] and [V4 Styles] sections are stored in Description: The [Script Info] and [V4 Styles] sections are stored in
the codecprivate. Each event is stored in its own Block. For more the codecprivate. Each event is stored in its own Block. For more
information, see the SSA/ASS section in Subtitles (#subtitles). information, see Section 7.3 on SSA/ASS.
6.5.3. S_TEXT/ASS 6.5.3. S_TEXT/ASS
Codec ID: S_TEXT/ASS Codec ID: S_TEXT/ASS
Codec Name: Advanced Subtitles Format Codec Name: Advanced Subtitles Format
Description: The [Script Info] and [V4 Styles] sections are stored in Description: The [Script Info] and [V4 Styles] sections are stored in
the codecprivate. Each event is stored in its own Block. For more the codecprivate. Each event is stored in its own Block. For more
information, see the SSA/ASS section in Subtitles (#subtitles). information, see Section 7.3 on SSA/ASS.
6.5.4. S_TEXT/USF
Codec ID: S_TEXT/USF
Codec Name: Universal Subtitle Format
Description: This is mostly defined, but not typed out yet. It will
first be available on the USF specification in Subtitles
(#subtitles).
6.5.5. S_TEXT/WEBVTT 6.5.4. S_TEXT/WEBVTT
Codec ID: S_TEXT/WEBVTT Codec ID: S_TEXT/WEBVTT
Codec Name: Web Video Text Tracks Format (WebVTT) Codec Name: Web Video Text Tracks Format (WebVTT)
Description: Advanced text subtitles. For more information, see the Description: Advanced text subtitles. For more information, see
WebVTT section in Subtitles (#subtitles). Section 7.4 on WebVTT.
6.5.6. S_IMAGE/BMP 6.5.5. S_IMAGE/BMP
Codec ID: S_IMAGE/BMP Codec ID: S_IMAGE/BMP
Codec Name: Bitmap Codec Name: Bitmap
Description: Basic image based subtitle format; The subtitles are Description: Basic image based subtitle format; The subtitles are
stored as images, like in the DVD. The timestamp in the block header stored as images, like in the DVD. The timestamp in the block header
of Matroska indicates the start display time, the duration is set of Matroska indicates the start display time, the duration is set
with the Duration element. The full data for the subtitle bitmap is with the Duration element. The full data for the subtitle bitmap is
stored in the Block's data section. stored in the Block's data section.
6.5.7. S_DVBSUB 6.5.6. S_DVBSUB
Codec ID: S_DVBSUB Codec ID: S_DVBSUB
Codec Name: Digital Video Broadcasting (DVB) subtitles Codec Name: Digital Video Broadcasting (DVB) subtitles
Description: This is the graphical subtitle format used in the Description: This is the graphical subtitle format used in the
Digital Video Broadcasting standard. For more information, see the Digital Video Broadcasting standard. For more information, see
Digital Video Broadcasting (DVB) section in Subtitles (#subtitles). Section 7.7 on Digital Video Broadcasting (DVB).
6.5.8. S_VOBSUB 6.5.7. S_VOBSUB
Codec ID: S_VOBSUB Codec ID: S_VOBSUB
Codec Name: VobSub subtitles Codec Name: VobSub subtitles
Description: The same subtitle format used on DVDs. Supported is Description: The same subtitle format used on DVDs. Supported is
only format version 7 and newer. VobSubs consist of two files, the only format version 7 and newer. VobSubs consist of two files, the
.idx containing information, and the .sub, containing the actual .idx containing information, and the .sub, containing the actual
data. The .idx file is stripped of all empty lines, of all comments data. The .idx file is stripped of all empty lines, of all comments
and of lines beginning with "alt:" or "langidx:". The line beginning and of lines beginning with "alt:" or "langidx:". The line beginning
with "id:" SHOULD be transformed into the appropriate Matroska track with "id:" SHOULD be transformed into the appropriate Matroska track
language element and is discarded. All remaining lines but the ones language element and is discarded. All remaining lines but the ones
containing timestamps and file positions are put into the containing timestamps and file positions are put into the
"CodecPrivate" element. "CodecPrivate" element.
skipping to change at page 28, line 20 skipping to change at page 29, line 27
language element and is discarded. All remaining lines but the ones language element and is discarded. All remaining lines but the ones
containing timestamps and file positions are put into the containing timestamps and file positions are put into the
"CodecPrivate" element. "CodecPrivate" element.
For each line containing the timestamp and file position data is read For each line containing the timestamp and file position data is read
from the appropriate position in the .sub file. This data consists from the appropriate position in the .sub file. This data consists
of a MPEG program stream which in turn contains SPU packets. The of a MPEG program stream which in turn contains SPU packets. The
MPEG program stream data is discarded, and each SPU packet is put MPEG program stream data is discarded, and each SPU packet is put
into one Matroska frame. into one Matroska frame.
6.5.9. S_HDMV/PGS 6.5.8. S_HDMV/PGS
Codec ID: S_HDMV/PGS Codec ID: S_HDMV/PGS
Codec Name: HDMV presentation graphics subtitles (PGS) Codec Name: HDMV presentation graphics subtitles (PGS)
Description: This is the graphical subtitle format used on Blu-rays. Description: This is the graphical subtitle format used on Blu-rays.
For more information, see HDMV text presentation in Subtitles For more information, see Section 7.6 on HDMV text presentation.
(#subtitles).
6.5.10. S_HDMV/TEXTST 6.5.9. S_HDMV/TEXTST
Codec ID: S_HDMV/TEXTST Codec ID: S_HDMV/TEXTST
Codec Name: HDMV text subtitles Codec Name: HDMV text subtitles
Description: This is the textual subtitle format used on Blu-rays. Description: This is the textual subtitle format used on Blu-rays.
For more information, see HDMV graphics presentation in Subtitles For more information, see Section 7.5 on HDMV graphics presentation.
(#subtitles).
6.5.11. S_KATE 6.5.10. S_KATE
Codec ID: S_KATE Codec ID: S_KATE
Codec Name: Karaoke And Text Encapsulation Codec Name: Karaoke And Text Encapsulation
Description: A subtitle format developed for ogg. The mapping for Description: A subtitle format developed for ogg. The mapping for
Matroska is described on the Xiph wiki Matroska is described on the Xiph wiki
(http://wiki.xiph.org/index.php/OggKate#Matroska_mapping). As for (http://wiki.xiph.org/index.php/OggKate#Matroska_mapping). As for
Theora and Vorbis, Kate headers are stored in the private data as Theora and Vorbis, Kate headers are stored in the private data as
xiph-laced packets. xiph-laced packets.
6.6. Button Codec Mappings 6.6. Button Codec Mappings
6.6.1. B_VOBBTN 6.6.1. B_VOBBTN
skipping to change at page 29, line 20 skipping to change at page 30, line 25
Codec Name: VobBtn Buttons Codec Name: VobBtn Buttons
Description: Based on MPEG/VOB PCI packets Description: Based on MPEG/VOB PCI packets
(http://dvd.sourceforge.net/dvdinfo/pci_pkt.html). The file contains (http://dvd.sourceforge.net/dvdinfo/pci_pkt.html). The file contains
a header consisting of the string "butonDVD" followed by the width a header consisting of the string "butonDVD" followed by the width
and height in pixels (16 bits integer each) and 4 reserved bytes. and height in pixels (16 bits integer each) and 4 reserved bytes.
The rest is full PCI packets (http://dvd.sourceforge.net/dvdinfo/ The rest is full PCI packets (http://dvd.sourceforge.net/dvdinfo/
pci_pkt.html). pci_pkt.html).
6.7. Block Addition Mappings
Registered "BlockAddIDType" are:
6.7.1. Use BlockAddIDValue
Block type identifier: 0
Block type name: Use BlockAddIDValue
Description: This value indicates that the actual type is stored in
"BlockAddIDValue" instead. This value is expected to be used when it
is important to have a strong compatibility with players or derived
formats not supporting "BlockAdditionMapping" but using
"BlockAdditions" with an unknown "BlockAddIDValue", and SHOULD NOT be
used if it is possible to use another value.
6.7.2. Opaque data
Block type identifier: 1
Block type name: Opaque data
Description: the "BlockAdditional" data is interpreted as opaque
additional data passed to the codec with the Block data.
"BlockAddIDValue" MUST be 1.
6.7.3. ITU T.35 metadata
Block type identifier: 4
Block type name: ITU T.35 metadata
Description: the "BlockAdditional" data is interpreted as ITU T.35
metadata, as defined by ITU-T T.35 terminal codes. "BlockAddIDValue"
MUST be 4.
6.7.4. avcE
Block type identifier: 0x61766345
Block type name: Dolby Vision enhancement-layer AVC configuration
Description: the "BlockAddIDExtraData" data is interpreted as the
Dolby Vision enhancement-layer AVC configuration box as described in
[DolbyVisionWithinIso]. This extension MUST NOT be used if "Codec
ID" is not "V_MPEG4/ISO/AVC".
6.7.5. dvcC
Block type identifier: 0x64766343
Block type name: Dolby Vision configuration
Description: the "BlockAddIDExtraData" data is interpreted as
"DOVIDecoderConfigurationRecord" structure, as defined in
[DolbyVisionWithinIso], for Dolby Vision profiles less than and equal
to 7.
6.7.6. dvvC
Block type identifier: 0x664767643
Block type name: Dolby Vision configuration
Description: the "BlockAddIDExtraData" data is interpreted as
"DOVIDecoderConfigurationRecord" structure, as defined in
[DolbyVisionWithinIso], for Dolby Vision profiles greater than 7.
6.7.7. hvcE
Block type identifier: 0x68766345
Block type name: Dolby Vision enhancement-layer HEVC configuration
Description: the "BlockAddIDExtraData" data is interpreted as the
Dolby Vision enhancement-layer HEVC configuration as described in
[DolbyVisionWithinIso]. This extension MUST NOT be used if "Codec
ID" is not "V_MPEGH/ISO/HEVC".
6.7.8. mvcC
Block type identifier: 0x6D766343
Block type name: MVC configuration
Description: the "BlockAddIDExtraData" data is interpreted as
"MVCDecoderConfigurationRecord" structure, as defined in
[ISO.14496-15].
6.8. This extension MUST NOT be used if "Codec ID" is not "V_MPEG4/ISO/
AVC".
6.9. title: Subtitles
7. Subtitles 7. Subtitles
Because Matroska is a general container format, we try to avoid Because Matroska is a general container format, we try to avoid
specifying the formats to store in it. This type of work is really specifying the formats to store in it. This type of work is really
outside of the scope of a container-only format. However, because outside of the scope of a container-only format. However, because
the use of subtitles in A/V containers has been so limited (with the the use of subtitles in A/V containers has been so limited (with the
exception of DVD) we are taking the time to specify how to store some exception of DVD) we are taking the time to specify how to store some
of the more common subtitle formats in Matroska. This is being done of the more common subtitle formats in Matroska. This is being done
to help facilitate their growth. Otherwise, incompatibilities could to help facilitate their growth. Otherwise, incompatibilities could
prevent the standardization and use of subtitle storage. prevent the standardization and use of subtitle storage.
skipping to change at page 30, line 25 skipping to change at page 33, line 31
first line of the .IDX file). If the version is smaller, you must first line of the .IDX file). If the version is smaller, you must
remux them using the SubResync utility from VobSub 2.23 (or MPC) into remux them using the SubResync utility from VobSub 2.23 (or MPC) into
v7 format. Generally any newly created subs will be in v7 format. v7 format. Generally any newly created subs will be in v7 format.
The .IFO file will not be used at all. The .IFO file will not be used at all.
If there is more than one subtitle stream in the VobSub set, each If there is more than one subtitle stream in the VobSub set, each
stream will need to be separated into separate tracks for storage in stream will need to be separated into separate tracks for storage in
Matroska. E.g. the VobSub file contains streams for both English and Matroska. E.g. the VobSub file contains streams for both English and
German subtitles. Then the resulting Matroska file SHOULD contain German subtitles. Then the resulting Matroska file SHOULD contain
two tracks. That way the language information can be 'dropped' and two tracks. That way the language information can be dropped and
mapped to Matroska's language tags. mapped to Matroska's language tags.
The .IDX file is reformatted (see below) and placed in the The .IDX file is reformatted (see below) and placed in the
CodecPrivate. CodecPrivate.
Each .BMP will be stored in its own Block. The Timestamp with be Each .BMP will be stored in its own Block. The Timestamp with be
stored in the Blocks Timestamp and the duration will be stored in the stored in the Blocks Timestamp and the duration will be stored in the
Default Duration. Default Duration.
Here is an example .IDX file: Here is an example .IDX file:
skipping to change at page 33, line 9 skipping to change at page 36, line 12
custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \ custom colors: OFF, tridx: 0000, colors: 000000, 000000, 000000, \
000000 000000
There SHOULD also be two Blocks containing one image each with the There SHOULD also be two Blocks containing one image each with the
timestamps "00:00:01:101" and "00:00:08:708". timestamps "00:00:01:101" and "00:00:08:708".
7.2. SRT Subtitles 7.2. SRT Subtitles
SRT is perhaps the most basic of all subtitle formats. SRT is perhaps the most basic of all subtitle formats.
It consists of four parts, all in text.. It consists of four parts, all in text:
1. A number indicating which subtitle it is in the sequence. 2. The 1. A number indicating which subtitle it is in the sequence. 2. The
time that the subtitle appears on the screen, and then disappears. 3. time that the subtitle appears on the screen, and then disappears. 3.
The subtitle itself. 4. A blank line indicating the start of a new The subtitle itself. 4. A blank line indicating the start of a new
subtitle. subtitle.
When placing SRT in Matroska, part 3 is converted to UTF-8 (S_TEXT/ When placing SRT in Matroska, part 3 is converted to UTF-8 (S_TEXT/
UTF8) and placed in the data portion of the Block. Part 2 is used to UTF8) and placed in the data portion of the Block. Part 2 is used to
set the timestamp of the Block, and BlockDuration element. Nothing set the timestamp of the Block, and BlockDuration element. Nothing
else is used. else is used.
skipping to change at page 34, line 18 skipping to change at page 37, line 21
(standing for Advanced SSA). Because SSA and ASS are so similar, (standing for Advanced SSA). Because SSA and ASS are so similar,
they are treated the same here. they are treated the same here.
Like SRT, this format is text based with a particular syntax. Like SRT, this format is text based with a particular syntax.
A file consists of 4 or 5 parts, declared ala INI file (but it's not A file consists of 4 or 5 parts, declared ala INI file (but it's not
an INI !) an INI !)
The first, "[Script Info]" contains some information about the The first, "[Script Info]" contains some information about the
subtitle file, such as it's title, who created it, type of script and subtitle file, such as it's title, who created it, type of script and
a very important one : "PlayResY". Be careful of this value, a very important one: "PlayResY". Be careful of this value,
everything in your script (font size, positioning) is scaled by it. everything in your script (font size, positioning) is scaled by it.
Sub Station Alpha uses your desktops Y resolution to write this Sub Station Alpha uses your desktops Y resolution to write this
value, so if a friend with a large monitor and a high screen value, so if a friend with a large monitor and a high screen
resolution gives you an edited script, you can mess everything up by resolution gives you an edited script, you can mess everything up by
saving the script in SSA with your low-cost monitor. saving the script in SSA with your low-cost monitor.
The second, "[V4 Styles]", is a list of style definitions. A style The second, "[V4 Styles]", is a list of style definitions. A style
describe how will look a text on the screen. It defines font, font describe how will look a text on the screen. It defines font, font
size, primary/.../outile colour, position, alignment, etc. size, primary/.../outile colour, position, alignment, etc.
For example this : For example this:
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, \ Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, \
TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, \ TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, \
Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,\ Style: Wolf main,Wolf_Rain,56,15724527,15724527,15724527,4144959,0,\
0,1,1,2,2,5,5,30,0,0 0,1,1,2,2,5,5,30,0,0
The third, "[Events]", is the list of text you want to display at the The third, "[Events]", is the list of text you want to display at the
right timing. You can specify some attribute here. Like the style right timing. You can specify some attribute here. Like the style
to use for this event (MUST be defined in the list), the position of to use for this event (MUSTbe defined in the list), the position of
the text (Left, Right, Vertical Margin), an effect. Name is mostly the text (Left, Right, Vertical Margin), an effect. Name is mostly
used by translator to know who said this sentence. Timing is in used by translator to know who said this sentence. Timing is in
h:mm:ss.cc (centisec). h:mm:ss.cc (centisec).
Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, \ Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, \
Effect, Text Effect, Text
Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf main,Cher,0000,0000,\ Dialogue: Marked=0,0:02:40.65,0:02:41.79,Wolf main,Cher,0000,0000,\
0000,,Et les enregistrements de ses ondes delta ? 0000,,Et les enregistrements de ses ondes delta ?
Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf main,autre,0000,0000,\ Dialogue: Marked=0,0:02:42.42,0:02:44.15,Wolf main,autre,0000,0000,\
0000,,Toujours rien. 0000,,Toujours rien.
"[Pictures]" or "[Fonts]" part can be found in some SSA file, they "[Pictures]" or "[Fonts]" part can be found in some SSA file, they
contains UUE-encoded pictures/font but those features are only used contains UUE-encoded pictures/font but those features are only used
by Sub Station Alpha, i.e. no filter (Vobsub/Avery Lee Subtiler by Sub Station Alpha -- i.e. no filter (Vobsub/Avery Lee Subtiler
filter) use them. filter) use them.
Now, how are they stored in Matroska ? Now, how are they stored in Matroska?
* All text is converted to UTF-8* All the headers are stored in * All text is converted to UTF-8
CodecPrivate ( Script Info and the Styles list)* Start & End field
are used to set TimeStamp and the BlockDuration element. the data * All the headers are stored in CodecPrivate (Script Info and the
stored is :* Events are stored in the Block in this order: Styles list)
ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect,
Text (Layer comes from ASS specs ... it's empty for SSA.) * Start & End field are used to set TimeStamp and the BlockDuration
"ReadOrder field is needed for the decoder to be able to reorder element. the data stored is:
the streamed samples as they were placed originally in the file."
* Events are stored in the Block in this order: ReadOrder, Layer,
Style, Name, MarginL, MarginR, MarginV, Effect, Text (Layer comes
from ASS specs ... it's empty for SSA.) "ReadOrder field is
needed for the decoder to be able to reorder the streamed samples
as they were placed originally in the file."
Here is an example of an SSA file. Here is an example of an SSA file.
[Script Info] [Script Info]
; This is a Sub Station Alpha v4 script. ; This is a Sub Station Alpha v4 script.
; For Sub Station Alpha info and downloads, ; For Sub Station Alpha info and downloads,
; go to \ ; go to \
; [http://www.eswat.demon.co.uk/](http://www.eswat.demon.co.uk/) ; [http://www.eswat.demon.co.uk/](http://www.eswat.demon.co.uk/)
; or email \ ; or email \
; [kotus@eswat.demon.co.uk](mailto:kotus@eswat.demon.co.uk) ; [kotus@eswat.demon.co.uk](mailto:kotus@eswat.demon.co.uk)
skipping to change at page 38, line 5 skipping to change at page 41, line 5
Block's timestamp: 00:02:40.650 BlockDuration: 00:00:01.140 Block's timestamp: 00:02:40.650 BlockDuration: 00:00:01.140
1,,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses \ 1,,Wolf main,Cher,0000,0000,0000,,Et les enregistrements de ses \
ondes delta ? ondes delta ?
Block's timestamp: 00:02:42.420 BlockDuration: 00:00:01.730 Block's timestamp: 00:02:42.420 BlockDuration: 00:00:01.730
2,,Wolf main,autre,0000,0000,0000,,Toujours rien. 2,,Wolf main,autre,0000,0000,0000,,Toujours rien.
7.4. USF Subtitles 7.4. WebVTT
Under construction
7.5. WebVTT
The "Web Video Text Tracks Format" (short: WebVTT) is developed by The "Web Video Text Tracks Format" (short: WebVTT) is developed by
the World Wide Web Consortium (W3C) (https://www.w3.org/). Its the World Wide Web Consortium (W3C) (https://www.w3.org/). Its
specifications are freely available (https://w3c.github.io/webvtt/). specifications are freely available (https://w3c.github.io/webvtt/).
The guiding principles for the storage of WebVTT in Matroska are: The guiding principles for the storage of WebVTT in Matroska are:
* Consistency: store data in a similar way to other subtitle codecs * Consistency: store data in a similar way to other subtitle codecs
* Simplicity: making decoding and remuxing as easy as possible for * Simplicity: making decoding and remuxing as easy as possible for
existing infrastructures existing infrastructures
* Completeness: keeping as much data as possible from the original * Completeness: keeping as much data as possible from the original
WebVTT file WebVTT file
7.5.1. Storage of WebVTT in Matroska 7.4.1. Storage of WebVTT in Matroska
7.5.1.1. CodecID: codec identification 7.4.1.1. CodecID: codec identification
The CodecID to use is "S_TEXT/WEBVTT". The CodecID to use is "S_TEXT/WEBVTT".
7.5.1.2. CodecPrivate: storage of global WebVTT blocks 7.4.1.2. CodecPrivate: storage of global WebVTT blocks
This element contains all global blocks before the first subtitle This element contains all global blocks before the first subtitle
entry. This starts at the ""WEBVTT"" file identification marker but entry. This starts at the ""WEBVTT"" file identification marker but
excludes the optional byte order mark. excludes the optional byte order mark.
7.5.1.3. Storage of non-global WebVTT blocks 7.4.1.3. Storage of non-global WebVTT blocks
Non-global WebVTT blocks (e.g. "NOTE") before a WebVTT Cue Text are Non-global WebVTT blocks (e.g., "NOTE") before a WebVTT Cue Text are
stored in Matroska's BlockAddition element together with the Matroska stored in Matroska's BlockAddition element together with the Matroska
Block containing the WebVTT Cue Text these blocks precede (see below Block containing the WebVTT Cue Text these blocks precede (see below
for the actual format). for the actual format).
7.5.1.4. Storage of Cues in Matroska blocks 7.4.1.4. Storage of Cues in Matroska blocks
Each WebVTT Cue Text is stored directly in the Matroska Block. Each WebVTT Cue Text is stored directly in the Matroska Block.
A muxer MUST change all WebVTT Cue Timestamps present within the Cue A muxer MUST change all WebVTT Cue Timestamps present within the Cue
Text to be relative to the Matroska Block's timestamp. Text to be relative to the Matroska Block's timestamp.
The Cue's start timestamp is used as the Matroska Block's timestamp. The Cue's start timestamp is used as the Matroska Block's timestamp.
The difference between the Cue's end timestamp and its start The difference between the Cue's end timestamp and its start
timestamp is used as the Matroska Block's duration. timestamp is used as the Matroska Block's duration.
7.5.1.5. BlockAdditions: storing non-global WebVTT blocks, Cue Settings 7.4.1.5. BlockAdditions: storing non-global WebVTT blocks, Cue Settings
Lists and Cue identifiers Lists and Cue identifiers
Each Matroska Block may be accompanied by one BlockAdditions element. Each Matroska Block may be accompanied by one BlockAdditions element.
Its format is as follows: Its format is as follows:
1. The first line contains the WebVTT Cue Text's optional Cue 1. The first line contains the WebVTT Cue Text's optional Cue
Settings List followed by one line feed character (U+0x000a). Settings List followed by one line feed character (U+0x000a).
The Cue Settings List may be empty in which case the line The Cue Settings List may be empty, in which case the line
consists of the line feed character only. consists of the line feed character only.
2. The second line contains the WebVTT Cue Text's optional Cue 2. The second line contains the WebVTT Cue Text's optional Cue
Identifier followed by one line feed character (U+0x000a). The Identifier followed by one line feed character (U+0x000a). The
line may be empty indicating that there was no Cue Identifier in line may be empty indicating that there was no Cue Identifier in
the source file in which case the line consists of the line feed the source file, in which case the line consists of the line feed
character only. character only.
3. The third and all following lines contain all WebVTT Comment 3. The third and all following lines contain all WebVTT Comment
Blocks that precede the current WebVTT Cue Block. These may be Blocks that precede the current WebVTT Cue Block. These may be
absent. absent.
If there is no Matroska BlockAddition element stored together with If there is no Matroska BlockAddition element stored together with
the Matroska Block then all three components (Cue Settings List, Cue the Matroska Block, then all three components (Cue Settings List, Cue
Identifier, Cue Comments) MUST be assumed to be absent. Identifier, Cue Comments) MUST be assumed to be absent.
7.5.2. Examples of transformation 7.4.2. Examples of transformation
Here's an example how a WebVTT is transformed. Here's an example how a WebVTT is transformed.
7.5.2.1. Example WebVTT file 7.4.2.1. Example WebVTT file
Let's take the following example file: Let's take the following example file:
WEBVTT with text after the signature WEBVTT with text after the signature
STYLE STYLE
::cue { ::cue {
background-image: linear-gradient(to bottom, dimgray, lightgray); background-image: linear-gradient(to bottom, dimgray, lightgray);
color: papayawhip; color: papayawhip;
} }
skipping to change at page 40, line 42 skipping to change at page 43, line 39
00:01:03.000 --> 00:01:06.500 position:90% align:right size:35% 00:01:03.000 --> 00:01:06.500 position:90% align:right size:35%
Example entry 3: That stuff to the right of the timestamps are cue \ Example entry 3: That stuff to the right of the timestamps are cue \
settings. settings.
00:03:10.000 --> 00:03:20.000 00:03:10.000 --> 00:03:20.000
Example entry 4: Entries can even include timestamps. Example entry 4: Entries can even include timestamps.
For example:<00:03:15.000>This becomes visible five seconds For example:<00:03:15.000>This becomes visible five seconds
after the first part. after the first part.
7.5.2.2. Example of CodecPrivate 7.4.2.2. Example of CodecPrivate
The resulting CodecPrivate element will look like this: The resulting CodecPrivate element will look like this:
WEBVTT with text after the signature WEBVTT with text after the signature
STYLE STYLE
::cue { ::cue {
background-image: linear-gradient(to bottom, dimgray, lightgray); background-image: linear-gradient(to bottom, dimgray, lightgray);
color: papayawhip; color: papayawhip;
} }
skipping to change at page 41, line 35 skipping to change at page 44, line 35
lines:3 lines:3
regionanchor:0%,100% regionanchor:0%,100%
viewportanchor:10%,90% viewportanchor:10%,90%
scroll:up scroll:up
NOTE NOTE
Notes always span a whole block and can cover multiple Notes always span a whole block and can cover multiple
lines. Like this one. lines. Like this one.
An empty line ends the block. An empty line ends the block.
7.5.2.3. Storage of Cue 1 7.4.2.3. Storage of Cue 1
Example Cue 1: timestamp 00:00:00.000, duration 00:00:10.000, Block's Example Cue 1: timestamp 00:00:00.000, duration 00:00:10.000, Block's
content: content:
Example entry 1: Hello <b>world</b>. Example entry 1: Hello <b>world</b>.
BlockAddition's content starts with one empty line as there's no Cue BlockAddition's content starts with one empty line as there's no Cue
Settings List: Settings List:
hello hello
7.5.2.4. Storage of Cue 2 7.4.2.4. Storage of Cue 2
Example Cue 2: timestamp 00:00:25.000, duration 00:00:10.000, Block's Example Cue 2: timestamp 00:00:25.000, duration 00:00:10.000, Block's
content: content:
Example entry 2: Another entry. Example entry 2: Another entry.
This one has multiple lines. This one has multiple lines.
BlockAddition's content starts with two empty lines as there's BlockAddition's content starts with two empty lines as there's
neither a Cue Settings List nor a Cue Identifier: neither a Cue Settings List nor a Cue Identifier:
NOTE style blocks cannot appear after the first cue. NOTE style blocks cannot appear after the first cue.
7.5.2.5. Storage of Cue 3 7.4.2.5. Storage of Cue 3
Example Cue 3: timestamp 00:01:03.000, duration 00:00:03.500, Block's Example Cue 3: timestamp 00:01:03.000, duration 00:00:03.500, Block's
content: content:
Example entry 3: That stuff to the right of the timestamps are cue \ Example entry 3: That stuff to the right of the timestamps are cue \
settings. settings.
BlockAddition's content ends with an empty line as there's no Cue BlockAddition's content ends with an empty line as there's no Cue
Identifier and there were no WebVTT Comment blocks: Identifier and there were no WebVTT Comment blocks:
position:90% align:right size:35% position:90% align:right size:35%
7.5.2.6. Storage of Cue 4 7.4.2.6. Storage of Cue 4
Example Cue 4: timestamp 00:03:10.000, duration 00:00:10.000, Block's Example Cue 4: timestamp 00:03:10.000, duration 00:00:10.000, Block's
content: content:
Example entry 4: Entries can even include timestamps. For Example entry 4: Entries can even include timestamps. For
example:00:00:05.000 (00:00:05.000)This becomes visible five seconds example:00:00:05.000 (00:00:05.000)This becomes visible five seconds
after the first part. after the first part.
This Block does not need a BlockAddition as the Cue did not contain This Block does not need a BlockAddition as the Cue did not contain
an Identifier, nor a Settings List, and it wasn't preceded by Comment an Identifier, nor a Settings List, and it wasn't preceded by Comment
blocks. blocks.
7.5.3. Storage of WebVTT in Matroska vs. WebM 7.4.3. Storage of WebVTT in Matroska vs. WebM
Note: the storage of WebVTT in Matroska is not the same as the design Note: the storage of WebVTT in Matroska is not the same as the design
document for storage of WebVTT in WebM. There are several reasons document for storage of WebVTT in WebM. There are several reasons
for this including but not limited to: the WebM document is old (from for this including but not limited to: the WebM document is old (from
February 2012) and was based on an earlier draft of WebVTT and February 2012) and was based on an earlier draft of WebVTT and
ignores several parts that were added to WebVTT later; WebM does ignores several parts that were added to WebVTT later; WebM does
still not support subtitles at all (http://www.webmproject.org/docs/ still not support subtitles at all (http://www.webmproject.org/docs/
container/); the proposal suggests splitting the information across container/); the proposal suggests splitting the information across
multiple tracks making demuxer's and remuxer's life very difficult. multiple tracks making demuxer's and remuxer's life very difficult.
7.6. HDMV presentation graphics subtitles 7.5. HDMV presentation graphics subtitles
The specifications for the HDMV presentation graphics subtitle format The specifications for the HDMV presentation graphics subtitle format
(short: HDMV PGS) can be found in the document "Blu-ray Disc Read- (short: HDMV PGS) can be found in the document "Blu-ray Disc Read-
Only Format; Part 3 - Audio Visual Basic Specifications" in section Only Format; Part 3 - Audio Visual Basic Specifications" in section
9.14 "HDMV graphics streams". 9.14 "HDMV graphics streams".
7.6.1. Storage of HDMV presentation graphics subtitles 7.5.1. Storage of HDMV presentation graphics subtitles
The CodecID to use is "S_HDMV/PGS". A CodecPrivate element is not The CodecID to use is "S_HDMV/PGS". A CodecPrivate element is not
used. used.
7.6.1.1. Storage of HDMV PGS Segments in Matroska Blocks 7.5.1.1. Storage of HDMV PGS Segments in Matroska Blocks
Each HDMV PGS Segment (short: Segment) will be stored in a Matroska Each HDMV PGS Segment (short: Segment) will be stored in a Matroska
Block. A Segment is the data structure described in section 9.14.2.1 Block. A Segment is the data structure described in section 9.14.2.1
"Segment coding structure and parameters" of the Blu-ray "Segment coding structure and parameters" of the Blu-ray
specifications. specifications.
Each Segment contains a presentation timestamp. This timestamp will Each Segment contains a presentation timestamp. This timestamp will
be used as the timestamp for the Matroska Block. be used as the timestamp for the Matroska Block.
A Segment is normally shown until a subsequent Segment is A Segment is normally shown until a subsequent Segment is
encountered. Therefore the Matroska Block MAY have no Duration. In encountered. Therefore the Matroska Block MAY have no Duration. In
that case a player MUST display a Segment within a Matroska Block that case, a player MUST display a Segment within a Matroska Block
until the next Segment is encountered. until the next Segment is encountered.
A muxer MAY use a Duration, e.g. by calculating the distance between A muxer MAY use a Duration, e.g., by calculating the distance between
two subsequent Segments. If a Matroska Block has a Duration, a two subsequent Segments. If a Matroska Block has a Duration, a
player MUST display that Segment only for the duration of the Block's player MUST display that Segment only for the duration of the Block's
Duration. Duration.
7.7. HDMV text subtitles 7.6. HDMV text subtitles
The specifications for the HDMV text subtitle format (short: HDMV The specifications for the HDMV text subtitle format (short: HDMV
TextST) can be found in the document "Blu-ray Disc Read-Only Format; TextST) can be found in the document "Blu-ray Disc Read-Only Format;
Part 3 - Audio Visual Basic Specifications" in section 9.15 "HDMV Part 3 - Audio Visual Basic Specifications" in section 9.15 "HDMV
text subtitle streams". text subtitle streams".
7.7.1. Storage of HDMV text subtitles 7.6.1. Storage of HDMV text subtitles
The CodecID to use is "S_HDMV/TEXTST". The CodecID to use is "S_HDMV/TEXTST".
A CodecPrivate Element is required. It MUST contain the stream's A CodecPrivate Element is required. It MUST contain the stream's
Dialog Style Segment as described in section 9.15.4.2 "Dialog Style Dialog Style Segment as described in section 9.15.4.2 "Dialog Style
Segment" of the Blu-ray specifications. Segment" of the Blu-ray specifications.
7.7.1.1. Storage of HDMV TextST Dialog Presentation Segments in 7.6.1.1. Storage of HDMV TextST Dialog Presentation Segments in
Matroska Blocks Matroska Blocks
Each HDMV Dialog Presentation Segment (short: Segment) will be stored Each HDMV Dialog Presentation Segment (short: Segment) will be stored
in a Matroska Block. A Segment is the data structure described in in a Matroska Block. A Segment is the data structure described in
section 9.15.4.3 "Dialog presentation segment" of the Blu-ray section 9.15.4.3 "Dialog presentation segment" of the Blu-ray
specifications. specifications.
Each Segment contains a start and an end presentation timestamp Each Segment contains a start and an end presentation timestamp
(short: start PTS & end PTS). The start PTS will be used as the (short: start PTS & end PTS). The start PTS will be used as the
timestamp for the Matroska Block. The Matroska Block MUST have a timestamp for the Matroska Block. The Matroska Block MUST have a
Duration, and that Duration is the difference between the end PTS and Duration, and that Duration is the difference between the end PTS and
the start PTS. the start PTS.
A player MUST use the Matroska Block's timestamp and Duration instead A player MUST use the Matroska Block's timestamp and Duration instead
of the Segment's start and end PTS for determining when and how long of the Segment's start and end PTS for determining when and how long
to show the Segment. to show the Segment.
7.7.1.2. Character set 7.6.1.2. Character set
When TextST subtitles are stored inside Matroska, the only allowed When TextST subtitles are stored inside Matroska, the only allowed
character set is UTF-8. character set is UTF-8.
Each HDMV text subtitle stream in a Blu-ray can use one of a handful Each HDMV text subtitle stream in a Blu-ray can use one of a handful
of character sets. This information is not stored in the MPEG2 of character sets. This information is not stored in the MPEG2
Transport Stream itself but in the accompanying Clip Information Transport Stream itself but in the accompanying Clip Information
file. file.
Therefore a muxer MUST parse the accompanying Clip Information file. Therefore a muxer MUST parse the accompanying Clip Information file.
If the information indicates a character set other than UTF-8, it If the information indicates a character set other than UTF-8, it
MUST re-encode all text Dialog Presentation Segments from the MUST re-encode all text Dialog Presentation Segments from the
indicated character set to UTF-8 prior to storing them in Matroska. indicated character set to UTF-8 prior to storing them in Matroska.
7.8. Digital Video Broadcasting (DVB) subtitles 7.7. Digital Video Broadcasting (DVB) subtitles
The specifications for the Digital Video Broadcasting subtitle The specifications for the Digital Video Broadcasting subtitle
bitstream format (short: DVB subtitles) can be found in the document bitstream format (short: DVB subtitles) can be found in the document
"ETSI EN 300 743 - Digital Video Broadcasting (DVB); Subtitling "ETSI EN 300 743 - Digital Video Broadcasting (DVB); Subtitling
systems". The storage of DVB subtitles in MPEG transport streams is systems". The storage of DVB subtitles in MPEG transport streams is
specified in the document "ETSI EN 300 468 - Digital Video specified in the document "ETSI EN 300 468 - Digital Video
Broadcasting (DVB); Specification for Service Information (SI) in DVB Broadcasting (DVB); Specification for Service Information (SI) in DVB
systems". systems".
7.8.1. Storage of DVB subtitles 7.7.1. Storage of DVB subtitles
7.8.1.1. CodecID 7.7.1.1. CodecID
The CodecID to use is "S_DVBSUB". The CodecID to use is "S_DVBSUB".
7.8.1.2. CodecPrivate 7.7.1.2. CodecPrivate
The CodecPrivate element is five bytes long and has the following The CodecPrivate element is five bytes long and has the following
structure: structure:
* 2 bytes: composition page ID (bit string, left bit first) * 2 bytes: composition page ID (bit string, left bit first)
* 2 bytes: ancillary page ID (bit string, left bit first) * 2 bytes: ancillary page ID (bit string, left bit first)
* 1 byte: subtitling type (bit string, left bit first) * 1 byte: subtitling type (bit string, left bit first)
The semantics of these bytes are the same as the ones described in The semantics of these bytes are the same as the ones described in
section 6.2.41 "Subtitling descriptor" of ETSI EN 300 468. section 6.2.41 "Subtitling descriptor" of ETSI EN 300 468.
7.8.1.3. Storage of DVB subtitles in Matroska Blocks 7.7.1.3. Storage of DVB subtitles in Matroska Blocks
Each Matroska Block consists of one or more DVB Subtitle Segments as Each Matroska Block consists of one or more DVB Subtitle Segments as
described in segment 7.2 "Syntax and semantics of the subtitling described in segment 7.2 "Syntax and semantics of the subtitling
segment" of ETSI EN 300 743. segment" of ETSI EN 300 743.
Each Matroska Block SHOULD have a Duration indicating how long the Each Matroska Block SHOULD have a Duration indicating how long the
DVB Subtitle Segments in that Block SHOULD be displayed. DVB Subtitle Segments
7.8. in that Block SHOULD be displayed.
7.9. title: Block Additional Mapping
8. Block Additional Mapping 8. Block Additional Mapping
Extra data or metadata can be added to each "Block" using Extra data or metadata can be added to each "Block" using
"BlockAdditional" data. Each "BlockAdditional" contains a "BlockAdditional" data. Each "BlockAdditional" contains a
"BlockAddID" that identifies the kind of data it contains. When the "BlockAddID" that identifies the kind of data it contains. When the
"BlockAddID" is set to "1" the contents of the "BlockAdditional "BlockAddID" is set to "1" the contents of the "BlockAdditional
Element" are define by the Codec Mappings defines (see Element" are define by the Codec Mappings defines; see Section 6.1.5.
Section 6.1.5). When the "BlockAddID" is set a value greater than When the "BlockAddID" is set a value greater than "1", then the
"1", then the contents of the "BlockAdditional Element" are defined contents of the "BlockAdditional Element" are defined by the
by the "BlockAdditionalMapping Element" within the associated "Track "BlockAdditionalMapping Element", within the associated "Track
Element" where the "BlockAddID Element" of "BlockAdditional Element" Element", where the "BlockAddID Element" of "BlockAdditional Element"
equals the "BlockAddIDValue" of the associated Track's equals the "BlockAddIDValue" of the associated Track's
"BlockAdditionalMapping Element". That "BlockAdditionalMapping "BlockAdditionalMapping Element". That "BlockAdditionalMapping
Element" then identifies a particular Block Additional Mapping by the Element" identifies a particular Block Additional Mapping by the
"BlockAddIDType". "BlockAddIDType".
The following XML depicts a use of a Block Additional Mapping to The following XML depicts a use of a Block Additional Mapping to
associate a timecode value with a "Block": associate a timecode value with a "Block":
<Segment> <Segment>
<!--Mandatory elements ommitted for readability--> <!--Mandatory elements ommitted for readability-->
<Tracks> <Tracks>
<TrackEntry> <TrackEntry>
<TrackNumber>1</TrackNumber> <TrackNumber>1</TrackNumber>
skipping to change at page 46, line 41 skipping to change at page 49, line 44
<BlockAddID>2</BlockAddID><!--arbitrary value from <BlockAddID>2</BlockAddID><!--arbitrary value from
BlockAdditionalMapping--> BlockAdditionalMapping-->
<BlockAdditional>01:00:00:00</BlockAdditional> <BlockAdditional>01:00:00:00</BlockAdditional>
</BlockMore> </BlockMore>
</BlockAdditions> </BlockAdditions>
</BlockGroup> </BlockGroup>
</Cluster> </Cluster>
</Segment> </Segment>
Block Additional Mappings detail how additional data MAY be stored in Block Additional Mappings detail how additional data MAY be stored in
the "BlockMore Element" with a "BlockAdditionMapping Element" within the "BlockMore Element" with a "BlockAdditionMapping Element", within
the "Track Element" which identifies the "BlockAdditional" content. the "Track Element", which identifies the "BlockAdditional" content.
Block Additional Mappings define the "BlockAddIDType" value reserved Block Additional Mappings define the "BlockAddIDType" value reserved
to identify that type of data as well as providing an optional label to identify that type of data as well as providing an optional label
stored within the "BlockAddIDName Element". When the Block stored within the "BlockAddIDName Element". When the Block
Additional Mapping is dependent on additional contextual information Additional Mapping is dependent on additional contextual information,
then the Mapping SHOULD describe how such additional contextual then the Mapping SHOULD describe how such additional contextual
information is stored within the "BlockAddIDExtraData Element". information is stored within the "BlockAddIDExtraData Element".
The following Block Additional Mappings are defined. The following Block Additional Mappings are defined.
8.1. Summary of Assigned BlockAddIDType Values 8.1. Summary of Assigned BlockAddIDType Values
For convenience, the following table shows the assigned For convenience, the following table shows the assigned
BlockAddIDType values along with the BlockAddIDName and Citation. BlockAddIDType values along with the BlockAddIDName and Citation.
+----------------+------------------------+-------------+ +================+========================+=============+
| BlockAddIDType | BlockAddIDName | Citation | | BlockAddIDType | BlockAddIDName | Citation |
+================+========================+=============+ +================+========================+=============+
| 121 | SMPTE ST 12-1 timecode | Section 8.2 | | 121 | SMPTE ST 12-1 timecode | Section 8.2 |
+----------------+------------------------+-------------+ +----------------+------------------------+-------------+
Table 4 Table 4
8.2. SMPTE ST 12-1 Timecode 8.2. SMPTE ST 12-1 Timecode
8.2.1. Timecode Description 8.2.1. Timecode Description
SMPTE ST 12-1 timecode values can be stored in the "BlockMore SMPTE ST 12-1 timecode values can be stored in the "BlockMore
Element" to associate the content of a Matroska Block with a Element" to associate the content of a Matroska Block with a
particular timecode value. If the Block uses Lacing, the timecode particular timecode value. If the Block uses Lacing, the timecode
value is associated with the first frame of the Lace. value is associated with the first frame of the Lace.
The Block Additional Mapping contains a full binary representation of The Block Additional Mapping contains a full binary representation of
a 64 bit SMPTE timecode value stored in big endian format and a 64 bit SMPTE timecode value stored in big-endian format and
expressed exactly as defined in Section 8 and 9 of SMPTE 12M expressed exactly as defined in Section 8 and 9 of SMPTE 12M [ST12].
[SMPTE-ST12]. For convenience, here are the bit assignments for a For convenience, here are the bit assignments for a SMPTE ST 12-1
SMPTE ST 12-1 binary representation as described in Section 6.2 of binary representation as described in Section 6.2 of [RFC5484]:
[RFC5484]:
+---------------+------------------------+ +===============+========================+
| Bit Positions | Label | | Bit Positions | Label |
+===============+========================+ +===============+========================+
| 0--3 | Units of frames | | 0--3 | Units of frames |
+---------------+------------------------+ +---------------+------------------------+
| 4--7 | First binary group | | 4--7 | First binary group |
+---------------+------------------------+ +---------------+------------------------+
| 8--9 | Tens of frames | | 8--9 | Tens of frames |
+---------------+------------------------+ +---------------+------------------------+
| 10 | Drop frame flag | | 10 | Drop frame flag |
+---------------+------------------------+ +---------------+------------------------+
skipping to change at page 49, line 11 skipping to change at page 52, line 11
The BlockAddIDName value reserved for timecode is "SMPTE ST 12-1 The BlockAddIDName value reserved for timecode is "SMPTE ST 12-1
timecode". timecode".
8.2.4. BlockAddIDExtraData 8.2.4. BlockAddIDExtraData
BlockAddIDExtraData is unused within this block additional mapping. BlockAddIDExtraData is unused within this block additional mapping.
9. Normative References 9. Normative References
[IEEE.754.1985] [DolbyVisionWithinIso]
Institute of Electrical and Electronics Engineers, Dolby, "Dolby Vision Streams Within the ISO Base MediaFile
"Standard for Binary Floating-Point Arithmetic", August Format", 7 February 2020,
1985. <https://www.dolby.com/us/en/technologies/dolby-vision/
dolby-vision-bitstreams-within-the-iso-base-media-file-
format-v2.1.2.pdf>.
[SMPTE-ST12] [IEEE.1857-4]
Society of Motion Picture and Television Engineers, "SMPTE IEEE, "IEEE Standard for Second-Generation IEEE 1857 Video
ST 12-1:2014 Time and Control Code", February 2014, Coding", 23 October 2018,
<https://ieeexplore.ieee.org/servlet/ <https://standards.ieee.org/standard/1857_4-2018.html>.
opac?punumber=7291027>.
[IEEE.754] IEEE, "IEEE Standard for Binary Floating-Point
Arithmetic", 13 June 2019,
<https://standards.ieee.org/standard/754-2019.html>.
[ISO.14496-15]
International Organization for Standardization,
"Information technology — Coding of audio-visual objects —
Part 15: Carriage of network abstraction layer (NAL) unit
structured video in ISO base media file format",
ISO Standard 14496, 2014.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet:
Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002,
<https://www.rfc-editor.org/info/rfc3339>. <https://www.rfc-editor.org/info/rfc3339>.
[RFC6386] Bankoski, J., Koleszar, J., Quillio, L., Salonen, J.,
Wilkins, P., and Y. Xu, "VP8 Data Format and Decoding
Guide", RFC 6386, DOI 10.17487/RFC6386, November 2011,
<https://www.rfc-editor.org/info/rfc6386>.
[RFC6648] Saint-Andre, P., Crocker, D., and M. Nottingham, [RFC6648] Saint-Andre, P., Crocker, D., and M. Nottingham,
"Deprecating the "X-" Prefix and Similar Constructs in "Deprecating the "X-" Prefix and Similar Constructs in
Application Protocols", BCP 178, RFC 6648, Application Protocols", BCP 178, RFC 6648,
DOI 10.17487/RFC6648, June 2012, DOI 10.17487/RFC6648, June 2012,
<https://www.rfc-editor.org/info/rfc6648>. <https://www.rfc-editor.org/info/rfc6648>.
[RFC6386] Bankoski, J., Koleszar, J., Quillio, L., Salonen, J., [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
Wilkins, P., and Y. Xu, "VP8 Data Format and Decoding 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
Guide", RFC 6386, DOI 10.17487/RFC6386, November 2011, May 2017, <https://www.rfc-editor.org/info/rfc8174>.
<https://www.rfc-editor.org/info/rfc6386>.
[ST12] SMPTE, "Time and Control Code", ST ST 12-1:2014, DOI
10.5594/SMPTE.ST12-1.2014, 20 February 2014,
<http://ieeexplore.ieee.org/document/7291029/>.
10. Informative References 10. Informative References
[RFC5484] Singer, D., "Associating Time-Codes with RTP Streams", [RFC5484] Singer, D., "Associating Time-Codes with RTP Streams",
RFC 5484, DOI 10.17487/RFC5484, March 2009, RFC 5484, DOI 10.17487/RFC5484, March 2009,
<https://www.rfc-editor.org/info/rfc5484>. <https://www.rfc-editor.org/info/rfc5484>.
Authors' Addresses Authors' Addresses
Steve Lhomme Steve Lhomme
 End of changes. 125 change blocks. 
283 lines changed or deleted 441 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/