Opened 2 years ago

Last modified 9 months ago

#9925 new defect

libplacebo hdr tonemap not working

Reported by: acedogblast Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: libplacebo hdr vulkan
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When tonemaping a HDR video to SDR using libplacebo filter, ffmpeg will fail the conversion. This is the error that ffmpeg outputs:

[AVHWFramesContext @ 0x5596b2d8b740] There are no supported modifiers for the given sw_format
[Parsed_hwupload_0 @ 0x5596b2cc75c0] Failed to configure output pad on Parsed_hwupload_0
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument

How to reproduce:
./ffmpeg -i "$INPUT" -map 0:v:0 -init_hw_device vulkan=gpu:0.0 -vf "hwupload,libplacebo=tonemapping=bt.2446a:colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=limited:format=yuv420p10le,hwdownload" -c:v libx265 -crf 20 -preset:v slow -pix_fmt yuv420p10le "test.mkv"
ffmpeg version N-108133-gf976ed7fcf # This is git master as of 9/14/2022

Change History (8)

comment:1 by acedogblast, 2 years ago

Summary: libplacebolibplacebo hdr tonemap not working

comment:2 by acedogblast, 2 years ago

Version: unspecifiedgit-master

comment:3 by Anton1699, 2 years ago

If you are the same person that opened this thread on the FFmpeg subreddit, you said there that you're using the integrated graphics on an Intel Core i5-2540M.

According to this Intel support article, your GPU does not support Vulkan.

comment:4 by Ezav, 2 years ago

Keywords: libplacebo vulkan added; libplacbo removed

I have the same issue.

My graphic card work correctly with vulkan, I frequently play some games that require vulkan. What I want to do is applying GLSL shaders with libplacebo but I have the same error.

The first example from the libplacebo doc (https://www.ffmpeg.org/ffmpeg-filters.html#Examples-89) produce the same error. Compiled on git-master (299253ae).

comment:5 by acedogblast, 2 years ago

I am not the original poster for that reddit page but I do have a comment on it. The gpu I am using is RTX3080 with defiantly supports vulkan.

comment:6 by wammer, 2 years ago

I'm seeing the same error with a Tesla T4 GPU:

ffmpeg -i in.mp4 -init_hw_device vulkan -vf hwupload,libplacebo=format=yuv420p,hwdownload,format=yuv420p out.mp4
[AVHWFramesContext @ 0x55dc4152e640] There are no supported modifiers for the given sw_format
[Parsed_hwupload_0 @ 0x55dc4152ac00] Failed to configure output pad on Parsed_hwupload_0

Ubuntu 22.04.1 LTS
Vulkan Instance Version: 1.3.231
CUDA Version: 11.7
Input file: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive)

Version 0, edited 2 years ago by wammer (next)

comment:7 by hronek, 23 months ago

This patch make it work as a workaround: https://github.com/jellyfin/jellyfin-ffmpeg/issues/215#issuecomment-1410146318

FFmpeg 6.0 can also be patched and starts working. You need libplacebo 5.229.1 (maybe 5.229.2 also works)

comment:8 by hronek, 9 months ago

Newest FFmpeg v7.0 with libplacebo v6.338.2 works. No patch needed. This can be closed.

Note: See TracTickets for help on using tickets.