Unable to get mp3 support with QtWebEngine

安稳与你 提交于 2019-12-01 22:14:12

问题


I built QtWebEngine 5.7.1 from git sources to get support of proprietary codecs.

I wrote "WEBENGINE_CONFIG+=use_proprietary_codecs" to the qtwebengine.pro. While qmake was configuring the project, I saw the log saying that MP3 et H264 codecs were enabled.

I spent one day to get QtWebEngine fully compiled with msvc2015 in 32bit and ... The mp3 support still not working !

I use html5test.com to get a quick look of webbrowser capabilities.

I searched a bit and I found out about a ffmpegsumo.dll that wasn't built. I tried to get a 32bits copy over the internet, I don't know really where to put it, I tried different places, that still not working. Finally I thing that's not the good idea.

How QtWebEngine uses mp3 codec ? I'm a bit lost ...


回答1:


I finally found the solution. In brief, do not try to compile Qt SDK or any part of it using Qt Creator ...

Just use qmake and nmake in a simple cmd.exe shell. Here is how I did steppes :

First, I downloaded the source along the Qt SDK (5.7.1) with MaintenanceTools.

Then, I downloaded extra tools :

  • Python 2.7.13 from https://www.python.org/downloads/windows/
  • Perl (Strawberry vesion) from http://strawberryperl.com/
  • Bison and flex from https://sourceforge.net/projects/winflexbison/ (Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe)
  • Gperf from http://gnuwin32.sourceforge.net/packages/gperf.htm

Be sure to add every .exe to System path, and restart the computer.

Assuming Qt SDK is installed in c:\Qt, and the version is 5.7.1 compiled with MSVC2015, you start cmd.exe and you type :

cd C:\Qt\5.7\Src\qtwebengine\

C:\Qt\5.7\msvc2015\bin\qmake WEBENGINE_CONFIG+=use_proprietary_codecs

* Wait for basic configuration ... *

nmake

* Wait for compilation ... *

nmake install

* Wait for files copy into SDK ... *

Then you can use the SDK normally as if you just had downloaded it.




回答2:


I created a new topic on stackoverflow with step by step on how to do this (I lost 5 days to find these so I wanted to save others people time):

How to compile Qt webengine (5.11) on Windows with proprietary codecs




回答3:


In the chromium GYP build parameters file, I can read :

['proprietary_codecs==1', {
        'defines': ['USE_PROPRIETARY_CODECS'],
}],

Then I think there is a mistake in the Qt WebEngine Features documentation.

You should try to add in your qtwebengine.pro file

WEBENGINE_CONFIG+=proprietary_codecs

and not

WEBENGINE_CONFIG+=use_proprietary_codecs



回答4:


I tried the solution of Sébastien Bémelmans but it didn't work for me (I have Qt version 5.10.1).

Instead I found a solution on qt forum that I modified a bit to fit the actual Qt 5.10.1 version.

After doing all what Sébastien Bémelmans said:

#Edit ..\%QT_SOURCES_DIR%\qtwebengine\.qmake.conf
#Add
WEBENGINE_CONFIG += use_proprietary_codecs

#Edit ...\%QT_SOURCES_DIR%\qtwebengine\configure.json
#Search for webengine-proprietary-codecs
"autoDetect": false,
into
"autoDetect": true,
#Run qmake into ...\%QT_SOURCES_DIR%\qtwebengine\ (normally no need of adding WEBENGINE_CONFIG += use_proprietary_codecs after qmake)


来源:https://stackoverflow.com/questions/41611445/unable-to-get-mp3-support-with-qtwebengine

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