Hardware accelerated ffmpeg transcoding instructions with resize are not working

When compiling ffmpeg from source and testing hardware accelerated transcoding with scaling using the instructions for Linux located at Accelerated FFMPEG Instructions, the command listed in the instructions:

ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda –resize 1280x720 -i input.mp4 -c:a copy -c:v h264_nvenc -b:v 5M output.mp4

fails with the following message:

Option hwaccel (use HW accelerated decoding) cannot be applied to output url –resize -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for output file –resize.
Error opening output files: Invalid argument

The documentation claims the command “uses the built in resizer in cuvid decoder”, but it appears ffmpeg may no longer allow a resize option to be sent to the decoder. Any help with updating the documentation would be much appreciated.

Try (your command uses a dash on resize instead of a hyphen).

ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -resize 1280x720 -i input.mp4 -c:a copy -c:v h264_nvenc -b:v 5M output.mp4

Thanks @leigh123linux - yes, that was it. So the source PDF there has the same issue then, since of course I copied and pasted. Was thinking that command could only be applied to output on a newer version.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.