Video encoding works fine using VAAPI with their open source driver. Sadly there are lots of programs that don't implement VAAPI.
Supported codecs depend on what generation of video decoder your graphics card contains. See these two comparison tables.
https://wiki.archlinux.org/title/Hardware_video_acceleration...
https://en.wikipedia.org/wiki/Unified_Video_Decoder#Format_s...