forked from w3c/webcodecs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
avc_codec_registration.src.html
237 lines (196 loc) · 8.64 KB
/
avc_codec_registration.src.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<pre class='metadata'>
Title: AVC (H.264) WebCodecs Registration
Repository: w3c/webcodecs
Status: NOTE-ED
Shortname: webcodecs-avc-codec-registration
Level: none
Group: mediawg
ED: https://w3c.github.io/webcodecs/avc_codec_registration.html
TR: https://www.w3.org/TR/webcodecs-avc-codec-registration/
Editor: Paul Adenot, w3cid 62410, Mozilla https://www.mozilla.org/
Editor: Bernard Aboba, w3cid 65611, Microsoft Corporation https://www.microsoft.com/
Former Editor: Chris Cunningham, w3cid 114832, Google Inc. https://www.google.com/
Abstract: This registration is entered into the [[webcodecs-codec-registry]].
It describes, for AVC (H.264), the (1) fully qualified codec strings,
(2) the codec-specific {{EncodedVideoChunk}}
{{EncodedVideoChunk/[[internal data]]}} bytes, (3) the
{{VideoDecoderConfig/description|VideoDecoderConfig.description}} bytes,
(4) the values of {{EncodedVideoChunk}} {{EncodedVideoChunk/[[type]]}},
(5) the codec-specific extensions to {{VideoEncoderConfig}}, and
(6) the codec-specific extensions to {{VideoEncoderEncodeOptions}}.
The registration is not intended to include any information on whether a
codec format is encumbered by intellectual property claims. Implementers and
authors are advised to seek appropriate legal counsel in this matter if they
intend to implement or use a specific codec format. Implementers of
WebCodecs are not required to support the AVC / H.264 codec.
This registration is non-normative.
Markup Shorthands:css no, markdown yes, dfn yes
!Participate: <a href="https://github.com/w3c/webcodecs">Git Repository.</a>
!Participate: <a href="https://github.com/w3c/webcodecs/issues/new">File an issue.</a>
!Version History: <a href="https://github.com/w3c/webcodecs/commits">https://github.com/w3c/webcodecs/commits</a>
</pre>
<pre class='biblio'>
{
"ITU-T-REC-H.264": {
"href": "https://www.itu.int/rec/T-REC-H.264",
"title": "H.264 : Advanced video coding for generic audiovisual services",
"publisher": "ITU",
"date": "June 2019"
},
"iso14496-15": {
"href": "https://www.iso.org/standard/74429.html",
"title": "ISO/IEC 14496-15:2019 Information technology — Coding of audio-visual objects — Part 15: Carriage of network abstraction layer (NAL) unit structured video in the ISO base media file format",
"publisher": "ISO",
"date": "September 2019"
}
}
</pre>
Fully qualified codec strings {#fully-qualified-codec-strings}
==============================================================
The codec string begins with the prefix "avc1." or "avc3.", with a suffix of 6
characters as described respectively in Section 3.4 of [[rfc6381]] and Section
5.4.1 of [[iso14496-15]].
EncodedVideoChunk data {#encodedvideochunk-data}
================================================
{{EncodedVideoChunk}} {{EncodedVideoChunk/[[internal data]]}} is expected to be
an access unit as defined in [[ITU-T-REC-H.264]] section 7.4.1.2.
NOTE: An access unit contains exactly one primary coded picture.
If the bitstream is in {{AvcBitstreamFormat/avc}} format,
{{EncodedVideoChunk/[[internal data]]}} is assumed to be in canonical format, as
defined in [[iso14496-15]] section 5.3.2.
If the bitstream is in {{AvcBitstreamFormat/annexb}} format,
{{EncodedVideoChunk/[[internal data]]}} is assumed to be in in Annex B format,
as defined in [[ITU-T-REC-H.264]] Annex B.
NOTE: Since {{EncodedVideoChunk/[[internal data]]}} is inherently byte-aligned,
implementations are not required to recover byte-alignment.
VideoDecoderConfig description {#videodecoderconfig-description}
================================================================
If the {{VideoDecoderConfig/description}} is present, it is assumed to be an
`AVCDecoderConfigurationRecord`, as defined by [[iso14496-15]], section
5.3.3.1, and the bitstream is assumed to be in {{AvcBitstreamFormat/avc}}
format.
NOTE: This format is commonly used in .MP4 files, where the player generally
has random access to the media data.
If the {{VideoDecoderConfig/description}} is not present, the bitstream is
assumed to be in {{AvcBitstreamFormat/annexb}} format.
NOTE: "annexb" format is described in greater detail by [[ITU-T-REC-H.264]],
Annex B. This format is commonly used in live-streaming applications, where
including the SPS and PPS data periodically allows users to easily start
from the middle of the stream.
EncodedVideoChunk type {#encodedvideochunk-type}
================================================
If an {{EncodedVideoChunk}}'s {{EncodedVideoChunk/[[type]]}} is
{{EncodedVideoChunkType/key}}, and the bitstream is in
{{AvcBitstreamFormat/avc}} format, then the {{EncodedVideoChunk}} is expected to
contain a primary coded picture that is an instantaneous decoding refresh (IDR)
picture.
NOTE: If the bitstream is in {{AvcBitstreamFormat/avc}} format, parameter sets
necessary for decoding are included in
{{VideoDecoderConfig/description|VideoDecoderConfig.description}}.
If an {{EncodedVideoChunk}}'s {{EncodedVideoChunk/[[type]]}} is
{{EncodedVideoChunkType/key}}, and the bitstream is in
{{AvcBitstreamFormat/annexb}} format, then the {{EncodedVideoChunk}} is expected
to contain both a primary coded picture that is an instantaneous decoding
refresh (IDR) picture, and all parameter sets necessary to decode all video data
NAL units in the {{EncodedVideoChunk}}.
VideoEncoderConfig extensions {#videoencoderconfig-extensions}
==============================================================
<pre class='idl'>
<xmp>
partial dictionary VideoEncoderConfig {
AvcEncoderConfig avc;
};
</xmp>
</pre>
<dl>
<dt><dfn dict-member for=VideoEncoderConfig>avc</dfn></dt>
<dd>
Contains codec specific configuration options for the AVC (H.264) codec.
</dd>
</dl>
AvcEncoderConfig {#avc-encoder-config}
--------------------------------------
<pre class='idl'>
<xmp>
dictionary AvcEncoderConfig {
AvcBitstreamFormat format = "avc";
};
</xmp>
</pre>
<dl>
<dt><dfn dict-member for=AvcEncoderConfig>format</dfn></dt>
<dd>
Configures the format of output {{EncodedVideoChunk}}s. See
{{AvcBitstreamFormat}}.
</dd>
</dl>
AvcBitstreamFormat {#avc-bitstream-format}
------------------------------------------
<pre class='idl'>
<xmp>
enum AvcBitstreamFormat {
"annexb",
"avc",
};
</xmp>
</pre>
The {{AvcBitstreamFormat}} determines the location of AVC parameter sets, and
mechanisms for packaging the bitstream.
<dl>
<dt><dfn enum-value for=AvcBitstreamFormat>annexb</dfn></dt>
<dd>
SPS and PPS data are included periodically throughout the bitstream.
NOTE: This format is described in greater detail by [[ITU-T-REC-H.264]],
Annex B. This format is commonly used in live-streaming applications,
where including the SPS and PPS data periodically allows users to easily
start from the middle of the stream.
</dd>
<dt><dfn enum-value for=AvcBitstreamFormat>avc</dfn></dt>
<dd>
SPS and PPS data are not included in the bitstream and are instead emitted
via the {{VideoEncoder/[[output callback]]}} as the
{{VideoDecoderConfig/description|VideoDecoderConfig.description}} of the
{{EncodedVideoChunkMetadata/decoderConfig|EncodedVideoChunkMetadata.decoderConfig}}.
NOTE: This format is described in greater detail by [[iso14496-15]],
section 5.3. This format is commonly used in .MP4 files, where the
player generally has random access to the media data.
</dl>
VideoEncoderEncodeOptions extensions {#videoencoderencodeoptions-extensions}
==============================================================
<pre class='idl'>
<xmp>
partial dictionary VideoEncoderEncodeOptions {
VideoEncoderEncodeOptionsForAvc avc;
};
</xmp>
</pre>
<dl>
<dt><dfn dict-member for=VideoEncoderEncodeOptions>avc</dfn></dt>
<dd>
Contains codec specific encode options for the [[ITU-T-REC-H.264]] codec.
</dd>
</dl>
VideoEncoderEncodeOptionsForAvc {#avc-encode-options}
--------------------------------------
<pre class='idl'>
<xmp>
dictionary VideoEncoderEncodeOptionsForAvc {
unsigned short? quantizer;
};
</xmp>
</pre>
<dl>
<dt><dfn dict-member for=VideoEncoderEncodeOptionsForAvc>quantizer</dfn></dt>
<dd>
Sets per-frame quantizer value.
In [[ITU-T-REC-H.264]] the quantizer threshold can be varied from 0 to 51.
</dd>
</dl>
Privacy Considerations {#privacy-considerations}
==========================================================================
Please refer to the section [[WEBCODECS#privacy-considerations|Privacy
Considerations]] in [[WEBCODECS]].
Security Considerations {#security-considerations}
==========================================================================
Please refer to the section [[WEBCODECS#security-considerations|Security
Considerations]] in [[WEBCODECS]].