Hardware video acceleration

How to enable hardware video acceleration




Enable encoding with NVENC

NVENC requires the nvidia_uvm module and the creation of related device nodes under /dev.
Manually loading the nvidia_uvm module will not create the device nodes, but invoking the nvidia-modprobe utility will.

/etc/udev/rules.d/70-nvidia.rules
ACTION=="add", DEVPATH=="/bus/pci/drivers/nvidia", RUN+="/usr/bin/nvidia-modprobe -c0 -u"

Install Video Acceleration API (VA-API) and Video Decode and Presentation API for Unix (VDPAU)

pacman -Syu libva-utils vdpauinfo && yay -Syu libva-nvidia-driver
pacman -Syu libva-mesa-driver mesa-vdpau libva-vdpau-driver libvdpau-va-gl libva-utils vdpauinfo

Verify VA-API settings

vainfo

Verify VDPAU settings

vdpauinfo
grep -iE 'vdpau | dri driver' ~/.local/share/xorg/Xorg.0.log

Enable VA-API in Firefox

about:support

Verify WebRender is enabled under Compositing and ensure you are not running Software WebRender.
It should be enabled by default in GNOME and other desktop environments.

about:config

Set flags
gfx.webrender.all to true to force enable Hardware WebRender.
media.ffmpeg.vaapi.enabled to true in order to enable the use of VA-API with FFmpeg.
media.ffvpx.enabled to false to disable the internal decoders for VP8/VP9. This is necessary despite this bug being fixed.
media.navigator.mediadatadecoder_vpx_enabled to true to enable hardware VA-API decoding for WebRTC.
media.rdd-vpx.enabled to false to disable the remote data decoder process for VP8/VP9.
image.webp.enabled to fasle to stop images from saving in WebP.


Enable VA-API in GStreamer

pacman -Syu gstreamer-vaapi gst-plugins-bad

Verify VA-API support

gst-inspect-1.0 vaapi
gst-inspect-1.0 nvcodec