On Intel, in some cases VA-API might not work with the Intel iHD driver intel-media-driver. This might be workaroundable by using the Intel i965 driver libva-intel-driver. This workaround does not work anymore with Intel Iris Xe graphics, which are only supported by intel-media-driver, only solution there is to wait until Firefox implements a GPU process for X11/Wayland (planned FF94) .
From the wiki page you linked, it seems hardware acceleration for Firefox with Iris Xe graphics is dependent on waiting for Mozilla to fully implement it.
One way to get around this issue for the time being is to use an external video player, which is helpful for things like YouTube. I can confirm that hardware video acceleration is working with VLC, and also with MPV after some configuration (it’s not enabled by default on mpv), using the open source graphics drivers.
In VLC (and maybe mpv, haven’t tested) you can drag a YouTube URL into a VLC window and it will start streaming it. There’s also a menu option to open a video stream URL and have it play that way instead of click and drag.
There is also software you can use to download full YouTube videos first and then play them off your storage, such as youtube-dl - ArchWiki which is a command line interface. There are graphical layers that are separate that you can use if you don’t want to use the CLI (the wiki page has the links).
I know it’s not exactly what you’re asking for, but it’s what we have for now until Mozilla gets to fully enabling hardware acceleration on Firefox.
This is what I do. I’m working on automating the downloading from specified channels or playlists, as well as automatically naming and file-structur-ing them for PLEX. When I finally get around to finishing that, I’ll post it here if you want.
Relevant for FireFox hardware acceleration on linux. I’m seeing a reduction in CPU usage on the framework laptop when playing YouTube videos, but I don’t think it’s fully enabled yet as intel_gpu_top does not report any usage of the video decoder.
There is a bug that prevents current Firefox versions from working with the VA-API. Setting the environment variable MOZ_DISABLE_RDD_SANDBOX=1 is a workaround, but be advised that this essentially disables an important security feature.
There is also an article in the Fedora wiki about this. I’m on Fedora 36 and HW acceleration works as described.
You can edit the app launcher to make this persistent.
Make a copy of the launcher
cp /usr/share/applications/firefox.desktop ~/.local/share/applications/
Edit the copy
Change Exec=firefox %u to Exec=env MOZ_DISABLE_RDD_SANDBOX=1 firefox %u
Hardware accelerated AV1 video decoding is enabled on Windows with supported GPUs (Intel Gen 11+, AMD RDNA 2 Excluding Navi 24, GeForce 30). Installing the AV1 Video Extension from the Microsoft Store may also be required.
From some reddit posts it looks like they fixed vaapi, I will update en report back.
It works! In about:config change this two configs to true:
@Chiraag_Nataraj To check if vaapi is supported on your system you can install libva-utils, then check the output of vainfo. There you can see if your system is setup to support vaapi and with codecs it supports.
Hej @Proximus ,
Could you provide more details on what made your vivaldi work with va-api (FireFox Hardware Video Decoding - #8 by Proximus)?
Launching chromium or vavaldi 5.2.2623.41 with all extra setting didn’t do anything. (Although in contrast to chromium, vivaldi at least supported playing 4k on YouTube)
Enable the advised flags in vivaldi://flags, #enable-vp9-kSVC-decode-acceleration and #canvas-oop-rasterization
Make sure vaapi is working with command vainfo from package libva-utils
Run vivaldi stable with the flags/conf mentioned before
Are you using X11 or Wayland? For Wayland I read that you have to add this flag --ozone-platform-hint=x11
I have intel-media-driver 22.4.1-1
Youtube uses different codecs. This (codec av01) LTT youtube never uses vaapi but this (codec vp09) own always uses vaapi. Youtube switches what codecs they use, haven’t got codec av01 to work yet if it is even supported by our intel gpu. Right-Click on video, click on stats for nerds, there you can see which codec is being used for that video.
Hej @Proximus , thx for the details.
I didn’t set the vivaldi flags before - but they also didn’t help in my case.
I’m using Ubuntu 22.04 vanilla so I guess Wayland it is, but also adding --ozone-platform-hint=x11 didn’t work for me. I tried activating Wayland native support with --ozone-platform-hint=auto which causes chromium to fail starting with Failed to connect to Wayland display. Vivaldi starts, though also no impact on VA.
I then tried to verify that VLC uses the video and it also doesn’t use VA (test video with VP9).
How do I verify that VA is used:
check with intel_gpu_top if it shows 0.00% on Video then its not (it always shows a big bunch on Render/3D)
check CPU usage/temperatur with psensor if it shows CPU ~10% and 50+C temp it probably not. (idle is 0% CPU with 30-40C temp)
for reference: When I use MOZ_DISABLE_RDD_SANDBOX=1 I see 10% on Video, 10% CPU usage with temps ~30-40C
Now I tried starting an Ubuntu on Xorg session - and it worked - at least with vivaldi!
With all these settings vivaldi can now play 4k VP9 videos with substantial usage of the Video acceleration. VLC still does not. firefox v100 still needs disabled sandbox to make use of it.
PS: another side benefit is that the majority of apps are now rendered sharp with fractional scaling in x11 but bad screen tearing happens.
@JTM HW should also be working on Wayland, next time I have to setup my laptop I will set it up with Wayland. Only reason I have not done it yet is because then I will have to change all my config files from i3wm to probably sway.
Google might be your friend to find the flags for Wayland, one I found suggested to edit this ones: --use-gl=egl --ozone-platform-hint=auto.
So try it with this: vivaldi-stable --use-gl=egl --disable-features=UseChromeOSDirectVideoDecoder --enable-features=VaapiVideoDecoder --ignore-gpu-blocklist --enable-gpu-rasterization --enable-accelerated-2d-canvas --enable-accelerated-video-decode --enable-zero-copy --ozone-platform-hint=auto
About VLC, try MPV, worked immediately for me on Xorg. CTRL+H to enable HW. In wayland archwiki suggest to launch it with --gpu-context=wayland. Or to add it to the MPV conf file in ~/.config/mpv/mpv.conf.