Skip to content
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

Support widevine DRM Key Rotation #1298

Closed
asgharhussain opened this issue Feb 23, 2016 · 21 comments
Closed

Support widevine DRM Key Rotation #1298

asgharhussain opened this issue Feb 23, 2016 · 21 comments

Comments

@asgharhussain
Copy link

Hello,

We are working with Live TV (DASH) ABR packaging. The packager creates the MPD manifest while continuously rotating the Widevine(DRM) key. When I play the stream using ExoPlayer, the video does not play. The same video plays on Shaka Player.

If the DRM key policy is changed to static, then ExoPlayer (and Shaka Player) plays the stream.

Please let me know if there is a solution to this issue.

Thanks.

-Asghar

@ojw28
Copy link
Contributor

ojw28 commented Feb 23, 2016

We don't support key rotation yet, but it's on our radar.

@ghost ghost mentioned this issue Jun 22, 2016
@abouda
Copy link

abouda commented Nov 17, 2016

Hello,
I wanted to know if key rotation is supported in ExoPlayer 2 or is it being worked on.

@zhanghuicuc
Copy link

+1
I also want to know if key rotation is supported in ExoPlayer 2 or is it being worked on. Thanks.

@mcart666
Copy link

Any updates? Can you provide an approximate date when keys rotation may be available in Exo2?

@ojw28
Copy link
Contributor

ojw28 commented Jul 14, 2017

Does anyone have test streams available, that we can easily make use of (i.e. they should not be geo-restricted or require authentication, and the license server should always issue licenses)?

@mcart666
Copy link

What about streams from Axinom? See: https://github.com/Axinom/dash-test-vectors

I've checked the current version of Exo2 on "v7-MultiDRM-MultiKey" and "v7-MultiDRM-MultiKey-MultiPeriod", in particular:
https://media.axprod.net/TestVectors/v7-MultiDRM-MultiKey/Manifest_1080p.mpd
https://media.axprod.net/TestVectors/v7-MultiDRM-MultiKey-MultiPeriod/Manifest_1080p.mpd
https://media.axprod.net/TestVectors/v7-MultiDRM-MultiKey-MultiPeriod/Manifest_AudioOnly.mpd

The playback of the last one works until Exo is about to enter 2nd period, then fails with:
android.media.MediaCodec$CryptoException: Error decrypting data: requested key has not been loaded
However seeking over the moment of key change works correctly. For the first two streams Exo raises the exception just when the playback is about to start.

@ojw28
Copy link
Contributor

ojw28 commented Jul 14, 2017

That's not key rotation (which would be within a single period). Although that does separately sound like a problem.

@adrianrdzv
Copy link

@ojw28 We have key rotation in our streams, we can provide them to you for testing in a private message.

@mcart666
Copy link

@ojw28 So you're saying that this particular case (each period encrypted with a different key) is expected to work in Exo2?

@ojw28 ojw28 changed the title Widevine Live TV DRM Key Rotation Support widevine DRM Key Rotation Sep 20, 2017
@ojw28
Copy link
Contributor

ojw28 commented Sep 20, 2017

Key rotation should work in dev-v2 as of b62eab6. You'll need to set multiSession=true when instantiating your DefaultDrmSessionManager. If you're trying to test streams in the ExoPlayer demo app and wish to add one to media.exolist.json, you can specify "drm_multi_session": true, for the sample to enable multiSession mode.

@ueno-yuhei
Copy link

@ojw28
Hello, I was helped by this task.
Thank you very much.

b62eab6 was merged into release-v2 so I used it immediately.

The screen flickers black when doing Key Rotation, but can this be countermeasured?

@ojw28
Copy link
Contributor

ojw28 commented Dec 5, 2017

Are you setting multiSession to true?

@ueno-yuhei
Copy link

@ojw28 Thank you for answering.
yes, Setting multiSession to true.

It is specified when instantiating DefaultDrmSessionManager.
If multiSession is set to false, it seems that the key rotation video can not be played.

@ojw28
Copy link
Contributor

ojw28 commented Dec 5, 2017

There shouldn't be any flickering. You'd need to provide concrete reproduction steps (and probably a sample stream) for us to help work out why.

@ueno-yuhei
Copy link

@ojw28 Thank you for answering!

I will send a sample stream by email.
I will send it today.
I'm sorry but I would like you to do verification with that.

@ueno-yuhei
Copy link

@ojw28 I sent an e-mail to dev.exoplayer@gmail.com.
If you know something, please contact us.

@ojw28
Copy link
Contributor

ojw28 commented Dec 7, 2017

I'm able to reproduce. I'm not sure why it's happening though, unfortunately. I would guess there's something wrong with the way the content has been prepared, or how the license policy is configured. Or at least, that there's something in these areas that our implementation is unhappy with.

For comparison, here's a key rotation sample stream we have that plays fine in the demo app. One option could be for you to spent a bit of time working out what's different:

{
  "name": "Sintel - 3 minutes key rotation",
  "uri": "https://storage.googleapis.com/playerinfra/wv/sintel_3min_rotate.mpd",
  "drm_scheme": "widevine",
  "drm_multi_session": true,
  "drm_license_url": "https://widevine-proxy.appspot.com/proxy"
}

@ojw28
Copy link
Contributor

ojw28 commented Dec 7, 2017

Closing this issue because the feature is implemented now.

@wvpaf - Do we provide any tools/diagnostics/guidance for producing content in which the keys rotate?

@ojw28 ojw28 closed this as completed Dec 7, 2017
@ueno-yuhei
Copy link

@ojw28 Thank you for answering!

"Sintel - 3 minutes key rotation"
I checked it.
It seems to be black and flicker after 3 minutes.
It seems that the following error has appeared at that time.

12-07 20:47:58.482 26068-26068/com.google.android.exoplayer2.demo E/EventLogger: internalError [364.05, audioTrackUnderrun [49248, 256, 483]]

adb logcat log
NexusPlayerLog.txt

If you know something, please contact us.

@ojw28
Copy link
Contributor

ojw28 commented Dec 7, 2017

Heh, I looked more closely and see it too. It does seem to be far less severe than when using your test stream though, so I'm not sure whether there's something additional broken in that case. Re-opening this issue to work out what's going wrong for the sample I ref'd above in any case, thanks!

@ojw28
Copy link
Contributor

ojw28 commented Dec 7, 2017

The reason for the black flicker is that although MediaDrm session sharing is enabled, the secure video decoder is still being recreated. That shouldn't be happening. I've filed #3561 to track this issue, and will close this again as it was really intended to track the initial implementation. Thanks!

@ojw28 ojw28 closed this as completed Dec 7, 2017
@google google locked and limited conversation to collaborators Apr 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants