Log in

View Full Version : [DDVT Tool] Dolby Vision RPU Demuxing / Injecting / Editing.


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 [14] 15 16 17 18 19 20 21 22 23 24

LV8
6th July 2023, 07:48
Just wondering. If I encode something in HDR10 with no available metadata, could I use this program to trigger Dolby Vision with static metadata? So something could play in Dolby Vision with no metadata?

Can you add your own metadata?

I'm new to this, apologies if it's a nooby question.

There's something even better you can do. In fact, you can use Davinci Resolve to automatically generate a custom RPU with completely dynamic metadata using the official Dolby's algorithm.

GodzilaAvenger
6th July 2023, 07:58
I was recently adding HDR10+ metadata from a web source to one of my Blu-rays and I noticed the difference in light level values between it and the Blu-ray's DV RPU, as shown in the attachments. Is this normal? DV FALL seems to be very static.

Boulder
6th July 2023, 08:16
My guess is that your TV might only play in Dolby Vision if the codec tag is dvhe/dvh1.
At least both of your samples are hev1.

One way is to use MP4Box to mux:

MP4Box.exe -add video.hevc:dvp=f8.hdr10:hdr=none:stype=dvhe -brand mp42isom -ab dby1 -new video-muxed.mp4


Thank you, I'll test it then. I just used the DDVT_MKVTOMP4 script to convert the files, so if this works, it's a feature request to -QfG- to allow setting the codec tag :D

Well, plays as Dolby Vision on my OLED48CX9LB LG TV...

Neither of these would display DV on my LG SK8500PTA.

But, quickly running them thru tsmuxer to .m2ts, DID display DV
Thank you for testing, good to hear that the methods themselves work :)

Boulder
6th July 2023, 12:54
Couldn't get the files to switch on the DV mode, so I have to ask Sony if they can tell me which profiles are supported. I'm not keeping my hopes up too high because the support people may see the same information I see on their pages :D

MadMonkey57
7th July 2023, 09:02
Profile 8 was a relatively recent addition to Dolby Vision, and isn't supported by older TVs, presumably including these pre-2020 LG models. I'd hope/expect they'd at least play back as native HDR-10 ignoring the dynamic metadata.
Yes indeed.

I made peace with it now. I might get a Shield some day.

SeeMoreDigital
7th July 2023, 11:48
My guess is that your TV might only play in Dolby Vision if the codec tag is dvhe/dvh1.
At least both of your samples are hev1.

One way is to use MP4Box to mux:

MP4Box.exe -add video.hevc:dvp=f8.hdr10:hdr=none:stype=dvhe -brand mp42isom -ab dby1 -new video-muxed.mp4

Bummer... Even after re-muxing Boulder's samples with MP4box, my 2016 LG television displays them in HDR10. However, the UI now displays 'DVHE' (which it didn't do before): -

https://i.ibb.co/F5YBsLc/P-20230707-113645-1.jpg

Cheers

quietvoid
7th July 2023, 12:10
Bummer... Even after re-muxing Boulder's samples with MP4box, my 2016 LG television displays them in HDR10.
Cheers

Older LG TVs don't like new MP4 files, and I still don't understand why.
With older MP4Box versions, my C8 would play them as Dolby VIsion but new versions didn't work.

You're more likely to get Dolby Vision with .TS files.

There's also Dolby's old MP4 muxer but it's slow and not very user friendly: https://github.com/DolbyLaboratories/dlb_mp4base/tree/ad46704703d2f558a61c2dba444ae43a8e3effff/bin
The new versions also didn't work on my C8.

guest
7th July 2023, 12:14
Bummer... Even after re-muxing Boulder's samples with MP4box, my 2016 LG television displays them in HDR10. However, the UI now displays 'DVHE' (which it didn't do before): -

https://i.ibb.co/F5YBsLc/P-20230707-113645-1.jpg

Cheers

I think you probably should try them in .m2ts, instead..

