Decrypting widevine DRM protected video in android using MediaDrm

user1581813 picture user1581813 · Jul 1, 2014 · Viewed 7.4k times · Source

I am trying to decrypt widevine DRm protected media file using Android's MediaDrm API. But MediaDrm is instantiated using UUId( of DRM-scheme). Android developer site says

"App accesses the DRM-scheme-identifying UUID, typically from metadata in the content, and uses this UUID to construct an instance of a MediaDrm object that is able to support the DRM scheme required by the content". (www.developer.android.com/reference/android/media/MediaDrm.html).

So I tried to get UUID using MediaExtractor.getpsshInfo() but it returned a null object. Then I tried DrmManagerClient.getMetadata(uri of media content) but again this method also returned null.

I tried this on the follwing widevine demo uri:

content URL: http://commondatastorage.googleapis.com/wvmedia/starz_main_720p_6br_tp.wvm
Licence server: https://license.uat.widevine.com/getlicense/widevine

although after aquiring rights using DrmManagerClient API I am able to play the video in Android's native MediaPLayer( VideoView) but I want to decrypt the media file using Android's MediaDrm API and want to get unencrypted data ,which I am not able to do because I am not getting proper UUID value. Can someone point me in the right direction to achieve this.

Or Can some one help me in accessing a DRM scheme - UUID value?

Thanks

Answer

user1581814 picture user1581814 · Jul 2, 2014

mediaDRM is designed for EME Common Encryption playback. See https://developer.android.com/reference/android/media/MediaDrm.html

The Widevine content you have listed is not in the Common Encryption format and therefore, is incompatible.