mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
27.79k stars 2.86k forks source link

Switching to HDR mode on Windows 24H2 when "Automatically manage color for apps" is enabled in SDR mode #14567

Open 1aTa opened 1 month ago

1aTa commented 1 month ago

mpv Information

mpv v0.38.0-580-g00f43e09 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Jul  7 2024 00:04:00
libplacebo version: v7.349.0 (v7.349.0-dirty)
FFmpeg version: N-116159-gecd3a9783
FFmpeg library versions:
   libavcodec      61.9.100
   libavdevice     61.2.100
   libavfilter     10.2.102
   libavformat     61.4.100
   libavutil       59.28.100
   libswresample   5.2.100
   libswscale      8.2.100

Other Information

Windows 24H2 Build 26100 has a new option which seems to be confusing all HDR mode switching utilities and media players, including mpv.

The new option "Automatically manage color for apps" under "System > Display > Color Management" increases the color range of Windows SDR to HDR levels to remove things like color banding. It works great and is very noticeable throughout the Windows UI but a side effect is all apps think they are already in HDR mode, when they're actually not. With this option enabled the only way I've found to switch Windows HDR mode on and off is with the toggle in Windows settings.

mpv is unable to switch to HDR mode from SDR mode.

More info here: https://support.microsoft.com/en-us/windows/auto-color-management-in-windows-11-64a4de7f-9c93-43ec-bdf1-3b12ffa0870b

Reproduction Steps

Whilst in SDR mode goto "System > Display > Color Management" and enable "Automatically manage color for apps".

Play any HDR video in mpv.

Expected Behavior

Display should switch to HDR mode.

Actual Behavior

Display stays in SDR mode as mpv believes it's already in HDR mode.

Log File

log.txt

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

Andarwinux commented 1 month ago

Everything worked as expected. ACM is still SDR, it just uses the same technology as Windows HDR for global color management. mpv is just using DXGI API to implement HDR presentation, it cannot change the Windows HDR mode in this way, any such behavior is a GPU driver hack. ref: https://learn.microsoft.com/en-us/windows/win32/direct3darticles/high-dynamic-range

1aTa commented 1 month ago

So why isn't mpv, or any other media player which supports HDR auto switching, switching to the proper HDR mode if ACM is enabled?

HDR videos look completely blown out if played in SDR mode with ACM enabled as mpv believes the display is in HDR mode, so I have to manually switch to proper HDR mode using Windows settings.

Andarwinux commented 1 month ago

[ 0.960][v][vo/gpu-next/libplacebo] New swap chain configuration received from hint: format: R10G10B10A2_UNORM, color space: RGB_FULL_G2084_NONE_P2020.

It looks like you have a problem with your driver, which is advertising RGB_FULL_G2084_NONE_P2020 support without Windows HDR enabled, which causes mpv think your display is HDR.

1aTa commented 1 month ago

Which I assume is caused by having the new Windows 24H2 ACM enabled.

i.e. "ACM is still SDR, it just uses the same technology as Windows HDR for global color management."

1aTa commented 1 month ago

This is the first app that I know of which has resolved this issue: https://github.com/res2k/HDRTray/issues/13