This specification defines a [[MEDIA-SOURCE]] byte stream format specification based on the WebM container format.

The working group maintains a list of all bug reports that the editors have not yet tried to address; there may also be related open bugs in the [[MEDIA-SOURCE]] repository.

Implementors should be aware that this specification is not stable. Implementors who are not taking part in the discussions are likely to find the specification changing out from under them in incompatible ways. Vendors interested in implementing this specification before it eventually reaches the Candidate Recommendation stage should track the GitHub repository and take part in the discussions.

Introduction

This specification describes a byte stream format based on the WebM container format [[!WEBM]]. It defines the MIME-type parameters used to signal codecs, and provides the necessary format specific definitions for , , and required by the of [[!MEDIA-SOURCE]].

MIME-type parameters

This section specifies the parameters that can be used in the MIME-type passed to or .

codecs
A comma separated list of codec IDs used to specify what codecs will be used in the byte stream.
Codec ID Valid with "audio/webm" Valid with "video/webm"
vorbis true true
opus true true
vp8 false true
vp9 false true
vp09... as described in the VP Codec ISO Media File Format Binding document [[VP09CODECSPARAMETERSTRING]] false true
Implementations SHOULD support all of the codec IDs mentioned in the table above.
Implementations SHOULD encourage applications to prefer the "vp09..." codec ID over "vp9". The "vp09..." format provides detailed profile and color information, enabling implementations to give more accurate answers for codec support.

Examples of valid MIME-types with a codecs parameter.

  • audio/webm;codecs="vorbis"
  • video/webm;codecs="vorbis"
  • video/webm;codecs="vp8"
  • video/webm;codecs="vp8,vorbis"
  • video/webm;codecs="vp9,opus"
  • video/webm;codecs="vp09.00.10.08"
  • video/webm;codecs="vp09.02.10.10.01.09.16.09.01,opus"

Initialization Segments

A WebM MUST contain a subset of the elements at the start of a typical WebM file.

The user agent MUST run the if any of the following conditions are not met:

  1. The MUST start with an element, followed by a header.
  2. The size value in the header MUST signal an "unknown size" or contain a value large enough to include the and elements that follow.
  3. A element and a element MUST appear, in that order, after the header and before any further or elements.

The user agent MUST accept and ignore any elements other than an or a that occur before, in between, or after the and elements.

The user agent MUST source attribute values for id, kind, label and language for , and objects as described for WebM in the in-band tracks spec [[INBANDTRACKS]].

Media Segments

A WebM is a single element.

The user agent uses the following rules when interpreting content in a :

  1. The TimecodeScale in the most recently appended applies to all timestamps in the
  2. The Timecode element in the contains a in TimecodeScale units.
  3. The Cluster header MAY contain an "unknown" size value. If it does then the end of the cluster is reached when another header or an element header that indicates the start of an is encountered.

The user agent MUST run the if any of the following conditions are not met:

  1. The Timecode element MUST appear before any Block & SimpleBlock elements in a .
  2. Block & SimpleBlock elements are in time increasing order consistent with the .
  3. If the most recent describes multiple tracks, then blocks from all the tracks MUST be interleaved in time increasing order. At least one block from all audio and video tracks MUST be present.

The user agent MUST accept and ignore or elements that follow a element.

Random Access Points

Either a SimpleBlock element with its Keyframe flag set, or a BlockGroup element having no ReferenceBlock elements, signals the location of a for that track. The order of multiplexed blocks within a MUST conform to the .

Acknowledgments

The editors would like to thank for their contributions to this specification.