mpv-player / mpv

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

vo_gpu-next: `--hdr-compute-peak=yes` should ignore the dovi metadata. #11338

Open hooke007 opened 1 year ago

hooke007 commented 1 year ago

Important Information

Provide following Information:

Reproduction steps

Load any dovi video and set hdr-compute-peak=yes

Expected behavior

https://mpv.io/manual/master/#options-hdr-compute-peak

Compute the HDR peak and frame average brightness per-frame instead of relying on tagged metadata.

I do not want use dovi's RPU metadata.

Actual behavior

cycle hdr-compute-peak but nothing would help.

Log file

I think it was an oversight in design that introduced by recent commits https://github.com/mpv-player/mpv/commit/41ad51bda281e56ddc8bb4416b82b47903e779f1

Sample files

N/A

quietvoid commented 1 year ago

The same happens for HDR10+, as this is designed in libplacebo to disable peak detection when metadata is present. I guess it needs extra flags.

In the meantime you can bypass any Dolby Vision metadata with vf=format:dolbyvision=no

kasper93 commented 1 year ago

I agree this behavior should be customizable. There should be easy way to select between DV, HDR10+ and peak detect as metadata source. Currently HDR10+ metadata is overwritten with DV if both are present.

hooke007 commented 1 year ago

In the meantime you can bypass any Dolby Vision metadata with vf=format:dolbyvision=no

It would totally break the rendering of dovi p5.

quietvoid commented 1 year ago

Well yes, currently there is no way to do what you want.

haasn commented 1 year ago

In https://github.com/haasn/libplacebo/tree/dv_metadata I added the ability to choose the data source (between DV metadata and HDR10+ metadata). However, in that commit, I also made the peak detection shader default to DV-style PQ Y measurements. So that branch still disables peak detection if DV metadata is already present. (You can, however, choose between HDR10+ dynamic metadata and DV-style peak detection)

Can you clarify why exactly you want to ignore the DV metadata?

hooke007 commented 1 year ago

Can you clarify why exactly you want to ignore the DV metadata?

"Compute the HDR peak and frame average brightness per-frame instead of relying on tagged metadata." I do not want use metadata.

kasper93 commented 1 year ago

You can play around with tone_map_metadata libplacebo option to select the metadata to use. For example --libplacebo-opts=tone_map_metadata=cie_y.

quietvoid commented 1 year ago

I don't think tone_map_metadata=cie_y solves the issue because the enum value is the same as what's used when enabling peak detection.

danbezerra commented 1 year ago

I would also like to have the ability to disable DV metadata and instead rely on compute-peak. My reason is the different brightness level that can be introduced with the FEL Layer. The RPU will assume that the FEL layer is being consumed, therefore passing the "wrong" peak values from MPV POV (since MPV only consumes the base layer).

I'm using vf=format:dolbyvision=no as suggested by quietvoid, however if this solution creates issues with DV P5 files (I haven't tested myself), then this is not a solution that can be applied to all DV enabled files.

haasn commented 1 year ago

I would also like to have the ability to disable DV metadata and instead rely on compute-peak. My reason is the different brightness level that can be introduced with the FEL Layer. The RPU will assume that the FEL layer is being consumed, therefore passing the "wrong" peak values from MPV POV (since MPV only consumes the base layer).

We should probably ignore dovi L1 extensions when an EL is present, like we do for reshaping data...

quietvoid commented 1 year ago

Well yes, but also what if I want to use the brightness metadata for files where I have confirmed that the EL doesn't impact the brightness? A manual option or am I supposed to convert my metadata to be not-profile-7 ?(which isn't practical, since it requires modifying the file).

danbezerra commented 1 year ago

That's the problem. We either apply a solution more broadly than ideally it needs to be, or we leave issues exposed by allowing all FEL titles to use DV metadata. I can't think of an auto way to know which FEL titles are problematic or not... Other than dreaming about the day where MPV fully supports FEL. Then our problem is solved :-)