mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-02 05:55:08 +00:00
Deployed 7a5bac78 with MkDocs version: 1.6.1
This commit is contained in:
@@ -3140,8 +3140,9 @@ least one and no track is left.</p>
|
||||
<h3 id="segment-filtering-hooks">Segment-filtering hooks<a class="headerlink" href="#segment-filtering-hooks" title="Permanent link">¶</a></h3>
|
||||
<ul>
|
||||
<li><strong>HLS</strong>: set <code>track.OnSegmentFilter(segment)</code> to drop unwanted segments (ads/bumpers).
|
||||
An <code>EXT-X-KEY</code> applies to each later segment until the next <code>EXT-X-KEY</code>, also when the
|
||||
filter or <code>--sample</code> drops the segment that carries it. unshackle ignores an <code>EXT-X-KEY</code> that
|
||||
An <code>EXT-X-KEY</code> applies to each later segment until the next <code>EXT-X-KEY</code> with the same
|
||||
<code>KEYFORMAT</code>, or with another <code>METHOD</code>, also when the filter or <code>--sample</code> drops the segment
|
||||
that carries it. <code>METHOD=NONE</code> ends every <code>EXT-X-KEY</code>. unshackle ignores an <code>EXT-X-KEY</code> that
|
||||
applies to dropped segments only: no licence, no request and no new decryption. It also
|
||||
ignores the <code>EXT-X-DISCONTINUITY</code> of a dropped segment. A dropped ad break thus does not
|
||||
disturb decryption when the playlist repeats the <code>EXT-X-KEY</code> of the title after the break.
|
||||
@@ -3289,21 +3290,33 @@ these conditions are true:</p>
|
||||
<ul>
|
||||
<li>The track has no DRM object.</li>
|
||||
<li>Every <code>EXT-X-KEY</code> of its media playlist is <code>SAMPLE-AES</code> or <code>SAMPLE-AES-CTR</code> for a DRM system
|
||||
unshackle cannot license.</li>
|
||||
unshackle cannot license, or <code>METHOD=NONE</code>. A segment under <code>METHOD=NONE</code> must have an init segment
|
||||
that no encrypted segment uses: a decrypter that reads the encrypted init segment decrypts the clear
|
||||
samples too. A tag with <code>KEYFORMAT="identity"</code>, or with no <code>KEYFORMAT</code>, names no DRM system: each
|
||||
encrypted segment also needs a tag of a DRM system.</li>
|
||||
<li>The configured CDM is a PlayReady or Widevine CDM.</li>
|
||||
<li>The init segment (<code>EXT-X-MAP</code>) of the track names a key ID in its <code>tenc</code> box. When the <code>tenc</code> key ID is all
|
||||
zeros, its <code>pssh</code> boxes must name exactly one key ID, and the encrypted segments must have one init
|
||||
segment and the playlist one key URI. MPEG-TS media has no init segment.</li>
|
||||
zeros, the playlist must have one key URI, and each init segment under the key tag must give the same
|
||||
key ID: its <code>tenc</code> key ID, or else the one key ID that its <code>pssh</code> boxes name. A clear init segment,
|
||||
such as the one of a clear lead or tail, does not count. MPEG-TS media has no init segment.</li>
|
||||
<li>The init segment does not change without an <code>EXT-X-DISCONTINUITY</code>.</li>
|
||||
</ul>
|
||||
<p>The download reads the key ID from the init segment, builds a DRM object for the DRM system of the
|
||||
CDM with <code>drm_stub</code>, and sends the challenge to the licence callback of the service. Over <code>--remote</code>
|
||||
the server reads the same key ID at the licence step, so it accepts the DRM object of the client. A
|
||||
licence that gives no content key stops the track before it downloads a segment.</p>
|
||||
<p>unshackle reads one key ID from each init segment. So it licenses a playlist that changes its content key
|
||||
correctly only when each content key has its own init segment with a real <code>tenc</code> key ID, after an
|
||||
<code>EXT-X-DISCONTINUITY</code>. When the first key ID is real, the download also reads the <code>tenc</code> key ID of
|
||||
each other init segment of the encrypted segments, and licenses each real key ID in its own licence step. A
|
||||
PlayReady DRM object then has one header for each key ID, because the header of <code>drm_stub</code> holds
|
||||
one key ID. A key ID that gets no content key stops the track before it downloads a segment. An
|
||||
init segment that gives no real key ID does not count.</p>
|
||||
<p>A service that must choose the DRM system itself, or one that knows the key ID, puts the DRM object
|
||||
on the track:</p>
|
||||
<ol>
|
||||
<li>Read the key ID from the init segment of the track. <code>HLS.get_track_kid_from_init</code> returns it.</li>
|
||||
<li>Read the key ID from the init segment of the track. <code>HLS.get_track_kid_from_init</code> returns it. It reads
|
||||
the first init segment of the playlist, unless you give it the init segment of the encrypted segments.</li>
|
||||
<li>Put a DRM object that names the key ID on the track: <code>drm_stub</code> from <code>unshackle.core.drm.cenc</code>
|
||||
with <code>"playready"</code> or <code>"widevine"</code> and the key ID. When only one of the two systems issues the
|
||||
content key, also set <code>track.drm_preference</code> to it.</li>
|
||||
@@ -3313,7 +3326,8 @@ on the track:</p>
|
||||
by the key ID, not with one that checks a header a packager signed. A platform can issue the
|
||||
content key of one package of a title and refuse another. When a track carries a Widevine or PlayReady DRM
|
||||
object and every <code>EXT-X-KEY</code> of its playlist is <code>SAMPLE-AES</code> or <code>SAMPLE-AES-CTR</code> for a key system
|
||||
unshackle cannot license, <code>HLS.drop_unsupported_keys</code> removes the tags from the parsed playlist.
|
||||
unshackle cannot license, or <code>METHOD=NONE</code> under the same condition, <code>HLS.drop_unsupported_keys</code> removes the
|
||||
tags from the parsed playlist.
|
||||
The download then licenses and decrypts the track with the DRM object of the track. This works for
|
||||
one content key per track: the key changes of the playlist go with the tags. This limit also
|
||||
applies to a DRM object that the download builds. Any other track stops with
|
||||
|
||||
Reference in New Issue
Block a user