• 9137阅读
  • 42回复

QT5.15.2  编译qwebengine  支持mp4 求助![已解决] [复制链接]

上一主题 下一主题
离线89614215
 

只看楼主 倒序阅读 楼主  发表于: 2021-01-20
如题!我已经试过n多方法了!总是提示错误
有哪位大神编译过,给个编译方法和注意事项!



这个错误 是怎么也跳不过去,请大神指点

根据论坛大神指点通过修改代码完成编译,现存放网盘,简单测试可用!
链接: https://pan.baidu.com/s/1GsFfs40uZf-6PzZLn_ZA7g 提取码: c8wb

以后编译的版本也会上传此链接!

在线lixinwei

只看该作者 1楼 发表于: 2021-01-20
Qt WebEngine 5.15.2,用VS2019 16.8版本好像无法编译通过的。解决方法要么降级VS2019的版本(很麻烦),要么按照https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/321741修改源码,要么放弃



离线89614215

只看该作者 2楼 发表于: 2021-01-20
回 lixinwei 的帖子
lixinwei:Qt WebEngine 5.15.2,用VS2019 19.8版本好像无法编译通过的。解决方法要么降级VS2019的版本(很麻烦),要么按照https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/321741修改源码,要么放弃
(2021-01-20 22:19)

源码我修改过一个文件,后边又提示编译器引用的文件错了,就不敢再改了。先按照你提供的地址修改一下源码试试吧,感谢你的指点!!!!
在线lixinwei

只看该作者 3楼 发表于: 2021-01-20
回 89614215 的帖子
89614215:源码我修改过一个文件,后边又提示编译器引用的文件错了,就不敢再改了。先按照你提供的地址修改一下源码试试吧,感谢你的指点!!!!
(2021-01-20 23:01)

我也没试过这样改源码,我只是根据git历史记录判断出要做这样的修改才能在VS2019 16.8版本下编译通过,希望能帮到你

在线liulin188

只看该作者 4楼 发表于: 2021-01-20
你要静态编译?
https://wiki.qt.io/Qt_5.12_Release
https://wiki.qt.io/New_Features_in_Qt_5.12
https://wiki.qt.io/Qt_5.12.0_Known_Issues
https://www.qt.io/blog/qt-5.13.2-released
https://www.qt.io/blog/qt-creator-4.10.2-released
https://wiki.qt.io/Qt_5.12_Tools_and_Versions
在线fsu0413

只看该作者 5楼 发表于: 2021-01-21
5.15.2的Webengine是坑。。。。
不要不敢改源码
离线89614215

只看该作者 6楼 发表于: 2021-01-23
回 lixinwei 的帖子
lixinwei:Qt WebEngine 5.15.2,用VS2019 16.8版本好像无法编译通过的。解决方法要么降级VS2019的版本(很麻烦),要么按照https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/321741修改源码,要么放弃
 (2021-01-20 22:19) 

通过修改代码完成编译!感谢!!!
离线kelly123

只看该作者 7楼 发表于: 2021-01-24
楼主,请问这个编译的QtWebEngine支持播放音视频吗
离线89614215

只看该作者 8楼 发表于: 2021-01-24
回 kelly123 的帖子
kelly123:楼主,请问这个编译的QtWebEngine支持播放音视频吗 (2021-01-24 09:53) 

支持mp4  。为了支持这个才自己编译的!!!
在线liulin188

只看该作者 9楼 发表于: 2021-01-25
支持楼主,给楼主打call
https://wiki.qt.io/Qt_5.12_Release
https://wiki.qt.io/New_Features_in_Qt_5.12
https://wiki.qt.io/Qt_5.12.0_Known_Issues
https://www.qt.io/blog/qt-5.13.2-released
https://www.qt.io/blog/qt-creator-4.10.2-released
https://wiki.qt.io/Qt_5.12_Tools_and_Versions
离线kelly123

只看该作者 10楼 发表于: 2021-01-25
回 89614215 的帖子
89614215:支持mp4  。为了支持这个才自己编译的!!! (2021-01-24 15:52) 

奇怪,我自己编译Qt5.13.0版本里的QtWebEngine.dll,用了网上说的所有方法,编译出来的就是不支持播放音视频,楼主能不能给个编译教程
在线fsu0413

