forked from w3c/webcodecs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
opus_codec_registration.src.html
182 lines (149 loc) · 6.32 KB
/
opus_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
<pre class='metadata'>
Title: Opus WebCodecs Registration
Repository: w3c/webcodecs
Status: NOTE-ED
Shortname: webcodecs-opus-codec-registration
Level: none
Group: mediawg
ED: https://w3c.github.io/webcodecs/opus_codec_registration.html
TR: https://www.w3.org/TR/webcodecs-opus-codec-registration/
Editor: Chris Cunningham, w3cid 114832, Google Inc. https://www.google.com/
Editor: Paul Adenot, w3cid 62410, Mozilla https://www.mozilla.org/
Editor: Bernard Aboba, w3cid 65611, Microsoft Corporation https://www.microsoft.com/
Abstract: This registration is entered into the [[webcodecs-codec-registry]].
It describes, for Opus, the (1) fully qualified codec strings, (2) the
codec-specific {{EncodedAudioChunk}} [=EncodedAudioChunk/[[internal data]]=]
bytes, (3) the {{AudioDecoderConfig.description}} bytes, (4) the values of
{{EncodedAudioChunk}} [=EncodedAudioChunk/[[type]]=], and (5) the
codec-specific extensions to {{AudioEncoderConfig}}
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 Opus 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='anchors'>
spec: WEBCODECS; urlPrefix: https://w3c.github.io/webcodecs/#
type: attribute
text: AudioDecoderConfig.description; url: dom-audiodecoderconfig-description
type: dfn
for: EncodedAudioChunkType; text: key; url: dom-encodedaudiochunktype-key
for: EncodedAudioChunk; text: [[internal data]]; url: dom-encodedaudiochunk-internal-data-slot
for: EncodedAudioChunk; text: [[type]]; url: dom-encodedaudiochunk-type-slot
type: method
for: AudioDecoder; text: AudioDecoder.decode; url: dom-audiodecoder-decode
type: interface
text: EncodedAudioChunk; url: encodedaudiochunk
type: dictionary
text: AudioDecoderConfig; url: dictdef-audiodecoderconfig
text: AudioEncoderConfig; url: dictdef-audioencoderconfig
</pre>
<pre class='biblio'>
{
"OPUS": {
"href": "https://datatracker.ietf.org/doc/html/rfc6716",
"title": "RFC 6716: Definition of the Opus Audio Codec",
"publisher": "IETF",
"date": "September 2012"
},
"OPUS-IN-OGG": {
"href": "https://datatracker.ietf.org/doc/html/rfc7845",
"title": "RFC 7845: Ogg Encapsulation for the Opus Audio Codec",
"publisher": "IETF",
"date": "April 2016"
}
}
</pre>
Fully qualified codec strings {#fully-qualified-codec-strings}
==============================================================
The codec string is `"opus"`.
EncodedAudioChunk data {#encodedaudiochunk-data}
================================================
An {{EncodedAudioChunk}} containing Opus can be in two different formats.
If the bitstream is in {{OpusBitstreamFormat/opus}} format,
{{EncodedAudioChunk}} have to be Opus packets, as described in [section
3](https://datatracker.ietf.org/doc/html/rfc6716#section-3) of [[OPUS]]
If the bitstream is in {{OpusBitstreamFormat/ogg}} format,
{{EncodedAudioChunk}} have to be audio data packets, as described in [section
3](https://datatracker.ietf.org/doc/html/rfc7845#section-3) of [[OPUS-IN-OGG]].
AudioDecoderConfig description {#audiodecoderconfig-description}
================================================================
{{AudioDecoderConfig.description}} can optionally set to an Identification
Header, described in section 5.1 of [[OPUS-IN-OGG]].
If an {{AudioDecoderConfig.description}} has been set, the bistream is assumed
to be in {{OpusBitstreamFormat/ogg}} format.
If an {{AudioDecoderConfig.description}} has not been set, the bitstream is
assumed to be in {{OpusBitstreamFormat/opus}} format.
EncodedAudioChunk type {#encodedaudiochunk-type}
================================================
The [=EncodedAudioChunk/[[type]]=] for an {{EncodedAudioChunk}} containing
Opus is always "[=EncodedAudioChunkType/key=]".
NOTE: Once the initialization has succeeded, any packet can be decoded at any
time without error, but this might not result in the expected audio output.
AudiEncoderConfig extensions {#audioencoderconfig-extensions}
=============================================================
<pre class='idl'>
<xmp>
partial dictionary AudioEncoderConfig {
OpusEncoderConfig opus;
};
</xmp>
</pre>
<dl>
<dt><dfn dict-member for=AudioEncoderConfig>opus</dfn></dt>
<dd>
Contains codec specific configuration options for the Opus codec.
</dd>
</dl>
OpusEncoderConfig {#opus-encoder-config}
--------------------------------------
<pre class='idl'>
<xmp>
dictionary OpusEncoderConfig {
OpusBitstreamFormat format = "opus";
};
</xmp>
</pre>
<dl>
<dt><dfn dict-member for=OpusEncoderConfig>format</dfn></dt>
<dd>
Configures the format of output {{EncodedAudioChunk}}s. See
{{OpusBitstreamFormat}}.
</dd>
</dl>
OpusBitstreamFormat {#opus-bitstream-format}
------------------------------------------
<pre class='idl'>
<xmp>
enum OpusBitstreamFormat {
"opus",
"ogg",
};
</xmp>
</pre>
The {{OpusBitstreamFormat}} determines if extra-data are necessary to decode the
encoded audio stream.
<dl>
<dt><dfn enum-value for=OpusBitstreamFormat>opus</dfn></dt>
<dd>
No metadata are necessary to decode the encoded audio stream.
</dd>
<dt><dfn enum-value for=OpusBitstreamFormat>ogg</dfn></dt>
<dd>
The metadata of the encoded audio stream are provided at configuration via
{{AudioDecoderConfig.description}}.
</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]].