This specification defines a [[MEDIA-SOURCE]] byte stream format specification based on MPEG audio streams.

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 defines segment formats for implementations of [[!MEDIA-SOURCE]] that choose to support MPEG audio streams specified in [[!ISO11172-3]], [[!ISO13818-3]], and [[!ISO14496-3]].

It defines the used to signal codecs, and provides the necessary format specific definitions for , , and required by the of the Media Source Extensions spec. It also defines extra behaviors and state that only apply to this byte stream format.

MIME-types

This section specifies the MIME-types that may be passed to or for byte streams that conform to this specification.

The "codecs" MIME-type parameter MUST NOT be used with these MIME-types.

MPEG Audio Frames

The format of an MPEG Audio Frame depends on the used.

Metadata Frames

Since , metadata frames, and Icecast headers are common in existing MPEG audio streams, implementations SHOULD gracefully handle such frames. Zero or more of these metadata frames are allowed to occur before, after, or between MPEG Audio Frame. Minimal implementations MUST accept, consume, and ignore these frames. More advanced implementations MAY choose to expose the metadata information via an inband or some other mechanism.

Icecast headers

There is no normative spec for Icecast/SHOUTcast headers, just examples. For the purpose of this specification, an Icecast header is defined as beginning with the 4 character sequence "ICY "(U+0049 I, U+0043 C, U+0059 Y, U+0020 SPACE) and ending with a pair of carriage-return line-feed sequences (U+000D CARRIAGE RETURN, U+000A LINE FEED, U+000D CARRIAGE RETURN, U+000A LINE FEED).

Icecast headers are allowed in the byte streams because some Icecast and SHOUTcast servers return a status line that looks like "ICY OK 200" instead of a standard HTTP status line. User-agent network stacks typically interpret this as an HTTP 0.9 response and include the header in the response body. Allowing these headers to appear provides a simple way to interoperate with these servers.

Segment Definitions

The MPEG audio byte stream is a combination of one or more MPEG Audio Frame and zero or more .