Important: Please read the Qt Code of Conduct -

QtWebEngine compilation with proprietary codecs doesn't work

  • Hello,

    I'm in charge of a software which uses Qt SDK and it need the web browser included. We switched to Qt 5.7 to get modern web capabilities. We solved all our migration problems from QtWebkit to QtWebengine, except one thing : MP3 playback. And we really need it.

    So I followed this article and somes others on the Internet.

    My target is Qt 5.7.1 32bits with MSVC2015. My approach was to download from github the qtwebengine module, supply everything it needs for compilation. I added the line "WEBENGINE_CONFIG+=use_proprietary_codecs" (and in doubt, "WEBENGINE_CONFIG+=proprietary_codecs", I saw it somewhere written that way) to "" file. I saw the log saying "Proprietary codecs (H264, MP3).... Enabled", so I assumed the configuration was ok. The compilation was successful.

    Then, my first idea was to copy the new dlls directly over the SDK ones in my application folder. And ... That didn't work.
    My second idea was to recompile my application with everything generated by the qtwebengine build. So I replaced all the files from the Qt SDK folder. I added an extra "WEBENGINE_CONFIG+=use_proprietary_codecs" to my own project. The compilation was successful, but I still don't have MP3 support.

    So please, is someone here can tell me, how I can get that damned MP3 support ? :'(

  • I would be interested to know if you fixed the issue.
    I am also trying to recompile for Netflix support.
    Would be nice if you could only copy the codecs/plugins to our application instead of rebuilding every time from source.

  • Any update on this?
    Or a guide on how to build QWebEngine with propretary codecs? I find hard to get the information for that.

    New framework Electron is much easier to use, no need to recompile, for anyone interested

  • Hello,

    I fixed the issue and I posted the solution on stack. I'm sorry I forgot I posted my bug in here too.

  • Hi,
    I do exactly what is explaining on this link

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

    I have on return:
    Proprietary codecs (H264, MP3).... Enabled
    Geolocation....................... Enabled

    But, on the command: nmake
    I have on return some error:
    Qt5WebView_resource.rc(1) : fatal error RC1015: cannot open include file 'windows.h'.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Windows Kits\10\bin\x86\rc.EXE"' : code retour '0x1'
    NMAKE : fatal error U1077: 'D:\InstallationApplis\VisualStudio2015\VC\bin\nmake.exe' : code retour '0x2'
    NMAKE : fatal error U1077: 'cd' : code retour '0x2'
    NMAKE : fatal error U1077: 'cd' : code retour '0x2'

    Is there any other way to integrate mp3 and mp4 codecs into qtwebengine?

  • @lipqil
    CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

    to remove above error.

  • I just recompiled QtWebEngine on latest 5.9.3
    Compile show the flag is on, but when I run my app, I still have the error message on netflix..
    I added the widevinecdm.dll and widevinecdmadapter.dll close to my executable.

    C:\Qt\Qt5.9.3\5.9.3\Src\qtwebengine>C:\Qt\Qt5.9.3\5.9.3\msvc2015\bin\qmake WEBENGINE_CONFIG+=use_proprietary_codecs

    Running configuration tests...
    Done running configuration tests.

    Configure summary:

    Qt WebEngine:
    Embedded build ......................... no
    Pepper Plugins ......................... yes
    Printing and PDF ....................... yes
    Proprietary Codecs ..................... yes
    Spellchecker ........................... yes
    WebRTC ................................. yes
    Using system ninja ..................... no


    Also added this to my .pro file:
    QTWEBENGINE_CHROMIUM_FLAGS="--always-authorize-plugins --register-pepper-plugins="/plugins/ppapi/widevinecdmadapter.dll; application/x-ppapi-widevine-cdm""

    I wish there was one clear guide on how to do all this.
    I have to refer to an old blog and the information is all scattered..
    A real guide should not be a blog and would need to have all steps -_-

  • Just to finish, my problem was the version of widevine was incompatible (recent one are not working for some reason)
    was really hard to debug but finally found it with trial an error :)


  • @maximus Have you solved the problem?Is there a complete step reference?

  • @dr_W

    See other topic :)
    it's working for me on OSX and Windows with the latest alpha version
    remember to use the same widevine version (Chromium version vs the one you take in Chrome)

  • 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):

Log in to reply