Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QtWebengine 5.15.10 with proprietary codecs, build problems on Ubuntu 22.04
QtWS25 Last Chance

QtWebengine 5.15.10 with proprietary codecs, build problems on Ubuntu 22.04

Scheduled Pinned Locked Moved Solved QtWebEngine
3 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maxt
    wrote on last edited by maxt
    #1

    I wrote an application with QtWebEngine, but I need support for the h264 codec and QtWebEngine doesn't include it by default because of patent problems, or so I heard.
    That's why I decided to build QtWebEngine from source and enable proprietary codecs.
    I can't use the latest Qt6-based QtWebEngine, so I chose the most recent Qt5 version, which is 5.15.10.

    # Installing dependencies:
    sudo apt install gperf perl flex bison python2 libnss3-dev qtdeclarative5-private-dev
    sudo apt install libdrm-dev libxcomposite-dev libxcomposite1 libnx-x11-dev libxkbfile-dev libxtst-dev libxdamage-dev  libxdamage1 libxrandr-dev libxrandr2 libxkbfile-dev libxkbfile1 libx11-xcb-dev
    
    
    # Getting source code
    git clone -b 5.15.10 https://github.com/qt/qtwebengine.git
    cd qtwebengine
    git submodule update --init --recursive
    
    # Checking versions of Python and g++
    python --version
    > Python 2.7.18
    g++ --version
    > g++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0
    
    # Creating build directory and building
    mkdir build
    cd build
    qmake .. -- -proprietary-codecs
    make -j4 -l4
    

    It manages to build most of the source, but then I get this message:

    [16150/25745] /usr/bin/g++ -MMD -MF obj/third_party/webrtc/modules/congestion_controller/rtp/control_handler/control_handler.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DRTC_ENABLE_VP9 -DHAVE_SCTP -DENABLE_EXTERNAL_AUTH -DWEBRTC_USE_H264 -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DWEBRTC_LIBRARY_IMPL -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DNO_MAIN_THREAD_WRAPPING -Igen -I../../../../src/3rdparty/chromium -I../../../../src/3rdparty/chromium/third_party/webrtc_overrides -I../../../../src/3rdparty/chromium/third_party/webrtc -Igen/third_party/webrtc -I../../../../src/3rdparty/chromium/third_party/abseil-cpp -I../../../../src/3rdparty/chromium/third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen -I../../../../src/3rdparty/chromium/third_party/libyuv/include -Igen -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -m64 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -std=gnu++14 -Wno-narrowing -Wno-class-memaccess -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage -Wno-invalid-offsetof -Wno-return-type -Wno-deprecated-copy -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -c ../../../../src/3rdparty/chromium/third_party/webrtc/modules/congestion_controller/rtp/control_handler.cc -o obj/third_party/webrtc/modules/congestion_controller/rtp/control_handler/control_handler.o
    ninja: build stopped: subcommand failed.
    make[3]: *** [Makefile.gn_run:436: run_ninja] Error 1
    make[3]: Leaving directory '/home/max/Documents/qtwebengine/build/src/core'
    make[2]: *** [Makefile:82: sub-gn_run-pro-make_first] Error 2
    make[2]: Leaving directory '/home/max/Documents/qtwebengine/build/src/core'
    make[1]: *** [Makefile:80: sub-core-make_first] Error 2
    make[1]: Leaving directory '/home/max/Documents/qtwebengine/build/src'
    make: *** [Makefile:49: sub-src-make_first] Error 2
    

    Then I try to run this command manually:

    /usr/bin/g++ -MMD -MF obj/third_party/webrtc/modules/congestion_controller/rtp/control_handler/control_handler.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DRTC_ENABLE_VP9 -DHAVE_SCTP -DENABLE_EXTERNAL_AUTH -DWEBRTC_USE_H264 -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DWEBRTC_LIBRARY_IMPL -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DNO_MAIN_THREAD_WRAPPING -Igen -I../../../../src/3rdparty/chromium -I../../../../src/3rdparty/chromium/third_party/webrtc_overrides -I../../../../src/3rdparty/chromium/third_party/webrtc -Igen/third_party/webrtc -I../../../../src/3rdparty/chromium/third_party/abseil-cpp -I../../../../src/3rdparty/chromium/third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen -I../../../../src/3rdparty/chromium/third_party/libyuv/include -Igen -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -m64 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -std=gnu++14 -Wno-narrowing -Wno-class-memaccess -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage -Wno-invalid-offsetof -Wno-return-type -Wno-deprecated-copy -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -c ../../../../src/3rdparty/chromium/third_party/webrtc/modules/congestion_controller/rtp/control_handler.cc -o obj/third_party/webrtc/modules/congestion_controller/rtp/control_handler/control_handler.o
    

    To run it manually, I change directory to

    cd src/core/release 
    

    and run this command. It works and the file compiles successfully, so I'm not sure if this particular file causes any problems. But the build fails anyway.

    I have 24 GB of RAM and memory consumption during the build never goes above 8 GB, when I look at

    htop
    

    during the build.

    Also I don't see any out of memory(OOM) errors when I run

    sudo dmesg
    

    I did a fair amount of Googling and forum reading, but couldn't find the answer.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      maxt
      wrote on last edited by
      #2

      I found a fix.
      It turns out QtWebEngine uses system Ninja by default, but also has its own Ninja.
      I read that using system Ninja can cause problems, so I switched to QtWebEngine Ninja by adding

      -no-feature-webengine-system-ninja
      

      to qmake, like so:

      qmake .. -- -proprietary-codecs -no-feature-webengine-system-ninja
      
      V 1 Reply Last reply
      1
      • M maxt

        I found a fix.
        It turns out QtWebEngine uses system Ninja by default, but also has its own Ninja.
        I read that using system Ninja can cause problems, so I switched to QtWebEngine Ninja by adding

        -no-feature-webengine-system-ninja
        

        to qmake, like so:

        qmake .. -- -proprietary-codecs -no-feature-webengine-system-ninja
        
        V Offline
        V Offline
        Vijaykarthikeyan
        wrote on last edited by
        #3

        @maxt Imusing Qt 5.15.2 version..my project is to connect the ip camera using ip address and viewing the output of the video of the ip camera using webengineview. When I worked with project in debug build..the output is showing.But when I try to build it in release build,it is not working.the web page is loading..but the video output is not loading..But,in web browser,it is showing. I have included all the necessay libraries to load the webview and i have succesfully viewed the output of the ip camera in debug build.The error message is:

        [66928:64908:0823/193205.676:INFO:CONSOLE(1)] "Uncaught NotSupportedError: Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp4;codecs="avc1.640029"') is unsupported.", source: http://192.168.56.50/module/videoMediaSource.js (1)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved