FFMPEG Hwaccel error with -hwaccel_output_format

7.7k views Asked by At

I have Nvidia 1050Ti gpu

I test ffmpeg with cuda

ffmpeg -hwaccel nvdec -hwaccel_output_format cuda  -i input.mp4 -y  \ 
-c:v h264_nvenc -c:a libmp3lame -b:v 3M \
-filter_complex hwdownload,scale=w=iw*min(1280/iw\,720/ih):h=ih*min(1280/iw\,720/ih),hwupload out.mp4

Error:

[hwupload @ 00000199b49c1080] A hardware device reference is required to upload frames to.
[Parsed_hwupload_2 @ 000001999ba8ee80] Query format failed for 'Parsed_hwupload_2': Invalid argument
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

I want full hardware transcode without using CPU.

1

There are 1 answers

0
Tín Trung On BEST ANSWER

To transcode using hardware NVIDIA GPU, see:

You need to manual compile FFmpeg with the CUDA feature enabled. scale is a "software" filter using CPU resource. The hardware (GPU) equivalents (with limited options) are scale_npp and scale_cuda.

  • hwdownload: send the frame down to RAM: GPU VRAM -> RAM.

  • hwupload: inverse of hwdownload (RAM -> GPU VRAM). Notice: NVENC only works with GPU VRAM.