-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
180 lines (159 loc) · 8.41 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>MPEG-2 TS Byte Stream Format</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
<script class="remove">
var respecConfig = {
// specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.
specStatus: "ED",
// the specification's short name, as in https://www.w3.org/TR/short-name/
shortName: "mse-byte-stream-format-mp2t",
// if there a publicly available Editor's Draft, this is the link
edDraftURI: "https://w3c.github.io/mse-byte-stream-format-mp2t/",
// editors, add as many as you like
// only "name" is required
editors: [
{
name: "Mark Watson",
company: "Netflix Inc.",
companyURL: "https://www.netflix.com/",
w3cid: "46379"
}
],
formerEditors: [
{
name: "Matthew Wolenetz",
mailto: "matt.wolenetz@gmail.com",
note: "Until February 2024",
company: "W3C Invited Expert",
w3cid: "148095"
},
{
name: "Jerry Smith",
note: "Until September 2017",
company: "Microsoft Corporation",
companyURL: "https://www.microsoft.com/"
},
{
name: "Aaron Colwell",
note: "Until April 2015",
company: "Google Inc.",
companyURL: "https://www.google.com/"
},
{
name: "Adrian Bateman",
note: "Until April 2015",
company: "Microsoft Corporation",
companyURL: "https://www.microsoft.com/"
}
],
// name of the WG
group: "media",
github: "w3c/mse-byte-stream-format-mp2t",
wgPublicList: "public-media-wg",
xref: ["html" ,"media-source"]
};
</script>
</head>
<body>
<section id="abstract">
This specification defines a [[[MEDIA-SOURCE]]] [[MEDIA-SOURCE]] byte stream format specification based on MPEG-2 Transport Streams [[MPEG2TS]].
</section>
<section id="sotd">
<p>The working group maintains <a href="https://github.com/w3c/mse-byte-stream-format-mp2t/issues">a list of all bug reports that the editors have not yet tried to address</a>;
there may also be related open bugs in the <a href="https://github.com/w3c/media-source">GitHub repository</a> of the [[[MEDIA-SOURCE]]] specification.</p>
</section>
<section id="introduction">
<h2>Introduction</h2>
<p>This specification defines segment formats for implementations of [[[MEDIA-SOURCE]]] [[MEDIA-SOURCE]] that choose to support MPEG-2 Transport Streams [[MPEG2TS]].</p>
<p>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 <a data-cite="media-source#byte-stream-formats">Byte Stream Formats section</a> of the [[[MEDIA-SOURCE]]] specification. This document also defines extra behaviors and state that only apply to this byte stream format.</p>
</section>
<section id="mime-parameters">
<h2>MIME-type info</h2>
<p>The MIME-type/subtype pair of "video/MP2T", as specified in [[RFC3551]], MUST be used for byte streams that conform
to this specification.</p>
<p>The following parameter can be used in the MIME-type passed to {{MediaSource/isTypeSupported()}} or {{MediaSource/addSourceBuffer()}}.</p>
<dl>
<dt>codecs</dt>
<dd>
A comma separated list of codec IDs used to specify what codecs will be used in the byte stream. Implementations SHOULD accept IDs in the form specified by [[RFC6381]].
<div class="note">Implementations MAY only implement a subset of the codecs and profiles mentioned in the RFC.</div>
</dd>
</dl>
</section>
<section id="mpeg2ts-general">
<h4>General Transport Stream Requirements</h4>
<p>MPEG-2 TS [=media segments=] and [=initialization segments=] MUST conform to the MPEG-2 TS Adaptive Profile [[MPEG2TS]].</p>
<p>The user agent MUST run the [=append error=] algorithm if any of the following conditions are met:</p>
<ol>
<li>Segments do not contain complete MPEG-2 TS packets.</li>
<li>Segments do not contain complete PES packets and sections.</li>
<li>Segments contain more than one program.</li>
<li>At least one MPEG-2 TS packet has a non-zero transport_error_indicator.</li>
</ol>
</section>
<section id="mpeg2ts-init-segments">
<h4>Initialization Segments</h4>
<p>An MPEG-2 TS [=initialization segment=] consists of a single PAT and a single PMT.</p>
<p>The user agent MUST run the [=append error=] algorithm if any of the following conditions are met:</p>
<ol>
<li>A PAT is not present in the [=initialization segment=]</li>
<li>A PMT is not present in the [=initialization segment=]</li>
</ol>
<p>The user agent MUST accept and ignore other SI, such as CAT, that are invariant for all subsequent [=media segments=].</p>
<p>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]].</p>
</section>
<section id="mpeg2ts-media-segments">
<h4>Media Segments</h4>
<p>The user agent MUST run the [=append error=] algorithm if any of the following conditions are met:</p>
<ol>
<li>A [=media segment=] relies on initialization information in another [=media segment=].</li>
<li>At least one PES packet does not have a PTS timestamp.</li>
<li>PCR is not present in the Segment prior to the first byte of a TS packet payload containing media data.</li>
</ol>
The user agent will accept and ignore PSI that is identical to the information in the last [=initialization segment=] which may appear repeatedly throughout the segment.
</section>
<section id="mpeg2ts-random-access-points">
<h4>Random Access Points</h4>
<p>A [=random access point=] as defined in this specification corresponds to Elementary Stream Random Access Point as defined in
[[MPEG2TS]].</p>
</section>
<section id="mpeg2ts-discontinuities">
<h4>Timestamp Rollover & Discontinuities</h4>
<p>Timestamp rollovers and discontinuities MUST be handled by the UA. The UA's MPEG-2 TS implementation MUST maintain an internal offset
variable, <dfn>MPEG2TS_timestampOffset</dfn>, to keep track of the offset that needs to be applied to timestamps
that have rolled over or are part of a discontinuity. <a>MPEG2TS_timestampOffset</a> is initially set to 0 when the <a class="externalDFN">SourceBuffer</a> 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:</p>
<pre>
Coded Frame Presentation Timestamp = (MPEG-2 TS presentation timestamp) + <var>MPEG2TS_timestampOffset</var>
Coded Frame Decode Timestamp = (MPEG-2 TS decode timestamp) + <var>MPEG2TS_timestampOffset</var></pre>
<p><a>MPEG2TS_timestampOffset</a> is updated in the following ways:</p>
<ul>
<li>Each time a timestamp rollover is detected, 2^33 MUST be added to <a>MPEG2TS_timestampOffset</a>.</li>
<li>When a discontinuity is detected, <a>MPEG2TS_timestampOffset</a> MUST be adjusted to make the timestamps after the discontinuity appear
to come immediately after the timestamps before the discontinuity.</li>
<li>When {{SourceBuffer/abort()}} is called, <a>MPEG2TS_timestampOffset</a> MUST be set to 0.</li>
<li>When {{SourceBuffer/timestampOffset}} is successfully set, <a>MPEG2TS_timestampOffset</a> MUST be set to 0.</li>
</ul>
</section>
<section id="conformance"></section>
<section id="acknowledgements">
<h2>Acknowledgments</h2>
The editors would like to thank
Alex Giladi,
Bob Lund,
David Singer,
Duncan Rowden,
Glenn Adams,
Mark Vickers,
and Michael Thornburgh for their contributions to this specification.
</section>
</body>
</html>