Make mp4/h264 video work in QtWebEngine on Windows

2019-04-02 16:08发布

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条回答
做自己的国王
2楼-- · 2019-04-02 17:02

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.

查看更多
登录 后发表回答