Alternate HDR10 metadata handling
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 37k
- Forks
- 3.5k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 22
Description
Expected behavior of the wanted feature
Currently, mpv looks at the file and uses the attached HDR10 metadata for image processing frame by frame. This is fine as long it does not change within the file. However, there are some files (namely, those files generated from a UHD BluRay that contain multiple cuts and are stitched together. => seamless branching) that have alternating HDR10 metadata.
For example here:
... a second later ...
As you can see, the HDR metadata changes.
Why is this a problem?
This causes the swapchain (in my case tested with -target-colorspace-hint) to reconfigure and lead to severe framedrops.
This is most notably the case when the displays output is frame-matched with the file's video parameters.
For files where the metadata does not change it's not happening, nor does it occur on SDR files. (obviously, as there is no metadata that could change)
This changing metadata behavior is probably violating the HDR10 spec but it would be nice if mpv could handle those files without a hitchup. Commercially available players, like a Blu-ray player, only check the file header/first frame for metadata and do not reconfigure the output while playing.
Alternative behavior of the wanted feature
This is a feature request to the issue I posted over a year ago => https://github.com/mpv-player/mpv/issues/11538
However, this is not a mpv bug, it's just a different file treatment.
That's why I opened this feature request - let the user allow how mpv should handle such files.
With a new setting (maybe a libplacebo flag?) the user could change this behavior and configure it as liked.
- For users wanting ultimate tone mapping, check for alternating metadata and always use them for optimal tone mapping.
- For other users only wanting HDR passthrough allow them to only use the attached first frame/fileheader HDR metadata (also with the danger of completely wrong metadata) and do not check for alternating metadata. This would prevent playback from unwanted frame drops caused by a swapchain reconfigure.
Thanks
Log File
See issue https://github.com/mpv-player/mpv/issues/11538
Sample Files
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the related issue #11538 and trace the HDR10 metadata handling described there; this report names no source files, tests, or sample files. Clarify where a user-selectable metadata policy belongs and define done as supporting both alternating-metadata processing and first-frame/file-header-only handling without unwanted output reconfiguration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli, desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100