Page 1 of 7

[SOLVED] Build CEF with proprietary codecs support

PostPosted: Fri Oct 16, 2015 6:11 am
by FinitelyFailed
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.

Re: Build CEF with proprietary codecs support

PostPosted: Fri Oct 16, 2015 6:33 am
by amaitland
Setting the environment variable used to work, at least with the 2357 branch.

Re: Build CEF with proprietary codecs support

PostPosted: Fri Oct 16, 2015 7:28 am
by FinitelyFailed
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. :)

Re: [SOLVED] Build CEF with proprietary codecs support

PostPosted: Fri Oct 16, 2015 10:09 am
by magreenblatt
Setting GYP_DEFINES before running the automate script should be sufficient. No need to modify cef.gypi.

Re: [SOLVED] Build CEF with proprietary codecs support

PostPosted: Sun Dec 13, 2015 12:12 pm
by markvw
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"

Re: [SOLVED] Build CEF with proprietary codecs support

PostPosted: Sun Dec 13, 2015 4:37 pm
by magreenblatt
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".

Re: [SOLVED] Build CEF with proprietary codecs support

PostPosted: Mon Feb 01, 2016 5:32 am
by azaitcev
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?

Re: [SOLVED] Build CEF with proprietary codecs support

PostPosted: Fri May 20, 2016 1:49 pm
by callum
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?

Re: [SOLVED] Build CEF with proprietary codecs support

PostPosted: Fri May 20, 2016 8:55 pm
by magreenblatt
Remove the quotes from GYP_DEFINES.

Re: [SOLVED] Build CEF with proprietary codecs support

PostPosted: Mon May 23, 2016 3:11 pm
by callum
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.