Ffmpeg with h264_nvenc not working

Hello,

I am using command to generate video from frames which I recorded but when using h264_nvenc I am getting errors below

ffmpeg -framerate 26 -i ecu_recording/frame_%06d.jpg -c:v h264_nvenc -preset fast -pix_fmt yuv420p output.mp4
ffmpeg version N-121913-g5169b0c3dc Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04.2)
configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --disable-static --enable-shared
libavutil 60. 19.100 / 60. 19.100
libavcodec 62. 21.100 / 62. 21.100
libavformat 62. 6.103 / 62. 6.103
libavdevice 62. 2.100 / 62. 2.100
libavfilter 11. 10.100 / 11. 10.100
libswscale 9. 3.100 / 9. 3.100
libswresample 6. 2.100 / 6. 2.100
Input #0, image2, from ‘ecu_recording/frame_%06d.jpg’:
Duration: 00:01:11.69, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg (Baseline), gray(bt470bg/unknown/unknown), 2560x1984 [SAR 1:1 DAR 40:31], 26 fps, 26 tbr, 26 tbn
File ‘output.mp4’ already exists. Overwrite? [y/N] y
Stream mapping:
Stream #0:0#0:0 (mjpeg (native) → h264 (h264_nvenc))
Press [q] to stop, [?] for help
[h264_nvenc @ 0xaaab18140710] Cannot load libnvidia-encode.so.1
[h264_nvenc @ 0xaaab18140710] The minimum required Nvidia driver for nvenc is 570.0 or newer
[vost#0:0/h264_nvenc @ 0xaaab181400b0] [enc:h264_nvenc @ 0xaaab18140690] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 0xaaab1817d860] Error sending frames to consumers: Operation not permitted
[vf#0:0 @ 0xaaab1817d860] Task finished with error code: -1 (Operation not permitted)
[vf#0:0 @ 0xaaab1817d860] Terminating thread with return code -1 (Operation not permitted)
[vost#0:0/h264_nvenc @ 0xaaab181400b0] [enc:h264_nvenc @ 0xaaab18140690] Could not open encoder before EOF
[vost#0:0/h264_nvenc @ 0xaaab181400b0] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_nvenc @ 0xaaab181400b0] Terminating thread with return code -22 (Invalid argument)
[out#0/mp4 @ 0xaaab1813fbd0] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A elapsed=0:00:00.04
Conversion failed!

Need help with this !!.

Regards,

Yash Gupta

Hello @yglovi, welcome to the NVIDIA developer forums.

I would start with this line:

Check your installed GPU driver version.

Also, when posting issues like these it helps a lot if you also share your system specs like

  • Operating system (including exact version number, even if one can find it hidden in your log details above)
  • CPU
  • GPU

Your ffmpeg version also looks none standard, did you install a beta or out of tree version?

Thanks.

Hello,

I am using nvidia jetson orin agx developer kit on jetpack 6.0 with cuda version12.2 and driver.

I version 540. ffmpeg which I have used is the latest from the branch. While libnvidia I have tried multiple version with minimum requirements of 530 and above. But all them give same error. The only change is the version number.

Need help in figuring out this issue.

Regards,

Yash Gupta

Waiting for reply.