Opus WebCodecs Registration

Editor’s Draft,

More details about this document
This version:
https://w3c.github.io/webcodecs/opus_codec_registration.html
Latest published version:
https://www.w3.org/TR/webcodecs-opus-codec-registration/
Feedback:
GitHub
Editors:
Chris Cunningham (Google Inc.)
Paul Adenot (Mozilla)
Bernard Aboba (Microsoft Corporation)
Participate:
Git Repository.
File an issue.
Version History:
https://github.com/w3c/webcodecs/commits

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 [[internal data]] bytes, (3) the AudioDecoderConfig.description bytes, (4) the values of 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.

Status of this document

This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.

Feedback and comments on this specification are welcome. GitHub Issues are preferred for discussion on this specification. Alternatively, you can send comments to the Media Working Group’s mailing-list, public-media-wg@w3.org (archives). This draft highlights some of the pending issues that are still to be discussed in the working group. No decision has been taken on the outcome of these issues including whether they are valid.

This document was published by the Media Working Group as an Editor’s Draft. The group does not expect this document to become a W3C Recommendation.

Publication as an Editor’s Draft does not imply endorsement by W3C and its Members.

The W3C Patent Policy does not carry any licensing requirements or commitments on this document.

This document is governed by the 2 November 2021 W3C Process Document.

1. Fully qualified codec strings

The codec string is "opus".

2. EncodedAudioChunk data

An EncodedAudioChunk containing Opus can be in two different formats.

If the bitstream is in opus format, EncodedAudioChunk have to be Opus packets, as described in section 3 of [OPUS]

If the bitstream is in ogg format, EncodedAudioChunk have to be audio data packets, as described in section 3 of [OPUS-IN-OGG].

3. 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 ogg format.

If an AudioDecoderConfig.description has not been set, the bitstream is assumed to be in opus format.

4. EncodedAudioChunk type

The [[type]] for an EncodedAudioChunk containing Opus is always "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.

5. AudiEncoderConfig extensions

partial dictionary AudioEncoderConfig {
  OpusEncoderConfig opus;
};

opus, of type OpusEncoderConfig b
Contains codec specific configuration options for the Opus codec.

5.1. OpusEncoderConfig

dictionary OpusEncoderConfig {
  OpusBitstreamFormat format = "opus";
};

format, of type OpusBitstreamFormat, defaulting to "opus"
Configures the format of output EncodedAudioChunks. See OpusBitstreamFormat.

5.2. OpusBitstreamFormat

enum OpusBitstreamFormat {
  "opus",
  "ogg",
};

The OpusBitstreamFormat determines if extra-data are necessary to decode the encoded audio stream.

opus
No metadata are necessary to decode the encoded audio stream.
ogg
The metadata of the encoded audio stream are provided at configuration via AudioDecoderConfig.description.

6. Privacy and Security Considerations

Please refer to the Privacy Considerations and Security Considerations sections in [WEBCODECS].

Conformance

Document conventions

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

Examples in this specification are introduced with the words “for example” or are set apart from the normative text with class="example", like this:

This is an example of an informative example.

Informative notes begin with the word “Note” and are set apart from the normative text with class="note", like this:

Note, this is an informative note.

Conformant Algorithms

Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or "return false and abort these steps") are to be interpreted with the meaning of the key word ("must", "should", "may", etc) used in introducing the algorithm.

Conformance requirements phrased as algorithms or specific steps can be implemented in any manner, so long as the end result is equivalent. In particular, the algorithms defined in this specification are intended to be easy to understand and are not intended to be performant. Implementers are encouraged to optimize.

Index

Terms defined by this specification

Terms defined by reference

References

Normative References

[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119
[WEBCODECS]
Chris Cunningham; Paul Adenot; Bernard Aboba. WebCodecs. 16 December 2021. WD. URL: https://www.w3.org/TR/webcodecs/

Informative References

[OPUS]
RFC 6716: Definition of the Opus Audio Codec. September 2012. URL: https://datatracker.ietf.org/doc/html/rfc6716
[OPUS-IN-OGG]
RFC 7845: Ogg Encapsulation for the Opus Audio Codec. April 2016. URL: https://datatracker.ietf.org/doc/html/rfc7845
[WEBCODECS-CODEC-REGISTRY]
Chris Cunningham; Paul Adenot; Bernard Aboba. WebCodecs Codec Registry. 16 December 2021. NOTE. URL: https://www.w3.org/TR/webcodecs-codec-registry/

IDL Index

partial dictionary AudioEncoderConfig {
  OpusEncoderConfig opus;
};


dictionary OpusEncoderConfig {
  OpusBitstreamFormat format = "opus";
};


enum OpusBitstreamFormat {
  "opus",
  "ogg",
};