Skip to content

Commit

Permalink
Merge pull request #149 from WICG/establish_codec_registry
Browse files Browse the repository at this point in the history
Establish codec registry and AVC registration.
  • Loading branch information
chcunningham authored Mar 24, 2021
2 parents 57e2560 + 49baae7 commit cf0784b
Show file tree
Hide file tree
Showing 5 changed files with 455 additions and 158 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
out/
index.html
avc_codec_registration.html
codec_registry.html
deploy_key
deploy_key.pub
index.html
out/

50 changes: 41 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
SHELL=/bin/bash

local: index.src.html
local: local-index local-codec-registry local-avc-codec-registration

local-index: index.src.html
bikeshed --die-on=warning spec index.src.html index.html

index.html: index.src.html
local-codec-registry: codec_registry.src.html
bikeshed --die-on=warning spec codec_registry.src.html codec_registry.html

local-avc-codec-registration: avc_codec_registration.src.html
bikeshed --die-on=warning spec avc_codec_registration.src.html avc_codec_registration.html

remote-index: index.src.html
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
--output index.html \
--write-out "%{http_code}" \
Expand All @@ -16,14 +24,38 @@ index.html: index.src.html
exit 22 \
);

remote: index.html
remote-codec-registry: codec_registry.src.html
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
--output codec_registry.html \
--write-out "%{http_code}" \
--header "Accept: text/plain, text/html" \
-F die-on=warning \
-F file=@codec_registry.src.html) && \
[[ "$$HTTP_STATUS" -eq "200" ]]) || ( \
echo ""; cat codec_registry.html; echo ""; \
rm -f codec_registry.html; \
exit 22 \
);

remote-avc-codec-registration: avc_codec_registration.src.html
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
--output avc_codec_registration.html \
--write-out "%{http_code}" \
--header "Accept: text/plain, text/html" \
-F die-on=warning \
-F file=@avc_codec_registration.src.html) && \
[[ "$$HTTP_STATUS" -eq "200" ]]) || ( \
echo ""; cat avc_codec_registration.html; echo ""; \
rm -f avc_codec_registration.html; \
exit 22 \
);


remote: remote-index remote-codec-registry remote-avc-codec-registration

ci: index.src.html
ci: index.src.html codec_registry.src.html avc_codec_registration.src.html
mkdir -p out
make remote
mv index.html out/index.html

clean:
rm index.html
rm -rf out

mv codec_registry.html out/codec_registry.html
mv avc_codec_registration.html out/avc_codec_registration.html
173 changes: 173 additions & 0 deletions avc_codec_registration.src.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<pre class='metadata'>
Title: AVC (H.264) WebCodecs Registration
Repository: wicg/web-codecs
Status: CG-DRAFT
Shortname: webcodecs-avc-codec-registration
Level: none
Group: wicg
ED: none
Editor: Chris Cunningham, w3cid 114832, Google Inc. https://google.com/
Editor: Paul Adenot, w3cid 62410, Mozilla https://www.mozilla.org/
Editor: Bernard Aboba, w3cid 65611, Microsoft Corporation https://www.microsoft.com/
Boilerplate: omit conformance

Abstract: This registration is entered into the [[webcodecs-codec-registry]].
It describes, for AVC (H.264), the (1) fully qualified codec strings, (2)
the {{VideoDecoderConfig.description}} bytes, and (3) the
codec-specific extensions to the {{VideoEncoderConfig}}.

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/wicg/web-codecs">Git Repository.</a>
!Participate: <a href="https://github.com/wicg/web-codecs/issues/new">File an issue.</a>
!Version History: <a href="https://github.com/wicg/web-codecs/commits">https://github.com/wicg/web-codecs/commits</a>
</pre>

<pre class='anchors'>
spec: webcodecs; urlPrefix: https://wicg.github.io/web-codecs/#
type: attribute
text: VideoDecoderConfig.description; url: dom-videodecoderconfig-description
type: interface
text: EncodedVideoChunk; url: encodedvideochunk
text: VideoEncoder; url: videoencoder
type: dictionary
text: VideoEncoderConfig; url: dictdef-videoencoderconfig
text: VideoDecoderConfig; url: dictdef-videodecoderconfig
</pre>

<pre class='biblio'>
{
"WEBCODECS": {
"href": "https://wicg.github.io/web-codecs/",
"title": "WebCodecs",
"publisher": "WICG"
},
"WEBCODECS-CODEC-REGISTRY": {
"href": "https://wicg.github.io/web-codecs/codec_registry.html",
"title": "WebCodecs Codec Registry",
"publisher": "WICG"
},
"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"
}
}
</pre>

Fully qualified codec strings {#fully-qualified-codec-strings}
==============================================================

The codec string must begin with the prefix "avc1.", and contain a suffix of 6
characters as described in Section 3.4 of [[rfc6381]].

NOTE: The common "avc3." prefix is intentionally not included. This prefix does
not signal a material difference to decoder inputs, so it is omitted for
simplification. For the purposes of this registration, authors should simply
map "avc3." to "avc1.".

VideoDecoderConfig description {#videodecoderconfig-description}
================================================================

A {{VideoDecoderConfig.description}} may or may not be required by the
AVC codec depending on the bitstream format of the AVC content to be decoded.

If the {{VideoDecoderConfig.description}} includes an
`AVCDecoderConfigurationRecord`, as defined by [[iso14496-15]], section
5.3.3.1, it will be assumed that the bitstream is in "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 provided, it will be
assumed that the bitstream is in “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.

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 Sequence Parameter
Set (SPS) and Picture Parameter Set (PPS) data, and mechanisms for packaging
the bitstream.

SPS and PPS are described in greater detail in sections G.3.41 and G.3.55 of
[[ITU-T-REC-H.264]].

<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}} of the
{{VideoDecoderConfig}}.
<var ignore=''>output_config</var>.

NOTE: This format is described in greater detail by [[iso14496-15]],
section 5.3.3.1. This format is commonly used in .MP4 files, where the
player generally has random access to the media data.
</dl>
Loading

0 comments on commit cf0784b

Please sign in to comment.