Skip to content

Commit cf0784b

Browse files
authored
Merge pull request #149 from WICG/establish_codec_registry
Establish codec registry and AVC registration.
2 parents 57e2560 + 49baae7 commit cf0784b

5 files changed

+455
-158
lines changed

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
out/
2-
index.html
1+
avc_codec_registration.html
2+
codec_registry.html
33
deploy_key
44
deploy_key.pub
5+
index.html
6+
out/
57

Makefile

+41-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
SHELL=/bin/bash
22

3-
local: index.src.html
3+
local: local-index local-codec-registry local-avc-codec-registration
4+
5+
local-index: index.src.html
46
bikeshed --die-on=warning spec index.src.html index.html
57

6-
index.html: index.src.html
8+
local-codec-registry: codec_registry.src.html
9+
bikeshed --die-on=warning spec codec_registry.src.html codec_registry.html
10+
11+
local-avc-codec-registration: avc_codec_registration.src.html
12+
bikeshed --die-on=warning spec avc_codec_registration.src.html avc_codec_registration.html
13+
14+
remote-index: index.src.html
715
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
816
--output index.html \
917
--write-out "%{http_code}" \
@@ -16,14 +24,38 @@ index.html: index.src.html
1624
exit 22 \
1725
);
1826

19-
remote: index.html
27+
remote-codec-registry: codec_registry.src.html
28+
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
29+
--output codec_registry.html \
30+
--write-out "%{http_code}" \
31+
--header "Accept: text/plain, text/html" \
32+
-F die-on=warning \
33+
-F file=@codec_registry.src.html) && \
34+
[[ "$$HTTP_STATUS" -eq "200" ]]) || ( \
35+
echo ""; cat codec_registry.html; echo ""; \
36+
rm -f codec_registry.html; \
37+
exit 22 \
38+
);
39+
40+
remote-avc-codec-registration: avc_codec_registration.src.html
41+
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
42+
--output avc_codec_registration.html \
43+
--write-out "%{http_code}" \
44+
--header "Accept: text/plain, text/html" \
45+
-F die-on=warning \
46+
-F file=@avc_codec_registration.src.html) && \
47+
[[ "$$HTTP_STATUS" -eq "200" ]]) || ( \
48+
echo ""; cat avc_codec_registration.html; echo ""; \
49+
rm -f avc_codec_registration.html; \
50+
exit 22 \
51+
);
52+
53+
54+
remote: remote-index remote-codec-registry remote-avc-codec-registration
2055

21-
ci: index.src.html
56+
ci: index.src.html codec_registry.src.html avc_codec_registration.src.html
2257
mkdir -p out
2358
make remote
2459
mv index.html out/index.html
25-
26-
clean:
27-
rm index.html
28-
rm -rf out
29-
60+
mv codec_registry.html out/codec_registry.html
61+
mv avc_codec_registration.html out/avc_codec_registration.html

avc_codec_registration.src.html

