Log in

View Full Version : Vulkan enc support, anyone gotten it to work?


TEB
2nd October 2024, 13:53
hi, im trying to test the vulkan video encoding extentions added in ffmpeg v7.1.
Anyone gotten it to work yet ?


Nvidia RTX4060, newest drivers etc..


./ffmpeg.exe -init_hw_device vulkan=vk:0 -filter_hw_device vk -i Bab.mkv -vf "hwupload=extra_hw_frames=16,format=yuv420p,scale_vulkan=1280:720" -c:v h264_vulkan -crf 22 output.mp4

Error:
Impossible to convert between the formats supported by the filter 'Parsed_hwupload_0' and the filter 'auto_scale_0'
[vf#0:0 @ 000001e33b794b40] Error reinitializing filters!
[vf#0:0 @ 000001e33b794b40] Task finished with error code: -40 (Function not implemented)
[vf#0:0 @ 000001e33b794b40] Terminating thread with return code -40 (Function not implemented)
[vost#0:0/h264_vulkan @ 000001e33b794380] Could not open encoder before EOF
[vost#0:0/h264_vulkan @ 000001e33b794380] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_vulkan @ 000001e33b794380] Terminating thread with return code -22 (Invalid argument)
[out#0/mp4 @ 000001e352de8200] Nothing was written into output file, because at least one of its streams received no packets.

GeoffreyA
9th October 2024, 11:52
Try changing "format=yuv420p" to "format=vulkan" and see what happens. It goes further but still doesn't work on my Vega 8, which, I think, is missing a hardware extension.

Z2697
9th October 2024, 17:32
Nah. Perhaps some Linux magic would make it work?

takla
9th October 2024, 21:53
Can't test right now, but the following command worked for hw accel the last time I've used it

ffmpeg -y -benchmark -init_hw_device vulkan=GPU -hwaccel vulkan -hwaccel_output_format vulkan -extra_hw_frames 30 -i "input.mkv" -filter_hw_device GPU -vf "format=nv12,hwupload,libplacebo=w=iw/2:h=ih/2:downscaler=sinc,hwdownload,format=yuv420p" -c:v hevc_amf -qp_i 18 -qp_p 18 -g 240 -an TEST.mkv

Obviously the last part after -c:v has to be changed, but if you're smart enough you can figure it out from here.