Abstract

This specification defines a Media Source Extensions byte stream format specification based on the ISO Base Media File Format.

Status of This Document

This document is merely a W3C-internal document. It has no official standing of any kind and does not represent consensus of the W3C Membership.

Table of Contents

1. Introduction

This specification defines segment formats for implementations that choose to support the ISO Base Media File Format ISO/IEC 14496-12 (ISO BMFF).

It defines the MIME-type parameters used to signal codecs, and provides the necessary format specific definitions for initialization segments, media segments, and random access points required by the byte stream formats section of the Media Source Extensions spec.

2. MIME-type parameters

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

MIME-types for this specification must conform to the rules outlined for "audio/mp4" and "video/mp4" in RFC 6381.

Note
Implementations may only implement a subset of the codecs and profiles mentioned in the RFC.

3. Initialization Segments

An ISO BMFF initialization segment is defined in this specification as a single File Type Box (ftyp) followed by a single Movie Header Box (moov).

The user agent must run the end of stream algorithm with the error parameter set to "decode" if any of the following conditions are met:

  1. A File Type Box contains a major_brand or compatible_brand that the user agent does not support.
  2. A box or field in the Movie Header Box is encountered that violates the requirements mandated by the major_brand or one of the compatible_brands in the File Type Box.
  3. The tracks in the Movie Header Box contain samples (i.e. the entry_count in the stts, stsc or stco boxes are not set to zero).
  4. A Movie Extends (mvex) box is not contained in the Movie (moov) box to indicate that Movie Fragments are to be expected.

The user agent must support setting the offset from media composition time to movie presentation time by handling an Edit Box (edts) containing a single Edit List Box (elst) that contains a single edit with media rate one. This edit may have a duration of 0 (indicating that it spans all subsequent media) or may have a non-zero duration (indicating the total duration of the movie including fragments).

The user agent must support parameter sets (e.g., PPS/SPS) stored in the sample entry (as defined for avc1/avc2), and should support parameter sets stored inband in the samples themselves (as defined for avc3/avc4).

Note

For maximum content interoperability, user agents are strongly advised to support both inband and out-of-band storage of the SPS and PPS.

Valid top-level boxes such as pdin, free, and sidx are allowed to appear before the moov box. These boxes must be accepted and ignored by the user agent and are not considered part of the initialization segment in this specification.

4. Media Segments

An ISO BMFF media segment is defined in this specification as one optional Segment Type Box (styp) followed by a single Movie Fragment Box (moof) followed by one or more Media Data Boxes (mdat). If the Segment Type Box is not present, the segment must conform to the brands listed in the File Type Box (ftyp) in the initialization segment.

Valid top-level boxes defined in ISO/IEC 14496-12 other than ftyp, moov, styp, moof, and mdat are allowed to appear between the end of an initialization segment or media segment and before the beginning of a new media segment. These boxes must be accepted and ignored by the user agent and are not considered part of the media segment in this specification.

The user agent must run the end of stream algorithm with the error parameter set to "decode" if any of the following conditions are met:

  1. A box or field in the Movie Fragment Box is encountered that violates the requirements mandated by the major_brand or one of the compatible_brands in the Segment Type Box in this media segment or the File Type Box in the initialization segment if a Segment Type Box is not present.
  2. This media segment contains a Segment Type Box that is not compatible with the File Type Box in the initialization segment.
  3. The Movie Fragment Box does not contain at least one Track Fragment Box (traf).
  4. The Movie Fragment Box does not use movie-fragment relative addressing.
  5. External data references are being used.
  6. At least one Track Fragment Box does not contain a Track Fragment Decode Time Box (tfdt)
  7. The Media Data Boxes do not contain all the samples referenced by the Track Fragment Run Boxes (trun) of the Movie Fragment Box.
  8. Inband parameter sets are not present in the appropriate samples and parameter sets are not present in the last initialization segment appended.

A Movie Fragment Box uses movie-fragment relative addressing when the first Track Fragment Run(trun) box in each Track Fragment Box has the data-offset-present flag set and either of the following conditions are met:

5. Random Access Points

A random access point as defined in this specification corresponds to a Stream Access Point of type 1 or 2 as defined in Annex I of ISO/IEC 14496-12.

6. Acknowledgments

The editors would like to thank Chris Poole, Cyril Concolato, David Singer, Jer Noble, Jerry Smith, Joe Steele, John Simmons, Kevin Streeter, Michael Thornburgh, and Steven Robertson for their contributions to this specification.

7. Revision History

Version Comment
20 June 2014
  • Bug 26066 - Clarify edit list requirements.
03 March 2014
  • Bug 24903 - Add ftyp & styp validation text.
  • Bug 24345 - Loosen restrictions and clarify what relative addressing means.
02 December 2013 Initial CR version.