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 GitHub repository of the [[[MEDIA-SOURCE]]] specification.
This specification defines segment formats for implementations of [[[MEDIA-SOURCE]]] [[MEDIA-SOURCE]] that choose to support MPEG-2 Transport Streams [[MPEG2TS]].
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]]] specification. 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 [[RFC3551]], MUST be used for byte streams that conform to this specification.
The following parameter can be used in the MIME-type passed to {{MediaSource/isTypeSupported()}} or {{MediaSource/addSourceBuffer()}}.
MPEG-2 TS [=media segments=] and [=initialization segments=] MUST conform to the MPEG-2 TS Adaptive Profile [[MPEG2TS]].
The user agent MUST run the [=append error=] algorithm 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 [=append error=] algorithm if any of the following conditions are met:
The user agent MUST accept and ignore other SI, such as CAT, that are invariant for all subsequent [=media segments=].
The user agent MUST source attribute values for `id`, `kind`, `label` and `language` for {{AudioTrack}}, {{VideoTrack}} and {{TextTrack}} objects as described for MPEG-2 Transport Streams in the in-band tracks spec [[INBANDTRACKS]].
The user agent MUST run the [=append error=] algorithm 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 [[MPEG2TS]].
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: