libplacebo icon indicating copy to clipboard operation
libplacebo copied to clipboard

Trying to get current FFmpeg git master + vulkan + libplacebo to work together.

Open diegocr opened this issue 1 year ago • 13 comments

Hello there,

Looks like there have been some big changes recently, apparently since the time libplacebo started to require vulkan 1.3.0 and FFmpeg adapted accordingly to not restrict it to version 1.2.0 and such.

I've been fighting for the past few days trying to get my command(s) to work like they used to.

i.e. up until:

ffmpeg version N-110340-gbcfec3fd47-g0e1745774e+1 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)

This used to work fine:

ffmpeg.exe -hwaccel cuda -hwaccel_output_format cuda -extra_hw_frames 3 -init_hw_device vulkan=gpu:0 -filter_hw_device gpu -i "%INPUT%" -vf "scale_cuda=w=1920:h=-1:interp_algo=lanczos,hwupload=derive_device=vulkan,libplacebo=format=yuv420p10le:downscaler=ewa_lanczos" -c:v hevc_nvenc -pix_fmt p010le ....

as per today's builds, i.e.

ffmpeg version N-111315-g369fad7de9-gb40324d417+1 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13.1.0 (Rev7, Built by MSYS2 project)
  1. scale_cuda is no longer working.
  2. i seem unable to use hwupload any longer.

(ffmpeg does segfault when using that)

The more close command i got this working again with is the following:

ffmpeg.exe -hwaccel cuda -extra_hw_frames 3 -init_hw_device vulkan=gpu:0 -filter_hw_device gpu -i "%INPUT%" -vf "libplacebo=w=1920:h=-2:format=yuv420p10le" -c:v hevc_nvenc -pix_fmt p010le ...

However, i do get 70-90fps while previously it was 160-180fps

I've also tried to initialize vulkan directly with...

ffmpeg.exe -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -filter_hw_device vk -i "%INPUT%" -vf "libplacebo=w=1920:h=-2:format=yuv420p10le" -c:v hevc_nvenc -pix_fmt p010le ....

...which does speed it up to 130fps, but all i get back are green frames, and countless of those warnings printed:

[libplacebo @ 000001b691246cc0] Masking `blit_src` from wrapped texture because the corresponding format 'rxgx10' does not support PL_FMT_CAP_BLITTABLE
[libplacebo @ 000001b691246cc0] Masking `blit_src` from wrapped texture because the corresponding format 'rx10' does not support PL_FMT_CAP_BLITTABLE
[hevc @ 000001b6df0dd5c0] Decoding frame, 184551 bytes, 8 slices
[libplacebo @ 000001b691246cc0] Masking `blit_src` from wrapped texture because the corresponding format 'rxgx10' does not support PL_FMT_CAP_BLITTABLE
[libplacebo @ 000001b691246cc0] Masking `blit_src` from wrapped texture because the corresponding format 'rx10' does not support PL_FMT_CAP_BLITTABLE
[hevc @ 000001b6df0de9c0] Decoding frame, 551234 bytes, 8 slices
[libplacebo @ 000001b691246cc0] Masking `blit_src` from wrapped texture because the corresponding format 'rxgx10' does not support PL_FMT_CAP_BLITTABLE
[libplacebo @ 000001b691246cc0] Masking `blit_src` from wrapped texture because the corresponding format 'rx10' does not support PL_FMT_CAP_BLITTABLE

I'm pretty sure i am doing something wrong here and already feeling i am losing my mind, so i will really appreciate some guidance/advice on how to get this back working at full speed 🙏🏻

diegocr avatar Jul 01 '23 11:07 diegocr