forked from w3c/encrypted-media
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcenc-format-respec.html
197 lines (171 loc) · 12.3 KB
/
cenc-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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ISO Common Encryption EME Stream Format and Initialization Data</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c-common" class="remove"></script>
<script src="encrypted-media.js" 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 http://www.w3.org/TR/short-name/
shortName: "encrypted-media", <!-- The registry does not have its own short name. -->
// if there a publicly available Editor's Draft, this is the link
edDraftURI: "https://w3c.github.io/encrypted-media/cenc-format.html",
// if this is a LCWD, uncomment and set the end of its review period
// lcEnd: "2009-08-05",
// editors, add as many as you like
// only "name" is required
editors: [
{ name: "David Dorwin", url: "",
company: "Google Inc.", companyURL: "https://www.google.com/" },
{ name: "Adrian Bateman", url: "",
company: "Microsoft Corporation", companyURL: "https://www.microsoft.com/" },
{ name: "Mark Watson", url: "",
company: "Netflix Inc.", companyURL: "https://www.netflix.com/" },
{ name: "Jerry Smith", url: "",
company: "Microsoft Corporation", companyURL: "https://www.microsoft.com/" },
],
otherLinks: [
{ key: "Repository",
href: "https://github.com/w3c/encrypted-media/"}
],
emeDefGroupName: "cenc-format",
emeUnusedGroupNameExcludeList: ["encrypted-media",
"eme-references-from-registry"
],
// name of the WG
wg: "HTML Working Group",
// URI of the public WG page
wgURI: "http://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",
// Empty definitions for objects declared in the document are here to
// prevent error messages from being displayed for references to these objects.
definitionMap: {},
preProcess: [ encryptedMediaPreProcessor ],
// Empty definitions for objects declared in the document are here to
// prevent error messages from being displayed for references to these objects.
definitionMap: {},
postProcess: [ encryptedMediaPostProcessor ],
localBiblio: {
"BMFF": {
title: "ISO/IEC 14496-12:2012, Information technology -- Coding of audio-visual objects -- Part 12: ISO base media file format",
href: "http://standards.iso.org/ittf/PubliclyAvailableStandards/c061988_ISO_IEC_14496-12_2012.zip",
status: "International Standard",
publisher: "ISO/IEC"
},
"CENC-1ST": {
title: "ISO/IEC 23001-7:2012, Information technology -- MPEG systems technologies -- Part 7: Common encryption in ISO base media file format files",
href: "https://www.iso.org/obp/ui/#iso:std:iso-iec:23001:-7:ed-1:v1",
status: "International Standard",
publisher: "ISO/IEC",
},
"CENC-2ND": {
title: "ISO/IEC DIS 23001-7 2nd Edition",
<!-- href: "https://www.iso.org/obp/ui/#iso:std:iso-iec:23001:-7:ed-2", -->
status: "Draft International Standard",
publisher: "ISO/IEC",
}
}
};
</script>
<!-- script to register bugs -->
<script src="https://w3c.github.io/webcomponents/assets/scripts/bug-assist.js"></script>
<meta name="bug.product" content="HTML WG">
<meta name="bug.component" content="Encrypted Media Extensions">
<link rel="stylesheet" href="eme.css">
</head>
<body>
<!-- TODO: Use styles for ISO boxes like the MSE registry. -->
<section id="abstract">
<p>This specification defines the stream format and initialization data for using ISO Base media File Format [[!BMFF]] content using the ISO Common Encryption ('cenc') protection scheme [[!CENC-1ST]] with the <a def-id="eme-spec"></a>.
It also defines a common SystemID and PSSH box format for use with Encrypted Media Extensions.
</p>
</section>
<section id="sotd">
<p>The Working Group maintains <a href="https://www.w3.org/brief/MjY5"> a list of all bug reports that the editors have not yet tried to address</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="stream-format">
<h2>Stream Format</h2>
<p>Under the ISO Common Encryption ('cenc') protection scheme [[!CENC-1ST]], ISO Base media File Format [[!BMFF]] content is encrypted at the sample level with AES-128 CTR encryption. This protection method enables multiple Key Systems to decrypt the same media content.</p>
<p>Each key is identified by a <a def-id="key-id"></a> and each encrypted sample is associated with the Key ID of the key needed to decrypt it. This association is signaled either through the specification of a default Key ID in the track encryption box ('tenc') or by assigning the sample to a Sample Group, the definition of which specifies a Key ID. Common encryption files may contain a mixture of encrypted and unencrypted samples.</p>
</section>
<section id="detect-encrypt">
<h2>Detecting Encryption</h2>
<p>Protection scheme signaling conforms with ISO Base media File Format [[!BMFF]]. When protection has been applied, the stream type will be transformed to 'encv' for video or 'enca' for audio, with a Protection Scheme Information Box ('sinf') added to the sample entry in the Sample Description Box ('stsd'). The Protection Scheme Information Box ('sinf') will contain a Scheme Type Box ('schm') with a scheme_type field set to a value of 'cenc' (Common Encryption).</p>
<p>The "encrypted block" is a sample. Determining whether a sample is encrypted depends on the corresponding Track Encryption Box ('tenc') and the sample group with grouping type 'seig' (CencSampleEncryption group), if any, associated with the sample.
The default encryption state of a sample is defined by the IsEncrypted flag in the associated track encryption box ('tenc'). This default state may be modified by the IsEncrypted flag in the SampleGroupDescriptionBox ('sgpd'), pointed to by an index in the SampleToGroupBox ('sbgp').</p>
<p>Samples can be partially encrypted, specified by subsample information referenced by SampleAuxiliaryInformationSizesBox ('saiz') and SampleAuxiliaryInformationOffsetsBox ('saio') boxes.</p>
<p>For complete information, see [[!CENC-1ST]].</p>
</section>
<section id="init-data">
<h2>Initialization Data and Events</h2>
<p>Common Encryption files may contain one or more protection system specific header ('pssh') boxes, each for a unique SystemID at each location where a 'pssh' box is necessary.</p>
<p><a def-id="initialization-data"></a> is always one or more concatenated 'pssh' boxes.
An implementation (the user agent and/or CDM) MUST be able to examine multiple 'pssh' boxes in the Initialization Data to find a 'pssh' box that it supports.
At least one of the concatenated 'pssh' boxes SHOULD contain the SystemID defined in the <a href="#common-system">Common SystemID and PSSH Box Format</a> section.
</p>
<p>Each time one or more 'pssh' boxes are encountered, the <a def-id="initdata-encountered-algorithm"></a> algorithm shall be invoked with <var title="">initDataType</var> = "cenc" and <var title="">initData</var> = the 'pssh' box(es). Multiple 'pssh' boxes MUST be provided together if and only if they appear directly next to each other in the file.</p>
<p>If a supported 'pssh' box (based on SystemID) is not found while processing the <var>initData</var> in the <a def-id="createSession"></a> algorithm, follow the algorithm step for "<var>init data</var> is not supported by the <var>cdm</var>."</p>
<p class="note">ISO Common Encryption 2nd Edition [[!CENC-2ND]] also specifies storage of a 'pssh' box base64 encoded in an XML element of the form <cenc:pssh (base64 'pssh')>. For instance, DASH manifests may provide 'pssh' boxes in this format, each contained in a ContentProtection Descriptor element identified by a SystemID. These 'pssh' boxes may be decoded and concatenated by an application to provide equivalent Initialization Data to that stored in movie or movie fragment boxes.</p>
</section>
<section id="common-system">
<h2>Common SystemID and PSSH Box Format</h2>
<p>This section defines a common open SystemID and PSSH box format for use with EME.
Key System implementations supporting ISO Common Encryption MUST support this SystemID and format.
Media resources for use with EME SHOULD contain appropriate PSSH box(es) for this SystemID.
<p class="note">
Use of this SystemID is RECOMMENDED for applications, packagers, and implementors.
Use of other SystemIDs with the EME APIs is discouraged.
'pssh' box(es) for this SystemID SHOULD be included in all new or repackaged content so that the content can be used with any compliant Key System.
For existing content, applications may alternatively obtain a 'pssh' box containing this SystemID or another Initialization Data Type (e.g. <a href="keyids-format.html">keyids</a>) from another source.
</p>
<p class="note">Implementations MAY support other SystemIDs for backwards compatibility with existing streams.</p>
<p><a def-id="clear-key"></a> uses this SystemID for ISO Common Encryption content.
When <a def-id="createSession"></a> is called with <var>initDataType</var> "cenc", the Clear Key CDM will use the PSSH box with this SystemID to generate a license request.
</p>
<section id="common-system-definition">
<h3>Definition</h3>
<p>The SystemID is 1077efec-c0b2-4d02-ace3-3c1e52e2fb4b.</p>
<p>The PSSH box format is as follows. It follows version 1 of the 'pssh' box as defined in ISO Common Encryption 2nd Edition [[!CENC-2ND]].</p>
<dl>
<dt>version</dt>
<dd>1</dd>
<dt>KID and KID_count</dt>
<dd>The <a def-id="key-id"></a>(s) represented by the PSSH box. For example, those key ID(s) used by the Movie ('moov') or Movie Fragment ('moof').</dd>
<dt>Data and DataSize</dt>
<dd>Reserved for future use. DataSize SHALL be set to 0 when constructing this box. When processing, if dataSize is non-zero the Data field SHALL be ignored.</dd>
</dl>
</section>
<section class="informative">
<h2>Example</h2>
<p>The following example contains two key IDs.</p>
<pre class="example">
var pssh = [
0x00, 0x00, 0x00, 0x4c, 0x70, 0x73, 0x73, 0x68, // BMFF box header (76 bytes, 'pssh')
0x01, 0x00, 0x00, 0x00, // Full box header (version = 1, flags = 0)
0x10, 0x77, 0xef, 0xec, 0xc0, 0xb2, 0x4d, 0x02, // SystemID
0xac, 0xe3, 0x3c, 0x1e, 0x52, 0xe2, 0xfb, 0x4b,
0x00, 0x00, 0x00, 0x02, // KID_count (2)
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, // First KID ("0123456789012345")
0x38, 0x39, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, // Second KID ("ABCDEFGHIJKLMNOP")
0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
0x00, 0x00, 0x00, 0x00, // Size of Data (0)
];
</pre>
</section>
</section>
</body>
</html>