In 2022, most video comes with H265 and AV1. For now, only MPEG, H264, VC1, and VP9 are supported in the transformation driver
xtknight • Updated Jul 31, 2023
has a lot of potential. It bases on NVDEC, which is a new API provided by Nvidia. But it will crash Chrome because of limited support
elFarto • Updated Aug 30, 2023
Updated Aug 30, 2023
The fundamental reason that we are in this stage is Nvidia and Google are both too stubborn to support each other.
Here it is again. Google doesn't want to add specific code for Nvidia's GPUs because there are so many other GPUs on the market that it would be a lot of work to support all of them. Meanwhile, Nvidia wants to provide specific functionality through its own unique API.
We need an abstraction layer for GPUs! Luckily we have DirectX in Windows, Metal in macOS, and Vulkan in Linux. And Vulkan is expected to support AV1 in 2023. So I believe Chrome will have a good hardware-accelerated video decode solution soon or later.
Developers of Chrome also said in June 2022, “VaapiVideoDecoder is in the process of shipping with Vulkan support now.”
VP9 & AV1 Vulkan Video Extensions Expected Next Year
While this week saw the ratification of the Vulkan Video 1.0 extensions in stable form after being out as provisional extensions since early 2021, one of the sad aspects of it is still lacking support for the popular royalty-free VP9 and AV1 codecs
But before that, let’s see how we can add limited support for hardware video decoding to Chrome in 2022.
⚠️ 2022-12-24 UPDATE: The hardware decoder is extremely unstable. I gave up.
First, install the VDPAU→VA_API transform driver
yay -S libva-vdpau-driver-vp9-git
vainfo, you shall see the driver.
❯ vainfo Trying display: wayland Trying display: x11 vainfo: VA-API version: 1.16 (libva 2.16.0) vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.4 vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileMPEG4Simple : VAEntrypointVLD VAProfileMPEG4AdvancedSimple : VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264Main : VAEntrypointVLD VAProfileH264High : VAEntrypointVLD VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileVP9Profile0 : VAEntrypointVLD
Use the following command to start Chrome (I use the beta version, you can use the stable version as well):
google-chrome-beta --use-gl=desktop \ --use-vulkan \ --enable-features=VaapiVideoDecoder,VaapiVideoEncoder,VaapiIgnoreDriverChecks \ --disable-features=UseChromeOSDirectVideoDecoder
In the Chrome flag settings, enable these:
- Override software rendering list
- GPU rasterization
- Zero-copy rasterizer
- Hardware decode acceleration for k-SVC VP9
Relaunch Chrome, and open chrome://gpu to check if Video Decode is hardware accelerated.
That’s not enough. Play a Youtube video and press F12. Click More Options > More tools > Media to open the Media panel. Check if the hardware decoder is true.
Notice that the hardware decoder won’t always be available due to the limitation of GPU-supported decoding formats. But it should work in most cases.