SeeMoreDigital
7th July 2023, 12:31
I think you probably should try them in .m2ts, instead..
Actually I just tried that and the .m2ts re-muxes (using TSmuxer GUI git-79b86ec) don't play at all... Which is most odd!

guest
7th July 2023, 12:47
Actually I just tried that and the .m2ts re-muxes (using TSmuxer GUI git-79b86ec) don't play at all... Which is most odd!

Yes, that IS odd.... it's the only way I can them to play in DV.

SeeMoreDigital
7th July 2023, 12:55
Yes, that IS odd.... it's the only way I can them to play in DV.What tools are you creating your 'transport' stream muxes?

Can you upload one of your working .m2ts muxes?

guest
7th July 2023, 13:47
What tools are you creating your 'transport' stream muxes?

Can you upload one of your working .m2ts muxes?

https://forum.doom9.org/showthread.php?p=1989214#post1989214

Tsmuxer nightly, same .mp4 clips....

Boulder
7th July 2023, 13:54
Yes indeed.

I made peace with it now. I might get a Shield some day.

But wouldn't the display device itself still need to support the profile even though you use an external player? That's why I'm trying to figure this stuff out since I'm going to upgrade my Odroid N2 at some point and Dune/Homatics R 4K Plus, RockTek G2 and Nokia 8010 now support Dolby Vision using Kodi in an alpha CoreELEC build.

rwill
7th July 2023, 15:31
Thank you for testing, good to hear that the methods themselves work :)

Can you please test this .mp4 on your device? I used a non-public muxer.

https://drive.google.com/file/d/1_XbzARCCV-iOqSpme_y3q3Sx2PnUsWu2/view?usp=sharing

Boulder
7th July 2023, 15:45
Can you please test this .mp4 on your device? I used a non-public muxer.

https://drive.google.com/file/d/1_XbzARCCV-iOqSpme_y3q3Sx2PnUsWu2/view?usp=sharing

Sorry, it only plays back as HDR only on the TV.

pandv2
7th July 2023, 21:23
A little, not very important, bug in 0.59 beta.

If I extract the dolby rpu, is extracted in outputdirectory, and not in outputdirectory\<FILENAME>_[<SCRIPTNAME>]. I am using the context menu.

SeeMoreDigital
7th July 2023, 22:32
Can you please test this .mp4 on your device? I used a non-public muxer.

https://drive.google.com/file/d/1_XbzARCCV-iOqSpme_y3q3Sx2PnUsWu2/view?usp=sharingSorry, it only plays back as HDR only on the TV.
Same here: -

https://i.ibb.co/4srWy87/test.jpg

guest
8th July 2023, 01:49
Can you please test this .mp4 on your device? I used a non-public muxer.

https://drive.google.com/file/d/1_XbzARCCV-iOqSpme_y3q3Sx2PnUsWu2/view?usp=sharing

& @ Boulder & @ SeeMoreDigital (SMD)

Well, I hate to say it, but this also played in DV, after re-muxing with tsmuxer to .m2ts...

SeeMoreDigital
8th July 2023, 09:53
& @ Boulder & @ SeeMoreDigital (SMD)

Well, I hate to say it, but this also played in DV, after re-muxing with tsmuxer to .m2ts...I tried re-muxing your 'dolby_test_rpu_xxx.mp4' sample to .ts and .m2ts using TSmuxer GUI (git-49a59c0) and just got coloured spinning balls followed by "unable to play"...

EDIT: My OPPO UDP-203 plays and displays the 'dolby_test_rpu_xxx.mp4' sample in HDR10 but outputs the video signal at 1080i50 and images bounce/flicker up and down. However, the OPPO is able to play and display the .ts and .m2ts re-muxes in Dolby Vision but outputs the video signal at 2160p25.

guest
8th July 2023, 11:58
I tried re-muxing your 'dolby_test_rpu_xxx.mp4' sample to .ts and .m2ts using TSmuxer GUI (git-49a59c0) and just got coloured spinning balls followed by "unable to play"...

EDIT: My OPPO UDP-203 plays and displays the 'dolby_test_rpu_xxx.mp4' sample in HDR10 but outputs the video signal at 1080i50 and images bounce/flicker up and down. However, the OPPO is able to play and display the .ts and .m2ts re-muxes in Dolby Vision but outputs the video signal at 2160p25.

Strange...

So just a little more info for you:-

Using TSmuxer GUI (git-7277259)

Also, only using the LG built in player, via a USB stick.

MadMonkey57
9th July 2023, 07:57
But wouldn't the display device itself still need to support the profile even though you use an external player? That's why I'm trying to figure this stuff out since I'm going to upgrade my Odroid N2 at some point and Dune/Homatics R 4K Plus, RockTek G2 and Nokia 8010 now support Dolby Vision using Kodi in an alpha CoreELEC build.
Well I might be wrong, but here's my reasoning.
The TV is able to play DV files under *some* circumstances. I was even able to play Profile 8 videos in an M2TS container (muxed with latest tsmuxer). But then I struggle with the limitations of M2TS (no TXT subtitles, no dolby atmos, ...).
It seems to me that LG's built in player struggles with the container, not the video stream.

guest
9th July 2023, 12:20
Well I might be wrong, but here's my reasoning.
The TV is able to play DV files under *some* circumstances. I was even able to play Profile 8 videos in an M2TS container (muxed with latest tsmuxer). But then I struggle with the limitations of M2TS (no TXT subtitles, no dolby atmos, ...).
It seems to me that LG's built in player struggles with the container, not the video stream.

What I do with subtitles with .m2ts is have the .srt named the same as the video file, and in the same directory.

It also supports Dolby Atmos 5.1, not sure about 7.1, but my system doesn't support 7.1 anything, but good 5.1 is plenty good enough.

Fuso
10th July 2023, 10:30
Strange...

So just a little more info for you:-

Using TSmuxer GUI (git-7277259)

Also, only using the LG built in player, via a USB stick.


I couldn't find this exact version. Can you give a link to it?

guest
10th July 2023, 12:36
I couldn't find this exact version. Can you give a link to it?

Well, it's probably a newer build, now...

Keep yourself up to date, here...

https://forum.doom9.org/showthread.php?t=176668

https://github.com/justdan96/tsMuxer/releases

ivanb
11th July 2023, 04:18
Can you please test this .mp4 on your device? I used a non-public muxer.


It seems that your muxer doesn't put HEVC sequence headers (VPS/SPS/PPS) into 'hvcC' sample entry:

https://i.ibb.co/CvpF1SZ/Screenshot-2023-07-11-at-10-09-39.png (https://ibb.co/zbWwntY)

Some players may not like it

MadMonkey57
11th July 2023, 10:21
What I do with subtitles with .m2ts is have the .srt named the same as the video file, and in the same directory.

It also supports Dolby Atmos 5.1, not sure about 7.1, but my system doesn't support 7.1 anything, but good 5.1 is plenty good enough.
I'll try that, thx.
But these are really tedious workarounds...

guest
13th July 2023, 13:55
I've got a new format displaying on my LG....

https://i.imgur.com/dEOkkiu.jpg

fransalas
14th July 2023, 20:04
maybe this is not from here but I would like to ask if there is any way to modify by hand the values of Luminance monitor mastering:

GodzilaAvenger
15th July 2023, 06:46
You can use the editor function of dovi_tool (https://github.com/quietvoid/dovi_tool).

puremind
24th July 2023, 17:09
i have created 2 little Batch scripts, one Demuxer and one Injector. With this scripts you can simply:

- Change DoVi Profile 7,5 to Profile 8
- Adding Delays (useful for Hybrid Releases)
- Convert HDR10+ Metadata to DoVi Profile 8 Metadata
- Delete HDR10+ Metadata from Videostream

https://workupload.com/file/GWpvx2dzvcs

quietvoid many thanks for this awesome tools.

Hello

In order to accelerate conversions from MKV to MP4 I customized your script so that you can pass a folder instead of a file path to allow for batch conversion of files.
18452

Changes include:

The script will now convert all files in the specified folder (C:\folder and C:\folder\ both work).
It will ask for the audio codec selection only for the first file and then apply those settings to all further files
It will summarize the output file name, FPS and audio codec while it is converting, not only the source characteristics
The converted files will go to the source folder instead of a custom folder for each conversion.
This allows the user to replace all of their MKV's with the MP4's without having to pull for multiple subfolders.
It will keep the MKV's until you have been able to check the files (user should delete the MKV's manually)
it will check if there is already an MP4 file with the output file name and skip the mkv conversion if there is
it will also convert any subfolder files, so be careful if you convert at root level, you may convert your entire mkv library at once :D


NOTE:

Only convert files that have the same characteristics using this script.
If you want to convert heterogeneous files, the loop would need to be tweaked so that each source file is analyzed (:CHECK is always performed) and only skipping the audio codec selection part.


I created this because I often have multiple files in one folder all waiting to be converted and it can be very tedious to do it one by one.

You should feel free to add this script to your rar release, either as a replacement of the DDVT_MKVTOMP4 script or as a separate command.

One thing that I wanted to ask you about. As you know, right now conversion fails if there is an image based subtitle track in the MKV. Should we just strip the subtitles when this is detected? It seems to me we could use something like this in the script so that no conversion would fail?
# remove all subtitles (copy none)
mkvmerge -o output.mkv --no-subtitles input.mkv

If you think it makes sense, I would appreciate if you could include in future versions of your scripts. :)

-QfG-
27th July 2023, 21:51
-v0.60 Online
*Minor Bugfixes
*Updated mkvtoolnix to v 78.0.0.0.

Boss 14
30th July 2023, 16:20
A new version, but DDVT INJECTOR is still v0.59beta - is that right?
Thank you.

-QfG-
30th July 2023, 17:23
Yes, changes only on the Hybrid script. Forget to change version in this script.

hidef_rec
30th July 2023, 19:47
With "Change DoVi Profile 7,5 to Profile 8"... I used Demuxer on a Profile 5 MKV & and now have a RPU. How do I use it to convert the MKV to a Profile 8? Or, is this not what the script was intended to do? Thanks.

TomDoom
31st July 2023, 15:56
Hi -QfG-

thanks for those nice scripts :)

I mostly use the MKV2MP4 Convert to have DV play on my LG TV. However, the MP4 File has the wrong audio language tag. Every track will become tagged as ENGLISH, unfortunately.
That even happens If you don't change/convert the audio track.

MKV:

Audio #1
ID : 2
[...]
Title : German
Language : German


After MP4 conversion:

Audio #1
ID : 2
[...]
Title : German
Language : English

