-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HLS Widevine VOD playback stops with "Playback failed" at the second (and every subsequent) key rotation #6903
Comments
For example, these are the first few segments in the example without a clear lead, and slightly abbreviated.
Playback stops at When I press play again, it resumes and stops at This is an example with a clear lead.
Playback stops at |
I made a mistake in the reproduction steps. To create an example without a clear lead, use |
I'm not able to repro this by following your instructions. Can you either host the stream somewhere and send a link to the manifest, or upload the whole directory somewhere so I can ensure I'm using exactly the same media. |
Thank you for the quick response. This is the original video: HLS without a clear lead: MPD without a clear lead: HLS with a clear lead: MPD with a clear lead: |
Thanks for the links, I can repro exactly how you describe. I added some logging to the At the beginning of playback, during the initial load, these 6 key IDs are returned from the DRM server:
i.e. we have enough info at that point to decrypt the first 2 audio & video segments, plus a couple of key IDs that I don't know what they're for. Then when the playback fails, and I press 'resume', the following Key IDs are returned from the DRM server:
So it seems at the moment like we're not issuing new license requests during HLS playback for upcoming segments with different keys. |
The keys that you don't see in the media playlists are for SD video. The license proxy seems to be configured to return audio, SD and HD keys, even though the example only uses the HD video key. If it helps, I have also created a Dockerfile that should allow you to reproduce the streams locally. FROM nginx:1.17
RUN apt update \
&& apt install -y python curl
RUN cd /usr/local/bin \
&& curl -LO https://github.com/ytdl-org/youtube-dl/releases/download/2020.01.24/youtube-dl \
&& chmod +x youtube-dl \
&& curl -L -o packager https://github.com/google/shaka-packager/releases/download/v2.4.1/packager-linux \
&& chmod +x packager
RUN cd /usr/share/nginx/html \
&& youtube-dl -f 22 -o tears.mp4 'https://www.youtube.com/watch?v=41hv2tW5Lc4' \
&& mkdir no-clear-lead \
&& cd no-clear-lead \
&& packager \
--enable_widevine_encryption \
--key_server_url https://license.uat.widevine.com/cenc/getcontentkey/widevine_test \
--signer widevine_test \
--aes_signing_key 1ae8ccd0e7985cc0b6203a55855a1034afc252980e970ca90e5202689f947ab9 \
--aes_signing_iv d58ce954203b7c9a9a9d467f59839249 \
--content_id 74657374 \
--protection_scheme cenc \
--clear_lead 0 \
--crypto_period_duration 10 \
--segment_duration 10 \
--hls_master_playlist_output index.m3u8 \
--mpd_output index.mpd \
--generate_static_live_mpd \
input=../tears.mp4,stream=audio,segment_template='audio-$Number%03d$.mp4',playlist_name='audio.m3u8',init_segment='audio-init.mp4' \
input=../tears.mp4,stream=video,segment_template='video-$Number%03d$.mp4',playlist_name='video.m3u8',init_segment='video-init.mp4' \
&& cd .. \
&& mkdir clear-lead \
&& cd clear-lead \
&& packager \
--enable_widevine_encryption \
--key_server_url https://license.uat.widevine.com/cenc/getcontentkey/widevine_test \
--signer widevine_test \
--aes_signing_key 1ae8ccd0e7985cc0b6203a55855a1034afc252980e970ca90e5202689f947ab9 \
--aes_signing_iv d58ce954203b7c9a9a9d467f59839249 \
--content_id 74657374 \
--protection_scheme cenc \
--clear_lead 10 \
--crypto_period_duration 10 \
--segment_duration 10 \
--hls_master_playlist_output index.m3u8 \
--mpd_output index.mpd \
--generate_static_live_mpd \
input=../tears.mp4,stream=audio,segment_template='audio-$Number%03d$.mp4',playlist_name='audio.m3u8',init_segment='audio-init.mp4' \
input=../tears.mp4,stream=video,segment_template='video-$Number%03d$.mp4',playlist_name='video.m3u8',init_segment='video-init.mp4' docker build -t example .
docker run --rm -it -p 8000:80 example The URLs should now be:
|
Key rotation appears to be broken for HLS due to the way the |
This is a nice-regardless improvement to SampleQueue, which will likely to used to fix the referenced issue. It makes it possible for SampleQueue subclasses to support dynamic changes to format adjustment in a non-hacky way. Issue: #6903 PiperOrigin-RevId: 292314720
Passing EXT-X-KEY DrmInitData through the FragmentedMp4Extractor doesn't work for streams with key rotation, because an extractor instance is used for multiple segments, but is only passed the EXT-X-KEY DrmInitData corresponding to the first segment. This change removes passing DrmInitData through the extractor, and instead passes it via FormatAdjustingSampleQueue. This is in-line with how manifest DrmInitData is handled during DASH playbacks. Issue: #6903 PiperOrigin-RevId: 292323429
This should be fixed in |
This is a nice-regardless improvement to SampleQueue, which will likely to used to fix the referenced issue. It makes it possible for SampleQueue subclasses to support dynamic changes to format adjustment in a non-hacky way. Issue: #6903 PiperOrigin-RevId: 292314720
Passing EXT-X-KEY DrmInitData through the FragmentedMp4Extractor doesn't work for streams with key rotation, because an extractor instance is used for multiple segments, but is only passed the EXT-X-KEY DrmInitData corresponding to the first segment. This change removes passing DrmInitData through the extractor, and instead passes it via FormatAdjustingSampleQueue. This is in-line with how manifest DrmInitData is handled during DASH playbacks. Issue: #6903 PiperOrigin-RevId: 292323429
Issue: #6903 PiperOrigin-RevId: 292884280
Issue: #6903 PiperOrigin-RevId: 292884280
Issue description
When I play the video, it stops at the point where it needs to load the third key. The message on the screen is "Playback failed".
The exception message on an Android 7.0 device is:
On an Android 9.0 device, the exception message is:
If I press play, the video resumes until the next key rotation, when it stops with the same error. I can keep repeating this.
Reproduction steps
I downloaded the 720p version of Tears of Steel from YouTube, using youtube-dl, and renamed it to
tears.mp4
.youtube-dl -F 'https://www.youtube.com/watch?v=41hv2tW5Lc4'
youtube-dl -f 22 'https://www.youtube.com/watch?v=41hv2tW5Lc4'
I used the pre-compiled Shaka Packager v2.4.1 Linux binary.
I prepared two versions of the video: one with a clear lead, and one without (remove the
--clear_lead 10
line). The content ID istest
.I tried playing the stream in the demo app:
Playing the HLS version results in the described behavior. If it has the clear lead, the error happens a bit later. It always happens when the third key is about to be loaded.
The MPD version works fine.
Link to test content
Already explained.
A full bug report captured from the device
I hope the reproduction steps are enough. If not, I will capture one later.
Version of ExoPlayer being used
I used the demo app from
r2.11.1
.Device(s) and version(s) of Android being used
Huawei P10 Lite (WAS-LX1), Android 7.0, API 24.
Wileyfox Swift, Android 9.0, API 28.
The text was updated successfully, but these errors were encountered: