mpv-player / mpv

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

Clipping Colors HDR->SDR #13268

Open bbspills opened 8 months ago

bbspills commented 8 months ago

Important Information

Provide following Information:

mpv v0.37.0-135-gabc2a748 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects built on Dec 30 2023 00:56:22 libplacebo version: v6.338.0-62-g52314e0-dirty FFmpeg version: N-113150-ge063c1d07 FFmpeg library versions: libavutil 58.36.100 libavcodec 60.36.100 libavformat 60.20.100 libswscale 7.6.100 libavfilter 9.14.102 libswresample 4.13.100

Clipping

Reproduction steps

Open the file colorbars.mp4 (https://github.com/haasn/hdr-tests)

Expected behavior

No clipping on colors

Actual behavior

Clipping on Reds/Magenta and slightly on yellow/cyan/green

Log file

Log attached

Sample files

log.txt

mpv.conf.txt

llyyr commented 8 months ago

Can you reproduce this with a minimal config using gpu-next?

bbspills commented 8 months ago

Yes, I used this for my conf and it was still reproducible

msg-level=auto_profiles=warn,autocrop=warn,autoload=warn,cplayer=warn log-file=D:\mpv\log.txt

fullscreen = yes

Video

vo=gpu-next hwdec=d3d11va video-output-levels=full

video-align-y=1 # move video to the bottom of the screen

GPU Renderer

fbo-format=rgba32f #an alternative is rgba16hf for less perf impact

fbo-format=rgba16hf #similar to MadVR

gpu-api=d3d11 gpu-context=d3d11

d3d11-output-format=rgb10_a2

d3d11-output-format=auto

bbspills commented 8 months ago

Others have the same behavior here as well

https://www.avsforum.com/threads/unofficial-mpv-player-support-thread.3274072/page-58#post-63078575

Vern2 commented 8 months ago

Seeing the same issue here with or without an ICC profile.
That other PC based tone mapping solution has no issues with this pattern (or any other pattern showing a range of nit values) when using the following custom gamut:

0.6681 0.3292 red 0.2664 0.7046 green 0.1454 0.052 blue

I built an ICC profile using rawtherapee with the above values, and installed it:

############

Profiles

############

[bt.2100-pq] profile-cond=get("video-params/primaries") == "bt.2020" and get("video-params/gamma") == "pq" profile-restore=copy icc-profile=D:\apps\mpv_default\mpv-Cust-Gamma\RTv2_Custom.icc

target-trc=gamma2.2

target-prim=bt.2020

tone-mapping=auto hdr-compute-peak=yes target-peak=110
target-contrast=5000 hdr-contrast-recovery=0.2 hdr-contrast-smoothness=10 gamut-mapping-mode=relative

with no change in the clipping.

I have attached a screen shot showing what DaVinci Resolve is showing. Notice the clipping in red and green at higher nit levels.

Screenshot (834)