Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vo_dmabuf_wayland: No color correction with HDR content #12543

Closed
rmader opened this issue Oct 2, 2023 · 4 comments
Closed

vo_dmabuf_wayland: No color correction with HDR content #12543

rmader opened this issue Oct 2, 2023 · 4 comments

Comments

@rmader
Copy link
Contributor

rmader commented Oct 2, 2023

So far vo_dmabuf_wayland seems to ignore the HDR metadata, forwarding content to the compositor unconditionally. This is problematic as Wayland compositor right now assume BT709 / sRGB content and there's no way to tell them otherwise. The later will change once the color management protocol lands/gets adopted.

Thus vo_dmabuf_wayland should be able to trigger color space conversion from upstream elements, like it already does for pixel formats etc., and use it for any non-BT709 content. Once the color management protocols lands it will be possible to properly negotiate supported HDR modes.

How to test:

  • play BT2020 content, such as Camp by Sony), on a Wayland compositor that supports P010

Expected result

  • colors should look sharp

Observed result:

  • colors look washed out, not as sharp as when using other backends
@Dudemanguy
Copy link
Member

The amount of colorspace-related code in vo_dmabuf_wayland is exactly zero. I'll take a peek later and see what existing things we already have for this.

@philipl
Copy link
Member

philipl commented Oct 2, 2023

If you are running on Intel hardware, you can use the tonemap_vaapi filter to do this. I have a conceptual TODO to hook this up to as an automatic filter if we can detect that it's needed. I don't know if AMD drivers support it - their approach to vaapi is very bare-bones so I'd be surprised if they do.

@archerallstars
Copy link

archerallstars commented Feb 8, 2024

I try the tonemap_vaapi on Intel iGPU, UHD Graphics 620 (KBL GT2), but the result looks a lot darker than it should've been (I know because I also view the same movie on Prime Video - John Wick 4). Changing the format or the transfer value as specified on https://ffmpeg.org/ffmpeg-filters.html#tonemap_005fvaapi doesn't help.

And I don't think tonemap_vaapi is supported on AMD yet, see: Mesa issue #3865.


openSUSE Tumbleweed
mpv 0.37
ffmpeg 6.1.1
intel-media-driver 24.1.3

@Dudemanguy
Copy link
Member

With #15048, this works now on mutter 47. For any other compositor, they will need to implement xx-color-management-v4 and the correct format for support to work. e.g. kwin works with this MR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants