forked from w3c/media-source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webm-byte-stream-format-respec.html
277 lines (241 loc) · 13.4 KB
/
webm-byte-stream-format-respec.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
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>WebM Byte Stream Format</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c-common" class="remove"></script>
<!--<script src="respec-w3c-common.js" class="remove"></script>-->
<script src="media-source.js" class="remove"></script>
<script class="remove">
(function() {
var webmContainerSpecDefinitions = {
'webm-spec': { fragment: '#webm-guidelines', link_text: 'WebM spec', },
'webm-ebml-header': { fragment: '#ebml-basics', link_text: 'EBML Header', },
'webm-segment': { fragment: '#segment', link_text: 'Segment', },
'webm-info': { fragment: '#segment-information', link_text: 'Segment Information', },
'webm-tracks': { fragment: '#track', link_text: 'Tracks', },
'webm-cues': { fragment: '#cueing-data', link_text: 'Cues', },
'webm-chapters': { fragment: '#chapters', link_text: 'Chapters', },
'webm-cluster': { fragment: '#cluster', link_text: 'Cluster', },
'webm-muxer-guidelines': { fragment: '#muxer-guidelines', link_text: 'WebM Muxer Guidelines', },
};
var webmByteStreamFormatDefinitions = {
'webm-init-segment': { fragment: '#webm-init-segments', link_text: 'WebM initialization segment', },
};
mediaSourceAddDefinitionInfo("webm-container-spec", "http://www.webmproject.org/docs/container/", webmContainerSpecDefinitions);
mediaSourceAddDefinitionInfo("webm-byte-stream-format", "", webmByteStreamFormatDefinitions);
})();
</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 http://www.w3.org/TR/short-name/
shortName: "mse-byte-stream-format-webm",
// if there a publicly available Editor's Draft, this is the link
edDraftURI: "https://w3c.github.io/media-source/webm-byte-stream-format.html",
// if this is a LCWD, uncomment and set the end of its review period
// lcEnd: "2009-08-05",
//publishDate: "2015-03-09",
prevVersion: "https://www.w3.org/2013/12/byte-stream-format-registry/webm-byte-stream-format.html",
// editors, add as many as you like
// only "name" is required
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: "Aaron Colwell (until April 2015)", url: "",
company: "Google Inc.", companyURL: "http://www.google.com/" },
],
mseDefGroupName: "webm-byte-stream-format",
mseUnusedGroupNameExcludeList: ["media-source"],
mseContributors: [
"Chris Cunningham",
"Frank Galligan",
"Philip Jägenstedt",
],
// name of the WG
wg: "HTML Media Extensions Working Group",
// URI of the public WG page
wgURI: "https://www.w3.org/html/wg/",
// name (without the @w3c.org) of the public mailing to which comments are due
wgPublicList: "public-html-media",
// URI of the patent status for this WG, for Rec-track documents
// !!!! IMPORTANT !!!!
// This is important for Rec-track documents, do not copy a patent URI from a random
// document unless you know what you're doing. If in doubt ask your friendly neighbourhood
// Team Contact.
wgPatentURI: "https://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/webm-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: [ mediaSourceAddMainSpecDefinitionInfos, mediaSourcePreProcessor ],
// Empty definitions for objects declared in the document are here to
// prevent error messages from being displayed for references to these objects.
definitionMap: {},
postProcess: [ mediaSourcePostProcessor ],
localBiblio: {
"INBANDTRACKS": {
title: "Sourcing In-band Media Resource Tracks from Media Containers into HTML",
href: "https://dev.w3.org/html5/html-sourcing-inband-tracks/",
authors: ["Bob Lund", "Silvia Pfeiffer"],
publisher: "W3C",
},
"VP09CODECSPARAMETERSTRING": {
title: "VP Codec ISO Media File Format Binding",
href: "http://www.webmproject.org/vp9/mp4/#codecs-parameter-string",
authors: ["Frank Galligan", "Kilroy Hughes", "Thomás Inskip", "David Ronca"],
publisher: "WebM Project",
},
}
};
</script>
<!-- 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">
-->
<link rel="stylesheet" href="mse.css">
</head>
<body>
<section id="abstract">
This specification defines a <a def-id="mse-spec"></a> [[!MEDIA-SOURCE]] byte stream format specification based on the WebM container format.
</section>
<section id="sotd">
<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>
</section>
<section id="introduction">
<h2>Introduction</h2>
<p>This specification describes a byte stream format based on the WebM container format [[!WEBM]]. It defines the MIME-type parameters used to signal codecs, and provides
the necessary format specific definitions for <a def-id="init-segments"></a>, <a def-id="media-segments"></a>, and <a def-id="random-access-points"></a> required by
the <a def-id="byte-stream-formats-section"></a> of the Media Source Extensions spec.</p>
</section>
<section id="webm-mime-parameters">
<h2>MIME-type parameters</h2>
<p>This section specifies the parameters that can be used in the MIME-type passed to <a def-id="isTypeSupported"></a> or <a def-id="addSourceBuffer"></a>.</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.
<table class="old-table">
<thead>
<tr>
<th>Codec ID</th>
<th>Valid with "audio/webm"</th>
<th>Valid with "video/webm"</th>
</tr>
</thead>
<tbody>
<tr>
<td>vorbis</td>
<td>true</td>
<td>true</td>
</tr>
<tr>
<td>opus</td>
<td>true</td>
<td>true</td>
</tr>
<tr>
<td>vp8</td>
<td>false</td>
<td>true</td>
</tr>
<tr>
<td>vp9</td>
<td>false</td>
<td>true</td>
</tr>
<tr>
<td>vp09... as described in the VP Codec ISO Media File Format Binding document[[VP09CODECSPARAMETERSTRING]]</td>
<td>false</td>
<td>true</td>
</tr>
</tbody>
</table>
<div class="note">
Implementations SHOULD support all of the codec IDs mentioned in the table above.
</div>
<div class="note">
Implementations SHOULD encourage applications to prefer the "vp09..." codec ID over "vp9". The "vp09..." format provides detailed profile and color information, enabling implementations to give more accurate answers for codec support.
</div>
<p>Examples of valid MIME-types with a codecs parameter.</p>
<ul>
<li>audio/webm;codecs="vorbis"</li>
<li>video/webm;codecs="vorbis"</li>
<li>video/webm;codecs="vp8"</li>
<li>video/webm;codecs="vp8,vorbis"</li>
<li>video/webm;codecs="vp9,opus"</li>
<li>video/webm;codecs="vp09.00.10.08"</li>
<li>video/webm;codecs="vp09.02.10.10.01.09.16.09.01,opus"</li>
</ul>
</dd>
</dl>
</section>
<section id="webm-init-segments">
<h2>Initialization Segments</h2>
<p>A WebM <a def-id="init-segment"></a> MUST contain a subset of the elements at the start of a typical WebM file.</p>
<p>The user agent MUST run the <a def-id="append-decode-error-algorithm"></a> if any of the following conditions are not met:</p>
<ol>
<li>The <a def-id="init-segment"></a> MUST start with an <a def-id="webm-ebml-header"></a> element, followed by a <a def-id="webm-segment"></a> header.</li>
<li>The size value in the <a def-id="webm-segment"></a> header MUST signal an "unknown size" or contain a value large enough to include the <a def-id="webm-info"></a> and <a def-id="webm-tracks"></a> elements that follow.</li>
<li>A <a def-id="webm-info"></a> element and a <a def-id="webm-tracks"></a> element MUST appear, in that order, after the <a def-id="webm-segment"></a> header and before any further <a def-id="webm-ebml-header"></a> or <a def-id="webm-cluster"></a> elements.
</li>
</ol>
<p>The user agent MUST accept and ignore any elements other than an <a def-id="webm-ebml-header"></a> or a <a def-id="webm-cluster"></a> that occur before, in between, or after the <a def-id="webm-info"></a> and
<a def-id="webm-tracks"></a> elements.</p>
<p>The user agent MUST source attribute values for id, kind, label and language for <a def-id="audio-track"></a>, <a def-id="video-track"></a> and
<a def-id="text-track"></a> objects as described for WebM in the in-band tracks spec [[INBANDTRACKS]].</p>
</section>
<section id="webm-media-segments">
<h2>Media Segments</h2>
<p>A WebM <a def-id="media-segment"></a> is a single <a def-id="webm-cluster"></a> element.</p>
<p>The user agent uses the following rules when interpreting content in a <a def-id="webm-cluster"></a>:</p>
<ol>
<li>The TimecodeScale in the <a def-id="webm-init-segment"></a> most recently appended applies to all timestamps in the <a def-id="webm-cluster"></a></li>
<li>The Timecode element in the <a def-id="webm-cluster"></a> contains a <a def-id="presentation-timestamp"></a> in TimecodeScale units.</li>
<li>The Cluster header MAY contain an "unknown" size value. If it does then the end of the cluster is reached when another <a def-id="webm-cluster"></a> header or an element header that indicates the start
of an <a def-id="webm-init-segment"></a> is encountered.</li>
</ol>
<p>The user agent MUST run the <a def-id="append-decode-error-algorithm"></a> if any of the following conditions are not met:</p>
<ol>
<li>The Timecode element MUST appear before any Block & SimpleBlock elements in a <a def-id="webm-cluster"></a>.</li>
<li>Block & SimpleBlock elements are in time increasing order consistent with the <a def-id="webm-spec"></a>.</li>
<li>If the most recent <a def-id="webm-init-segment"></a> describes multiple tracks, then blocks from all the tracks MUST be interleaved in time increasing order. At least one block from all audio and video
tracks MUST be present.</li>
</ol>
<p>The user agent MUST accept and ignore <a def-id="webm-cues"></a> or <a def-id="webm-chapters"></a> elements that follow a <a def-id="webm-cluster"></a> element.</p>
</section>
<section id="webm-random-access-points">
<h2>Random Access Points</h2>
<p>Either a SimpleBlock element with its Keyframe flag set, or a BlockGroup element having no ReferenceBlock elements, signals the location of a <a def-id="random-access-point"></a> for that track. The order of multiplexed blocks within a <a def-id="media-segment"></a> MUST conform to the <a def-id="webm-muxer-guidelines"></a>.</p>
</section>
<section id="conformance"></section>
<section id="acknowledgements">
<h2>Acknowledgments</h2>
The editors would like to thank <a def-id="contributors"></a> for their contributions to this specification.
</section>
</body>
</html>