只看该作者 11楼 发表于: 2021-01-26
回 kelly123 的帖子
kelly123:
奇怪,我自己编译Qt5.13.0版本里的QtWebEngine.dll,用了网上说的所有方法,编译出来的就是不支持播放音视频,楼主能不能给个编译教程

configure里添加这个参数

  1. -webengine-proprietary-codecs

离线kelly123

只看该作者 12楼 发表于: 2021-01-26
回 fsu0413 的帖子
fsu0413:configure里添加这个参数
-webengine-proprietary-codecs
 (2021-01-26 12:49) 

我在命令行下用qmake语句这样编译:C:\Qt\Qt5.13.0\5.13.0\msvc2017_64\bin\qmake.exe -- -webengine-proprietary-codecs 但是编译出来的QtWebEngine.dll就是不支持音视频播放,会不会是因为我的Win10系统和VS2017都是中文版的缘原故?
在线fsu0413

只看该作者 13楼 发表于: 2021-01-26
回 kelly123 的帖子
kelly123:我在命令行下用qmake语句这样编译:C:\Qt\Qt5.13.0\5.13.0\msvc2017_64\bin\qmake.exe -- -webengine-proprietary-codecs 但是编译出来的QtWebEngine.dll就是不支持音视频播放,会不会是因为我的Win10系统和VS2017都是中文版的缘原故?
 (2021-01-26 18:19) 

你单独编webengine?不知道了。。。。
离线kelly123

只看该作者 14楼 发表于: 2021-01-26
回 fsu0413 的帖子
fsu0413:你单独编webengine?不知道了。。。。 (2021-01-26 20:10) 

是呀,我单独编译QWebEngine源码包,在命令行窗口看到proprietary_codecs=true ffmpeg_branding=chrome 可就是编译出来的dll不支持音视频
在线fsu0413

只看该作者 15楼 发表于: 2021-01-27
回 kelly123 的帖子
kelly123:是呀,我单独编译QWebEngine源码包,在命令行窗口看到proprietary_codecs=true ffmpeg_branding=chrome 可就是编译出来的dll不支持音视频[表情] (2021-01-26 21:08) 

单独编译webengine没试过,我都是放在Qt包里一起编的
离线89614215

只看该作者 16楼 发表于: 2021-01-28
回 kelly123 的帖子
kelly123:是呀,我单独编译QWebEngine源码包,在命令行窗口看到proprietary_codecs=true ffmpeg_branding=chrome 可就是编译出来的dll不支持音视频[表情] (2021-01-26 21:08)

这个版本我还真编译过。一会我发上边的共享链接里,你测试一下看看能用不!!!!!!!!!!!!!(注意备份测试,我记得是可以播放的,具体还是需要测试的!)
离线kelly123

只看该作者 17楼 发表于: 2021-01-28
回 89614215 的帖子
89614215:这个版本我还真编译过。一会我发上边的共享链接里,你测试一下看看能用不!!!!!!!!!!!!!(注意备份测试,我记得是可以播放的,具体还是需要测试的!)
 (2021-01-28 19:12) 

楼主发了吗,我测试下
离线kelly123

只看该作者 18楼 发表于: 2021-01-28
回 kelly123 的帖子
kelly123:楼主发了吗,我测试下 (2021-01-28 20:27) 

可以了,验证过楼主发的是可以的,谢谢你!
离线kelly123

只看该作者 19楼 发表于: 2021-01-28
回 kelly123 的帖子
kelly123:[表情]可以了,验证过楼主发的是可以的,谢谢你! (2021-01-28 21:18) 

群主,我想问下nmake install命令的安装路径怎么设置到自己想要的路径?
离线89614215

只看该作者 20楼 发表于: 2021-01-29
回 kelly123 的帖子
kelly123:群主,我想问下nmake install命令的安装路径怎么设置到自己想要的路径? (2021-01-28 21:54) 

我网上试过不管用,所以我就用笨办法,把原来的先备份一下。再编译安装
离线kelly123

只看该作者 21楼 发表于: 2021-01-29
回 89614215 的帖子
89614215:我网上试过不管用,所以我就用笨办法,把原来的先备份一下。再编译安装 (2021-01-29 20:08) 

我也试过网上说的方法,但就是不能把安装的目录单独放在一个新建的文件夹里
离线kelly123

