Dolby Vision, HDR10+, and cropping?

Please post here for issues related to UHD discs
Post Reply
allomere
Posts: 24
Joined: Sat May 30, 2020 3:44 am

Dolby Vision, HDR10+, and cropping?

Post by allomere »

It was my understanding that one should not crop video with dynamic metadata during an x265 encode. I noticed there was a recent update to dovi_tool that seems to allow for cropping. Is that the case, or am I misunderstanding?
quietvoid
Posts: 371
Joined: Sun Apr 19, 2020 4:15 pm

Re: Dolby Vision, HDR10+, and cropping?

Post by quietvoid »

You have to adjust the metadata accordingly, that's all.
So for Dolby Vision, if there are no more letterbox bars, dovi_tool with --crop is fine.
In some cases (IMAX), the editor can be used to adjust the metadata for specifc frames.

HDR10+ has nothing to adjust as far as I know.
allomere
Posts: 24
Joined: Sat May 30, 2020 3:44 am

Re: Dolby Vision, HDR10+, and cropping?

Post by allomere »

Thanks for the reply! Am wondering when to use --crop in my workflow. I normally demux the BL and EL, convert to 8.1, and then extract the 8.1 RPU with dovi_tool. Would I use --crop when extracting the new RPU?
quietvoid
Posts: 371
Joined: Sun Apr 19, 2020 4:15 pm

Re: Dolby Vision, HDR10+, and cropping?

Post by quietvoid »

You can't use the EL by itself anymore, since it requires the BL frames for frame order.
If you plan on using the RPU for a cropped encode, you need to use --crop or edit the RPU later. Otherwise it's disabled by default.

Alternative workflows would be to extract the RPU from MakeMKV's single layer file, and then to use mode 2 or the editor to convert it to profile 8.1.
You can also use the convert command to obtain a single layer profile 8.1, from which you can extract the RPU and get the same result.
allomere
Posts: 24
Joined: Sat May 30, 2020 3:44 am

Re: Dolby Vision, HDR10+, and cropping?

Post by allomere »

Okay, let me make sure I'm following then.

If I'm going to crop, the workflow should be:

MakeMKV -> dovi_tool extract-rpu -m 2 --crop -> x265

Is this correct?

I guess I'm' sort of hijacking my own thread, but I'm wondering if I can change my workflow even if I'm not planning to crop. Currently, I use dovi_tool to demux to BL and EL+RPU, use yusesope's tools to convert to 8.1, and then extract the RPU. Can I just directly extract the RPU and convert that to 8.1,
quietvoid
Posts: 371
Joined: Sun Apr 19, 2020 4:15 pm

Re: Dolby Vision, HDR10+, and cropping?

Post by quietvoid »

allomere wrote:
Mon Apr 26, 2021 6:22 pm
If I'm going to crop, the workflow should be:

MakeMKV -> dovi_tool extract-rpu -m 2 --crop -> x265

Is this correct?
The correct command line would be

Code: Select all

dovi_tool -m 2 --crop extract-rpu
If you are not cropping, you can just remove the --crop flag.
It is still much simpler than having to deal with demuxing and converting with yusesope's tool.

For the input, you have the choice of extracting the video to HEVC or using ffmpeg and piping it to dovi_tool.
The README has an example for demuxing but it also applies to extract-rpu.
allomere
Posts: 24
Joined: Sat May 30, 2020 3:44 am

Re: Dolby Vision, HDR10+, and cropping?

Post by allomere »

Thanks for your assistance, and the fantastic tools.
allomere
Posts: 24
Joined: Sat May 30, 2020 3:44 am

Re: Dolby Vision, HDR10+, and cropping?

Post by allomere »

Okay, arg, I have one more question for you - not actually related to the OP (but I can hijack my own thread, right? :)

Is it not necessary to demux a single track dual layer DV file before encoding it in x265? I can simply extract and convert the RPU to 8.1? Does it matter whether it is an FEL or MEL title?
quietvoid
Posts: 371
Joined: Sun Apr 19, 2020 4:15 pm

Re: Dolby Vision, HDR10+, and cropping?

Post by quietvoid »

allomere wrote:
Tue Apr 27, 2021 4:28 am
Is it not necessary to demux a single track dual layer DV file before encoding it in x265? I can simply extract and convert the RPU to 8.1? Does it matter whether it is an FEL or MEL title?
You never need to demux unless making a dual stream MP4. The RPU can be extracted from single layer, what MakeMKV creates.
And the RPU can be converted while extracting, or afterwards with the editor.
allomere
Posts: 24
Joined: Sat May 30, 2020 3:44 am

Re: Dolby Vision, HDR10+, and cropping?

Post by allomere »

I really appreciate your assistance and patience handling my annoying questions.

So would a more efficient workflow be:

MakeMKV -> dovi_tool convert -m 2 --discard (is the discard necessary?) -> Feed resulting HEVC file and RPU to x265?

Is there a difference between using mkvextract to demux the HEVC after running MakeMKV versus using the HEVC produced by the convert function? They seem to produce two different HEVC files.

Again, thanks very much for your help.
quietvoid
Posts: 371
Joined: Sun Apr 19, 2020 4:15 pm

Re: Dolby Vision, HDR10+, and cropping?

Post by quietvoid »

You don't need to extract the HEVC file because the MakeMKV file is already fine to use as HDR10 base layer.
So you only have to extract the RPU, and use it with x265.

The file from the convert function is different because in your command line, it is converting to profile 8.1 and removing the enhancement layer.
MakeMKV is always going to be profile 7 and have the EL.
allomere
Posts: 24
Joined: Sat May 30, 2020 3:44 am

Re: Dolby Vision, HDR10+, and cropping?

Post by allomere »

Got it. That all makes sense. One last question (I swear!) - should I be encoding the file MakeMKV produces, or the HEVC file with a discarded EL?
quietvoid
Posts: 371
Joined: Sun Apr 19, 2020 4:15 pm

Re: Dolby Vision, HDR10+, and cropping?

Post by quietvoid »

It makes no difference because most software is either unaware or ignores the Dolby Vision units in the bitstream currently.
allomere
Posts: 24
Joined: Sat May 30, 2020 3:44 am

Re: Dolby Vision, HDR10+, and cropping?

Post by allomere »

Well, I'm back again after some noodling around on this. But I think this question is easy - if I encode the file that MakeMKV produces (with the EL) is the resulting file going to be larger than encoding an HEVC file without the EL? Out of curiosity, I demuxed the file x265 produced after encoding the MakeMKV file (with EL) and interestingly there was a small EL file that it produced. Just makes me wonder if I'm getting something in the encoded file that I don't need and is just taking up space.

EDIT: Well, upon further testing, it looks even when I demux an encoded file that didn't have an EL, dovi_tool still produces an EL. I'm guessing that's the RPU.
quietvoid
Posts: 371
Joined: Sun Apr 19, 2020 4:15 pm

Re: Dolby Vision, HDR10+, and cropping?

Post by quietvoid »

Yes, because usually the RPU is contained inside the EL.
Post Reply