Make mp4/h264 video work in QtWebEngine on Windows

天涯浪子 提交于 2019-12-05 06:35:42

问题


When I point the QtWebEngine instance at a html5 test page (http://www.quirksmode.org/html5/tests/video.html) I see the WebM video, the Theora video, but not H.264/MP4.

Enabling mp4/mpeg4/avc support for Qt5 WebEngine on Linux said to build qtwebengine from source, so I'm building everything.

I downloaded this source package: http://download.qt.io/official_releases/qt/5.5/5.5.0/single/qt-everywhere-opensource-src-5.5.0.zip

I followed the directions for other dependencies, and then tried building with these commands:

configure -prefix %QT_ROOT%\build -opengl dynamic -release -nomake examples -opensource -confirm-license  -qt-libpng -qt-libjpeg -openssl -qt-pcre -no-cups -no-dbus -skip qtwebkit -skip qtconnectivity -skip qtdoc -skip qtgraphicaleffects -skip qtsensors -skip qtserialport -skip qtwebkit-examples -skip qtquick1 -skip qt3d -skip qtwebengine
nmake
nmake install
cd qtwebengine
..\build\bin\qmake WEBENGINE_CONFIG+=use_proprietary_codecs qtwebengine.pro
nmake
nmake install

Then when I build the web browser example against my new build, I get the same results as before. When I try to look for evidence that it did or didn't build the codecs, I see that ffmpegsumo.dll was created. I see no errors in the javascript console about this. I've tested with other test web pages beyond quicksmode and no results there either.


回答1:


My solution was to upgrade to Qt 5.6.1. Otherwise, I followed the directions in the original question and this time got a working result. Most notable, the qmake WEBENGINE_CONFIG+=use_proprietary_codecs did confirm it was checking and configuring h264 and mp3.



来源:https://stackoverflow.com/questions/37847968/make-mp4-h264-video-work-in-qtwebengine-on-windows

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