只看该作者 22楼 发表于: 2021-01-29
群主,我在编译32位版本的时候,在执行qmake命令后会提示错误:Required 64-bit cross-building or native toolchain could not be found.。但我的CMD是"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"环境,怎么会报提示64位的错误

离线89614215

只看该作者 23楼 发表于: 2021-01-31
回 kelly123 的帖子
kelly123:
群主,我在编译32位版本的时候,在执行qmake命令后会提示错误:Required 64-bit cross-building or native toolchain could not be found.。但我的CMD是"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"环境,怎么会报提示64位的错误


qwebengine  是在64位的环境下交叉编译完成的。



要用这个命令
或者

其实就4个命令,无聊的话可以都试一下。
离线kelly123

只看该作者 24楼 发表于: 2021-02-01
回 89614215 的帖子
89614215:qwebengine  是在64位的环境下交叉编译完成的。
[图片]
....... (2021-01-31 11:25) 

根据楼主提供的方法,成功编译出32位QtWebEngine库,感谢楼主!
在线lixinwei

只看该作者 25楼 发表于: 2021-02-04
回 kelly123 的帖子
kelly123:
群主,我想问下nmake install命令的安装路径怎么设置到自己想要的路径?


没有办法随心所欲地设置安装路径,但是有变通的办法
如:
  1. nmake install INSTALL_ROOT=\temp
假设你的Qt安装目录是D:\Qt\5.15.2\msvc2019,用这个命令可以安装到D:\temp\Qt\5.15.2\msvc2019,后续可以根据需要剪切到其他目录,这样就不会覆盖已有的文件了
INSTALL_ROOT=后面不能有正斜杠("/"),"temp"可以换成其他的,别跟现有的文件夹冲突就好了
在线fsu0413

只看该作者 26楼 发表于: 2021-02-05
回 lixinwei 的帖子
lixinwei:没有办法随心所欲地设置安装路径,但是有变通的办法
如:
nmake install INSTALL_ROOT=\temp假设你的Qt安装目录是D:\Qt\5.15.2\msvc2019,用这个命令可以安装到D:\temp\Qt\5.15.2\msvc2019,后续可以根据需要剪切到其他目录,这样就不会覆盖已有的文件了
....... (2021-02-04 20:16) 

configure的时候设置prefix。。。。???
在线lixinwei

只看该作者 27楼 发表于: 2021-02-05
回 fsu0413 的帖子
fsu0413:configure的时候设置prefix。。。。???
(2021-02-05 06:56)

如果编译整个Qt或者qtbase,可以设置prefix;但是如果单独编译qtbase以外的模块,如单独编译qtwebengine,是无法设置prefix的,但是可以用上述方法先把需要安装的文件安装到其他位置,以避免安装的时候已有的Qt5WebEngineCore.dll等文件被直接覆盖
在线fsu0413

只看该作者 28楼 发表于: 2021-02-06
回 lixinwei 的帖子
lixinwei:如果编译整个Qt或者qtbase,可以设置prefix;但是如果单独编译qtbase以外的模块,如单独编译qtwebengine,是无法设置prefix的,但是可以用上述方法先把需要安装的文件安装到其他位置,以避免安装的时候已有的Qt5WebEngineCore.dll等文件被直接覆盖 (2021-02-05 19:23) 

好吧。。。。看来我基本没单独编译过模块,我都是全编译的
离线richards

只看该作者 29楼 发表于: 2021-05-31
多谢楼主了  cef 能把mp4支持编译 且共享出来的好难找啊
离线liaohanghua

只看该作者 30楼 发表于: 2022-06-11
请问下大家,这个警告是什么问题。
Running configuration tests...
Checking for architecture supported... yes
Checking for bison... yes
Checking for submodule initialized... yes
Checking for build path without whitespace... yes
Checking for platform supported...
Checking for gperf... yes
Checking for flex... yes
Checking for python2... C:/Python27/python.exe
Checking for 64bit compiler... no
Checking for jumbo build merge limit... 0
Checking for winversion... yes
Checking for d-bus... no
Checking for fontconfig... no
Checking for libdrm... no
Checking for system ninja... 此时不应有 \Microsoft。
no
Checking for xcomposite... no
Checking for xcursor... no
Checking for xi... no
Checking for xtst... no
Done running configuration tests.

Configure summary:

