mpv icon indicating copy to clipboard operation
mpv copied to clipboard

SDR in HDR mode looks washed out. Fix inside!

Open mnisius opened this issue 1 year ago • 10 comments

mpv Information

mpv v0.38.0-678-g0818f600 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Aug  7 2024 00:12:51
libplacebo version: v7.349.0 (v7.349.0-5-g82bf46a-dirty)
FFmpeg version: N-116546-g792a9979e
FFmpeg library versions:
   libavcodec      61.11.100
   libavdevice     61.2.100
   libavfilter     10.2.102
   libavformat     61.5.101
   libavutil       59.32.100
   libswresample   5.2.100
   libswscale      8.2.100

Other Information

  • Windows version: 10
  • GPU model, driver and version: AMD 6600xt
  • Source of mpv: shinchiro
  • Introduced in version: since ever

Reproduction Steps

Enable HDR mode in Windows, set target-colorspace-hint=yes in your mpv.conf wich is neccesary for playing any HDR content. Then play any SDR File

Expected Behavior

Picture looks good with good contrast

Actual Behavior

Picture looks washed out, contrast is bad. There is an easy fix for this problem you just have to set target-trc=srgb and then the SDR file looks perfect. You can even adjust die brightness with the HDR/SDR Brightness Slider in the Windows HDR setting. Without this config the slider does nothing.

However with this setting HDR Movies look wrong so there is currently no way to configure mpv to just play SDR and HDR files correctly without manually actions.

Log File

output.txt

Sample Files

No response

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

  • [X] I tested with the latest mpv version to validate that the issue is not already fixed.
  • [X] I provided all required information including system and mpv version.
  • [X] I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • [X] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • [X] I attached the full, untruncated log file.
  • [X] I attached the backtrace in the case of a crash.

mnisius avatar Aug 07 '24 19:08 mnisius

do you know how profiles work? put this at the end your mpv.conf This will apply the settings according to the source material

[HDR]
profile-cond=get("video-params/primaries") == "bt.2020" and get("video-params/gamma") == "pq"
profile-restore=copy
target-colorspace-hint=yes
[SDR]
profile-cond=get("video-params/primaries") == "bt.709"
profile-restore=copy
target-trc=srgb

geextahslex avatar Aug 21 '24 08:08 geextahslex

I know but I think mpv should apply the correct settings automatically. It's a bad user experience if every user haa to create profiles just that movies look like they should.

mnisius avatar Aug 21 '24 09:08 mnisius

Sure the default settings could be changed in the future

geextahslex avatar Aug 21 '24 09:08 geextahslex

[SDR]
profile-cond=get("video-params/primaries") == "bt.709"
profile-restore=copy
target-trc=srgb

Why do you need this profile? Does this mean that SDR video files are not playing correctly by default? Can you add a picture with this profile and without it playing a SDR video file?

Obegg avatar Aug 21 '24 10:08 Obegg

Well it's complicated. Without config HDR files will not play correctly in HDR mode. You have to set target-colorspace-hint=yes then they look like they should. But with this option sdr videos will not play correctly any more. 🤷‍♂️

mnisius avatar Aug 21 '24 10:08 mnisius

Well it's complicated. Without config HDR files will not play correctly in HDR mode. You have to set target-colorspace-hint=yes then they look like they should. But with this option sdr videos will not play correctly any more. 🤷‍♂️

I just tested both commands on a SDR video file. Using target-trc=srgb without target-colorspace-hint=yes = colors are correct. Using target-colorspace-hint=yes without target-trc=srgb = colors are correct. In each test I took a screenshot using mpv screenshot command and I found no difference. Can you share screenshots please?

Obegg avatar Aug 21 '24 10:08 Obegg

By the way, target-colorspace-hint=yes only works with vo=gpu-next, do you use gpu-next? Also, you need to disable HDR in Windows if you are playing SDR video files.

Obegg avatar Aug 21 '24 10:08 Obegg

Sure but It will take some time. I'm not at home right now.

Do you have a HDR display and activated HDR mode in windows ? The colors are fine it's just the contrast and black level.

I use a profile that I activate with a keyboard shortcut and the change in contrast and black level is very obvious.

@Obegg Yes I use gpu-next and no I don't have to disable HDR mode that's my whole point. HDR means just more brightness and more colors. It is absolutely possible to play an sdr file in hdr mode it just needs the correct settings that I already posted here.

mnisius avatar Aug 21 '24 10:08 mnisius

I don't have to disable HDR mode that's my whole point. HDR means just more brightness and more colors

Uh, so I see why you say you have issues with the colors. I don't use HDR the same way you do, I only use HDR when playing HDR video files. But using HDR all the time could wear out the screen faster because of the additional brightness. So you might be right, setting target-trc=srgb while HDR is turned on in Windows could help fix the issue.

Obegg avatar Aug 21 '24 12:08 Obegg

Just because the screen is capable of a brighter image does not mean you have to use it all the time.

You can control the brightness of SDR content in HDR mode with a slider in the windows hdr settings. And if you set target-trc=srgb this slider will also change the brightness of the played file in mpv.

mnisius avatar Aug 21 '24 13:08 mnisius

Fixed by #16512

kasper93 avatar Jul 11 '25 21:07 kasper93