I got here through a search engine.
I was able to do hardware encoding on 13.4 as well, so I will leave a note.
Reference site
Stable Diffusion on FreeBSD with CUDA support. Contribute to verm/freebsd-stable-diffusion development by creating an account on GitHub.
github.com
% ffmpeg -f hevc -i ipcam_5min.h264 -c h264_nvenc -f mp4 ipcam_5min.mp4
[h264_nvenc @ 0x866a42c00] Cannot load libcuda.so.1
[vost#0:0/h264_nvenc @ 0x8669f8a00] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
Error while filtering: Operation not permitted
[out#0/mp4 @ 0x8669ec240] Nothing was written into output file, because at least one of its streams received no packets.
% time nv-sglrun ffmpeg -f hevc -i ipcam_5min.h264 -c h264_nvenc -f mp4 ipcam_5min.mp4
62.21s user 0.89s system 246% cpu 25.631 total
% time ffmpeg -f hevc -i ipcam_5min.h264 -c h264 -f mp4 ipcam_5min.mp4
949.17s user 5.40s system 641% cpu 2:28.77 total