Qt WebEngine Build Tools:
  Use System Ninja ....................... no
  Use System Gn .......................... no
  Jumbo Build Merge Limit ................ no
  Developer build ........................ no
  Sanitizer .............................. no
Qt PDF:
  Support V8 ............................. no
  Support XFA ............................ no
  Support XFA-BMP ........................ no
  Support XFA-GIF ........................ no
  Support XFA-PNG ........................ no
  Support XFA-TIFF ....................... no
Qt PDF Widgets:
  Support Qt PDF Widgets ................. yes

Note: The following modules are not being compiled in this configuration:
    webenginecore
    webengine
    webenginewidgets

WARNING: 64-bit cross-building or native toolchain required to build QtWebEngine could not be found.

WARNING: QtWebEngine will not be built.

Qt is now configured for building. Just run 'nmake'.
Once everything is built, you must run 'nmake install'.
Qt will be installed into 'D:\Qt\Qt5.15.2\5.15.2\msvc2019'.

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.
在线lixinwei

只看该作者 31楼 发表于: 2022-06-11
回 liaohanghua 的帖子
liaohanghua:请问下大家,这个警告是什么问题。
Running configuration tests...
Checking for architecture supported... yes
Checking for bison... yes
Checking for submodule initialized... yes
....... (2022-06-11 18:30)

见第23楼,编译32位版本要用“x64_x86 Cross Tools Command Prompt for VS 2019”
请善用浏览器自带的网页查找功能


离线liaohanghua

只看该作者 32楼 发表于: 2022-06-11
回 lixinwei 的帖子
lixinwei:见第23楼,编译32位版本要用“x64_x86 Cross Tools Command Prompt for VS 2019”
请善用浏览器自带的网页查找功能
....... (2022-06-11 19:14) 

谢谢
问下"D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe"
这个步骤的时候 提示
"QtPdf will not be built. QtPdf requires Visual Studio 2017 or higher."
是为什么  
离线liaohanghua

只看该作者 33楼 发表于: 2022-06-11
回 liaohanghua 的帖子
liaohanghua:谢谢
问下"D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe"
这个步骤的时候 提示
"QtPdf will not be built. QtPdf requires Visual Studio 2017 or higher."
....... (2022-06-11 19:37) 

用了论坛的方法 这一步可以过了
D:\Qt\Qt5.15.2\5.15.2\Src\qtwebengine>D:\Qt\Qt5.15.2\5.15.2\msvc2019\bin\qmake.exe -- -webengine-proprietary-codecs

Running configuration tests...
Checking for architecture supported... yes
Checking for bison... yes
Checking for submodule initialized... yes
Checking for build path without whitespace... yes
Checking for platform supported...
Checking for gperf... yes
Checking for flex... yes
Checking for python2... C:/Python27/python.exe
Checking for 64bit compiler... yes
Checking for winversion... yes
Checking for jumbo build merge limit... 0
Checking for d-bus... no
Checking for fontconfig... no
Checking for libdrm... no
Checking for system ninja... 此时不应有 \Microsoft。
no
Checking for xcomposite... no
Checking for xcursor... no
Checking for xi... no
Checking for xtst... no
Checking for embedded build... no
Checking for node.js... no
Done running configuration tests.

Configure summary:

Qt WebEngine Build Tools:
  Use System Ninja ....................... no
  Use System Gn .......................... no
  Jumbo Build Merge Limit ................ no
  Developer build ........................ no
  Sanitizer .............................. no
Qt WebEngineCore:
  Embedded build ......................... no
  Full debug information ................. no
  Pepper Plugins ......................... yes
  Printing and PDF ....................... yes
  Proprietary Codecs ..................... yes
  Spellchecker ........................... yes
  Native Spellchecker .................... no
  WebRTC ................................. yes
  PipeWire over GIO ...................... no
  Geolocation ............................ yes
  WebChannel support ..................... yes
  Kerberos Authentication ................ yes
  Extensions ............................. yes
  Node.js ................................ no
Qt WebEngineQml:
  Support Qt WebEngine Qml ............... yes
  UI Delegates ........................... yes
  Test Support ........................... no
Qt WebEngineWidgets:
  Support Qt WebEngine Widgets ........... yes
Qt PDF:
  Support V8 ............................. no
  Support XFA ............................ no
  Support XFA-BMP ........................ no
  Support XFA-GIF ........................ no
  Support XFA-PNG ........................ no
  Support XFA-TIFF ....................... no
