CefClient with widevine support

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CefClient with widevine support

Postby javess » Thu Jan 28, 2016 5:41 pm

I'm trying to set up an application in Windows 10 x64 that can take a link to an .MPD that protected via widevine and play it back. Something like https://shaka-player-demo.appspot.com/.

I'm following this procedure to build chromium/CEF with widevine support

Set some env variables:

> set DEPOT_TOOLS_WIN_TOOLCHAIN=0
> set GYP_DEFINES=proprietary_codecs=1 ffmpeg_branding=Chrome enable_widevine=1 target_arch=x64
> set GYP_GENERATORS=ninja,msvs-ninja
> set GYP_MSVS_VERSION=2013


Download the chromium automated git build script from https://bitbucket.org/chromiumembedded/ ... ate-git.py

run python automate-git.py --download-dir=chromium_build --branch=2526 --x64-build

This triggers a very big download and very lengthy compile. Once that process is done I go to \chromium_build\chromium\src\out\Release_x64 and try to run cefclient.exe --enable-widevine-cdm --cache-path=c:\temp\cache . I navigate to the shaka player demo site and try to run any of the widevine protected files and get the following error

Unable to create the CDM for the key system com.widevine.alpha

Am I missing something here? A few weeks ago I followed a similar procedure and got playback working. Can anyone provide any guidance?


Thanks!
javess
Techie
 
Posts: 20
Joined: Thu Jan 28, 2016 5:23 pm

Re: CefClient with widevine support

Postby magreenblatt » Thu Jan 28, 2016 6:06 pm

Did you remove widevinecdm.dll from the out\Release_x64 directory?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CefClient with widevine support

Postby javess » Thu Jan 28, 2016 6:27 pm

No, I didn't think of that. Could that be the cause of the load error?

I tried taking the binary distrib and generating the vs solutions. Compiling from there and then copying the adapter and cdm dll's from AppData/Local/CEF into the output directories. Is this the wrong approach?
javess
Techie
 
Posts: 20
Joined: Thu Jan 28, 2016 5:23 pm

Re: CefClient with widevine support

Postby magreenblatt » Thu Jan 28, 2016 8:45 pm

Copying around the widevine DLLs may cause issues. Does it work if you use the generated binary distribution with no additional changes and pass the "--enable-widevine-cdm --cache-path=c:\temp" command-line flags?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CefClient with widevine support

Postby javess » Fri Jan 29, 2016 5:50 am

I've done the following tests:

1) go to chromium\src\out\Release_x64 and run cefclient.exe --enable-widevine-cdm --cache-path=c:\temp --url=http://localhost:8000/test.html . This returns an error in the chromium console Unable to create the CDM for the key system com.widevine.alpha.
2) Remove widevinecdm.dll from out\Release_x64 and run the same command. Same results
3) Also remove the widevinecdmadapter.dll. Now the error is Unsupported keySystem
4) go to chromium\src\cef\binary_distrib\cef_binary_3.2526.1371.gea9b6c8_windows64 and run cmake -G "Visual Studio 12 Win64" . Use Visual Studio to compile cefclient and run it with the same params. Throws Unsupported keySystem
5) Copying the widevide dll from AppData into the chromium\src\cef\binary_distrib\cef_binary_3.2526.1371.gea9b6c8_windows64 Release folder gets me back to the Unable to create the CDM for the key system com.widevine.alpha. error.

In the cases when the error is Unable to create the CDM for the key system com.widevine.alpha. I've tracked the failure down to the creationg of the pepper cdm wrapper here https://code.google.com/p/chromium/code ... pe=cs&l=50. More specifically this is the code path where I think things fail https://code.google.com/p/chromium/code ... e=cs&l=810.
javess
Techie
 
Posts: 20
Joined: Thu Jan 28, 2016 5:23 pm

Re: CefClient with widevine support

Postby javess » Fri Jan 29, 2016 8:15 am

I found what I had done last time and tried that.

set GYP_DEFINES=proprietary_codecs=1 ffmpeg_branding=Chrome
python automate-git.py --x64-build --download-dir=cef_build --branch=2454

run cefclient.exe --enable-widevine-cdm --cache-path=c:\temp\cache --url=http://localhost:8000/test.html

I get playback but only for 10s (the videos in widevine seem to be unencrypted to start with)

After I remove the widevinecdm.dll from the Debug_x64 folder I get full playback.

I'm curious as to wether the 2526 branch is broken somehow.

[EDIT]: I'm running a new build for 2526 with the exact same settings. I'll post here with an update if it works/fails
Last edited by javess on Fri Jan 29, 2016 11:24 am, edited 1 time in total.
javess
Techie
 
Posts: 20
Joined: Thu Jan 28, 2016 5:23 pm

Re: CefClient with widevine support

Postby magreenblatt » Fri Jan 29, 2016 11:20 am

Breakage is definitely possible. Since you're building it locally would you mind trying to debug the problem? Implementation details are available in https://bitbucket.org/chromiumembedded/ ... devine-cdm
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CefClient with widevine support

Postby javess » Fri Jan 29, 2016 12:11 pm

My latest run on 2526 worked like a charm.

It seems that something in the GYP_DEFINES set as

set GYP_DEFINES=proprietary_codecs=1 ffmpeg_branding=Chrome enable_widevine=1 target_arch=x64

broke the build.

I just followed a basic build in the same way as with 2454 and everything works now.

Thanks for the support magreenblatt
javess
Techie
 
Posts: 20
Joined: Thu Jan 28, 2016 5:23 pm

Re: CefClient with widevine support

Postby PolesApart » Tue Feb 02, 2016 12:38 pm

Sorry to hijack the thread, but I just wanna check if my understanding is correct:

- Default cef builds have widevine provisions compiled in.
- Assuming a widevine app doesn't need proprietary codecs, can I use a default build and is using "--enable-widevine-cdm --enable-cache=..." enough?

Or not?
Last edited by PolesApart on Wed May 11, 2016 5:22 pm, edited 1 time in total.
PolesApart
Mentor
 
Posts: 73
Joined: Fri Dec 05, 2014 1:24 pm

Re: CefClient with widevine support

Postby magreenblatt » Tue Feb 02, 2016 2:02 pm

PolesApart wrote:Sorry to hijack the thread, but I just wanna check if my understanding is correct:

- Default cef builds have widevine provisions compiled in.
- Assuming a widevine app doesn't need proprietary codecs, I can use a default build and --enable-widevine-cdm --enable-cache=... is enough;

Or not?

Running with `--enable-widevine-cdm --cache-path=<path>` should be enough. If you built CEF/Chromium on Windows and you're running from the out\[Debug|Release] directory then you also need to delete widevinecdm.dll.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 102 guests