You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: codec_specs.md
+36-10
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,9 @@ which **MUST** be stored within the `CodecPrivate Element`. When the Initializat
71
71
within a track, then that updated Initialization data **MUST** be written into the `CodecState Element`
72
72
of the first `Cluster` to require it. If the encoding does not require any form of Initialization,
73
73
then `none`**MUST** be used to define the Initialization and the `CodecPrivate Element`
74
-
**SHOULD NOT** be written and **MUST** be ignored. Data that is defined Initialization to be
74
+
**SHOULD NOT** be written and **MUST** be ignored. If the encoding does require any form of Initialization,
75
+
then `CodecPrivate Element`**MUST** be written and **MUST** be provided to the decoder.
76
+
Data that is defined Initialization to be
75
77
stored in the `CodecPrivate Element` is known as `Private Data`.
76
78
77
79
### Codec BlockAdditions
@@ -332,8 +334,8 @@ Codec Name: Theora
332
334
333
335
Initialization: The `Private Data` contains the first three Theora packets in order. The lengths of the packets precedes them. The actual layout is:
334
336
335
-
* Byte 1: number of distinct packets `#p` minus one inside the CodecPrivate block. This **MUST** be "2" for current (as of 2016-07-08) Theora headers.
336
-
* Bytes 2..n: lengths of the first `#p` packets, coded in Xiph-style lacing. The length of the last packet is the length of the CodecPrivate block minus the lengths coded in these bytes minus one.
337
+
* Byte 1: number of distinct packets `#p` minus one inside the `Private Data`. This **MUST** be "2" for current (as of 2016-07-08) Theora headers.
338
+
* Bytes 2..n: lengths of the first `#p` packets, coded in Xiph-style lacing. The length of the last packet is the length of the `Private Data` minus the lengths coded in these bytes minus one.
337
339
* Bytes n+1..: The Theora identification header, followed by the commend header followed by the codec setup header. Those are described in the [Theora specs](http://www.theora.org/doc/Theora.pdf).
338
340
339
341
### V_PRORES
@@ -389,7 +391,7 @@ Description: FFV1 is a lossless intra-frame video encoding format designed to ef
389
391
Compared to uncompressed video, FFV1 offers storage compression, frame fixity, and self-description,
390
392
which makes FFV1 useful as a preservation or intermediate video format. [Draft FFV1 Specification](https://datatracker.ietf.org/doc/draft-ietf-cellar-ffv1/)
391
393
392
-
Initialization: For FFV1 versions 0 or 1, `Private Data`**SHOULD NOT** be written. For FFV1 version 3 or greater, the `Private Data`**MUST** contain the FFV1 Configuration Record structure, as defined in https://tools.ietf.org/html/draft-ietf-cellar-ffv1-04#section-4.2, and no other data.
394
+
Initialization: For FFV1 versions 0 or 1, none. For FFV1 version 3 or greater, the `Private Data`contains the FFV1 Configuration Record structure, as defined in https://tools.ietf.org/html/draft-ietf-cellar-ffv1-04#section-4.2, and no other data.
393
395
394
396
## Audio Codec Mappings
395
397
@@ -471,9 +473,11 @@ Codec ID: A_AC3
471
473
472
474
Codec Name: (Dolby™) AC3
473
475
474
-
Description: BSID <= 8 !! The private data is void ??? Corresponding ACM wFormatTag : 0x2000 ; channel number have
476
+
Description: For BSID <= 8. Corresponding ACM wFormatTag : 0x2000 ; channel number have
475
477
to be read from the corresponding audio element
476
478
479
+
Initialization: none
480
+
477
481
### A_AC3/BSID9
478
482
479
483
Codec ID: A_AC3/BSID9
@@ -549,10 +553,10 @@ Codec ID: A_VORBIS
549
553
Codec Name: Vorbis
550
554
551
555
Initialization: The `Private Data` contains the first three Vorbis packet in order. The lengths of the packets precedes them. The actual layout is:
552
-
- Byte 1: number of distinct packets `#p` minus one inside the CodecPrivate block.
556
+
- Byte 1: number of distinct packets `#p` minus one inside the `Private Data`.
553
557
This **MUST** be "2" for current (as of 2016-07-08) Vorbis headers.
554
558
- Bytes 2..n: lengths of the first `#p` packets, coded in Xiph-style lacing.
555
-
The length of the last packet is the length of the CodecPrivate block minus the lengths coded in these bytes minus one.
559
+
The length of the last packet is the length of the `Private Data` minus the lengths coded in these bytes minus one.
556
560
- Bytes n+1..: The [Vorbis identification header](https://xiph.org/vorbis/doc/Vorbis_I_spec.html),
557
561
followed by the [Vorbis comment header](https://xiph.org/vorbis/doc/v-comment.html)
558
562
followed by the [codec setup header](https://xiph.org/vorbis/doc/Vorbis_I_spec.html).
@@ -815,24 +819,30 @@ Codec Name: UTF-8 Plain Text
815
819
816
820
Description: Basic text subtitles. For more information, see (#subtitles) on Subtitles.
817
821
822
+
Initialization: none
823
+
818
824
### S_TEXT/SSA
819
825
820
826
Codec ID: S_TEXT/SSA
821
827
822
828
Codec Name: Subtitles Format
823
829
824
-
Description: The [Script Info] and [V4 Styles] sections are stored in the codecprivate. Each event is stored in its own Block.
830
+
Description: Each event is stored in its own Block.
825
831
For more information, see (#ssa-ass-subtitles) on SSA/ASS.
826
832
833
+
Initialization: The `Private Data` contains the [Script Info] and [V4 Styles] sections.
834
+
827
835
### S_TEXT/ASS
828
836
829
837
Codec ID: S_TEXT/ASS
830
838
831
839
Codec Name: Advanced Subtitles Format
832
840
833
-
Description: The [Script Info] and [V4 Styles] sections are stored in the codecprivate. Each event is stored in its own Block.
841
+
Description: Each event is stored in its own Block.
834
842
For more information, see (#ssa-ass-subtitles) on SSA/ASS.
835
843
844
+
Initialization: The `Private Data` contains the [Script Info] and [V4 Styles] sections.
845
+
836
846
### S_TEXT/WEBVTT
837
847
838
848
Codec ID: S_TEXT/WEBVTT
@@ -841,6 +851,8 @@ Codec Name: Web Video Text Tracks Format (WebVTT)
841
851
842
852
Description: Advanced text subtitles. For more information, see (#webvtt) on WebVTT.
843
853
854
+
Initialization: none
855
+
844
856
### S_IMAGE/BMP
845
857
846
858
Codec ID: S_IMAGE/BMP
@@ -852,6 +864,8 @@ The timestamp in the block header of Matroska indicates the start display time,
852
864
the duration is set with the Duration element. The full data for the subtitle bitmap
853
865
is stored in the Block's data section.
854
866
867
+
Initialization: none
868
+
855
869
### S_DVBSUB
856
870
857
871
Codec ID: S_DVBSUB
@@ -861,6 +875,8 @@ Codec Name: Digital Video Broadcasting (DVB) subtitles
861
875
Description: This is the graphical subtitle format used in the Digital Video Broadcasting standard.
862
876
For more information, see (#digital-video-broadcasting-dvb-subtitles) on Digital Video Broadcasting (DVB).
863
877
878
+
Initialization: none
879
+
864
880
### S_VOBSUB
865
881
866
882
Codec ID: S_VOBSUB
@@ -872,13 +888,15 @@ VobSubs consist of two files, the .idx containing information, and the .sub, con
872
888
The .idx file is stripped of all empty lines, of all comments and of lines beginning with `alt:` or `langidx:`.
873
889
The line beginning with `id:`**SHOULD** be transformed into the appropriate Matroska track language element
874
890
and is discarded. All remaining lines but the ones containing timestamps and file positions
875
-
are put into the `CodecPrivate` element.
891
+
are put into the `Private Data`.
876
892
877
893
For each line containing the timestamp and file position data is read from the appropriate
878
894
position in the .sub file. This data consists of a MPEG program stream which in turn
879
895
contains SPU packets. The MPEG program stream data is discarded, and each SPU packet
<documentationlang="en"purpose="definition">Private data only known to the codec.</documentation>
401
+
<documentationlang="en"purpose="definition">Private data only known to the codec. This element **MUST NOT** be present if the codec mapping specification stipulates no initialization or an initialization different from `none`, else **MUST NOT** be present.</documentation>
0 commit comments