mpv
mpv copied to clipboard
Dolby Vision property
I want to make an auto-profile exclusively for Dolby Vision, but I haven't found a property that would allow this. Is there such a property?
Not currently. I remember looking into this but I don't remember exactly what the conclusion was. Some things are unfortunately very hard to support as properties because DoVi records are attached to individual frames, rather than the stream.
However, the config record is present at the stream-level, so we should be able to make a property for its presence or absence. I don't remember why I didn't.
Not currently. I remember looking into this but I don't remember exactly what the conclusion was. Some things are unfortunately very hard to support as properties because DoVi records are attached to individual frames, rather than the stream.
However, the config record is present at the stream-level, so we should be able to make a property for its presence or absence. I don't remember why I didn't.
Maybe we just need to create a property for the profile of Dolby Vision, such as dolbyvision-profile.
The reason I need the profile at all, is because when running Windows in HDR, Dolby Vision is way too bright (low target-peak) and I have to specify the target-peak
for it to display correctly. Presently, DoVi is initially read as bt.709., so I have a profile for bt.709 with target-peak=1000
specified, which corrects it. But this in turn, makes the SDR media too dark. Still watchable, but obviously not correct. Regardless of this I would still prefer to be able to make a profile for DoVi.
I am using this, which works as long as filenames are named accordingly:
[DV]
profile-desc=DV
profile-cond=filename ~= nil and (filename:upper():match"[.]DV[.]" ~= nil or filename:upper():match"[.]DOVI[.]" ~= nil) and p["video-params/gamma"]~=nil and p["video-params/gamma"]~="pq"
# .. your profile settings
but I agree: a property to tell us exactly would be nice
Ah, what is the point. You need to retag with format it as PQ and BT.2020 (and in some cases full range) for it to even work and trigger HDR in vulkan (d3d11 is not autotrigger thingy, dumb Microsoft).
~~After this commit https://github.com/mpv-player/mpv/commit/3cf71fd7c7f5d4052b67ebdf11ff416a9beffbeb, the following auto-profile can be used to the video of Dolby Vision Profile 5.~~
Edit: This is an incorrect use case.
SDR video also causes this profile to be triggered.
Indeed, it's confusing.
There's nothing in that commit that uniquely identifies Dolby vision metadata. It's for HDR10 and HDR10+
hdr-metadata/max-luma and hdr-metadata/max-pq-y should be able to be used to differentiate between HDR (including DVP5)/SDR video, which is the main use case for the DV attribute, but for some reason this one has no effect.
[HDR] profile-cond=p["hdr-metadata/max-luma"] > 203 or p[" hdr-metadata/max-pq-y"] ~= nil profile-restore=copy target-trc=pq target-prim=bt.2020
I attempted to use this sub property of hdr-metadata/max-pq-y
for auto-profile at the beginning, but it not work.
hdr-metadata/max-luma and hdr-metadata/max-pq-y should be able to be used to differentiate between HDR (including DVP5)/SDR video, which is the main use case for the DV attribute, but for some reason this one has no effect.
[HDR] profile-cond=p["hdr-metadata/max-luma"] > 203 or p[" hdr-metadata/max-pq-y"] ~= nil profile-restore=copy target-trc=pq target-prim=bt.2020
I attempted to use this sub property of
hdr-metadata/max-pq-y
for auto-profile at the beginning, but it not work.
That would include all HDR. I am looking for a property that will exclusively apply to Dolby Vision.
hdr-metadata/max-luma and hdr-metadata/max-pq-y should be able to be used to differentiate between HDR (including DVP5)/SDR video, which is the main use case for the DV attribute, but for some reason this one has no effect.
[HDR] profile-cond=p["hdr-metadata/max-luma"] > 203 or p[" hdr-metadata/max-pq-y"] ~= nil profile-restore=copy target-trc=pq target-prim=bt.2020
Can somebody explain to me what the point of this profile is supposed to be? Why would you need to distinguish between HDR and SDR profiles? If you override target-trc
/target-prim
without actually enabling HDR mode, output will just be wrong. If you are enabling HDR mode, it should already have set the right output colorspace for you.
hdr-metadata/max-luma and hdr-metadata/max-pq-y should be able to be used to differentiate between HDR (including DVP5)/SDR video, which is the main use case for the DV attribute, but for some reason this one has no effect.
[HDR] profile-cond=p["hdr-metadata/max-luma"] > 203 or p[" hdr-metadata/max-pq-y"] ~= nil profile-restore=copy target-trc=pq target-prim=bt.2020
Can somebody explain to me what the point of this profile is supposed to be? Why would you need to distinguish between HDR and SDR profiles? If you override
target-trc
/target-prim
without actually enabling HDR mode, output will just be wrong. If you are enabling HDR mode, it should already have set the right output colorspace for you.The goal is to output HDR video in HDR mode and output SDR video in SDR mode, mainly to address the DoVi P5 trope. I've set target-colorspace-hint=yes before this profile, so it won't cause wacky colors
Ah, so it's a work-around for --target-colorspace-hint
not taking into account DV metadata? Then that should be fixed instead of hacking around it with properties. Incidentally, this is the same fix as https://github.com/mpv-player/mpv/issues/12221#issuecomment-1695977524
My request is specifically for Dolby Vision. The reason is, in my case the tone mapped result is too bright, and I want to adjust it.
After some experimentation, I've found that these properties are not available when the video is not playing, thus causing the return value to always be nil, so it may be necessary to have the conditional profile delay loading. I think a lua script is needed instead of a profile.
I have an idea to make it work properly.
[DoVi-profile 5]
profile-cond=p["estimated-vf-fps"] > 1 and p["video-params/gamma"] == "bt.1886" and p["hdr-metadata/max-pq-y"] ~= nil
profile-restore=copy
# ... your profile settings
hdr-metadata/max-luma and hdr-metadata/max-pq-y should be able to be used to differentiate between HDR (including DVP5)/SDR video, which is the main use case for the DV attribute, but for some reason this one has no effect.
[HDR] profile-cond=p["hdr-metadata/max-luma"] > 203 or p[" hdr-metadata/max-pq-y"] ~= nil profile-restore=copy target-trc=pq target-prim=bt.2020
Can somebody explain to me what the point of this profile is supposed to be? Why would you need to distinguish between HDR and SDR profiles? If you override
target-trc
/target-prim
without actually enabling HDR mode, output will just be wrong. If you are enabling HDR mode, it should already have set the right output colorspace for you.The goal is to output HDR video in HDR mode and output SDR video in SDR mode, mainly to address the DoVi P5 trope. I've set target-colorspace-hint=yes before this profile, so it won't cause wacky colors
Ah, so it's a work-around for
--target-colorspace-hint
not taking into account DV metadata? Then that should be fixed instead of hacking around it with properties. Incidentally, this is the same fix as #12221 (comment)
Yes, fixing it is much better than using this hacker method.
I briefly was thinking about it. I'm reluctant of adding any DV specific property or even reference the name of it. We use PQ(Y)
from it and that's about it.
If there are issues with DV they need to be fixed. I don't see why profile should distinguish between HDR10+, DV or even peak detect.
Except for some hack that are specific to one or the other, which I would rather find better solution to.
We have hdr-metadata
which is per frame information. Of course we could add a "name" there, but what if the file has multiple HDR metadata baked in? Also I'm in favor of displaying the data as it is used.
I would also take advantage of a DV property on my scenario:
- All HDR content is tone mapped to SDR BT.2020 (projector user here)
- I want to avoid DV metadata when handling P7 MKV rips (potential issue with FEL brightness) so I use vf=format:dolbyvision=no as part of my HDR profile and rely on hdr-compute-peak.
- However , for DV Profile 5 I have to re-enable DV support. All other HDR settings from my HDR profile would still apply.
Today, as others have said, DV P5 will fallback to my SDR bt.709 profile, which is wrong and messes up with my Blu-ray profile. I think there could be two ways to properly address this limitation:
a. a new setting that would allow me to turn off dolby vision support only when a 2nd video layer is present (P7). This way I could share my HDR profile with both HDR and DV (P5, P7...) files. b. a new setting that would indicate that a given file is DV P5, allowing me to create a profile specific for this scenario.
Any update on this being possibly implemented?
Any update on this being possibly implemented?
The following auto-profile can be used for DoVi P5.
[DoVi-P5]
profile-cond=p["video-out-params/max-luma"] > 203 and p["video-params/gamma"] == "bt.1886"
profile-restore=copy
...
Other non P5 DoVi videos can only be treated as HDR for processing.
profile-cond=p["video-out-params/max-luma"] > 203 and p["video-params/gamma"] == "bt.1886"
After merge of https://github.com/mpv-player/mpv/pull/13458 this has been fixed and will no longer use dummy values in video-*-params
Now you should do something like below for P5. Alternatively you can use video-out-params
if you want it to be affected by --vf=format:dolbyvision=no
. Depends on use case.
[DoVi-P5]
profile-cond=get("video-params/colormatrix") == "dolbyvision" and get("video-params/colorlevels") == "full"
profile-restore=copy
...