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

Multikey protected Dash video doesn't work #3780

Closed
pi-andrei opened this issue Feb 1, 2018 · 3 comments
Closed

Multikey protected Dash video doesn't work #3780

pi-andrei opened this issue Feb 1, 2018 · 3 comments
Assignees
Labels

Comments

@pi-andrei
Copy link

pi-andrei commented Feb 1, 2018

Issue description

ExoPlayer is unable to play DASH video with multiple content protection keys and fails with error:

com.google.android.exoplayer2.demo E/ExoPlayerImplInternal: Renderer error.
com.google.android.exoplayer2.ExoPlaybackException
    at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:750)
    at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:553)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:560)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:306)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:154)
    at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: android.media.MediaCodec$CryptoException: Error decrypting data: requested key has not been loaded
    at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method)
    at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:2480)
    at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:741)
    at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:553) 
    at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:560) 
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:306) 
    at android.os.Handler.dispatchMessage(Handler.java:98) 
    at android.os.Looper.loop(Looper.java:154) 
    at android.os.HandlerThread.run(HandlerThread.java:61) 

I saw one related topic in issue tracker: #1824 However it is closed with no actions done. There was a discussion about other ways to implement it and how to interpret DASH specs, but time has passed, and there is more clear explanation in newer spec what should client (player) do (See http://dashif.org/wp-content/uploads/2017/09/DASH-IF-IOP-v4.1-clean.pdf chapter 7.7.9. Client Interactions with DRM Systems):

Clients SHALL explicitly request all required media keys signaled by default KIDs and SHALL NOT assume that requesting one key from this set will implicitly make others available.

Multi-key is important in situation with different quality levels, because we need to apply different protection policies to different types of content. E.g. client needs a high security in-seat airline-owned device to play 4K video, but he may need medium security for 1080p and below that on any device. Using different keys is the technical mechanism that enables DRM system to enforce such different rules.

Reproduction steps

  1. In the ExoPlayer demo app version 2.6.1 add next content to the media.exolist.json
{
        "name": "v7-MultiDRM-MultiKey 1080p",
        "uri": "https://media.axprod.net/TestVectors/v7-MultiDRM-MultiKey/Manifest_1080p.mpd",
        "drm_scheme": "widevine",
        "drm_license_url": "https://drm-widevine-licensing.axtest.net/AcquireLicense",
        "drm_key_request_properties": {
          "X-AxDRM-Message": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiODAzOTliZjUtOGEyMS00MDE0LTgwNTMtZTI3ZTc0OGU5OGMwIiwiZW5jcnlwdGVkX2tleSI6ImxpTkpxVmFZa05oK01LY3hKRms3SWc9PSJ9LHsiaWQiOiI5MDk1M2UwOS02Y2IyLTQ5YTMtYTI2MC03YTVmZWZlYWQ0OTkiLCJlbmNyeXB0ZWRfa2V5Ijoia1l0SEh2cnJmQ01lVmRKNkxrYmtuZz09In0seyJpZCI6IjBlNGRhOTJiLWQwZTgtNGE2Ni04YzNmLWMyNWE5N2ViNjUzMiIsImVuY3J5cHRlZF9rZXkiOiI3dzdOWkhITE1nSjRtUUtFSzVMVE1RPT0ifSx7ImlkIjoiNTg1ZjIzM2YtMzA3Mi00NmYxLTlmYTQtNmRjMjJjNjZhMDE0IiwiZW5jcnlwdGVkX2tleSI6IkFjNFVVbVl0Qko1blBROU4xNXJjM2c9PSJ9LHsiaWQiOiI0MjIyYmQ3OC1iYzQ1LTQxYmYtYjYzZS02ZjgxNGRjMzkxZGYiLCJlbmNyeXB0ZWRfa2V5IjoiTzZGTzBmcVNXb3BwN2JqYy9ENGxNQT09In1dfX0.uF6YlKAREOmbniAeYiH070HSJhV0YS7zSKjlCtiDR5Y"
        }
}
  1. Try to play added media.

Link to test content

https://media.axprod.net/TestVectors/v7-MultiDRM-MultiKey/Manifest_1080p.mpd

Version of ExoPlayer being used

ExoPlayer 2.6.1

Device(s) and version(s) of Android being used

Not device specific. For bugreport used Nexus 9 with Android 7.1.1

A full bug report captured from the device

Bugreport sent by email

@ojw28
Copy link
Contributor

ojw28 commented Feb 21, 2018

  • Note that for the specific case where audio and video are encrypted with separate keys, you can enable support by setting multiSession = true when instantiating DefaultDrmSessionManager.
  • Enabling multiSession = true probably works for content where different representations within an adaptation set (e.g. HD vs SD video) as well, however I think adaptation wont be seamless. Ensuring it is, and that playback proceeds correctly, is what's being tracked by this issue.

@pi-andrei
Copy link
Author

Thanks for reply, multiple keys obtaining now works indeed.

@ojw28
Copy link
Contributor

ojw28 commented Apr 16, 2018

The remaining work here is now tracked by #4133.

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

No branches or pull requests

3 participants