Opened 4 months ago

Last modified 3 months ago

#11143 new defect

Vulkan filters fail when engaging NVDEC / NVENC

Reported by: rnbwdrk Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: vulkan NVDEC NVENC cuda
Cc: rnbwdrk Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by rnbwdrk)

Summary of the bug:

Vulkan filters fail when engaging NVDEC / NVENC.

How to reproduce:

The following works fine:

ffmpeg -init_hw_device cuda=cu:0 -init_hw_device vulkan=vk@cu -i IMG_8057.MOV -vf:v "hwupload=derive_device=vulkan,libplacebo=tonemapping=auto:colorspace=bt709:color_primaries=bt709:color_trc=bt709:format=yuv420p:upscaler=none:downscaler=none:peak_detect=0,hwupload=derive_device=cuda,scale_cuda=format=yuv420p" -f null -

Attempting to add NVDEC / NVENC into the mix fails:

ffmpeg -init_hw_device cuda=cu:0 -init_hw_device vulkan=vk@cu -hwaccel cuda -hwaccel_output_format cuda -i IMG_8057.MOV -vf:v "hwupload=derive_device=vulkan,libplacebo=tonemapping=auto:colorspace=bt709:color_primaries=bt709:color_trc=bt709:format=yuv420p:upscaler=none:downscaler=none:peak_detect=0,hwupload=derive_device=cuda,scale_cuda=format=yuv420p" -f null -

BtbN's latest git master (2024-08-16 13:46) Win64 GPL build was used for this test in 
Windows 10 22H2, although it has been extensively and exhaustively reproduced with 
various compiles and builds of ffmpeg 7.0, 7.0.1, and 7.0.2 in windows and in linux. 
Different versions of the Vulkan and Cuda SDK, NVIDIA Drivers, libplacebo, etc were also 
tried. Hardware-wise, the bug has been reproduced on both an NVIDIA A2000 and an RTX 2080 TI.

AFAIK the only time this has ever worked was with ffmpeg ~5.1.3 via 
a patch to libavutil/hwcontext_vulkan.c and a very specific version of libplacebo, 
as described here:

https://github.com/jellyfin/jellyfin-ffmpeg/issues/215

All attempted input files have been NVDEC compatible so the issue is not the file. In fact, 
everything works fine with the aforementioned jellyfin fix and ffmpeg 5.1.3. 

"summary" output (ffmpeg_output_summary.txt)

and 

"-v 9 -loglevel 99" output (ffmpeg_output.txt.zip)

and

"-report" output (ffmpeg-20240816-130347.log.zip)

Have been attached with metadata redacted.

Attachments (3)

ffmpeg_output_summary.txt (5.2 KB ) - added by rnbwdrk 4 months ago.
Summary Output
ffmpeg_output.txt.zip (548.7 KB ) - added by rnbwdrk 4 months ago.
-v 9 -loglevel 99 output
ffmpeg-20240816-130347.log.zip (439.2 KB ) - added by rnbwdrk 4 months ago.
-report output

Download all attachments as: .zip

Change History (7)

by rnbwdrk, 4 months ago

Attachment: ffmpeg_output_summary.txt added

Summary Output

by rnbwdrk, 4 months ago

Attachment: ffmpeg_output.txt.zip added

-v 9 -loglevel 99 output

by rnbwdrk, 4 months ago

-report output

comment:1 by rnbwdrk, 4 months ago

Description: modified (diff)

comment:2 by rnbwdrk, 4 months ago

Description: modified (diff)

comment:3 by rnbwdrk, 4 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.