Ffmpeg transfer video error by using the plugin of h264_nvenc

I try to use ffmpeg command with the plugin of h264_nvenc to transfer the video format, but got error as below:

I also check the enviroments and find all the informate had matched:

Hope someone can help to solve this problem, thanks in advance!

Does this issue happen on x86 or Jetson?

Found the error on x86 platform

More relevant to Video Processing & Optical Flow and moved to this forum.

Hi lmw0320,

Can you try one of the following command-lines?

ffmpeg -hwaccel cuda -i 1.mp4 -c:v h264_nvenc -b:v 4M -c:a copy output.mp4

or

ffmpeg -c:v h264_cuvid -i 1.mp4 -c:v h264_nvenc -b:v 4M -c:a copy output.mp4

Best regards,

Diego

No, found same error caused.
For I run the command by docker container. And I restart a new container with params of -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility, then the ffmpeg with gpu can be used to accelerate the transfer speed.
Thanks

1 Like

Hi @lmw0320,

I see. Thank you for sharing the solution to your problem. Please keep in mind that the best transcoding performance is achieved while using the GPU for both decoding and encoding. If FFmpeg does not find a suitable hardware accelerator, it will use the CPU for decoding. That’s why I suggested to use -hwaccel cuda or -c:v h264_cuvid.

Best regards,

Diego