Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C liability, trademark and document use rules apply.
This specification defines a Media Source Extensions byte stream format specification based on MPEG-2 Transport Streams.
This document was published by the HTML Working Group. If you wish to make comments regarding this document, please send them to public-html-media@w3.org (subscribe, archives). All comments are welcome.
This specification defines segment formats for implementations that choose to support MPEG-2 Transport Streams (MPEG-2 TS) specified in ISO/IEC 13818-1.
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. This document also defines extra behaviors and state that only apply to this byte stream format.The MIME-type/subtype pair of "video/MP2T", as specified in RFC 3551, must be used for byte streams that conform to this specification.
This following parameters can be used in the MIME-type passed to isTypeSupported()
or addSourceBuffer()
.
MPEG-2 TS media and initialization segments must conform to the MPEG-2 TS Adaptive Profile (ISO/IEC 13818-1:2012 Amd. 2).
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:
An MPEG-2 TS initialization segment consists of a single PAT and a single PMT.
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:
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:
A random access point as defined in this specification corresponds to Elementary Stream Random Access Point as defined in ISO/IEC 13818-1.
Timestamp rollovers and discontinuities must be handled by the UA. The UA's MPEG-2 TS implementation must maintain an internal offset
variable, MPEG2TS_timestampOffset, to keep track of the offset that needs to be applied to timestamps
that have rolled over or are part of a discontinuity. MPEG2TS_timestampOffset is initially set to 0 when the SourceBuffer
is
created. This offset must be applied to the timestamps as part of the conversion process from MPEG-2 TS packets
into coded frames for the coded frame processing algorithm. This results in the coded frame timestamps
for a packet being computed by the following equations:
Coded Frame Presentation Timestamp = (MPEG-2 TS presentation timestamp) + MPEG2TS_timestampOffset Coded Frame Decode Timestamp = (MPEG-2 TS decode timestamp) + MPEG2TS_timestampOffset
MPEG2TS_timestampOffset is updated in the following ways:
abort()
is called, MPEG2TS_timestampOffset must be set to 0.timestampOffset
is successfully set, MPEG2TS_timestampOffset must be set to 0.