forked from w3c/media-source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mp2t-byte-stream-format.html
635 lines (479 loc) · 31.1 KB
/
mp2t-byte-stream-format.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
<!DOCTYPE html>
<html lang="en" dir="ltr" typeof="bibo:Document " prefix="bibo: http://purl.org/ontology/bibo/ w3p: http://www.w3.org/2001/02pd/rec54#">
<head><meta lang="" property="dc:language" content="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>MPEG-2 TS Byte Stream Format</title>
<!-- script to register bugs -->
<!-- Disabled unless/until it supports GitHub issues.
<script src="https://w3c.github.io/webcomponents/assets/scripts/bug-assist.js"></script>
<meta name="bug.short_desc" content="[MSE] ">
<meta name="bug.product" content="HTML WG">
<meta name="bug.component" content="Media Source Extensions">
-->
<style>/* --- ISSUES/NOTES --- */
div.issue-title, div.note-title , div.ednote-title, div.warning-title {
padding-right: 1em;
min-width: 7.5em;
color: #b9ab2d;
}
div.issue-title { color: #e05252; }
div.note-title, div.ednote-title { color: #2b2; }
div.warning-title { color: #f22; }
div.issue-title span, div.note-title span, div.ednote-title span, div.warning-title span {
text-transform: uppercase;
}
div.note, div.issue, div.ednote, div.warning {
margin-top: 1em;
margin-bottom: 1em;
}
.note > p:first-child, .ednote > p:first-child, .issue > p:first-child, .warning > p:first-child { margin-top: 0 }
.issue, .note, .ednote, .warning {
padding: .5em;
border-left-width: .5em;
border-left-style: solid;
}
div.issue, div.note , div.ednote, div.warning {
padding: 1em 1.2em 0.5em;
margin: 1em 0;
position: relative;
clear: both;
}
span.note, span.ednote, span.issue, span.warning { padding: .1em .5em .15em; }
.issue {
border-color: #e05252;
background: #fbe9e9;
}
.note, .ednote {
border-color: #52e052;
background: #e9fbe9;
}
.warning {
border-color: #f11;
border-right-width: .2em;
border-top-width: .2em;
border-bottom-width: .2em;
border-style: solid;
background: #fbe9e9;
}
.warning-title:before{
content: "⚠"; /*U+26A0 WARNING SIGN*/
font-size: 3em;
float: left;
height: 100%;
padding-right: .3em;
vertical-align: top;
margin-top: -0.5em;
}
li.task-list-item {
list-style: none;
}
input.task-list-item-checkbox {
margin: 0 0.35em 0.25em -1.6em;
vertical-align: middle;
}
</style><link rel="stylesheet" href="mse.css">
<style>/*****************************************************************
* ReSpec 3 CSS
* Robin Berjon - http://berjon.com/
*****************************************************************/
/* --- INLINES --- */
em.rfc2119 {
text-transform: lowercase;
font-variant: small-caps;
font-style: normal;
color: #900;
}
h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
border: none;
}
dfn {
font-weight: bold;
}
a.internalDFN {
color: inherit;
border-bottom: 1px solid #99c;
text-decoration: none;
}
a.externalDFN {
color: inherit;
border-bottom: 1px dotted #ccc;
text-decoration: none;
}
a.bibref {
text-decoration: none;
}
cite .bibref {
font-style: normal;
}
code {
color: #C83500;
}
/* --- TOC --- */
.toc a, .tof a {
text-decoration: none;
}
a .secno, a .figno {
color: #000;
}
ul.tof, ol.tof {
list-style: none outside none;
}
.caption {
margin-top: 0.5em;
font-style: italic;
}
/* --- TABLE --- */
table.simple {
border-spacing: 0;
border-collapse: collapse;
border-bottom: 3px solid #005a9c;
}
.simple th {
background: #005a9c;
color: #fff;
padding: 3px 5px;
text-align: left;
}
.simple th[scope="row"] {
background: inherit;
color: inherit;
border-top: 1px solid #ddd;
}
.simple td {
padding: 3px 10px;
border-top: 1px solid #ddd;
}
.simple tr:nth-child(even) {
background: #f0f6ff;
}
/* --- DL --- */
.section dd > p:first-child {
margin-top: 0;
}
.section dd > p:last-child {
margin-bottom: 0;
}
.section dd {
margin-bottom: 1em;
}
.section dl.attrs dd, .section dl.eldef dd {
margin-bottom: 0;
}
@media print {
.removeOnSave {
display: none;
}
}
</style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-ED"><!--[if lt IE 9]><script src='https://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--><script id="initialUserConfig" type="application/json">{
"specStatus": "ED",
"shortName": "media-source",
"edDraftURI": "https://w3c.github.io/media-source/mp2t-byte-stream-format.html",
"prevVersion": "http://www.w3.org/2013/12/byte-stream-format-registry/mp2t-byte-stream-format.html",
"editors": [
{
"name": "Matthew Wolenetz",
"url": "",
"company": "Google Inc.",
"companyURL": "http://www.google.com/"
},
{
"name": "Jerry Smith",
"url": "",
"company": "Microsoft Corporation",
"companyURL": "http://www.microsoft.com/"
},
{
"name": "Mark Watson",
"url": "",
"company": "Netflix Inc.",
"companyURL": "http://www.netflix.com/"
},
{
"name": "Aaron Colwell (until April 2015)",
"url": "",
"company": "Google Inc.",
"companyURL": "http://www.google.com/"
},
{
"name": "Adrian Bateman (until April 2015)",
"url": "",
"company": "Microsoft Corporation",
"companyURL": "http://www.microsoft.com/"
}
],
"mseDefGroupName": "mp2t-byte-stream-format",
"mseUnusedGroupNameExcludeList": [
"media-source"
],
"mseContributors": [
"Alex Giladi",
"Bob Lund",
"David Singer",
"Duncan Rowden",
"Glenn Adams",
"Mark Vickers",
"Michael Thornburgh"
],
"wg": "HTML Media Extensions Working Group",
"wgURI": "http://www.w3.org/html/wg/",
"wgPublicList": "public-html-media",
"wgPatentURI": "http://www.w3.org/2004/01/pp-impl/40318/status",
"noIDLIn": true,
"scheme": "https",
"otherLinks": [
{
"key": "Repository",
"data": [
{
"value": "We are on GitHub",
"href": "https://github.com/w3c/media-source/"
},
{
"value": "File a bug",
"href": "https://github.com/w3c/media-source/issues"
},
{
"value": "Commit history",
"href": "https://github.com/w3c/media-source/commits/gh-pages/mp2t-byte-stream-format-respec.html"
}
]
},
{
"key": "Mailing list",
"data": [
{
"value": "public-html-media@w3.org",
"href": "https://lists.w3.org/Archives/Public/public-html-media/"
}
]
}
],
"preProcess": [
null,
null
],
"definitionMap": {
"mpeg2ts_timestampoffset": [
"mpeg2ts-timestampOffset"
]
},
"postProcess": [
null
],
"localBiblio": {
"INBANDTRACKS": {
"title": "Sourcing In-band Media Resource Tracks from Media Containers into HTML",
"href": "http://dev.w3.org/html5/html-sourcing-inband-tracks/",
"authors": [
"Bob Lund",
"Silvia Pfeiffer"
],
"publisher": "W3C"
}
}
}</script></head>
<body class="h-entry" role="document" id="respecDocument"><div class="head" role="contentinfo" id="respecHeader">
<p>
<a class="logo" href="http://www.w3.org/"><img width="72" height="48" src="https://www.w3.org/Icons/w3c_home" alt="W3C"></a>
</p>
<h1 class="title p-name" id="title" property="dcterms:title">MPEG-2 TS Byte Stream Format</h1>
<h2 id="w3c-editor-s-draft-10-august-2016"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft <time property="dcterms:issued" class="dt-published" datetime="2016-08-10">10 August 2016</time></h2>
<dl>
<dt>This version:</dt>
<dd><a class="u-url" href="https://w3c.github.io/media-source/mp2t-byte-stream-format.html">https://w3c.github.io/media-source/mp2t-byte-stream-format.html</a></dd>
<dt>Latest published version:</dt>
<dd><a href="http://www.w3.org/TR/media-source/">http://www.w3.org/TR/media-source/</a></dd>
<dt>Latest editor's draft:</dt>
<dd><a href="https://w3c.github.io/media-source/mp2t-byte-stream-format.html">https://w3c.github.io/media-source/mp2t-byte-stream-format.html</a></dd>
<dt>Editors:</dt>
<dd class="p-author h-card vcard" property="bibo:editor" resource="_:editor0"><span property="rdf:first" typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Matthew Wolenetz</span>, <a property="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.google.com/">Google Inc.</a></span>
<span property="rdf:rest" resource="_:editor1"></span>
</dd>
<dd class="p-author h-card vcard" resource="_:editor1"><span property="rdf:first" typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Jerry Smith</span>, <a property="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.microsoft.com/">Microsoft Corporation</a></span>
<span property="rdf:rest" resource="_:editor2"></span>
</dd>
<dd class="p-author h-card vcard" resource="_:editor2"><span property="rdf:first" typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Mark Watson</span>, <a property="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.netflix.com/">Netflix Inc.</a></span>
<span property="rdf:rest" resource="_:editor3"></span>
</dd>
<dd class="p-author h-card vcard" resource="_:editor3"><span property="rdf:first" typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Aaron Colwell (until April 2015)</span>, <a property="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.google.com/">Google Inc.</a></span>
<span property="rdf:rest" resource="_:editor4"></span>
</dd>
<dd class="p-author h-card vcard" resource="_:editor4"><span property="rdf:first" typeof="foaf:Person"><span property="foaf:name" class="p-name fn">Adrian Bateman (until April 2015)</span>, <a property="foaf:workplaceHomepage" class="p-org org h-org h-card" href="http://www.microsoft.com/">Microsoft Corporation</a></span>
<span property="rdf:rest" resource="rdf:nil"></span>
</dd>
<dt>Repository:</dt>
<dd>
<a href="https://github.com/w3c/media-source/">
We are on GitHub
</a>
</dd>
<dd>
<a href="https://github.com/w3c/media-source/issues">
File a bug
</a>
</dd>
<dd>
<a href="https://github.com/w3c/media-source/commits/gh-pages/mp2t-byte-stream-format-respec.html">
Commit history
</a>
</dd>
<dt>Mailing list:</dt>
<dd>
<a href="https://lists.w3.org/Archives/Public/public-html-media/">
public-html-media@w3.org
</a>
</dd>
</dl>
<p class="copyright">
<a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
2016
<a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
(<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
<a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
<a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>).
<abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
<a rel="license" href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a>
rules apply.
</p>
<hr title="Separator for header">
</div>
<section id="abstract" class="introductory" property="dc:abstract"><h2 id="h-abstract" resource="#h-abstract"><span property="xhv:role" resource="xhv:heading">Abstract</span></h2><p>
This specification defines a <a href="http://www.w3.org/TR/media-source/">Media Source Extensions</a> byte stream format specification based on MPEG-2 Transport Streams.
</p></section><section id="sotd" class="introductory"><h2 id="h-sotd" resource="#h-sotd"><span property="xhv:role" resource="xhv:heading">Status of This Document</span></h2>
<p>
<em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports index</a> at http://www.w3.org/TR/.</em>
</p>
<p>The working group maintains <a href="https://github.com/w3c/media-source/issues">a list of all bug reports that the editors have not yet tried to address</a>; there may also be open bugs in the <a href="http://w3.org/brief/Mjcw">previous bug tracker</a>.</p>
<p>Implementors should be aware that this specification is not stable. <strong>Implementors who are not taking part in the discussions are likely to find the specification changing out from under them in incompatible ways.</strong> Vendors interested in implementing this specification before it eventually reaches the Candidate Recommendation stage should join the mailing list mentioned below and take part in the discussions.</p>
<p>
This document was published by the <a href="http://www.w3.org/html/wg/">HTML Media Extensions Working Group</a> as an Editor's Draft.
If you wish to make comments regarding this document, please send them to
<a href="mailto:public-html-media@w3.org">public-html-media@w3.org</a>
(<a href="mailto:public-html-media-request@w3.org?subject=subscribe">subscribe</a>,
<a href="http://lists.w3.org/Archives/Public/public-html-media/">archives</a>).
All comments are welcome.
</p>
<p>
Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr>
Membership. This is a draft document and may be updated, replaced or obsoleted by other
documents at any time. It is inappropriate to cite this document as other than work in
progress.
</p>
<p>
This document was produced by
a group
operating under the
<a id="sotd_patent" property="w3p:patentRules" href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent
Policy</a>.
<abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/40318/status" rel="disclosure">public list of any patent
disclosures</a>
made in connection with the deliverables of
the group; that page also includes
instructions for disclosing a patent. An individual who has actual knowledge of a patent
which the individual believes contains
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
</p>
<p>This document is governed by the <a id="w3c_process_revision" href="http://www.w3.org/2015/Process-20150901/">1 September 2015 <abbr title="World Wide Web Consortium">W3C</abbr> Process Document</a>.
</p>
</section><section id="toc"><h2 class="introductory" id="h-toc" resource="#h-toc"><span property="xhv:role" resource="xhv:heading">Table of Contents</span></h2><ul class="toc" role="directory"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#mime-parameters" class="tocxref"><span class="secno">2. </span>MIME-type info</a></li><li class="tocline"><a href="#mpeg2ts-general" class="tocxref"><span class="secno">3. </span>General Transport Stream Requirements</a></li><li class="tocline"><a href="#mpeg2ts-init-segments" class="tocxref"><span class="secno">4. </span>Initialization Segments</a></li><li class="tocline"><a href="#mpeg2ts-media-segments" class="tocxref"><span class="secno">5. </span>Media Segments</a></li><li class="tocline"><a href="#mpeg2ts-random-access-points" class="tocxref"><span class="secno">6. </span>Random Access Points</a></li><li class="tocline"><a href="#mpeg2ts-discontinuities" class="tocxref"><span class="secno">7. </span>Timestamp Rollover & Discontinuities</a></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">8. </span>Conformance</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">9. </span>Acknowledgments</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">A. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">A.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">A.2 </span>Informative references</a></li></ul></li></ul></section>
<section id="introduction" typeof="bibo:Chapter" resource="#introduction" property="bibo:hasPart">
<!--OddPage--><h2 id="h-introduction" resource="#h-introduction"><span property="xhv:role" resource="xhv:heading"><span class="secno">1. </span>Introduction</span></h2>
<p>This specification defines segment formats for implementations that choose to support MPEG-2 Transport Streams
(MPEG-2 TS) specified in <a href="http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=44169">ISO/IEC 13818-1</a>.</p> It defines the MIME-type parameters used to signal codecs, and provides
the necessary format specific definitions for <a href="index.html#init-segment">initialization segments</a>, <a href="index.html#media-segment">media segments</a>, and <a href="index.html#random-access-point">random access points</a> required by
the <a href="index.html#byte-stream-formats">byte stream formats section</a> of the Media Source Extensions spec. This document also defines extra behaviors and state that only apply to this
byte stream format.<p></p>
</section>
<section id="mime-parameters" typeof="bibo:Chapter" resource="#mime-parameters" property="bibo:hasPart">
<!--OddPage--><h2 id="h-mime-parameters" resource="#h-mime-parameters"><span property="xhv:role" resource="xhv:heading"><span class="secno">2. </span>MIME-type info</span></h2>
<p>The MIME-type/subtype pair of "video/MP2T", as specified in <a href="http://tools.ietf.org/html/rfc3551">RFC 3551</a>, <em class="rfc2119" title="MUST">MUST</em> be used for byte streams that conform
to this specification.</p>
<p>This following parameters can be used in the MIME-type passed to <code><a href="index.html#dom-mediasource-istypesupported">isTypeSupported()</a></code> or <code><a href="index.html#dom-mediasource-addsourcebuffer">addSourceBuffer()</a></code>.</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 <em class="rfc2119" title="SHOULD">SHOULD</em> accept IDs in the form specified by
<a href="http://tools.ietf.org/html/rfc6381">RFC 6381</a>.
<div class="note"><div class="note-title" aria-level="3" role="heading" id="h-note1"><span>Note</span></div><div class="">Implementations <em class="rfc2119" title="MAY">MAY</em> only implement a subset of the codecs and profiles mentioned in the RFC.</div></div>
</dd>
</dl>
</section>
<section id="mpeg2ts-general" typeof="bibo:Chapter" resource="#mpeg2ts-general" property="bibo:hasPart">
<!--OddPage--><h2 id="h-mpeg2ts-general" resource="#h-mpeg2ts-general"><span property="xhv:role" resource="xhv:heading"><span class="secno">3. </span>General Transport Stream Requirements</span></h2>
<p>MPEG-2 TS media and initialization segments <em class="rfc2119" title="MUST">MUST</em> conform to the MPEG-2 TS Adaptive Profile (ISO/IEC 13818-1:2012 Amd. 2).</p>
<p>The user agent <em class="rfc2119" title="MUST">MUST</em> run the <a href="index.html#sourcebuffer-append-error">append error algorithm</a> with the <var>decode error</var> parameter set to true 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" typeof="bibo:Chapter" resource="#mpeg2ts-init-segments" property="bibo:hasPart">
<!--OddPage--><h2 id="h-mpeg2ts-init-segments" resource="#h-mpeg2ts-init-segments"><span property="xhv:role" resource="xhv:heading"><span class="secno">4. </span>Initialization Segments</span></h2>
<p>An MPEG-2 TS initialization segment consists of a single PAT and a single PMT.</p>
<p>The user agent <em class="rfc2119" title="MUST">MUST</em> run the <a href="index.html#sourcebuffer-append-error">append error algorithm</a> with the <var>decode error</var> parameter set to true if any of the following conditions are met:</p>
<ol>
<li>A PAT is not present in the <a href="index.html#init-segment">initialization segment</a></li>
<li>A PMT is not present in the <a href="index.html#init-segment">initialization segment</a></li>
</ol>
<p>The user agent <em class="rfc2119" title="MUST">MUST</em> accept and ignore other SI, such as CAT, that are invariant for all subsequent media segments.</p>
<p>The user agent <em class="rfc2119" title="MUST">MUST</em> source attribute values for id, kind, label and language for <code><a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#audiotrack-audiotrack">AudioTrack</a></code>, <code><a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#videotrack-videotrack">VideoTrack</a></code> and
<code><a href="https://www.w3.org/TR/html51/semantics-embedded-content.html#texttrack-texttrack">TextTrack</a></code> objects as described for MPEG-2 Transport Streams in the in-band tracks spec [<cite><a class="bibref" href="#bib-INBANDTRACKS">INBANDTRACKS</a></cite>].</p>
</section>
<section id="mpeg2ts-media-segments" typeof="bibo:Chapter" resource="#mpeg2ts-media-segments" property="bibo:hasPart">
<!--OddPage--><h2 id="h-mpeg2ts-media-segments" resource="#h-mpeg2ts-media-segments"><span property="xhv:role" resource="xhv:heading"><span class="secno">5. </span>Media Segments</span></h2>
<p>The user agent <em class="rfc2119" title="MUST">MUST</em> run the <a href="index.html#sourcebuffer-append-error">append error algorithm</a> with the <var>decode error</var> parameter set to true 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" typeof="bibo:Chapter" resource="#mpeg2ts-random-access-points" property="bibo:hasPart">
<!--OddPage--><h2 id="h-mpeg2ts-random-access-points" resource="#h-mpeg2ts-random-access-points"><span property="xhv:role" resource="xhv:heading"><span class="secno">6. </span>Random Access Points</span></h2>
<p>A random access point as defined in this specification corresponds to Elementary Stream Random Access Point as defined in
<a href="http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=44169">ISO/IEC 13818-1</a>.</p>
</section>
<section id="mpeg2ts-discontinuities" typeof="bibo:Chapter" resource="#mpeg2ts-discontinuities" property="bibo:hasPart">
<!--OddPage--><h2 id="h-mpeg2ts-discontinuities" resource="#h-mpeg2ts-discontinuities"><span property="xhv:role" resource="xhv:heading"><span class="secno">7. </span>Timestamp Rollover & Discontinuities</span></h2>
<p>Timestamp rollovers and discontinuities <em class="rfc2119" title="MUST">MUST</em> be handled by the UA. The UA's MPEG-2 TS implementation <em class="rfc2119" title="MUST">MUST</em> maintain an internal offset
variable, <dfn id="mpeg2ts-timestampOffset" data-dfn-type="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. <var>MPEG2TS_timestampOffset</var> is initially set to 0 when the <code><a href="index.html#idl-def-SourceBuffer" class="idlType">SourceBuffer</a></code> is
created. This offset <em class="rfc2119" title="MUST">MUST</em> be applied to the timestamps as part of the conversion process from MPEG-2 TS packets
into <a href="index.html#coded-frame">coded frames</a> for the <a href="index.html#sourcebuffer-coded-frame-processing">coded frame processing algorithm</a>. 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><var><a href="#mpeg2ts-timestampOffset">MPEG2TS_timestampOffset</a></var> is updated in the following ways:</p>
<ul>
<li>Each time a timestamp rollover is detected, 2^33 <em class="rfc2119" title="MUST">MUST</em> be added to <var><a href="#mpeg2ts-timestampOffset">MPEG2TS_timestampOffset</a></var>.</li>
<li>When a discontinuity is detected, <var><a href="#mpeg2ts-timestampOffset">MPEG2TS_timestampOffset</a></var> <em class="rfc2119" title="MUST">MUST</em> be adjusted to make the timestamps after the discontinuity appear
to come immediately after the timestamps before the discontinuity.</li>
<li>When <code><a href="index.html#dom-sourcebuffer-abort">abort()</a></code> is called, <var><a href="#mpeg2ts-timestampOffset">MPEG2TS_timestampOffset</a></var> <em class="rfc2119" title="MUST">MUST</em> be set to 0.</li>
<li>When <code><a href="index.html#dom-sourcebuffer-timestampoffset">timestampOffset</a></code> is successfully set, <var><a href="#mpeg2ts-timestampOffset">MPEG2TS_timestampOffset</a></var> <em class="rfc2119" title="MUST">MUST</em> be set to 0.</li>
</ul>
</section>
<section id="conformance" typeof="bibo:Chapter" resource="#conformance" property="bibo:hasPart"><!--OddPage--><h2 id="h-conformance" resource="#h-conformance"><span property="xhv:role" resource="xhv:heading"><span class="secno">8. </span>Conformance</span></h2>
<p>
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples,
and notes in this specification are non-normative. Everything else in this specification is
normative.
</p>
<p id="respecRFC2119">The key words <em class="rfc2119" title="MAY">MAY</em>, <em class="rfc2119" title="MUST">MUST</em>, and <em class="rfc2119" title="SHOULD">SHOULD</em> are
to be interpreted as described in [<cite><a class="bibref" href="#bib-RFC2119">RFC2119</a></cite>].
</p>
</section>
<section id="acknowledgements" typeof="bibo:Chapter" resource="#acknowledgements" property="bibo:hasPart">
<!--OddPage--><h2 id="h-acknowledgements" resource="#h-acknowledgements"><span property="xhv:role" resource="xhv:heading"><span class="secno">9. </span>Acknowledgments</span></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>
<section id="references" class="appendix" typeof="bibo:Chapter" resource="#references" property="bibo:hasPart"><!--OddPage--><h2 id="h-references" resource="#h-references"><span property="xhv:role" resource="xhv:heading"><span class="secno">A. </span>References</span></h2><section id="normative-references" typeof="bibo:Chapter" resource="#normative-references" property="bibo:hasPart"><h3 id="h-normative-references" resource="#h-normative-references"><span property="xhv:role" resource="xhv:heading"><span class="secno">A.1 </span>Normative references</span></h3><dl class="bibliography" resource=""><dt id="bib-RFC2119">[RFC2119]</dt><dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119" property="dc:requires"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119" property="dc:requires">https://tools.ietf.org/html/rfc2119</a>
</dd></dl></section><section id="informative-references" typeof="bibo:Chapter" resource="#informative-references" property="bibo:hasPart"><h3 id="h-informative-references" resource="#h-informative-references"><span property="xhv:role" resource="xhv:heading"><span class="secno">A.2 </span>Informative references</span></h3><dl class="bibliography" resource=""><dt id="bib-INBANDTRACKS">[INBANDTRACKS]</dt><dd>Bob Lund; Silvia Pfeiffer. <a href="http://dev.w3.org/html5/html-sourcing-inband-tracks/" property="dc:references"><cite>Sourcing In-band Media Resource Tracks from Media Containers into HTML</cite></a>. URL: <a href="http://dev.w3.org/html5/html-sourcing-inband-tracks/" property="dc:references">http://dev.w3.org/html5/html-sourcing-inband-tracks/</a>
</dd></dl></section></section></body></html>