Hello. I am trying to get Nvidia hardware encoding working, specifically for ALVR but we may use FFmpeg to test if it’s working as that’s a more widely known program. I have an RTX 3060 card on a desktop computer running Endeavour OS (Arch Linux). My Driver version is 525.89.02 and CUDA version 12 (pacman shows cuda 11.8.0-1 but nvidia-smi outputs CUDA version 12). I followed the Arch Wiki and installed nvidia-utils. The modules are loaded:
Trying to render a video with FFmpeg using this command ffmpeg -y -hwaccel cuda -i bigbuckbunny.mp4 bigbuckbunny2.mp4 works, but uses CPU. I compiled FFmpeg myself following Nvidia’s instructions and tried again and got this error:
Device creation failed: -12.
No device available for decoder: device type cuda needed for codec h264.
Also, ffmpeg -help encoder=h264_nvenc returns error Codec 'h264_nvenc' is not recognized by FFmpeg.. I have also installed x265, libde265 and nvenc packages from the AUR but the same issue still occurs. What can I do to get Nvidia H265 Hardware encoding working? Thanks in advance.
Those instructions are from a time when nvidia first released the free headers so are likely much outdated and only work with a years-old ffmpeg source release. Nowadays, most distros include this.