Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-91677

Add vaapi support to Linux build

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.6.0 Beta1, 6.6.0
    • 5.15.3, 6.2.2, 6.3.0, 6.4.0
    • WebEngine
    • Linux/Wayland, Linux/X11
    • 7e5ee9d6a (108-based), 1b7aaf1c7 (dev)

    Description

      Most Linux distros (Debian, Fedora, Arch Linux, Gentoo) now ship chromium with vaapi support enabled, which in principle allows users to make use of hardware accelerated video decoding (HAVD). This indicates that 1) builds with vaapi support are stable, and also that 2) HAVD works and is somewhat commonly used. In fact, chromium version 88 now enables the use_vaapi build flag by default. Enabling this flag is necessary (but not sufficient) to use in-browser HAVD on h264 and VP8/9 videos on Linux. To actually turn on HAVD, the user needs to supply some runtime flags to chromium (to check if HAVD is actually being used on an intel GPU, check the Video*/0 fields of intel_gpu_top). The specific set of flags one needs enable at runtime differs from system to system, but on Chromium v87 (the one shipped with the recently released qtwebengine 5.15.3) and a modern Intel GPU I only needed to use ––enable–accelerated–video–decode and --use-gl=desktop.

      Enabling HAVD has been previously discussed in the context of qtwebengine (https://wiki.qt.io/QtWebEngine/VideoAcceleration and https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/209204), but these discussions/code changes seem really outdated today. Some chromium-based browsers (such as brave ) literally only enable the use_vaapi flag, and nothing more. Furthermore, HAVD on Linux has seen an increasing amount of attention in the Chromium repo, and, as I observed above, indeed seems to work without much hassle on any Intel GPU from Kaby Lake onward. Further stability of vaapi is guaranteed by the fact that Intel has been steadily working on libva and the intel-media-driver. (NVIDIA might be a different story, but, again, use_vaapi is a build-flag that doesn't affect runtime, so NVIDIA users needn't worry).

      The intend of this suggestion is to prioritize support for HAVD in qtwebengine, such that qtwebengine users can benefit from performance and battery-life related improvements other chromium-based browsers have seen in the last two years. It would be lovely if you could introduce support for the use_vaapi buildflag in QT 5.15.X (or 6.X!), as watching any HD video in webengine drains a lot of battery, and uses a disproportionate amount of CPU resources.

      Attachments

        Issue Links

          Activity

            People

              allan.jensen Allan Sandfeld Jensen
              rien333 Rijnder Wever
              Votes:
              4 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: