Firefox for Fedora bundled with support for accelerating video decoding via VA-API

Firefox package maintainer for Fedora Linux сообщил about readiness for use in Fedora of hardware accelerated video decoding in Firefox using VA-API. Acceleration currently only works in Wayland-based environments. VA-API support in Chromium has been implemented in Fedora last year.

Hardware accelerated video decoding in Firefox is made possible by new backend for Wayland, which uses the DMABUF mechanism for rendering to textures and organizing the sharing of buffers with these textures by different processes. In Fedora 32 and Fedora 31, freshly packaged with Firefox 77, the new backend is enabled by default when launched in a Wayland-based GNOME session, but hardware video decoding acceleration requires additional installation of the ffmpeg, libva, and libva-utils packages from the repository RPMFusionbuilt with VA-API support.

On systems with Intel graphics cards, acceleration only works with the libva-intel-driver driver (the libva-intel-hybrid-driver driver is currently not supported). For AMD GPUs, acceleration works with the standard radeonsi_drv_video.so library, which is part of the mesa-dri-drivers package. Support for NVIDIA video cards is not yet implemented. You can use the vainfo utility to evaluate driver support for VA-API. If support is confirmed, then to enable acceleration in Firefox on the "about:config" page, set the variables "gfx.webrender.enabled" and "widget.wayland-dmabuf-vaapi.enabled" to true. After restarting the browser, you need to check the activation of WebRender and the new backend (Wayland/drm) on the "about: support" page.

Firefox for Fedora bundled with support for accelerating video decoding via VA-API

Firefox for Fedora bundled with support for accelerating video decoding via VA-API

After that, you need to make sure that you use the VA-API to speed up when watching videos (there may be compatibility issues with codecs, video sizes and libraries), for which you can enable debug mode by running Firefox with the MOZ_LOG environment variable and check the output for the "VA- API FFmpeg init successful" and
"Got one VAAPI frame output".

MOZ_LOG="PlatformDecoderModule:5" MOZ_ENABLE_WAYLAND=1 firefox

The use of acceleration when watching Youtube depends on the video encoding method (H.264, AV1, etc.). You can view the format in the right-click context menu in the "Stats for nerds" section. To select the format supported by the hardware video decoding system, you can use the add-on enhanced-h264ify.

Firefox for Fedora bundled with support for accelerating video decoding via VA-API

Separately, it is noted that packages with Firefox 77.0 for Fedora include additional patches that affect performance and stability, which are not included in the regular builds of Firefox 77.0 from Mozilla. Inclusion of these patches in the main composition is expected only in Firefox 78.0 (users can use the beta version of Firefox 78 or nightly builds from Mozilla by launching the browser with the command "MOZ_ENABLE_WAYLAND=1 ./firefox"). In addition, Mozilla builds use the built-in libvpx library that does not support VA-API to decode VP8/VP9 - if you need to speed up VP8/VP9 decoding, disable libvpx by setting the "media.ffvpx.enabled" variable in about: config to " false" (in the package from the Fedora repository, libvpx is already disabled).

Source: opennet.ru

Add a comment