[SOLVED] Build CEF with proprietary codecs 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.

[SOLVED] Build CEF with proprietary codecs support

Postby FinitelyFailed » Fri Oct 16, 2015 6:11 am

Hi

I would like to build CEF 2524 (current master branch) for Windows (x64, Visual Studio 2013) with proprietary codec support. I have managed to build CEF with the automated python script without any problem. But I struggle on how to enable proprietary codecs (H.264, MP3 etc.).
I have read a number of different methods, which all include setting "proprietary_codecs=1", some mention setting "ffmpeg_branding=Chrome". Some mention that I should add them to cef.gypi and some that I should set the env variable GYP_DEFINES (in cmd run 'set GYP_DEGINES=""proprietary_codecs=1 ffmpeg_branding=Chrome" ?).

I have tried to change cef.gypi and add "proprietary_codecs=1" and build it, but that didn't work.
Last edited by FinitelyFailed on Fri Oct 16, 2015 7:28 am, edited 1 time in total.
FinitelyFailed
Techie
 
Posts: 27
Joined: Wed Sep 16, 2015 1:22 am

Re: Build CEF with proprietary codecs support

Postby amaitland » Fri Oct 16, 2015 6:33 am

Setting the environment variable used to work, at least with the 2357 branch.
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 624
Joined: Wed Jan 14, 2015 2:35 am

Re: Build CEF with proprietary codecs support

Postby FinitelyFailed » Fri Oct 16, 2015 7:28 am

My latest build just finished. And it works. :)

I first ran the automatic buildscript (which is awesome btw).

When that build was finished I, did the following:
Added:
'proprietary_codecs': 1",
'ffmpeg_branding': 'Chrome'

to the cef.gypi file in chromium/src/cef/.

I sat the environment variable GYP_DEFINES (set GYP_DEFINES="proprietary_codecs=1 ffmpeg_branding=Chrome".

Then I ran the script again, with some flags: "python automate-git-py --download-dir=cef_master --x64-build --no-update --force-config --force-build"

And now it works. :)
FinitelyFailed
Techie
 
Posts: 27
Joined: Wed Sep 16, 2015 1:22 am

Re: [SOLVED] Build CEF with proprietary codecs support

Postby magreenblatt » Fri Oct 16, 2015 10:09 am

Setting GYP_DEFINES before running the automate script should be sufficient. No need to modify cef.gypi.
magreenblatt
Site Admin
 
Posts: 9034
Joined: Fri May 29, 2009 6:57 pm

Re: [SOLVED] Build CEF with proprietary codecs support

Postby markvw » Sun Dec 13, 2015 12:12 pm

Perhaps a stupid question but how do I change the GYP_DEFINES ?

Can I just open terminal and set?
export GYP_DEFINES="proprietary_codecs=1 ffmpeg_branding=Chrome"
markvw
Techie
 
Posts: 11
Joined: Fri Dec 11, 2015 3:58 am

Re: [SOLVED] Build CEF with proprietary codecs support

Postby magreenblatt » Sun Dec 13, 2015 4:37 pm

markvw wrote:Perhaps a stupid question but how do I change the GYP_DEFINES ?

Can I just open terminal and set?
export GYP_DEFINES="proprietary_codecs=1 ffmpeg_branding=Chrome"

Yes. Do that before running automate-git.py or cef_create_projects.sh. If you're on Windows use "set" instead of "export".
magreenblatt
Site Admin
 
Posts: 9034
Joined: Fri May 29, 2009 6:57 pm

Re: [SOLVED] Build CEF with proprietary codecs support

Postby azaitcev » Mon Feb 01, 2016 5:32 am

I followed these steps:

FinitelyFailed wrote:I sat the environment variable GYP_DEFINES (set GYP_DEFINES="proprietary_codecs=1 ffmpeg_branding=Chrome".

Then I ran the script again, with some flags: "python automate-git-py --download-dir=cef_master --x64-build --no-update --force-config --force-build"


but I get this error:


Updating projects from gyp files...
usage: version.py [-h] [-f FILE] [-i INPUT] [-o OUTPUT] [-t TEMPLATE]
[-e EVAL]
...
version.py: error: Unexpected arguments: ['ffmpeg_branding=Chrome', 'fastbuild=1', '-t', '@MAC_PREFPANE_BUNDLE_NAME@']
gyp: Call to 'python ../build/util/version.py -f ../remoting/branding_Chrome buildtype=Official proprietary_codecs=1 ffmpeg_branding=Chrome fastbuild=1 -t "@MAC_PREFPANE_BUNDLE_NAME@"' returned exit status 2 while in ..\remoting\remoting.gyp.
gyp: Undefined variable c_sources in ..\third_party\ffmpeg\ffmpeg.gyp
Traceback (most recent call last):
File "tools\gclient_hook.py", line 106, in <module>
RunAction(cef_dir, gyper)
File "c:\cefsource\source\chromium\src\cef\tools\gclient_util.py", line 39, in RunAction
command, cwd=dir, always=True)
File "c:\cefsource\depot_tools\gclient_utils.py", line 293, in CheckCallAndFilterAndHeader
return CheckCallAndFilter(args, **kwargs)
File "c:\cefsource\depot_tools\gclient_utils.py", line 538, in CheckCallAndFilter
rv, args, kwargs.get('cwd', None), None, None)
subprocess2.CalledProcessError: Command 'c:\\cefsource\\depot_tools\\python276_bin\\python.exe ../build/gyp_chromium cef.gyp -I cef.gypi' returned non-zero exit status 1 in c:\cefsource\source\chromium\src\cef
Traceback (most recent call last):
File "c:\cefsource\automate-git.py", line 894, in <module>
run(path, cef_src_dir, depot_tools_dir)
File "c:\cefsource\automate-git.py", line 55, in run
shell=(sys.platform == 'win32'))
File "C:\cefsource\depot_tools\python276_bin\lib\subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['c:\\cefsource\\source\\chromium\\src\\cef\\cef_create_projects.bat']' returned non-zero exit status 1


Did I miss something?
azaitcev
Newbie
 
Posts: 1
Joined: Mon Feb 01, 2016 5:22 am

Re: [SOLVED] Build CEF with proprietary codecs support

Postby callum » Fri May 20, 2016 1:49 pm

I've been trying to do the same thing for the Win32 2526 branch.

I set the environment variables in a command prompt and ran the script - resulting CEF works as expected but no media support - navigating to an MPEG-4 URL in cefclient.exe asked to download it.

I added the lines as described to the cef.gypi file, rebuilt and the embedded medias support worked - navigating to a video URL played it inside cefclient.exe along with transport controls.

This is how I added the environment variables:
set GYP_DEFINES="proprietary_codecs=1 ffmpeg_branding=Chrome"

Worth mentioning that when I tried the same thing on OS X using 'export' and the tip, vs a named branch, I got a CEF package that played media.

Only other undocumented thing I noticed about the Windows version is that I had to:
set GYP_MSVS_VERSION=2013
before the script would run.

Has anyone successfully build a version on Windows with the proprietary codecs enabled by simply setting environment variables?
callum
Expert
 
Posts: 224
Joined: Mon Feb 23, 2015 6:19 pm

Re: [SOLVED] Build CEF with proprietary codecs support

Postby magreenblatt » Fri May 20, 2016 8:55 pm

Remove the quotes from GYP_DEFINES.
magreenblatt
Site Admin
 
Posts: 9034
Joined: Fri May 29, 2009 6:57 pm

Re: [SOLVED] Build CEF with proprietary codecs support

Postby callum » Mon May 23, 2016 3:11 pm

That didn't work either. I entered:

set GYP_MSVS_VERSION=2013
set GYP_DEFINES=proprietary_codecs=1 ffmpeg_branding=Chrome

at a command prompt and ran:

python automate-git.py --download-dir=.\cef_opt_release --no-debug-build --branch=2526

Builds as expected but visiting an MPEG-4 URL still asks to download it vs play it.
callum
Expert
 
Posts: 224
Joined: Mon Feb 23, 2015 6:19 pm

Next

Return to Support Forum

Who is online

Users browsing this forum: Bing [Bot], GieltjE, Google [Bot] and 15 guests