How to enable H264 support in CEF3 latest version ?

匿名 (未验证) 提交于 2019-12-03 01:27:01

问题:

I have known that cef3's older version like 2623 can enable H264 support through modify chromium\src\cef\cef.gypi file. But in recent versions like 3071 or 3029, cef3 has removed cef.gypi file. I have googled this, but what I found is still through modify the cef.gypi file. Since this methold is only valid for older versions. Is there another way that I can make newer version enable H264 support ? Thanks very much!

回答1:

Indeed the compile option to support proprietary codecs was moved.

the magic now happens here:

set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome 

there is 2 batch files that you should update/create (as found here):

c:\code\chromium_git\update.bat:

set CEF_USE_GN=1 set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome set GN_ARGUMENTS=--ide=vs2015 --sln=cef --filters=//cef/* python ..\automate\automate-git.py --download-dir=C:\code\chromium_git --depot-tools-dir=C:\code\depot_tools --no-distrib --no-build 

c:\code\chromium_git\chromium\src\cef\create.bat:

set CEF_USE_GN=1 set GN_DEFINES=is_win_fastlink=true proprietary_codecs=true ffmpeg_branding=Chrome set GN_ARGUMENTS=--ide=vs2015 --sln=cef --filters=//cef/* call cef_create_projects.bat 

There is 2 wiki articles that explain how to build CEF/Chromium:

  1. https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart.md
  2. and BranchesAndBuilding in the same wiki

Update: Here are more links with infos on Chromium build flags:

https://www.chromium.org/developers/gn-build-configuration
https://www.chromium.org/audio-video
https://chromium.googlesource.com/chromium/src/+/lkcr/docs/windows_build_instructions.md

... GYP/GN flags which can alter behaviour of Chromium's HTML5 audio/video implementation.  ffmpeg_branding   Overrides which version of FFmpeg to use   Default: $(branding)   Values:     Chrome - includes additional proprietary codecs (MP3, etc..) for use with Google Chrome     Chromium - builds default set of codecs  proprietary_codecs   Alters the list of codecs Chromium claims to support, which affects  and canPlayType() behaviour   Default: 0(gyp)/false(gn)   Values:     0/false -  and canPlayType() assume the default set of codecs     1/true -  and canPlayType() assume they support additional proprietary codecs 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!