2025-02-07 (Updated 2025-02-10)
To use vaapi on FreeBSD, follow these steps:
Install the following packages:
graphics/drm-kmod
graphics/mesa-gallium-va
multimedia/libva-utils
The first two are required for vaapi driver, and the last one is used to test vaapi.
Follow the FreeBSD Handbook Chapter 5.3 Graphic card drivers :
For my AMD zen4 iGPU system, run the following:
sysrc kld_list+=amdgpu
Then reboot.
After reboot, you can give video permission to users that need it:
pw groupmod video -m <user>
You can run vainfo to verify as root or user with video group, or try some ffmpeg transcoding:
ffmpeg -vaapi_device /dev/dri/card0 -i input.webm -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mp4