Maybe you can fix that (or anyone else knows what's going wrong here and tell me what tou change)? That's happening since loooong time and I think you heard of it already.

Thanks!
Tom

sagor
3rd August 2023, 15:19
Excellent tools.Thanx for your hard work.
Anyone know here how to fix forwarding/rewarding issue on dolby vision video file.
When i merge audio or subtitle using with mkvmerge video won't forward or reward, it pause the video on Nova Video Player streaming via Jellyfin.
Also why the after crop factor issue video file size doesn't match with the original file?

Boss 14
5th August 2023, 16:07
I have a problem like this, I convert from P7 to P8 with the original video file, but after importing in the encodec file it says "CHECK RPU..."
https://thumbs4.imagebam.com/a5/fd/99/MEN7M1F_t.png (https://www.imagebam.com/view/MEN7M1F)https://thumbs4.imagebam.com/8d/f7/2c/MEN7M1I_t.png (https://www.imagebam.com/view/MEN7M1I)
And after "CHECK RPU..." it got like this, I don't know where did I go wrong? help me!
https://thumbs4.imagebam.com/55/1c/75/MEN7M1K_t.png (https://www.imagebam.com/view/MEN7M1K)

I also have this problem and do not know what to do?

von Suppé
8th August 2023, 09:57
Why don't you set check by typing C and then start checking cropping values by typing S ? See what happens.
Maybe RPU from 4K is used for HD? You can also manually check border values by opening a screenshot in an image editor.

von Suppé
31st August 2023, 11:26
I have no experience with crossinjecting P7 RPU into 2K encodes. I do wonder why one would do such. Perhaps it's because of your playback device/software capabilities. In case of a resize & HDR encode, I imagine P7 RPU can be used - probably with some adaptation.
If you need to convert to 2K SDR, a tonemap from HDR to SDR has to be applied prior to resizing & encoding. I guess then P7 metadata has no use whatsoever. But I can be dead wrong here and totally missing something.

In your 3rd screenshot at MOVIE INPUT, I don't know why the tool returns with "Failed px". Don't know what it would mean; maybe it can't determine the borders properly. I ALWAYS do this manually. By taking a screenshot whilst playing the file and have a look in an image editor.
Your target resolution being 1920x1012 I assume that you already determined the black bars and that they are cropped out in the encode. Then you have to "crop" RPU, which resets the L5 values to zero. L5 values represent the number of source-pixels of the widths/heights of surrounding black borders (which in your case are all zero, if my assumption is correct).

It may help when you'd explain why you want to do this.

Boulder
1st September 2023, 15:01
I have no experience with crossinjecting P7 RPU into 2K encodes. I do wonder why one would do such. Perhaps it's because of your playback device/software capabilities. In case of a resize & HDR encode, I imagine P7 RPU can be used - probably with some adaptation.

Since it's all just metadata, wouldn't it be okay to just crop the borders and downscale and then inject the RPU which is also marked as cropped? Of course, the metadata is not 100% correct due to the changes the downscales causes in the video, but the same applies to regular HDR10 as well.

von Suppé
2nd September 2023, 10:27
Since it's all just metadata, wouldn't it be okay to just crop the borders and downscale and then inject the RPU which is also marked as cropped? Of course, the metadata is not 100% correct due to the changes the downscales causes in the video, but the same applies to regular HDR10 as well.

My idea also.

What's tickling me is why the downscale. I know DV can be 2K and can have HDR10/HLG/SDR fallback.
I am wondering if there'd be DV compatible players/displays that would be limited to 2K. Or maybe OP just wants to save harddrive space?

Boulder
2nd September 2023, 10:43
My idea also.

What's tickling me is why the downscale. I know DV can be 2K and can have HDR10/HLG/SDR fallback.
I am wondering if there'd be DV compatible players/displays that would be limited to 2K. Or maybe OP just wants to save harddrive space?

I think the idea is just to save space, I do the same all the time with both HD and UHD sources.

puremind
3rd September 2023, 03:43
Hello

In order to accelerate conversions from MKV to MP4 I customized your script so that you can pass a folder instead of a file path to allow for batch conversion of files.
18452

Changes include:

The script will now convert all files in the specified folder (C:\folder and C:\folder\ both work).
It will ask for the audio codec selection only for the first file and then apply those settings to all further files
It will summarize the output file name, FPS and audio codec while it is converting, not only the source characteristics
The converted files will go to the source folder instead of a custom folder for each conversion.
This allows the user to replace all of their MKV's with the MP4's without having to pull for multiple subfolders.
It will keep the MKV's until you have been able to check the files (user should delete the MKV's manually)
it will check if there is already an MP4 file with the output file name and skip the mkv conversion if there is
it will also convert any subfolder files, so be careful if you convert at root level, you may convert your entire mkv library at once :D


NOTE:

Only convert files that have the same characteristics using this script.
If you want to convert heterogeneous files, the loop would need to be tweaked so that each source file is analyzed (:CHECK is always performed) and only skipping the audio codec selection part.


I created this because I often have multiple files in one folder all waiting to be converted and it can be very tedious to do it one by one.

You should feel free to add this script to your rar release, either as a replacement of the DDVT_MKVTOMP4 script or as a separate command.

