2

I'm doing some nvidia GPU hevc transcoding to get stuff done at faster speeds. Most of the ~2000 titles that I'm transcoding work fine, but a handful are failing like

Impossible to convert between the formats supported by the filter 'Parsed_hwupload_cuda_3' and the filter 'auto_scale_0' [vf#0:0 @ 0x55b72ac9a3c0] Error reinitializing filters! Failed to inject frame into filter network: Function not implemented Error while filtering: Function not implemented 

I'm aware of the need to hwdownload and hwupload during a filtering pipeline, but when I remove all video filters from the command, it instead says

Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scale_0' 

Here are a couple of examples of commands producing the errors. With filters and an error mentioning Parsed_hwupload_cuda_3:

"ffmpeg" "-hwaccel" "cuda" "-hwaccel_output_format" "cuda" "-hide_banner" "-y" "-i" \ "in.mkv" "-max_muxing_queue_size" "1024" "-map" "0" "-c" "copy" "-filter:v:0" \ "hwdownload,format=nv12,crop=1456:1080:232:0,hwupload_cuda" "-c:0" "hevc_nvenc" \ "-f" "matroska" "out.mkv" 

and without filters and the error mentioning Parsed_null_0:

"ffmpeg" "-hwaccel" "cuda" "-hwaccel_output_format" "cuda" "-hide_banner" "-y" "-i" \ "in.mkv" "-max_muxing_queue_size" "1024" "-map" "0" "-c" "copy" "-c:0" "hevc_nvenc" \ "-f" "matroska" "out.mkv" 

Note: The quoting in the commands is because I'm generating them with a script and logging them out before running.

I can't find any info about that auto_scale_0 filter. Why is it failing like this?

5
  • It's a good idea to link the complete ffmpeg logs. Commented Jan 16, 2024 at 10:40
  • 1
    I think there's no problem with your command line. I had the same issue with the latest FFmpeg snapshot I compiled back in january. Try to recompile it with the latest version with github.com/markus-perl/ffmpeg-build-script For me, the freshly compiled FFmpeg solved the issue. Commented Feb 28, 2024 at 14:49
  • @GergelyLukacsy (and OP) Out of curiosity, do you happen to know what was different about those videos that led to encountering this error? Commented May 5 at 23:57
  • 1
    @TTT I got quite experienced with GPU encoding since I posted this and I know exactly what's the problem. OP uses a GPU decoder and the selected codec -hwaccel cuda doesn't know how to decode the input stream. Why? Because with GPU decoding, you have to know exactly the input stream's codec and choose the GPU decoder codec accordingly. (With regular CPU decoding, FFmpeg chooses a codec for you automatically. This is not the case with GPU-dec.) Plain -hwaccel cuda -i IN.mkv will only decode AVC/H264 streams, so most probably the problematic video wasn't encoded with AVC. Commented May 6 at 10:37
  • 1
    @TTT Okay, to be really sure what's the problem, a full, unedited FFmpeg ouput would've been necessary, so here's another potential cause: even if your FFmpeg has the proper libraries and codecs compiled and your system has all the necessary drivers, it doesn't guarantee that your card can actually process the input codec/bit depth/pixel formats. For example, a P2000 card can only decode yuv420p h264 streams with 8bit color depth, but it would fail with 10bit. See: developer.nvidia.com/… Commented May 6 at 11:48

1 Answer 1

0

I had a similar issue. Solved using this page: https://trac.ffmpeg.org/wiki/HWAccelIntro

I add :

-noautoscale -filter_complex [0:0]scale_cuda=iw:-2[out] -map [out] 

from:

mps = f'/home/pierre/ffmpeg/ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i {folderv}{file} -c:v av1_nvenc -preset p7 -tune hq -rc-lookahead 53 -cq:v {qffmpeg} -spatial-aq 1 -aq-strength 2 -c:a copy {folderv}{target}' 

to

mps=f'/home/pierre/ffmpeg/ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i {folderv}{file} -noautoscale -filter_complex [0:0]scale_cuda=iw:-2[out] -map [out] -c:v av1_nvenc -preset p7 -tune hq -rc-lookahead 53 -cq:v {qffmpeg} -spatial-aq 1 -aq-strength 2 -c:a copy {folderv}{target}' 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.