Qt PDF Widgets:
  Support Qt PDF Widgets ................. yes

WARNING: Building without node.js will disable some features of QtWebEngine DevTools.

Qt is now configured for building. Just run 'nmake'.
Once everything is built, you must run 'nmake install'.
Qt will be installed into 'D:\Qt\Qt5.15.2\5.15.2\msvc2019'.

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.
离线liaohanghua

只看该作者 34楼 发表于: 2022-06-11
Re:QT5.15.2  编译qwebengine  支持mp4 求助![已解决]
求教一下
有没有碰到这个步骤
"D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe"
提示
Microsoft (R) 程序维护实用工具 14.29.30141.0 版
版权所有 (C) Microsoft Corporation。  保留所有权利。

        cd src\ && ( if not exist Makefile D:\Qt\Qt5.15.2\5.15.2\msvc2019\bin\qmake.exe -o Makefile D:\Qt\Qt5.15.2\5.15.2\Src\qtwebengine\src\src.pro ) && "D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe" -f Makefile

Microsoft (R) 程序维护实用工具 14.29.30141.0 版
版权所有 (C) Microsoft Corporation。  保留所有权利。

        cd core\ && ( if not exist Makefile D:\Qt\Qt5.8.0\5.8\msvc2015\bin\qmake.exe -o Makefile D:\Qt\Qt5.15.2\5.15.2\Src\qtwebengine\src\core\core.pro ) && "D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe" -f Makefile

Microsoft (R) 程序维护实用工具 14.29.30141.0 版
版权所有 (C) Microsoft Corporation。  保留所有权利。

"QtWebEngineCore module will not be built. 64-bit cross-building or native toolchain required to build QtWebEngine could not be found."
        cd pdf\ && ( if not exist Makefile D:\Qt\Qt5.8.0\5.8\msvc2015\bin\qmake.exe -o Makefile D:\Qt\Qt5.15.2\5.15.2\Src\qtwebengine\src\pdf\pdf.pro ) && "D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe" -f Makefile

Microsoft (R) 程序维护实用工具 14.29.30141.0 版
版权所有 (C) Microsoft Corporation。  保留所有权利。

"QtPdf will not be built. QtPdf requires Visual Studio 2017 or higher."
这个错误
在线lixinwei

只看该作者 35楼 发表于: 2022-06-11
回 liaohanghua 的帖子
liaohanghua:求教一下
有没有碰到这个步骤
"D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe"
提示
Microsoft (R) 程序维护实用工具 14.29.30141.0 版
....... (2022-06-11 20:31)

"D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe"
说明你用的依然是 “x86 Native Tools Command Prompt for VS 2019”
编译32位webengine,必须使用开始菜单中的“x64_x86 Cross Tools Command Prompt for VS 2019”
另外,你还可以安装node.js,用来消除warning


离线zqh0.0

只看该作者 36楼 发表于: 2022-06-16
有没有大佬弄过Ubuntu下QT5.9.4版本编译QWebEngine
离线liaohanghua

只看该作者 37楼 发表于: 2022-06-18
回 lixinwei 的帖子
lixinwei:"D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe"
说明你用的依然是 “x86 Native Tools Command Prompt for VS 2019”
编译32位webengine,必须使用开始菜单中的“x64_x86 Cross Tools Command .. (2022-06-11 21:34) 

谢谢,已解决 需要清掉之前的编译中间文件配置,然后就可以编译了
在线fsu0413

只看该作者 38楼 发表于: 2022-06-19
回 zqh0.0 的帖子
zqh0.0:有没有大佬弄过Ubuntu下QT5.9.4版本编译QWebEngine (2022-06-16 15:10) 

Ubuntu有自带的WebEngine,用apt-get就能装
如果非得自己编译的话,参考
https://doc.qt.io/archives/qt-5.9/qtwebengine-platform-notes.html#linux
离线89614215

只看该作者 39楼 发表于: 2022-06-21
回 zqh0.0 的帖子
zqh0.0:有没有大佬弄过Ubuntu下QT5.9.4版本编译QWebEngine (2022-06-16 15:10) 

网盘里有5.15.2的linux版本。不知道你能凑合不
快速回复
限100 字节
 
上一个 下一个