+173
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
<pre class='metadata'>
2+
Title: AVC (H.264) WebCodecs Registration
3+
Repository: wicg/web-codecs
4+
Status: CG-DRAFT
5+
Shortname: webcodecs-avc-codec-registration
6+
Level: none
7+
Group: wicg
8+
ED: none
9+
Editor: Chris Cunningham, w3cid 114832, Google Inc. https://google.com/
10+
Editor: Paul Adenot, w3cid 62410, Mozilla https://www.mozilla.org/
11+
Editor: Bernard Aboba, w3cid 65611, Microsoft Corporation https://www.microsoft.com/
12+
Boilerplate: omit conformance
13+
14+
Abstract: This registration is entered into the [[webcodecs-codec-registry]].
15+
It describes, for AVC (H.264), the (1) fully qualified codec strings, (2)
16+
the {{VideoDecoderConfig.description}} bytes, and (3) the
17+
codec-specific extensions to the {{VideoEncoderConfig}}.
18+
19+
The registration is not intended to include any information on whether a
20+
codec format is encumbered by intellectual property claims. Implementers and
21+
authors are advised to seek appropriate legal counsel in this matter if they
22+
intend to implement or use a specific codec format. Implementers of
23+
WebCodecs are not required to support the AVC / H.264 codec.
24+
25+
This registration is non-normative.
26+
27+
Markup Shorthands:css no, markdown yes, dfn yes
28+
!Participate: <a href="https://github.com/wicg/web-codecs">Git Repository.</a>
29+
!Participate: <a href="https://github.com/wicg/web-codecs/issues/new">File an issue.</a>
30+
!Version History: <a href="https://github.com/wicg/web-codecs/commits">https://github.com/wicg/web-codecs/commits</a>
31+
</pre>
32+
33+
<pre class='anchors'>
34+
spec: webcodecs; urlPrefix: https://wicg.github.io/web-codecs/#
35+
type: attribute
36+
text: VideoDecoderConfig.description; url: dom-videodecoderconfig-description
37+
type: interface
38+
text: EncodedVideoChunk; url: encodedvideochunk
39+
text: VideoEncoder; url: videoencoder
40+
type: dictionary
41+
text: VideoEncoderConfig; url: dictdef-videoencoderconfig
42+
text: VideoDecoderConfig; url: dictdef-videodecoderconfig
43+
</pre>
44+
45+
<pre class='biblio'>
46+
{
47+
"WEBCODECS": {
48+
"href": "https://wicg.github.io/web-codecs/",
49+
"title": "WebCodecs",
50+
"publisher": "WICG"
51+
},
52+
"WEBCODECS-CODEC-REGISTRY": {
53+
"href": "https://wicg.github.io/web-codecs/codec_registry.html",
54+
"title": "WebCodecs Codec Registry",
55+
"publisher": "WICG"
56+
},
57+
"ITU-T-REC-H.264": {
58+
"href": "https://www.itu.int/rec/T-REC-H.264",
59+
"title": "H.264 : Advanced video coding for generic audiovisual services",
60+
"publisher": "ITU",
61+
"date": "June 2019"
62+
}
63+
}
64+
</pre>
65+
66+
Fully qualified codec strings {#fully-qualified-codec-strings}
67+
==============================================================
68+
69+
The codec string must begin with the prefix "avc1.", and contain a suffix of 6
70+
characters as described in Section 3.4 of [[rfc6381]].
71+
72+
NOTE: The common "avc3." prefix is intentionally not included. This prefix does
73+
not signal a material difference to decoder inputs, so it is omitted for
74+
simplification. For the purposes of this registration, authors should simply
75+
map "avc3." to "avc1.".
76+
77+
VideoDecoderConfig description {#videodecoderconfig-description}
78+
================================================================
79+
80+
A {{VideoDecoderConfig.description}} may or may not be required by the
81+
AVC codec depending on the bitstream format of the AVC content to be decoded.
82+
83+
If the {{VideoDecoderConfig.description}} includes an
84+
`AVCDecoderConfigurationRecord`, as defined by [[iso14496-15]], section
85+
5.3.3.1, it will be assumed that the bitstream is in "avc" format.
86+
87+
NOTE: This format is commonly used in .MP4 files, where the player generally
88+
has random access to the media data.
89+
90+
If the {{VideoDecoderConfig.description}} is not provided, it will be
91+
assumed that the bitstream is in “annexb” format.
92+
93+
NOTE: "annexb" format is described in greater detail by [[ITU-T-REC-H.264]],
94+
Annex B. This format is commonly used in live-streaming applications, where
95+
including the SPS and PPS data periodically allows users to easily start
96+
from the middle of the stream.
97+
98+
VideoEncoderConfig extensions {#videoencoderconfig-extensions}
99+
==============================================================
100+
101+
<pre class='idl'>
102+
<xmp>
103+
partial dictionary VideoEncoderConfig {
104+
AvcEncoderConfig avc;
105+
};
106+
</xmp>
107+
</pre>
108+
109+
<dl>
110+
<dt><dfn dict-member for=VideoEncoderConfig>avc</dfn></dt>
111+
<dd>
112+
Contains codec specific configuration options for the AVC (H.264) codec.
113+
</dd>
114+
</dl>
115+
116+
AvcEncoderConfig {#avc-encoder-config}
117+
--------------------------------------
118+
<pre class='idl'>
119+
<xmp>
120+
dictionary AvcEncoderConfig {
121+
AvcBitstreamFormat format = "avc";
122+
};
123+
</xmp>
124+
</pre>
125+
126+
<dl>
127+
<dt><dfn dict-member for=AvcEncoderConfig>format</dfn></dt>
128+
<dd>
129+
Configures the format of output {{EncodedVideoChunk}}s. See
130+
{{AvcBitstreamFormat}}.
131+
</dd>
132+
</dl>
133+
134+
AvcBitstreamFormat {#avc-bitstream-format}
135+
------------------------------------------
136+
<pre class='idl'>
137+
<xmp>
138+
enum AvcBitstreamFormat {
139+
"annexb",
140+
"avc",
141+
};
142+
</xmp>
143+
</pre>
144+
145+
The {{AvcBitstreamFormat}} determines the location of AVC Sequence Parameter
146+
Set (SPS) and Picture Parameter Set (PPS) data, and mechanisms for packaging
147+
the bitstream.
148+
149+
SPS and PPS are described in greater detail in sections G.3.41 and G.3.55 of
150+
[[ITU-T-REC-H.264]].
151+
152+
<dl>
153+
<dt><dfn enum-value for=AvcBitstreamFormat>annexb</dfn></dt>
154+
<dd>
155+
SPS and PPS data are included periodically throughout the bitstream.
156+
157+
NOTE: This format is described in greater detail by [[ITU-T-REC-H.264]],
158+
Annex B. This format is commonly used in live-streaming applications,
159+
where including the SPS and PPS data periodically allows users to easily
160+
start from the middle of the stream.
161+
</dd>
162+
<dt><dfn enum-value for=AvcBitstreamFormat>avc</dfn></dt>
163+
<dd>
164+
SPS and PPS data are not included in the bitstream and are instead emitted
165+
via the {{VideoEncoder}} [[output callback]] as the
166+
{{VideoDecoderConfig.description}} of the
167+
{{VideoDecoderConfig}}.
168+
<var ignore=''>output_config</var>.
169+
170+
NOTE: This format is described in greater detail by [[iso14496-15]],
171+
section 5.3.3.1. This format is commonly used in .MP4 files, where the
172+
player generally has random access to the media data.
173+
</dl>

0 commit comments

Comments
 (0)