jessielw / HDR-Multi-Tool

A graphical user interface for parsing HDR10+ and Dolby Vision
MIT License
75 stars 6 forks source link

additional crop options #11

Closed LukasLohmar closed 4 months ago

LukasLohmar commented 8 months ago

SVT-HEVC needs to get input where the height is set to a multiple of 8 when using 10 bit and 4K resolution. so if the cropped resolution is 3840x2070 (crop of 45 on top and bottom) in SVT-HEVC it needs 2072 in height, but still would be 2070 pixel in this tool when extracting DV. so DV wouldnt fit the encoded hevc file because its off by 2 pixels. additional UI to set specific crop values would be really appreciated.

jessielw commented 8 months ago

I wouldn't mind implementing that. Could you provide some details as far as when this is required and something that would cover all use cases.

From what I've read the crop switch is enough for all crops when it comes to dolby vision, but in interested to learn more as well as add the feature if required.

LukasLohmar commented 8 months ago

thank you for your fast response.

setting custom crop values is required when specific heights are needed. i already mentioned that the SVT-HEVC encoder wont produce usable output when height is not set to a multiple of 8. sometimes the basic crop wont hit a multiple of 8 and it produces a small mismatch in dolby vision layer and base layer.

a lot of movies will be 3840x1604 when cropped which is not a multiple of 8, so in order to encode in SVT-HEVC it will be changed to leave a small black bar at the top/bottom and set height to either 1600 or 1608. but the dovitool will crop to 1604 with the crop switch.

to resolve this issue the dovitool can edit the metadata in a second step where you export the rpu without crop switch and then edit it with a very easy definable .json where the specific crop values are custommizable.

json example cli example

maybe just an additional checkbox when crop is enabled and then input fields for top/left/right/bottom crop-values will do the job. i could implement it myself and just open a pr.

jessielw commented 8 months ago

You're very welcome to add it in via a PR if you'd like as I've been a little to busy to get around to it so far! Let me know what you decide.

jessielw commented 5 months ago

Update I will eventually add the requested feature in when time allows.

I had to implement this in another project recently and I understand what you meant.