Dolby Vision Profile 7 & 8 support (.ts/.mkv files)

I’m mostly curious how someone has mostly P8 videos, given that rips are P7 and streaming content is P5. Feels like you’d have to go out of your way for P8. Maybe I’m unaware of some other scenario.

Regardless, maybe just strip them down to HDR? Personally, I’m in the process of converting all my P7 DoVi movies to P8 and am loving the new functionality. Has worked flawlessly for me, so far.

I’ve been converting all my files to Profile 8 since it was possible which was probably about a year ago now.

Lots of torrents out there with P8

HDR10 has a dimmer appearance than DV in general due to the nature of static tone mapping. There’s really no reason to use the HDR10 version, even if you’re a “vivid preset” enjoyer, especially with the bad HDR10 metadata bug which causes TVs to tone map incorrectly.

Also you should be able to customize the tone mapping settings on your tv specific to just DV and wont affect HDR presentation.

What is that?

I have to disagree with this. My “anecdata” in comparing DV to HDR10 playback across many sources suggests DV is largely being used to make a dimmer/darker picture with increased contrast between scenes, not the other way around.

With today’s mainstream TVs you’re maxing out peak brightness at ~1000nits in a 2-10% window with either HDR or DV, so the RPU is largely being applied to increase scene/shot contrast by making dark scenes darker, not by making brights brighter or increasing the FALL for a scene.

In my experience, with max brightness and similar picture settings for DV and HDR on a Sony A80J (as well as previous displays), an HDR picture is always, on average, brighter than the same scene in DV.

In terms of preferring HDR, some people don’t like those inky blacks and want to see WTF is actually going on. That’s a valid preference.

Mind you, as a slave to purity, I am not one of those people. I’m on the opposite extreme of the spectrum, using madVR measurements to get DV playback for sources only presently available in HDR10.

The eternal debate between supporters of “purity” and supporters of personal preference. Or technique vs. feelings, if you will.

What often goes wrong in such discussions (not saying that is necessarily the case here), is that people talk about this as if there is a right and a wrong.

But, if I feel that bass gives me more enjoyment of music, it becomes meaningless if a purist tell me that I am doing something wrong. If I think Springsteen’s “Born in The USA” album has a flat production, but I love it with more bass, why the hell shouldn’t I EQ it according to that? I listen for my own pleasure, not the producer’s.

An analogy could be a salesperson who, instead of asking the customer what the customer prefers, tells the customer what the person should prefer. I like the salesperson who informs me neutrally about the difference between HDR and Dolby Vision, but who does not conclude on my behalf about which I should prefer.

HDR can be the best for some. No problem.

Totally true!

This is precisely why apps such as Infuse should be provided with a range of options, so that all users can enjoy the film medium as an art form in the way they like it best. That is my conclusion regarding this.

Are you sure certain your opinion of DoVi isn’t being colored by the flawed implementation of DoVi on your A80J? Sony’s base configuration data for Gamma calibration (factory and calibrated) on all their J & K series WOLED displays has known issues that Sony is unfortunately unlikely to address. The A95K was Sony’s first OLED to be able to accurately display DoVi.

Question:

If in some cases you think file size is more important than DoVi, but you have a DoVi UHD disk to be ripped with MakeMKV,can you convert/compress a DoVi file to HDR10 in HandBrake?

Or will the result be strange if the file you put into HandBrake is not HDR10?

Handbrake will ignore the DoVi Enhancement Layer and just compress the HDR10 Base Layer.
With that said, you could convert the Enhancement Layer to an RPU file and then interleave that RPU into the Handbrake compressed video stream after compression to get the best of everything since your EL will be tiny in RPU format used by Profile 8.1.

Thank you for your quick response.

First, I’m happy with what you write about HandBrake just ignoring the DoVi Enhancement Layer and compressing the HDR10 Base Layer. This seems logical, but I was concerned because I’ve read claims in forums that DoVi movies compressed in HandBrake get weird colors. I hope you are right :slight_smile:

Secondly, Is there an easy way to do what you mention with converting the EL to an RPU file etc.? What tools are required?

And no mention of DoVi picture preset or if HDR10 dynamic tonemapping was enabled on the TV.

@Videoman The RPU is basically insignificant in size compared to the BL so there’s no point in trying to save space past converting to 8.1

What I was thinking was to compress the video itself to maybe half the size in HandBrake. Then there is a significant upside to that, in terms of storage space. Maybe save 20-40 GB. Just like when you compress an ordinary blu-ray from, say, 20 GB to 10 GB.

If it can be combined with still having DoVi, then of course that would be nice.

Will the operation be like this?

  1. Rip the UHD blu-ray with MakeMKV
  2. Extract the Enhancement Layer (how?)
  3. Convert the Enhancement layer to a DoVi P8 compatible RPU file (how?)
  4. Convert/compress the video with HandBrake.
  5. Mux the DoVi P8 compatible RPU file into the converted/compressed video (how?)

One-time setup necessary:

  1. Download DDVT from here: [DDVT Tool] Dolby Vision RPU Demuxing / Injecting / Editing. - Doom9's Forum
  2. Extract DDVT somewhere convenient (I keep it at %USERPROFILE%\Apps\DDVT)
  3. OPTIONAL: Shift+Right-click on both DDVT_DEMUXER and DDVT_INJECTOR, click on “Send to”, and click on “Desktop (create shortcut)”.
  4. I rename both shortcuts on my desktop to DEMUXER and INJECTOR respectively.