One thing that I wanted to ask you about. As you know, right now conversion fails if there is an image based subtitle track in the MKV. Should we just strip the subtitles when this is detected? It seems to me we could use something like this in the script so that no conversion would fail?
# remove all subtitles (copy none)
mkvmerge -o output.mkv --no-subtitles input.mkv

If you think it makes sense, I would appreciate if you could include in future versions of your scripts. :)

@-QfG-

I found we can use mkvextract:
mkvextract file.mkv tracks [tracknumber] file.srt

I think your script already saves key information using media info, so all you would have to do is store information about on which track each language is found, then ask the user which subtitles they want to extract and do the extraction command on the tracks that the user selected and put them in the same folder as the source folder.

This would allow srt subtitles to be preserved on all episodes of a same video within MP4all.cmd.

Is there a way to extrac them in a different format and then add them to an MP4 container?

benwaggoner
6th September 2023, 20:15
Since it's all just metadata, wouldn't it be okay to just crop the borders and downscale and then inject the RPU which is also marked as cropped? Of course, the metadata is not 100% correct due to the changes the downscales causes in the video, but the same applies to regular HDR10 as well.
Yeah, that should work in general. All HDR metadata explicitly ignores the letterboxing, so cropping it out shouldn't change anything.

Downscaling doesn't have a huge impact, but the low-pass filter nature of downscaling can reduce a frame's peak brightness quite a bit if it is coming from single points, like stars.

Worst case would be white single pixels on a black background. If they were 1000 nits at 4K, they'd only be 250 nits at 2K, as each white pixel would be averaged out with three black pixels.

Atlantis
8th September 2023, 11:32
Is there an up-to-date step by step guide on how to re-encode a Dolby Vision file?

Update: well that was easier than I thought. Didn't even need to learn anything! All I did was extract RPU, encode normally like an HDR file and inject RPU and it worked! Maybe it helped that the original was a hybrid!

Question, I tried both cropped RPU and no crop RPU and made 2 files, both look the same to my eyes. Is cropping RPU really make a huge difference?

GodzilaAvenger
9th September 2023, 07:52
This may help. (https://forum.doom9.org/showthread.php?p=1979732#post1979732)

Boulder
9th September 2023, 08:05
Couldn't get the files to switch on the DV mode, so I have to ask Sony if they can tell me which profiles are supported. I'm not keeping my hopes up too high because the support people may see the same information I see on their pages :D

Well, they never got back to me which does not surprise me, but I got a Homatics R box and the RPU injected encodes at least trigger Dolby Vision on the old Sony :D I have to try and see if the picture itself looks okay, I just tested on Death Wish which is probably not the best sample itself.

NeverExists
11th September 2023, 05:58
does this tool allow hdr extraction? cause I have an SDR video stream from one file that I'm using, and HDR and Dolby Vision metadata from a web release.

GodzilaAvenger
11th September 2023, 07:52
If I'm not mistaken you can't just turn an SDR video into HDR by adding metadata. SDR uses 8-bit colors and HDR uses 10-bit ones, so the base video streams are completely different. That HDR/DV metadata just tells the display how to adjust its brightness.

Yosho
12th September 2023, 17:34
How could we go about fixing:

Format : Timed Text
Muxing mode : sbtl
Codec ID : tx3g
Duration : 1 h 53 min
Bit rate mode : Variable
Bit rate : 69 b/s
Frame rate : 0.409 FPS
Stream size : 57.3 KiB (0%)
Title : Traditional
Language : English
Service kind : Dubbed
Default : No
Forced : No

If original was:

Format : UTF-8
Codec ID : S_TEXT/UTF8
Codec ID/Info : UTF-8 Plain Text
Duration : 1 h 52 min
Bit rate : 63 b/s
Frame rate : 0.287 FPS
Count of elements : 1945
Stream size : 52.7 KiB (0%)
Title : Traditional
Language : Cantonese (Hant)
Default : No
Forced : No

Before conversion?

Is this an mp4box issue perhaps?