quietvoid / dovi_tool

dovi_tool is a CLI tool combining multiple utilities for working with Dolby Vision.
MIT License
623 stars 59 forks source link

Allow editing metadata blocks for HDR10+, madVR sourced generation #91

Closed quietvoid closed 2 years ago

quietvoid commented 2 years ago

Currently, the shots are overwritten by those created with only L1 metadata. It should technically be replacing the metadata blocks (probably excluding L1?) by those in the JSON.

Then comes the question, how do we define a default list of blocks for all shots?

ghost commented 2 years ago

Previous versions used a globally defined L2 (like the old generator_example.json had) for the entire video that wasn't discarded when generating from madvr data. I think this worked out fine even if it's technically supposed to be per-shot. I actually had to revert to an older version for the time being because of it.

I'm converting regular 1080p Rec.709 bluray to 1080p BT.2020 HDR10 8.1 DolbyVision using incredibly generic zscale conversion and abuse power and slope values found through trial and error to compensate for something that seems to be more or less constant across every source disk tried that could probably be better done by applying a LUT if I had any reasonable way of generating an appropriate one at the moment. I'm pretty convinced that the upscaling being done in hardware on modern TVs is better than any algorithm studios had access to (or were willing to spend the time running) until recently... so doing it this way looks better than some 2k upscale UHD BDs... which is very, very sad.

Currently either global or shot-list metadata is overwritten when generating so there isn't a way to use L2 as the bug says. If the shot specification from the current generator_example is used for metadata that can vary in the future, I'd suggest allowing the duration to be left out (where the default would be the entire length of the generated data). It can currently be set to an extremely high value for the same effect but I don't know how correct this is or if it will actually get "fixed" in the binary data.

quietvoid commented 2 years ago

At first I wanted to make the first shot the list of default metadata, but that wouldn't work for people that want to actually edit shots even for HDR10+/madVR sourced metadata.

So I might just make a new "default metadata" array of blocks that would disallow L5/L6 blocks (because those already have a defined config). And of course will have to correctly set metadata according to the initial shot/frame edits.

quietvoid commented 2 years ago

@GabeBlincoln It should now again be possible to do what you're looking for. Example (along with --madvr-file param):

{
    "level6": {
        "max_display_mastering_luminance": 1000,
        "min_display_mastering_luminance": 1,
        "max_content_light_level": 1000,
        "max_frame_average_light_level": 400
    },
    "default_metadata_blocks": [
        {
            "Level2": {
                "target_max_pq": 2851,
                "trim_slope": 2048,
                "trim_offset": 2048,
                "trim_power": 1800,
                "trim_chroma_weight": 2048,
                "trim_saturation_gain": 2048,
                "ms_weight": 2048
            }
        }
    ]
}
ghost commented 2 years ago

Sounds good to me, I'll test later but don't forsee any issues. :)

On Sun, Jan 2, 2022, 11:25 PM quietvoid @.***> wrote:

@GabeBlincoln https://github.com/GabeBlincoln It should now again be possible to do what you're looking for. Example:

{ "level6": { "max_display_mastering_luminance": 1000, "min_display_mastering_luminance": 1, "max_content_light_level": 1000, "max_frame_average_light_level": 400 }, "default_metadata_blocks": [ { "Level2": { "target_max_pq": 2851, "trim_slope": 2048, "trim_offset": 2048, "trim_power": 1800, "trim_chroma_weight": 2048, "trim_saturation_gain": 2048, "ms_weight": 2048 } } ]}

— Reply to this email directly, view it on GitHub https://github.com/quietvoid/dovi_tool/issues/91#issuecomment-1003865156, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHTZ3BEP6QNXEAZ3PA3WDG3UUEQNLANCNFSM5K4JDSOQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>