The summarized version of my preferred steps are:

  1. Backup with MakeMKV
  2. Drag+drop the MKV file onto the DDVT_DEMUXER script.
  3. Press 2 to crop the RPU if you’re cropping the file in Handbrake.
  4. Press S to start the script and wait for it to complete.
  5. Copy the RPU.bin file to the same location as your Handbrake compressed video file.
  6. Compress with Handbrake.
  7. Drag+drop the Handbrake Compressed file onto the DDVT_INJECTOR script.
  8. Optional: Press 4 if you want the script to Mux everything for you.
  9. Press S to start the script and wait a few minutes for it to complete (should take less than 10-minutes on an SSD, but might be slower if you have an HDD or are working off a NAS).

These are the same steps with more explantations:

  1. Backup Blu-ray to MKV with MakeMKV.
  2. Demux a DoVi Profile 8.1 RPU with the DDVT_DEMUXER script by simply dragging+dropping the MKV file onto the DDVT_DEMUXER script (shortcut on your desktop if you followed my optional recommendation above).
  3. Press 2 to crop the RPU if you’re cropping the file in Handbrake.
  4. Press S to start the script and wait for it to complete (should only take about a minute on an SSD, but might be slower if you have an HDD or are working off a NAS).
  5. Navigate into the folder that was created in the directory of the video file you just processed with the DEMUX script.
  6. Copy the RPU.bin file to the output/destination directory where your Handbrake compressed video will reside.
  7. Compress your video with Handbrake as an MKV.
  8. Inject the RPU.bin back into your Handbrake compressed video with the DDVT_INJECTOR script by simply dragging+dropping the MKV file onto the DDVT_INJECTOR script (shortcut on your desktop if you followed my optional recommendation above).
  9. Optional: Press 4 to have the script create an MKV file for you.
  10. Press S to start the script and wait a few minutes for it to complete (should take less than 10-minutes on an SSD, but might be slower if you have an HDD or are working off a NAS).

Note: I personally prefer to not Press 4 in the second-to-last step and to instead Mux it back together myself with MKVToolNix GUI so I can ensure all flags+metadata are set correctly since MakeMKV and Handbrake both have issues with MKV flags/options for subtitles. If you go this route then just drag the Handbrake MKV and the DDVT_INJECTOR’s output BL+RPU.hevc file onto the MKVToolNix GUI app window, uncheck the original HEVC stream, set other flags+metadata as desired, click “Start Multiplexing”, and wait for it to complete.

Wow, thank you so much for taking the time to do this. It was exactly what I needed.

Hope it’s okay for me to ask some follow-up questions.

  1. Regarding cropping in HandBrake: I usually have cropping set to “Automatic”. Does that mean that I don’t need to crop the RPU, or must I crop anyway according to the values ​​HandBrake sets in Automatic mode.

  2. Regarding the file you compress in HandBrake: Is this the original file from MakeMKV or is it the original file strapped for the RPU file? Or maybe it doesn’t matter, because HandBrake ignores the enhancement layer anyway.

  3. Regarding injecting the RPU file back into the HandBrake compressed video: Does it matter which order you drag and drop respectively the video and the RPU file into the DDVT_ INJECT script?

  4. I will probably use the same method as you at the end of the route, for the same reasons. Does that mean I can skip the whole drag and drop into the DDVT_INJECT script part and go directly to MKVToolNix? Or must I do something in the script first and then get an output that I can put into MKVToolNix?

  5. I was also a bit unsure about some of the terms here. When you say “drag the DDVT BL+RPU.hevc onto the MKVToolNix GUI app window”, is this the same as the previously mentioned RPU.bin file or something else?

I hope you can answer these questions and I will try this myself afterwards. I’m excited about it. It can naturally take some time, since the HandBrake part with my settings (RF 20, 2-pass encoding, encoder preset slow) can mean 30 hours per video.

Thanks again for your helpfulness.

Edit:
Just to be on the safe side 1: I guess in the last section in MKVToolNix I can also put in an srt. sub without causing any problems for the end result?

Just to be on the safe side 2: By using this method, one can completely ignore the P7 → P8 RESET_9999 script that has been discussed earlier in the thread, right?

You’re welcome @Videoman. Answers to your questions below:

  1. Continue to crop in Handbrake as you always have if you prefer that. The RPU needs to be cropped in DDVT_DEMUX if you choose to crop in Handbrake, but DDVT_DEMUX handles the values automatically for you as well so no need to do anything other than Press 2 when prompted.
  2. Use the original file from MakeMKV to compress. It doesn’t matter though since Handbrake will only use the BL (base layer anwyays).
  3. You only drag and drop the Handbrake Compressed File onto DDVT_INJECT. The RPU.bin file just needs to be in the same directory as that video file.
  4. No, you still need to drag and drop onto DDVT_INJECT if you prefer to just use MKVToolNix to Mux yourself, just don’t Press 4.
  5. I cleaned up the language for clarity in my previous post. If you don’t Press 4 while using DDVT_INJECT then it’ll ouput an HEVC file instead of an MKV file. That HEVC file is what I was referring to as BL+RPU.hevc. You’ll supply that HEVC file to MKVToolNix along with whatever other file(s) you want to Mux.
  6. Yes, you can add in SRT files if you want while Muxing with MKVToolNix.
  7. Yes, you can ignore the RESET_9999 script if you use this method instead. I prefer this method for its flexibility personally, but I understand why some people prefer the RESET_9999 script.

If you want to test this quicker than in 30-hours, consider encoding a video with the fastest possible settings in Handbrake just as a test. You can probably tweak things to get it to encode in under an hour if you sacrifice quality.

This is awesome. If I can pull this off, I’d go so far as to say it’ll take my video collection to a new level. This is a steep learning curve for me, but very useful and fun. It’s just been 1-2 weeks since I got my first UHD friendly drive.

I would never have been able to do this without your help. I will try your excellent recipe and report back.

Good idea. I will consider that. Right now I have another slow file running :slight_smile: