View Full Version : [DDVT Tool] Dolby Vision RPU Demuxing / Injecting / Editing.
GodzilaAvenger
29th November 2023, 03:42
Does this still applies? So if i have a movie with mixed IMAX and normal widescreen content, do i set borders to 0? DDVT says top and bottom video border are 208 px and rpu top and bottom borders are 207 px.
Do i need to crop video borders to 0? or crop rpu? or both??
For mixed aspect ratio content I recommend leaving the RPU borders as they are, i.e. the border part should display something like "[LEAVE UNTOUCHED]". Another option would be to set the borders to the height of the smallest black bar (corresponding to the tallest scene(s)).
techdiver
29th November 2023, 12:24
When adding DV or HDR10+ metadata you have to make sure that it's synced with the video stream, otherwise there'll be annoying artifacts (jumps in brightness). This is especially true when using sources from different medium, like digital vs. Blu-ray, as those are usually not synced because of some initial logo or something.
To check if the metadata is synced with the file you can use the FILEINFO script to get the scene cuts (frame numbers where scenes change, frame numbers starting from 0), and match that with the frame number in the actual video (I like using djv, though be careful since in it frame numbers start from 1, not 0). You can then apply the positive or negative delay in the INJECTOR script (I haven't used the HYBRID script but if it has a delay option you can use that too).
Excellent. Thanks for the reply! :thanks:
-QfG-
5th December 2023, 05:12
-v0.61.5 Online.
*FIXED missing HDR Info String in mkvtomp4 script with DV P5 files.
*Updated mkvtoolnix to v 81.0.0.0.
EDIT: Little error in the DEMUXER script, it's fixed now, no version update, simply download again. (12/08/2023)
NeverExists
16th December 2023, 07:22
Hi, with Wandavision Web Version, when I try to extract the RPU It recognizes Dolby Vision Profile 5, but then gives an error saying 0 frames parsed.
Edit: NVM It's cause it was an mp4. using MKVToolnix to convert it to mkv, then running through the demuxer worked.
cool advertise
19th December 2023, 13:16
-v0.61.5 Online.
I think I found a bug in your tool, in the demuxer, when you have an .mkv with only hdr10+, without dolby vision, and you want to extract or demux the hdr10+ in a HDR10Plus.json file, the tool does not extract it. :(
EDIT: I had the first version of the tool v0.61.5, now I have downloaded the latest one and everything works, sorry...
-QfG-
21st December 2023, 22:11
No problem. :)
NVM It's cause it was an mp4. using MKVToolnix to convert it to mkv, then running through the demuxer worked.
Will check and fix mp4 demuxing in the next version.
GodzilaAvenger
24th December 2023, 04:19
I recently got the new Avatar (2009) Blu-ray which comes with Dolby Vision FEL, but when I looked at the RPU the brightness data seems to be static, like HDR10 (the L1 plot is just a straight line). I found a web source with HDR10+ metadata that seems to be far more dynamic when it comes to scene-by-scene (or even frame-by-frame) L1 data. So my question is, should I stick to the original RPU or should I convert the HDR10+ one to DV RPU and inject it into the file?
-QfG-
28th December 2023, 02:47
You must check the frames by the Seamless Branching CAN UHD. The Extended Cut from the CAN UHD has 396 Frames more as the BD and WEB versions. Theatrical Cut from the US UHD has better quality, but no DV. You can add the DV EL Layer from the CAN Theatrical Cut into the US UHD.
GodzilaAvenger
28th December 2023, 21:16
I have the US UHD Steelbook Theatrical Cut which does come with P7 DV FEL. The problem is that like every other 4K release of Avatar the brightness data in the RPU is just the same value for all scenes (essentially HDR10). But, I've found a web source (of the Theatrical Cut) with HDR10+ metadata where the brightness is dynamic. So my question is, do I stick to the original RPU, or should I turn the HDR10+ metadata into a new RPU and inject it instead?
von Suppé
3rd January 2024, 10:10
GA, why don't you just give HDR10+ a try and see if the result looks better than with native FEL/RPU.
Chances are that the HDR10+ video be of other grading, but in the end your eyes are the final judge.
GodzilaAvenger
6th January 2024, 23:31
So, to my eyes they pretty much look the same, but then again I'm not that good at judging picture quality in general, so I was wondering if there's a best practice in this situation since I don't know much about mastering or color grading or metadata generation.
sofakng
7th January 2024, 02:03
Can somebody explain the RPU and its relationship to profile 5 and profile 8?
If I understand correctly, the RPU is the dynamic metadata packets describing the change in brightness per frame/scene, etc.
Does profile 5 contain RPU data or is it 'already applied' (encoded) into the video stream?
I know profile 5 doesn't contain a base layer (and has a different colorspace) from profile 8 but I'm still trying to understand the basics...
GodzilaAvenger
7th January 2024, 09:34
Your understanding of RPU is generally correct (it also has dynamic tone-mapping data). P5 and P8 both have a base layer and an RPU, P5 base layer uses a different color space from the one that P8 uses to be backwards compatible with HDR10. You can use dovi_tool (which is baked into DDVT) to convert P5 RPU to P8.
-QfG-
21st January 2024, 20:55
-v0.62 Online
*UPDATED Complete overhaul of the Injector script.
*ADDED Feature for settings custom mkvtoolnix path in Options.
*Updated mkvtoolnix to v 82.0.0.0.
*FIXED minor bugfixes
Axeldook
21st January 2024, 22:08
Thank you
great tool for DV'ing my mkv's that wont play DV on my LG c1's.
Quick question, any way to add chapters ?
thank you
-QfG-
22nd January 2024, 20:30
You can simply add chapters with mkvtoolnix.
SeeMoreDigital
22nd January 2024, 21:23
...great tool for DV'ing my mkv's that wont play DV on my LG c1's.
What device are you going to play them with?
Axeldook
23rd January 2024, 21:13
Hi,
LG C1 with Plex app
Axeldook
23rd January 2024, 21:15
Hi,
MKV tool nix doesnt do mp4
Nico8583
23rd January 2024, 23:35
Hi,
mkvtoolnix now supports Dolby Vision but can't directly convert Profile 7 to Profile 8.1. Is there a way to convert MKV Profile 7 from mkvtoolnix to MKV Profile 8.1 directly ? So just convert video track and keep other elements untouched.
Thank you.
von Suppé
24th January 2024, 08:39
MKV tool nix doesnt do mp4
Doesn't the DDVT_MKVTOMP4 script work for you?
[EDIT] My bad, apologies. The script doesn't convert 7 to 8.1.
I take it your tv doesn't support P7?
Axeldook
24th January 2024, 11:19
Hi,
thank you for all the responses.
LG oled wont play DV MKV, only DV mp4.
hence the ask, is there a way to add chapters to the mp4 files once ive used this tool to convert from mkv to mp4
von Suppé
24th January 2024, 12:37
Cli-tool mp4box.exe has the capability to write chapters in mp4 container. Eventhough QfG-dovitools has this onboard, I think adding chapters has not been implemented in the DDVT_MKVTOMP4 script. Hopefully @-QfG- has it on the to-do list.
If you don't mind a workaround with 3rd party tools, you can use CleverFFMpegGUI (frontend to cli-tool ffmpeg.exe) to add chapters to mp4 files. AFAIK it would only accept timecodes.txt files, so you'd first have to extract the chapters from your mkv into that format. Which chapterEditor is capable of.
https://www.videohelp.com/software/clever-FFmpeg-GUI
https://www.videohelp.com/software/ffmpeg
https://www.videohelp.com/software/chapterEditor
Axeldook
24th January 2024, 12:39
great stuff. will give it a try and report back
thank you
von Suppé
24th January 2024, 12:59
will give it a try...
FYI when in chapterEditor, in the upper-left corner choose "Chapter editors" in which window you click on "Converter".
Select your mkv with "File" and at "Output format" choose "Timecodes (txt)". Beware to set proper and same Source- and Target FPS.
At last "Save as" and Bob's your uncle.
[EDIT]
To all, my apologies. I was mistaken in thinking ffmpeg accepting a chapter-timestamps textfile. I've asked hubblec4 (chapterEditor) for help.
-QfG-
26th January 2024, 20:27
-v0.63 Online!
*UPDATED Complete overhaul of the DEMUXER script.
*UPDATED Complete overhaul of the REMOVER script.
*UPDATED No more Target subfolders.
*FIXED minor bugfixes
I think adding chapters has not been implemented in the DDVT_MKVTOMP4 script. Hopefully @-QfG- has it on the to-do list.
DDVT_MKVTOMP4.cmd - Line 287:
Erase the switch "-map_chapters -1". I hope this works.
Or:
https://ikyle.me/blog/2020/add-mp4-chapters-ffmpeg
Is there a way to convert MKV Profile 7 from mkvtoolnix to MKV Profile 8.1 directly ?
Yes. Open the DDVT_HYBRID.cmd script. Now add in the HDR section your P7 File. Now add the same P7 file in the DV section. Press start and you have a P8 Hybrid.
Axeldook
27th January 2024, 09:45
great work !
AgentXXL
27th January 2024, 21:10
Just wondering if I missed something in the conversation... I was using 61.5 with no problems but I saw that 62 had been released so I updated to it. I noticed that there is no longer an option to mux the DV injected stream into a mkv with the audio and subtitles. I came back to check today and saw that v63 was released so I installed it, thinking it might fix the missing option (used to be option 5 for the injector script). I know I can manually remux using MKVToolnix, but is there a reason why that is no longer an option in v62/63?
Regardless, thanks again for these amazing scripts!
Nico8583
28th January 2024, 02:14
Yes. Open the DDVT_HYBRID.cmd script. Now add in the HDR section your P7 File. Now add the same P7 file in the DV section. Press start and you have a P8 Hybrid.
Thank you, just tried it and it works.
-QfG-
28th January 2024, 16:01
Just wondering if I missed something in the conversation... I was using 61.5 with no problems but I saw that 62 had been released so I updated to it. I noticed that there is no longer an option to mux the DV injected stream into a mkv with the audio and subtitles. I came back to check today and saw that v63 was released so I installed it, thinking it might fix the missing option (used to be option 5 for the injector script). I know I can manually remux using MKVToolnix, but is there a reason why that is no longer an option in v62/63?
Regardless, thanks again for these amazing scripts!
The muxing Option is only available, if your Input File is a *.mkv or *.mp4. The setting is in the Injector Script default = Disabled and in the Hybrid Script default = enabled. Otherwise send me a screenshot from the Menu and i will check for errors.
EDIT: There is a fixed version 0.63 Online, a little mistake in INJECTOR script with the logfile. But the mux function still works:
https://i.imgur.com/85JuuYNl.png
AgentXXL
31st January 2024, 20:34
The muxing Option is only available, if your Input File is a *.mkv or *.mp4. The setting is in the Injector Script default = Disabled and in the Hybrid Script default = enabled. Otherwise send me a screenshot from the Menu and i will check for errors.
EDIT: There is a fixed version 0.63 Online, a little mistake in INJECTOR script with the logfile. But the mux function still works:
I always use .mkv source files. I downloaded 0.63-Fixed and I'm still seeing no mux option. Here's screenshots from both Injector and Hybrid scripts.
Note that when I use DDVT_Options.cmd, it doesn't add a menu item for Hybrid. I also preferred the old method where it looked for a RPU.bin instead of needing to drag and drop.
I suspect it may be the menu entries in the registry are corrupted somehow - if I choose Remove from DDVT_Options.cmd, the menu items are still there, even after a reboot. I'll try manually removing them from the registry.
Sorry for the large pictures... forgot to resize before posting.
AgentXXL
31st January 2024, 20:48
I suspect it may be the menu entries in the registry are corrupted somehow - if I choose Remove from DDVT_Options.cmd, the menu items are still there, even after a reboot. I'll try manually removing them from the registry.
OK, after removing the entries from the registry manually I re-ran DDVT_Options.cmd after deleting the existing .ini file. Now I don't get context menus at all. Running Win11 Pro 23H2 fully updated.
Thoughts?
bobowb
1st February 2024, 11:11
Hello guys i am new here so please be good help me !
my TV is LG OLED C8 and i use the internal TV player to play movies As i know the TV supports DV Profile 8 too . I have problem with most of these "hybrid" DV-HDR .mkv files like the one below . The TV can play such files but the problem is that they always play in HDR mode and cant trigger the TV DolbyVision mode .
I have been tried these:
ffmpeg -i inputfile.mkv -c:v copy -c:a copy -strict unofficial outputfile.mp4
and to mux the .mkv file to .m2ts with tsMuxeR
but unfortunately the TV plays the .mp4 and .m2ts files again just in HDR mode but not in DolbyVision! I have been tried and all DDVT Tools scripts but no luck ... :(
So my question is there any more simple way to make the internal LG TV player to play such "Hybrid" files in DolbyVision mode ? Thank you in advance !
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L5@High
HDR format : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible / SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible
Codec ID : V_MPEGH/ISO/HEVC
Duration : 1 h 2 min
Bit rate : 23.2 Mb/s
Width : 3 840 pixels
Height : 1 606 pixels
Display aspect ratio : 2.40:1
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0 (Type 2)
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.157
Stream size : 10.1 GiB (97%)
Language : English
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Mastering display color primaries : Display P3
Mastering display luminance : min: 0.0050 cd/m2, max: 1000 cd/m2
Maximum Content Light Level : 765 cd/m2
Maximum Frame-Average Light Level : 293 cd/m2
Axeldook
1st February 2024, 20:49
Hi MAte
i have some C2's and they will only play DV if you remove subs and chapters (mkvtoolnix) then with the new mkv file with just audio and video, drag and drop into the 'DDVT_MKVTOMP4' bat file and run it.
the Mp4 file it outputs will run in DV.
bobowb
2nd February 2024, 14:47
Hi MAte
i have some C2's and they will only play DV if you remove subs and chapters (mkvtoolnix) then with the new mkv file with just audio and video, drag and drop into the 'DDVT_MKVTOMP4' bat file and run it.
the Mp4 file it outputs will run in DV.
Thank you very much for the tip my friend ! Will test it later and report the result here :thanks:
P.S Well i did all like you said but the TV doesnt trigger the DV mode again and unfortunately plays the .MP4 file just in HDR mode ... :(
guest
3rd February 2024, 02:15
Thank you very much for the tip my friend ! Will test it later and report the result here :thanks:
P.S Well i did all like you said but the TV doesnt trigger the DV mode again and unfortunately plays the .MP4 file just in HDR mode ... :(
Hi "bob",
I haven't done this for a little while, but when I was doing DV stuff to play on my LG with the "built in player", I found that you needed to remove this part :- HDR format : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU,HDR10 compatible / SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible, using these tools, and I also found that it would only display DV when it was either a .ts or .m2ts file !!!!
So referencing AgentXXL's screenshot, I'd used item #4 in the "MENU" to "remove HDR10+"
EDIT:- I have been "playing around" with the latest build on a Hybrid video, and there appears to be no where you can remove any HDR10 info (as shown in the above screenshot), Menu item #4 isn't available :(
bobowb
3rd February 2024, 08:44
Hi "bob",
I haven't done this for a little while, but when I was doing DV stuff to play on my LG with the "built in player", I found that you needed to remove this part :- HDR format : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU,HDR10 compatible / SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible, using these tools, and I also found that it would only display DV when it was either a .ts or .m2ts file !!!!
So referencing AgentXXL's screenshot, I'd used item #4 in the "MENU" to "remove HDR10+"
EDIT:- I have been "playing around" with the latest build on a Hybrid video, and there appears to be no where you can remove any HDR10 info (as shown in the above screenshot), Menu item #4 isn't available :(
Thank you TDS but i already tried to remove the HDR+ metadata with DDVT_REMOVER.cmd (actually it removes just HDR+ but the HDR cant be removed)and to demux file to .m2ts but this doesnt make the TV to trigger the DV mode again ... :(
guest
3rd February 2024, 10:07
Thank you TDS but i already tried to remove the HDR+ metadata with DDVT_REMOVER.cmd (actually it removes just HDR+ but the HDR can't be removed)and to demux file to .m2ts but this doesn't make the TV to trigger the DV mode again ... :(
Yeah, well like I said, I haven't done any of this stuff for quite a while, and a LOT of things have changed, and I have forgotten probably just as much :(
Hopefully the "higher ups" will chime in with some advice.
There has to be a simple way of removing both types of HDR....
I know I was successfully modding some hybrid videos that would play on my LG.
I just need to get into it again !!!
There might be (probably is) a way to get x265 to remove the HDR & inject a DV rpu (I know it can inject an rpu.bin)
bobowb
3rd February 2024, 10:53
Ok if someone knows let share his experience please !
quietvoid
3rd February 2024, 16:49
The LG C8 doesn't work with current MP4 muxing tools. It should still work with tsMuxer if your file shows Dolby Vision in MediaInfo.
For MP4 you need to use Dolby's muxer from 2018: https://github.com/DolbyLaboratories/dlb_mp4base/tree/ad46704703d2f558a61c2dba444ae43a8e3effff/bin
Either way it's best to stick to .TS with tsMuxer, it should be working fine.
guest
4th February 2024, 02:26
The LG C8 doesn't work with current MP4 muxing tools. It should still work with tsMuxer if your file shows Dolby Vision in MediaInfo.
For MP4 you need to use Dolby's muxer from 2018: https://github.com/DolbyLaboratories/dlb_mp4base/tree/ad46704703d2f558a61c2dba444ae43a8e3effff/bin
Either way it's best to stick to .TS with tsMuxer, it should be working fine.
Yep, can confirm, simply run the "hybrid" mkv thru tsmuxer, and create a .ts or .m2ts file, and the LG will display Dolby Vision.
Only problem I have is if you "jump" (forward or back) the playback from the remote, the playback will take a second or 2 to start to play, but HDR hasn't got that issue.
guest
5th February 2024, 04:35
Attn -QfG-,
I have started using this tool again, after a long break, and the last build I used is #53
So I grabbed the latest build (#63.fixed) the other day, and when just simply wanting to extract the rpu.bin, it fails :(, however, #53 does the job, no issue :)
So I just got #60 & #62 (also noticed that there is a significant increase in the file size between #60 & #61.1, and then again between # 61.5 & #62.
#60 worked, #62 failed.
Am I missing something, or do I just need to keep using the older builds ??
Just fyi, that's all.
https://i.imgur.com/CpV5yY0.jpg
ripburnlearn
5th February 2024, 07:29
I need some guidance here. I have an Amazon firestick 4K max. I have an MKV file in 4K that's about 40GB in size. The playback is extremely choppy. I read that the Amazon firestick 4K max has trouble with files with both HDR10+ and Dolby vision. So I figured that was the issue (the other issue could also be streaming that 40GB is too much for the device to handle).
So I figured I'd use handbrake to shrink the size down. In the process of doing that I used this tool to backup the original (40GB) HDR10+ stream and remove the Dolby Vision.
I then used handbrake, only to find out it doesn't keep HDR10+, it reverts it down to HDR10. So I had this idea of injecting this newly compressed MKV with the original HDR10+ stream (using DDVT_INJECTOR) which was backed up by this program.
I tried doing that and it outputted a hevc file, rather than an MKV file. I guess I'm wondering if what I'm attempting is even possible (when I re-encode with handbrake, does that make it incompatible with the HDR10+ backup?)
Also, how do I get an MKV file? I figured the injector would inject the HDR10+.json file into the MKV and give me a new MKV file. Kinda lost as what I'm supposed to do with this hevc output.
Thanks!
GodzilaAvenger
5th February 2024, 08:42
AFAIK there are no issues with injecting DV/HDR10+ metadata into a re-encoded stream. You can use MKVToolNix to add the audio tracks/subtitles/chapters from the original .mkv along with the .hevc file and create a new .mkv.
ripburnlearn
5th February 2024, 11:56
AFAIK there are no issues with injecting DV/HDR10+ metadata into a re-encoded stream. You can use MKVToolNix to add the audio tracks/subtitles/chapters from the original .mkv along with the .hevc file and create a new .mkv.Ahhhh, good call! Completely forgot about that program being able to do that. So I was able to do it and MediaInfo says "SMPTE ST 2094 App 4, Version 1" under "HDR Format". Does that look right? In the original file where I striped out the Dolby Vision it says: "SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible". What's the significance if it missing that "HDR10+ Profile B compatible" line?
EDIT: The original file also has these included entries while the newly created file doesn't:
Mastering display color primaries : BT.2020
Mastering display luminance : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level : 411 cd/m2
Maximum Frame-Average Light Level : 322 cd/m2
Fuso
5th February 2024, 13:15
Hello guys i am new here so please be good help me !
my TV is LG OLED C8 and i use the internal TV player to play movies As i know the TV supports DV Profile 8 too . I have problem with most of these "hybrid" DV-HDR .mkv files like the one below . The TV can play such files but the problem is that they always play in HDR mode and cant trigger the TV DolbyVision mode .
I have both B8 and C2, and also Samsung models, and so far the only universal solution is to mux them into TS/M2TS.
Profile 8 mp4 will work on both new and old type of internal LG players, but the Codec ID must be dvhe. This tool will convert to mp4 with Codec ID hev1 which plays as HDR on the B8/C8. But dvhe is not compatible with non-DoVi devices such as Samsung AU9072.
Still, it will be a great addition to add the option to chose the Codec ID when converting to mp4.
GodzilaAvenger
5th February 2024, 20:30
Ahhhh, good call! Completely forgot about that program being able to do that. So I was able to do it and MediaInfo says "SMPTE ST 2094 App 4, Version 1" under "HDR Format". Does that look right? In the original file where I striped out the Dolby Vision it says: "SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible". What's the significance if it missing that "HDR10+ Profile B compatible" line?
EDIT: The original file also has these included entries while the newly created file doesn't:
Mastering display color primaries : BT.2020
Mastering display luminance : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level : 411 cd/m2
Maximum Frame-Average Light Level : 322 cd/m2
I'm not really sure how to interpret this. Does it play as you expect it? One possibility may be that what MediaInfo shows (info about the .mkv container) does not match the underlying .hevc stream. Another possibility, since display mastering and MaxFALL and MaxCLL are all HDR10 info, is that Handbrake stripped out the HDR10 metadata and left you with a PQ10 .hevc stream.
giyo279
6th February 2024, 07:26
I want to make an HDR10+ hybrid -- HDR10+ from the web, injected in the bluray. The HDR10+ from the web is 40 frames behind the bluray. I know there are ways to edit/sync DV RPUs to the base layer, but are there similar tools/methods for HDR10+?
GodzilaAvenger
6th February 2024, 08:06
I think you can enter the frame delay (positive or negative) in the DDVT_INJECTOR script.
Ritsuka
6th February 2024, 08:29
Ahhhh, good call! Completely forgot about that program being able to do that. So I was able to do it and MediaInfo says "SMPTE ST 2094 App 4, Version 1" under "HDR Format". Does that look right? In the original file where I striped out the Dolby Vision it says: "SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible". What's the significance if it missing that "HDR10+ Profile B compatible" line?
EDIT: The original file also has these included entries while the newly created file doesn't:
Mastering display color primaries : BT.2020
Mastering display luminance : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level : 411 cd/m2
Maximum Frame-Average Light Level : 322 cd/m2
The latest HandBrake version will preserve HDR10+ and Dolby Vision when using the x265 10-bit encoder. So either something went wrong or who knows, it's hard to say without additional info.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.