mpv-player / mpv

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

SDR video behaves very dark, even if it does not trigger the HDR profile #11989

Closed Ptilopsis01 closed 1 year ago

Ptilopsis01 commented 1 year ago

Important Information

Provide following Information:

Reproduction steps

#解码/渲染设置
ao=wasapi
vo=gpu-next
hwdec=d3d11va-copy
#hwdec=vulkan
gpu-api=d3d11
#gpu-api=vulkan
gpu-context=d3d11
#gpu-context=displayvk
#使用硬解的格式
hwdec-codecs=all
#d3d11-adapter=AMD
#d3d11-adapter=Intel
d3d11-adapter=NVIDIA
#vulkan-device=NVIDIA GeForce RTX 3060 Laptop GPU
#d3d11va零拷贝模式,可降低gpu 3D engine占用
d3d11va-zero-copy=yes
#播放网络视频时的向后缓存大小(KiB或MiB)
#demuxer-max-bytes=200MiB
video-output-levels=full        #RGB是full还是limited
keep-open=yes               # 播放完毕后不自动退出
d3d11-output-format=rgb10_a2
d3d11-output-csp=auto
#退出时记住播放状态
save-position-on-quit
#禁用默认快捷键方案
no-input-default-bindings

#日志文件
log-file="~~/mpv.log"

##缓存设置##

#开启缓存
cache=yes
#最大缓存大小(KiB或MiB)
demuxer-max-bytes=100MiB
demuxer-max-back-bytes=100MiB
#缓存文件位置
cache-dir="~~/cache"
#用磁盘缓存而不是内存
cache-on-disk=yes
#缓存时间
#cache-secs=20
#cache-pause=yes

#窗口/OSD/OSC设置

#贴边吸附(限win)
snap-window=yes
#无边框
no-border
#任务栏显示进度
taskbar-progress
#关闭屏上信息条显示
no-osd-bar
#OSD信息位置、字体大小(x横向左中右left/center/right,y纵向上中下top/center/buttom)
osd-align-x=left
osd-align-y=top
osd-font-size=25
#设置OSD文本信息的持续时间(毫秒)(默认值:1000)
osd-duration=2000
#OSD随窗口大小缩放(yes/no)
osd-scale-by-window=no
#设置默认打开的窗口大小
autofit
no-hidpi-window-scale

#自动隐藏鼠标
cursor-autohide=2000
#cursor-autohide-fs-only                 # 只在全屏模式隐藏鼠标

#视频/音频/字幕/截图设置

#色彩管理
icc-profile-auto=yes
vf=format=colorlevels=auto:colormatrix=auto:dolbyvision=yes

icc-cache-dir="~~/icc_cache"            # 保存缓存加速启动
gpu-shader-cache-dir="~~/shaders_cache" # 保存缓存加速启动

#视频同步
video-sync=audio
interpolation=yes           # 是否开启补帧算法 yes(better sync, consume a little resource) | no(low-latency)
tscale=gaussian     # 补帧算法选择 work only interpolation=yes, mitchell | oversample | linear | catmull_rom | gaussian | bicubic

#变速播放时的音调修正
audio-pitch-correction=yes
#加载视频文件的外部字幕文件方式。(fuzzy 加载含有视频文件名的全部字幕文件)
sub-auto=fuzzy
#加载含有视频文件名的音频文件
#audio-file-auto=fuzzy
#是否强制使用字幕设置
sub-ass-override=no
#设置字体
sub-font="思源黑体 CN Medium"
#字体大小,默认55,此值是以高度为720的屏幕为比例,更大或更小的屏幕会缩放
sub-font-size=55
#字体描边粗细
sub-border-size=1.3
#字体阴影
sub-shadow-offset=1.7
#阴影颜色
sub-shadow-color='#80000000'
#强制外挂ass字幕使用黑边
sub-ass-force-margins=yes
#是否使纯文本字幕输出在黑边上,默认 yes
sub-use-margins=yes
#指定优先使用音轨(DVD使用ISO 639-1两位语言代码,MKV、MPEG-TS使用ISO 639-2 三位语言代码)
#alang=zh,chi
#指定优先使用字幕轨(DVD使用ISO 639-1两位语言代码,MKV、MPEG-TS使用ISO 639-2 三位语言代码)
slang=zh-Hans,zh,chi,zh-Hant
#播放循环方式,循环写inf否则写no
loop-playlist=no
#设定程序启动后的默认音量、程序最大音量
#volume=75
volume-max=100

#截屏文件格式(可选:png、ppm、pgm、pgmyuv、tga、jpg、jpeg)
screenshot-format=png
#截屏文件保存路径
screenshot-directory=C:\Users\pc\Videos\Captures
#upscaling and downscaling
scale=jinc
cscale=jinc
dscale=bicubic
dither-depth=auto
scaler-resizes-only
correct-downscaling=yes
linear-downscaling=yes
sigmoid-upscaling=yes
deband=no

#滤镜管理

[profile-medium_resolution]
profile-decs=medium_resolution
profile-cond=(p["video-params/w"]>=1280 or p["video-params/h"]>=800)# and (p["estimated-vf-fps"]<=45)
glsl-shaders-clr
glsl-shaders-append="~~/shaders/KrigBilateral.glsl"
glsl-shaders-append="~~/shaders/Anime4K_Clamp_Highlights.glsl"
glsl-shaders-append="~~/shaders/Anime4K_Upscale_Denoise_CNN_x2_UL.glsl"
glsl-shaders-append="~~/shaders/Anime4K_AutoDownscalePre_x2.glsl"

[profile-low_resolution]
profile-desc=low_resolution
profile-cond=(p["video-params/w"]<1280 and p["video-params/h"]<800)
glsl-shaders-clr
glsl-shaders-append="~~/shaders/KrigBilateral.glsl"
glsl-shaders-append="~~/shaders/Anime4K_Clamp_Highlights.glsl"
glsl-shaders-append="~~/shaders/Anime4K_Upscale_GAN_x4_UL.glsl"
glsl-shaders-append="~~/shaders/Anime4K_Denoise_Bilateral_Median.glsl"

[HDR_video]
profile-decs=HDR_video
profile-cond=(p["video-params/gamma"] == pq) 
#profile-restore=copy
icc-profile-auto=no
target-colorspace-hint
target-peak=500
tone-mapping=hable
tone-mapping-param=0.5
gamut-mapping-mode=auto
hdr-compute-peak=yes

The first picture is an SDR video with the above profile, and the second one is the same video with the same profile which only deleted the "HDR_video" part. It's clear that the video in the first picture was limited to 203nits, but it should not be effected by this profile according to the 'profile-cond'

Expected behavior

When the "HDR_video" profile is not triggered(such as SDR videos), do not limit the video to 203nits

Actual behavior

As above

Log file

mpv.log

Sample files

Sample files needed to reproduce this issue can be uploaded to https://0x0.st/ or similar sites. (Only needed if the issue cannot be reproduced without it.) Do not use garbage like "cloud storage", especially not Google Drive.

llyyr commented 1 year ago

Can you reproduce this with --no-config?

Ptilopsis01 commented 1 year ago

Can you reproduce this with --no-config?

Yes, it's dark

llyyr commented 1 year ago

Regenerate the logs, using --no-config this time, and also update the issue with a sample file

Also just to be sure, you have to invoke mpv with --no-config from the command line. Putting no-config in your mpv.conf doesn't do anything

Ptilopsis01 commented 1 year ago

Regenerate the logs, using --no-config this time, and also update the issue with a sample file

Also just to be sure, you have to invoke mpv with --no-config from the command line. Putting no-config in your mpv.conf doesn't do anything

mpv.log

https://0x0.st/HeSs.avi

llyyr commented 1 year ago

This shouldn't be happening with --no-config. I can't reproduce it unless I set target-peak=500. Either way, you're missing quotation marks in your profile-cond. Replace it with profile-cond=p["video-params/gamma"] == "pq" and it should work

hooke007 commented 1 year ago

BTW, target-colorspace-hint does not support being changed at runtime.

Ptilopsis01 commented 1 year ago

This shouldn't be happening with --no-config. I can't reproduce it unless I set target-peak=500. Either way, you're missing quotation marks in your profile-cond. Replace it with profile-cond=p["video-params/gamma"] == "pq" and it should work

Thanks!

Ptilopsis01 commented 1 year ago

BTW, target-colorspace-hint does not support being changed at runtime.

I thought the params should be loaded before runtime

hooke007 commented 1 year ago

But you put it in the profile. So it did nothing in your conf.

Ptilopsis01 commented 1 year ago

But you put it in the profile. So it did nothing in your conf.

I see...