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

GodzilaAvenger
28th September 2024, 20:16
Technically speaking, it has some overall brightness metadata, but it is part of the whole HDR10 package, it's not something you can take out and put on an SDR video and call it a day. You can Google "how HDR works".

sk2316
29th September 2024, 01:19
Technically speaking, it has some overall brightness metadata, but it is part of the whole HDR10 package, it's not something you can take out and put on an SDR video and call it a day. You can Google "how HDR works".

ok i got it
if i encode hdr10 file (SMPTE ST 2084) to h265 10 bits file
why output file information is not show "SMPTE ST 2084"
it's not hdr10? but color is like original file!

GodzilaAvenger
29th September 2024, 03:16
Bit depth isn't the defining factor, both HDR and SDR can be 10-bit. You are encoding to BT.709 colorspace, which is still SDR.

sk2316
29th September 2024, 03:42
Bit depth isn't the defining factor, both HDR and SDR can be 10-bit. You are encoding to BT.709 colorspace, which is still SDR.

i forgot to tell you ,output file is BT2020
i don't understand why output file color is like original file
it should be waste out color?

Z2697
29th September 2024, 04:07
The HDR part of HDR10 is PQ (ST2084). BT.2020 is WCG part.

sk2316
29th September 2024, 07:41
The HDR part of HDR10 is PQ (ST2084). BT.2020 is WCG part.
ok i got it
if i encode hdr10 file (SMPTE ST 2084) to h265 10 bits file
why output file information is not show "SMPTE ST 2084"
it's not hdr10? but color is like original file!

puremind
7th October 2024, 12:15
DDVT Tool Download Folder on MEGA.
(The tool based on quietvoids tools)

-Demuxing DV Metadata from MKVs/MP4s.
-Convert HDR10+ Metadata to DoVi Metadata (Experimental).
-Convert Profile 7/5 Metadata to Profile 8.1.
-Inject DoVi Metadata in Streams.
-Easy Delay Adjustment in Injector.
-Complete Open Source Batch Scripts!

Credits to quietvoid for his awesome tools.
Credits to Atak_Snajpera for the BorderDetect tool.

>> DOWNLOAD via MEGA Folder (https://mega.nz/folder/E5MjzAYD#xz9bKC8fnuQmOMo_ncjniQ) <<[/CENTER]

A while ago, I had shared a mass convert script adapted from yours so that it would do all files in a given folder sequentially. I had commented that it would be nice to also extract and convert subtitle tracks to MP4.

In case anyone is interested, I am sharing the updated script.

https://i.imgur.com/Vn40OUV.png

The use is very simple just type MP4all C:\YourFolder\ from where the file is script and it will translate all of your files. You can specify preferred audio and subtitle track you want and it will mux it all together for each file in the folder.

18727

Be careful that sometimes there are up to 3 subtitle tracks with the same language (e.g, forced, SDH and standard) and you want to extract the standard one, so if you don't see subtitles you probably extracted the wrong one. If I have time later, I will append the title information to help with the choice but those loops inside command files are killing me.

Edit: Fixed an issue whereby it would not detect subtitle tracks if there is only 1 subtitle track or the file name contained spaces.

asarian
10th October 2024, 03:34
I have a HDR video (Push), with a Dolby Vision layer (see below). Muxing the 2 into a single MKV doesn't trigger DV, though (on my new LG G4).

Can I use these tools to make that work? Or do I have to somehow re-encode the main stream with DV data? As the confusing part is, that I have a Star Trek blu-ray which also appears DV-enabled, but apparently there it's all in 1 single stream.

Thanks.


M2TS, 2 video tracks, 3 audio tracks, 2 subtitle tracks, 1:51:27, 11.988p
1: h265/HEVC, 2160p24 /1.001 (16:9), 10 bits
2: h265/HEVC, 1080p24 /1.001 (16:9), 10 bits - Dolby Vision Enhancement Layer
3: TrueHD/AC3 (Atmos), 7.1 channels, 48kHz
(embedded: AC3 EX, 5.1 channels, 448kbps, 48kHz)

puremind
10th October 2024, 15:14
I have a HDR video (Push), with a Dolby Vision layer (see below). Muxing the 2 into a single MKV doesn't trigger DV, though (on my new LG G4).

Can I use these tools to make that work? Or do I have to somehow re-encode the main stream with DV data? As the confusing part is, that I have a Star Trek blu-ray which also appears DV-enabled, but apparently there it's all in 1 single stream.

Thanks.


M2TS, 2 video tracks, 3 audio tracks, 2 subtitle tracks, 1:51:27, 11.988p
1: h265/HEVC, 2160p24 /1.001 (16:9), 10 bits
2: h265/HEVC, 1080p24 /1.001 (16:9), 10 bits - Dolby Vision Enhancement Layer
3: TrueHD/AC3 (Atmos), 7.1 channels, 48kHz
(embedded: AC3 EX, 5.1 channels, 448kbps, 48kHz)


You can use the tool in posted above, very simple instructions. You don't need to do much for the file you have. It is more complicated to transform HDR layer into DV readable, but here you already have the DV layer baked into.

guest
10th October 2024, 18:34
I have a HDR video (Push), with a Dolby Vision layer (see below). Muxing the 2 into a single MKV doesn't trigger DV, though (on my new LG G4).

Can I use these tools to make that work? Or do I have to somehow re-encode the main stream with DV data? As the confusing part is, that I have a Star Trek blu-ray which also appears DV-enabled, but apparently there it's all in 1 single stream.

Thanks.


M2TS, 2 video tracks, 3 audio tracks, 2 subtitle tracks, 1:51:27, 11.988p
1: h265/HEVC, 2160p24 /1.001 (16:9), 10 bits
2: h265/HEVC, 1080p24 /1.001 (16:9), 10 bits - Dolby Vision Enhancement Layer
3: TrueHD/AC3 (Atmos), 7.1 channels, 48kHz
(embedded: AC3 EX, 5.1 channels, 448kbps, 48kHz)

LG's require the video to be an .mp4 for DV to be displayed !!!

I have an LG C4, but I don't use DDVT.

asarian
10th October 2024, 18:41
You can use the tool in posted above, very simple instructions. You don't need to do much for the file you have. It is more complicated to transform HDR layer into DV readable, but here you already have the DV layer baked into.

Awesome! Thx. Yes, I rather not re-encode, if possible.

asarian
10th October 2024, 18:52
LG's require the video to be an .mp4 for DV to be displayed !!!

You'd think so; but on my LG G4, my remuxed Strange New Worlds Blu-Rays trigger Dolby Vision, with just the single layer (via Kodi)

X:\Star Trek\Star Trek Strange New Worlds>eac3to "Star Trek Strange New Worlds - S01E01.mkv"
MKV, 1 video track, 1 audio track, 0:52:51, 24p /1.001
1: h265/HEVC, English, 2160p24 /1.001 (16:9), 10 bits
2: RAW/PCM, English, 5.1 channels, 24 bits, 48kHz

I took a look at the original again, to make sure I hadn't perhaps forgotten to mux the DV layer, but nope, it's just the 1 STREAM (And it looks absoutely spectacular with DV, btw! My old Q90 couldn't do DV).

puremind
10th October 2024, 19:01
Awesome! Thx. Yes, I rather not re-encode, if possible.

This one just let's you choose video quality and your preferred srt subtitle track, and it will transform it into MP4 DV that plays anywhere.

But with DDVT_Hybrid tool it is actually very easy to reencode, you just drag and drop the same HDR file twice and it will create the DV layer and final file. It just takes longer.

asarian
10th October 2024, 20:52
You can use the tool in posted above, very simple instructions. You don't need to do much for the file you have. It is more complicated to transform HDR layer into DV readable, but here you already have the DV layer baked into.

I tried the DDVT_DEMUXER.cm tool, but it keeps saying no Dolby Vision profile found on any of the files with the extra DV Layer in it.

asarian
10th October 2024, 20:53
This one just let's you choose video quality and your preferred srt subtitle track, and it will transform it into MP4 DV that plays anywhere.

But with DDVT_Hybrif tool it is actually very easy to reencode, you just drag and drop the same HDR file twice and it will create the DV layer and final file. It just takes longer.

Okay, will try this DDVT_Hybrid tool too.

LaFirma
13th October 2024, 03:33
LG's require the video to be an .mp4 for DV to be displayed !!!

I have an LG C4, but I don't use DDVT.

You'd think so; but on my LG G4, my remuxed Strange New Worlds Blu-Rays trigger Dolby Vision, with just the single layer (via Kodi)

X:\Star Trek\Star Trek Strange New Worlds>eac3to "Star Trek Strange New Worlds - S01E01.mkv"
MKV, 1 video track, 1 audio track, 0:52:51, 24p /1.001
1: h265/HEVC, English, 2160p24 /1.001 (16:9), 10 bits
2: RAW/PCM, English, 5.1 channels, 24 bits, 48kHz

I took a look at the original again, to make sure I hadn't perhaps forgotten to mux the DV layer, but nope, it's just the 1 STREAM (And it looks absoutely spectacular with DV, btw! My old Q90 couldn't do DV).


LG OLED cx/c1/c2/c3/c4 will only work on DV in PROFILE 5 or 8... in PLEX/KODI they will only work if they are MP4/M2TS.
On Jellifyn it plays MKV.
I use DDVT TOOL to convert PROFILE 7 to 8 and it works perfectly.

NOT WORK:
HDR format : Dolby Vision, Version 1.0, dvhe.07.06, BL+EL+RPU, Blu-ray compatible / SMPTE ST 2086, HDR10 compatible

WORK:
HDR format : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible

asarian
13th October 2024, 13:24
LG OLED cx/c1/c2/c3/c4 will only work on DV in PROFILE 5 or 8... in PLEX/KODI they will only work if they are MP4/M2TS.
On Jellifyn it plays MKV.
I use DDVT TOOL to convert PROFILE 7 to 8 and it works perfectly.

NOT WORK:
HDR format : Dolby Vision, Version 1.0, dvhe.07.06, BL+EL+RPU, Blu-ray compatible / SMPTE ST 2086, HDR10 compatible

WORK:
HDR format : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible

Let's look at this MKV again:

X:\Star Trek\Star Trek Strange New Worlds>eac3to "Star Trek Strange New Worlds - S01E01.mkv"
MKV, 1 video track, 1 audio track, 0:52:51, 24p /1.001
1: h265/HEVC, English, 2160p24 /1.001 (16:9), 10 bits
2: RAW/PCM, English, 5.1 channels, 24 bits, 48kHz

MediaInfo says the following about the video:

Dolby Vision, Version 1.0, Profile 7.6, dvhe.07.06, BL+EL+RPU, no metadata compression, Blu-ray compatible / SMPTE ST 2086, Version HDR10, HDR10 compatible

This WORKS, and yields a playable MKV, with DV, on my LG G4. (Played with Kodi 21.0)

This, however, is what I'm struggling with:

M2TS, 2 video tracks, 3 audio tracks, 2 subtitle tracks, 1:51:27, 11.988p
1: h265/HEVC, 2160p24 /1.001 (16:9), 10 bits
2: h265/HEVC, 1080p24 /1.001 (16:9), 10 bits - Dolby Vision Enhancement Layer
3: TrueHD/AC3 (Atmos), 7.1 channels, 48kHz
(embedded: AC3 EX, 5.1 channels, 448kbps, 48kHz)

I can't, for the life of me, get any of the DDVT TOOLS to even find Dolby Vision data in the file, though. The DV layer is clearly there, but I get no tool to recognize it.

SeeMoreDigital
13th October 2024, 14:50
Let's look at this MKV again:
This, however, is what I'm struggling with:

M2TS, 2 video tracks, 3 audio tracks, 2 subtitle tracks, 1:51:27, 11.988p
1: h265/HEVC, 2160p24 /1.001 (16:9), 10 bits
2: h265/HEVC, 1080p24 /1.001 (16:9), 10 bits - Dolby Vision Enhancement Layer
3: TrueHD/AC3 (Atmos), 7.1 channels, 48kHz
(embedded: AC3 EX, 5.1 channels, 448kbps, 48kHz)

I can't, for the life of me, get any of the DDVT TOOLS to even find Dolby Vision data in the file, though. The DV layer is clearly there, but I get no tool to recognize it.
Out of interest... What happens if you try and play the .m2ts file using the LG G4's built-in 'video' player?

asarian
13th October 2024, 20:28
Out of interest... What happens if you try and play the .m2ts file using the LG G4's built-in 'video' player?

Not even sure I can attach an SMB to the LG G4. :) But I can try.

P.S. That Push DV blu-ray was remuxed at some point (I removed all stuff I didn't need). Could DV metadata have been removed in the process?

I also ripped the entire blu-ray folder structure to disk, but MediaInfo still does not acknowledge DV presence in the alleged DV stream; just sees it as a regular 1080p hevc stream.

SeeMoreDigital
13th October 2024, 20:52
Not even sure I can attach an SMB to the LG G4. :) But I can try.How about an NTFS formatted USB powered HDD or thumb drive?

Personally, I currently use an old SATA 120GB solid state drive (within a USB caddy) for such testing. Which works fine with my 2016 LG television...

GodzilaAvenger
13th October 2024, 22:14
Let's look at this MKV again:

X:\Star Trek\Star Trek Strange New Worlds>eac3to "Star Trek Strange New Worlds - S01E01.mkv"
MKV, 1 video track, 1 audio track, 0:52:51, 24p /1.001
1: h265/HEVC, English, 2160p24 /1.001 (16:9), 10 bits
2: RAW/PCM, English, 5.1 channels, 24 bits, 48kHz

MediaInfo says the following about the video:

Dolby Vision, Version 1.0, Profile 7.6, dvhe.07.06, BL+EL+RPU, no metadata compression, Blu-ray compatible / SMPTE ST 2086, Version HDR10, HDR10 compatible

This WORKS, and yields a playable MKV, with DV, on my LG G4. (Played with Kodi 21.0)

This, however, is what I'm struggling with:

M2TS, 2 video tracks, 3 audio tracks, 2 subtitle tracks, 1:51:27, 11.988p
1: h265/HEVC, 2160p24 /1.001 (16:9), 10 bits
2: h265/HEVC, 1080p24 /1.001 (16:9), 10 bits - Dolby Vision Enhancement Layer
3: TrueHD/AC3 (Atmos), 7.1 channels, 48kHz
(embedded: AC3 EX, 5.1 channels, 448kbps, 48kHz)

I can't, for the life of me, get any of the DDVT TOOLS to even find Dolby Vision data in the file, though. The DV layer is clearly there, but I get no tool to recognize it.

The first one is single-layer DV (i.e. DV data baked as an Enhancement Layer (EL) into the video stream), the second one is dual-layer DV (DV data a separate 1080p stream). DDVT only works with the first one, mediainfo will also show DV only for the first one, showing the second one as having a 4k stream and a 1080p stream. You can use MKVToolNix to remux the .m2ts file into .mkv and then use DDVT.

asarian
14th October 2024, 04:50
The first one is single-layer DV (i.e. DV data baked as an Enhancement Layer (EL) into the video stream),

If I understood things correctly, I should be able to extract the EL from the main stream, and reapply it later, right? (So I can denoise movies first).

the second one is dual-layer DV (DV data a separate 1080p stream). DDVT only works with the first one, mediainfo will also show DV only for the first one, showing the second one as having a 4k stream and a 1080p stream. You can use MKVToolNix to remux the .m2ts file into .mkv and then use DDVT.

Tried that already; but if I drop the dual layer mkv on DDVT, it still says it cannot find DV data. Ideally, by the looks of it, I am looking for a way, in case of dual layer, to re-encode the EL into the main stream somehow.

GodzilaAvenger
14th October 2024, 07:50
If I understood things correctly, I should be able to extract the EL from the main stream, and reapply it later, right? (So I can denoise movies first).

I believe so, yes. DDVT_DEMUXER should give you a base layer HDR.hevc file, an EL.hevc file, and a RPU.bin file.

I think denoising the base layer could get tricky. If the DV is MEL, it should be fine. If it's FEL though (see here (https://forum.doom9.org/showthread.php?p=1924655#post1924655) for the difference) denoising the base layer may screw things up when it's put together with the EL, as the EL's purpose in FEL is to add up to the base layer to recreate the original 12-bit stream. Of course you can just add the RPU to the base layer and get a Profile 8 DV. Quite a while ago (documented in some of the conversation early in this thread) I tried adding EL to an encoded BL but the result wouldn't even trigger DV on any display (I think because encoding messed up frame orders as well).

Tried that already; but if I drop the dual layer mkv on DDVT, it still says it cannot find DV data. Ideally, by the looks of it, I am looking for a way, in case of dual layer, to re-encode the EL into the main stream somehow.

MKVToolNix (at least some of the later versions that I've tried) should give you a single-layer .mkv from a dual-layer .m2ts file (or playlist if the Blu-ray does branching). DDVT can't work with your .mkv if it is dual-layer.

asarian
14th October 2024, 11:48
I believe so, yes. DDVT_DEMUXER should give you a base layer HDR.hevc file, an EL.hevc file, and a RPU.bin file.

I think denoising the base layer could get tricky. If the DV is MEL, it should be fine. If it's FEL though (see here (https://forum.doom9.org/showthread.php?p=1924655#post1924655) for the difference) denoising the base layer may screw things up when it's put together with the EL, as the EL's purpose in FEL is to add up to the base layer to recreate the original 12-bit stream. Of course you can just add the RPU to the base layer and get a Profile 8 DV. Quite a while ago (documented in some of the conversation early in this thread) I tried adding EL to an encoded BL but the result wouldn't even trigger DV on any display (I think because encoding messed up frame orders as well).

Yeah, you cannot change framerate, of course, or resize the base layer; it's kind of a 1:1 deal. But I really hope denoising will work. :) Way I understood it (and my understanding is clearly minimal), the EL consists essentiallly of location-based nits information, per frame. Hoping no precise 1:1 pixel overlap is required, or denoising will indeed be a bust.

MKVToolNix (at least some of the later versions that I've tried) should give you a single-layer .mkv from a dual-layer .m2ts file (or playlist if the Blu-ray does branching). DDVT can't work with your .mkv if it is dual-layer.

Holy crap! I had no idea MKVtoolnix could do this! I thought it was just ignoring the DV layer, but, indeed, it mixes the two somehow, and MediaInfo suddenly reports DV data on the now single stream!

Thank you kindly! This will help me tremendously.


EDIT: The MKVToolNix route was a great success! :) Reason I never saw it mix the DV main with EL before, is that MKVToolNix only does this on pure m2ts files (whereas I generally mux everything to mkv, as that plays so much nicer with Kodi and such). So, I first used tsMuxer to convert my denoised Push UHD mkv to m2ts again. Then used MKVToolNix to use the main (denoised) stream of the new m2ts, and added the original m2ts from disc (sans the main stream, of course, but with the EL), and muxed them together with MKVToolNix.The result is a totally wonderfully playing, single-layer, DV edition, in MKV, of my denoised Push UHD disc. :) Worked flawlessly. (I guess my 'gut' was right about the EL only containing positional nits info, and not requiring a bit-for-bit matching main stream). And it didn't even require re-encoding (at least not the x265 kind, that takes 12 hours).

GodzilaAvenger
14th October 2024, 22:03
You are very welcome!

You can tell by looking at the DV layer's bitrate if it is MEL (Minimum Enhancement Layer), faux FEL (Full Enhancement Layer), or actual FEL (here (https://avdisco.com/t/demystifying-dolby-vision-profile-levels-dolby-vision-levels-mel-fel/95)'s a good explainer on DV).

(My information is from this (https://forum.blu-ray.com/showpost.php?p=12116287&postcount=1) post in particular, click on the three Show Spoilers to read the full post) If the DV layer bitrate is on the order of ~100 kbps, then it is MEL, i.e. it only contains the RPU, i.e. the scene-by-scene brightness and tonemapping metadata.

If the DV layer bitrate is a little over 2 Mbps, it is faux FEL. The EL contains the RPU along with a uniform 1080p stream. If the bitrate is more than that (generally anything above 2.2 Mbps), it is actual FEL, and the EL contains both the RPU and the stream data that, when added to the base 10-bit HDR layer, recreates the film's original 12-bit stream.

I looked at Push's disk info and it looks like this:

Disc Title : PUSH
Disc Size : 61,837,342,720 bytes
Protection : AACS2
BD-Java : Yes
Playlist : 00802.MPLS
Size : 56,903,645,184 bytes
Length : 15127.180
Total Bitrate : 68.07 Mbps
Video : MPEG-H HEVC Video / 49719 kbps / 2160p / 23.976 fps / 169 / Main 10 Profile 5.1 High / 420 / 10 bits / HDR / BT.2020 /
Video : * MPEG-H HEVC Video / 7836 kbps / 1080p / 23.976 fps / 169 / Main 10 Profile 5.1 High / 420 / 10 bits / Dolby Vision / BT.2020 /
Audio : English / Dolby Atmos/TrueHD Audio / 7.1-Atmos / 48 kHz / 5847 kbps / 24-bit (AC3 Core5.1-EX / 48 kHz / 448 kbps)
Audio : English / Dolby Digital Audio / 2.0 / 48 kHz / 192 kbps / Dolby Surround
Audio : Spanish / Dolby Digital Audio / 5.1 / 48 kHz / 448 kbps
Subtitle : English / 27.089 kbps
Subtitle : Spanish / 22.159 kbps

Based on the discussion above, this is actual FEL. So why didn't you encounter any issues when denoising the base layer? I think the most likely reason is that your player, like almost all players out there, discards the video stream on the EL and only uses the RPU, so what you see is the base 10-bit HDR stream. It is also true that most TVs (even the likes of G4) don't get bright enough for you to notice the difference FEL makes, as it seems to be geared toward movie theatre projectors.

asarian
15th October 2024, 03:28
You are very welcome!

...

Based on the discussion above, this is actual FEL. So why didn't you encounter any issues when denoising the base layer? I think the most likely reason is that your player, like almost all players out there, discards the video stream on the EL and only uses the RPU, so what you see is the base 10-bit HDR stream. It is also true that most TVs (even the likes of G4) don't get bright enough for you to notice the difference FEL makes, as it seems to be geared toward movie theatre projectors.


That would be disappointing. :) I do notice a huge difference between regular HDR and DV, though. The latter is far more vibrant, more accentuated, as it were.

If the player is ignoring FEL, at least the TV detects the 'Dolby Vision' signal.

As to why I didn't encounter any issues when denoising the base layer? I dunno. Why would I? (no sarcasm). I mean, I denoised the movie years ago (before I had a DV capable TV), and only used the main stream for the process. Is there something wrong with my assumption that the EL just adds locational info to the screen? All denoising does, is re-arrange the pixels a bit, in essence.

GodzilaAvenger
15th October 2024, 08:50
FEL is made up of two elements: a 1080p video stream that is essentially "(movie studio 12-bit stream - 10-bit base layer stream)", and metadata that gives your TV information about how to adjust the brightness and colors for each scene, i.e. the RPU.

Your player isn't completely discarding the FEL, it is keeping the RPU from the FEL that lets your TV detect the DV signal and leads to those vibrant colors you mentioned.

asarian
15th October 2024, 18:07
FEL is made up of two elements: a 1080p video stream that is essentially "(movie studio 12-bit stream - 10-bit base layer stream)", and metadata that gives your TV information about how to adjust the brightness and colors for each scene, i.e. the RPU.

Your player isn't completely discarding the FEL, it is keeping the RPU from the FEL that lets your TV detect the DV signal and leads to those vibrant colors you mentioned.

Again, that's disappointing to hear. How can you tell, though? I mean, MKVToolNix turned it all into a single layer now. Is there a way to tell what the TV is using? (or disgarding).

GodzilaAvenger
16th October 2024, 02:20
https://docs.google.com/spreadsheets/d/1jBIGF8XTVi9VmDBZ8a5hEyongYMCDlUiLHU9n1f_S74/edit

Since the last time I checked this a few years ago more players have become capable of playing full fat DV, so perhaps I'm wrong and your player does play the FEL along the RPU, check the list to see if it does. I think it would be hard to say visaully if the FEL is being used, it is supposed to help remove banding introduced by x265 and to retain film grain, but personally I can't tell the difference.

Also, I misspoke earlier. Your original Push file is dual-track dual-layer Profile 7 DV, when you use MKVToolNix it becomes single-track dual-layer Profile 7 DV. I confused tracks and layers

AgentXXL
16th October 2024, 15:04
Holy crap! I had no idea MKVtoolnix could do this! I thought it was just ignoring the DV layer, but, indeed, it mixes the two somehow, and MediaInfo suddenly reports DV data on the now single stream!

Thank you kindly! This will help me tremendously.


EDIT: The MKVToolNix route was a great success! :) Reason I never saw it mix the DV main with EL before, is that MKVToolNix only does this on pure m2ts files (whereas I generally mux everything to mkv, as that plays so much nicer with Kodi and such). So, I first used tsMuxer to convert my denoised Push UHD mkv to m2ts again. Then used MKVToolNix to use the main (denoised) stream of the new m2ts, and added the original m2ts from disc (sans the main stream, of course, but with the EL), and muxed them together with MKVToolNix.The result is a totally wonderfully playing, single-layer, DV edition, in MKV, of my denoised Push UHD disc. :) Worked flawlessly. (I guess my 'gut' was right about the EL only containing positional nits info, and not requiring a bit-for-bit matching main stream). And it didn't even require re-encoding (at least not the x265 kind, that takes 12 hours).

You can also use MakeMKV to convert the dual layer files to single layer. Just open the dual layer file, choose a destination folder and click the Make MKV button.

asarian
18th October 2024, 04:59
https://docs.google.com/spreadsheets/d/1jBIGF8XTVi9VmDBZ8a5hEyongYMCDlUiLHU9n1f_S74/edit

Since the last time I checked this a few years ago more players have become capable of playing full fat DV, so perhaps I'm wrong and your player does play the FEL along the RPU, check the list to see if it does. I think it would be hard to say visaully if the FEL is being used, it is supposed to help remove banding introduced by x265 and to retain film grain, but personally I can't tell the difference.

Your knowledge of players is impressive. I have a Dune Solo 8K, and, indeed, this is what your sheet says:

M2TS & TS & MP4 & MKV
*EL is ignored and only the dynamic
metadata in the RPU is processed
*colors are accurate

Also, I misspoke earlier. Your original Push file is dual-track dual-layer Profile 7 DV, when you use MKVToolNix it becomes single-track dual-layer Profile 7 DV. I confused tracks and layers

Also, if indeed grain is retained in the EL, then clearly FEL gets ignored, as the denoised movie didn't re-introduce new noise.

Z2697
18th October 2024, 05:31
https://docs.google.com/spreadsheets/d/1jBIGF8XTVi9VmDBZ8a5hEyongYMCDlUiLHU9n1f_S74/edit

Since the last time I checked this a few years ago more players have become capable of playing full fat DV, so perhaps I'm wrong and your player does play the FEL along the RPU, check the list to see if it does. I think it would be hard to say visaully if the FEL is being used, it is supposed to help remove banding introduced by x265 and to retain film grain, but personally I can't tell the difference.

Also, I misspoke earlier. Your original Push file is dual-track dual-layer Profile 7 DV, when you use MKVToolNix it becomes single-track dual-layer Profile 7 DV. I confused tracks and layers

It actually meant to brought the 10-bits BL into 12-bits but...
FEL is usually a complete mess (a lot of noise-like pixels) in 1/4 resolution and less than 1/5 bitrate of the BL, I highly doubt the benefit if not harm it has.
Just see how many blocking and other compression artifacts they ususlly has. I'm not sure if I really feel comfortable to put that back into the main video.
With that being said, 10-bits surely isn't super enough for HDR and applying FEL surely does *something* (whether it's good or not).

P.S. "Difference of bit depths" often looks like noise/grain especially when there's actual noise/grain present in the original image.

lemaireus
12th November 2024, 15:45
I seem to have run into a bug in DDVT tools. Each time I try to extract a Dolby Vision Profile 8 RPU, the option to enter a '4. Crop RPU' goes blank. Instead, the 'Crop RPU' option moves to '3. Convert *':

https://i.postimg.cc/K8NrmNq9/DDVT-Bug-DV-Profile-8-1.jpg

When I enter '4' to set the 'Crop RPU' option to 'Yes', it is the 'Convert' option that changes to 'Yes' but the 'Crop RPU' option remains unavailable:

https://i.postimg.cc/Sxq3ZgYV/DDVT-Bug-DV-Profile-8-2.jpg

Thereafter, DDVT duly extracts the RPU, but when it's time to inject that RPU back, it gives a 'RPU does not match video' and 'video does not match RPU' message.

This problem occurs every time when the RPU is of Dolby Vision Profile 8. I've never run into this error in DDVT when the RPU is of Dolby Vision Profile 7.

Any ideas whether this is a bug in DDVT tool or might it be an issue with Dolby Vision profile 8?

DarkRepaer
18th November 2024, 12:32
You are very welcome! I have not tried this personally yet, but based on what @quietvoid and @-QfG have said and dovi_tool's documentation, I think this is how things work:

Let's say you have a file where most scenes have a standard AR (3840x1608), two have IMAX AR (3840x2076), and one is something in between (3840x1960). Then your "custom.json" file which is located next to your "RPU.bin" would look something like this:

{
"mode": 0,
"active_area": {
"presets": [
{
"id": 0,
"left": 0,
"right": 0,
"top": 276,
"bottom": 276
}
{
"id": 1,
"left": 0,
"right": 0,
"top": 42,
"bottom": 42
}
{
"id": 2,
"left": 0,
"right": 0,
"top": 100,
"bottom": 100
}
],
"edits": {
"all": 0,
"1000-1234": 1,
"2400-2468": 2,
"4800-4848": 1
}
}
}

You can then use the following command to edit your RPU:

dovi_tool editor -i RPU.bin -j custom.json -o Edited_RPU.bin

What this essentially does is to first assign the default AR L5 borders to all frames, then overwrite it for the frames specified. From what @-QfG- has said, I think if you have a "custom.json" file directly next to the "RPU.bin" file, when using DDVT_INJECTOR the tool first edits the RPU (using the dovi_tool command above) and then injects it into the mkv.
Hi GodzilaAvenger, thanks for the explanation on how to set the DV Aspect Ratio change.
I have two questions for you.
How can I find the crop values ​​to set for the various AR changes?
And after injecting the RPU, how do I check if everything is correct?

GodzilaAvenger
18th November 2024, 23:17
Hi,
For the first question, I do it by hand. I have a 4K display and I use Microsoft PowerToys' Screen Ruler to measure the borders. It's pretty tedious. Hopefully someone else knows of a more automated way of doing it (I think you can detect borders with FFmpeg but I've never tried it).
As for the second one, I think you just have to watch it and see if there are any weird brightness issues or frame cropping. Again, I'd welcome those with more experience to share their method if they have a better one.

DarkRepaer
22nd November 2024, 20:11
Hi,
For the first question, I do it by hand. I have a 4K display and I use Microsoft PowerToys' Screen Ruler to measure the borders. It's pretty tedious. Hopefully someone else knows of a more automated way of doing it (I think you can detect borders with FFmpeg but I've never tried it).
As for the second one, I think you just have to watch it and see if there are any weird brightness issues or frame cropping. Again, I'd welcome those with more experience to share their method if they have a better one.
For the first question ok, but for the second question, is it possible to see perhaps from the info tool, such as the "all" scenecut file, the various crop values ​​applied to individual frames or in some other technical way?

GodzilaAvenger
22nd November 2024, 23:17
Yes, if you use the FILEINFO tool with the default settings it'll give you a massive .json file that has the frame-by-frame info, you can look at the L5 data for each frame to verify your work.

DarkRepaer
23rd November 2024, 17:34
Yes, if you use the FILEINFO tool with the default settings it'll give you a massive .json file that has the frame-by-frame info, you can look at the L5 data for each frame to verify your work.
So to know the exact AR and therefore the top and bottom values ​​I use the crop function of StaxRip (the software I use for the encodes), obviously in manual. Bringing a concrete example of a film, one of the most difficult complicated examples (25 different ARs), can you tell me if the custom json prepared can be corrected? :helpful:
Just for confirmation before proceeding with the injection. :thanks:

Aspect Ratio Film

0-3259 - 0,0,0,0 |id0
3260-16248 - 0,0,204,204 |id1
16249-17426 - 0,0,0,0 |id0
17427-35823 - 0,0,204,204 |id1
35824-38205 - 0,0,0,0 |id0
38206-39001 - 0,0,204,204 |id1
39002 - 0,0,138,138 |id2
39003 - 0,0,70,70 |id3
39004 - 0,0,4,4 |id4
39005-40639 - 0,0,0,0 |id0
40640-60260 - 0,0,204,204 |id1
60261-61591 - 0,0,0,0 |id0
61592-95714 - 0,0,204,204 |id1
95715-96263 - 0,0,0,0 |id0
96264-112299 - 0,0,204,204 |id1
112300 - 0,0,194,194 |id5
112301 - 0,0,184,184 |id6
112302 - 0,0,176,176 |id7
112303 - 0,0,168,168 |id8
112304 - 0,0,158,158 |id9
112305 - 0,0,150,150 |id10
112306 - 0,0,140,140 |id11
112307 - 0,0,130,130 |id12
112308 - 0,0,122,122 |id13
112309 - 0,0,114,114 |id14
112310 - 0,0,104,104 |id15
112311 - 0,0,94,94 |id16
112312 - 0,0,86,86 |id17
112313 - 0,0,76,76 |id18
112314 - 0,0,68,68 |id19
112315 - 0,0,58,58 |id20
112316 - 0,0,50,50 |id21
112317 - 0,0,40,40 |id22
112318 - 0,0,30,30 |id23
112319 - 0,0,22,22 |id24
112320 - 0,0,14,14 |id25
112321 - 0,0,4,4 |id4
112322-141753 - 0,0,0,0 |id0
141754-158601 - 0,0,204,204 |id1
158602-159671 - 0,0,0,0 |id0
159672-169886 - 0,0,204,204 |id1



Custom.json

{
"mode": 0,
"active_area": {
"crop": false,
"presets": [
{
"id": 0,
"left": 0,
"right": 0,
"top": 0,
"bottom": 0
},
{
"id": 1,
"left": 0,
"right": 0,
"top": 204,
"bottom": 204
},
{
"id": 2,
"left": 0,
"right": 0,
"top": 138,
"bottom": 138
},
{
"id": 3,
"left": 0,
"right": 0,
"top": 70,
"bottom": 70
},
{
"id": 4,
"left": 0,
"right": 0,
"top": 4,
"bottom": 4
},
{
"id": 5,
"left": 0,
"right": 0,
"top": 194,
"bottom": 194
},
{
"id": 6,
"left": 0,
"right": 0,
"top": 184,
"bottom": 184
},
{
"id": 7,
"left": 0,
"right": 0,
"top": 176,
"bottom": 176
},
{
"id": 8,
"left": 0,
"right": 0,
"top": 168,
"bottom": 168
},
{
"id": 9,
"left": 0,
"right": 0,
"top": 158,
"bottom": 158
},
{
"id": 10,
"left": 0,
"right": 0,
"top": 150,
"bottom": 150
},
{
"id": 11,
"left": 0,
"right": 0,
"top": 140,
"bottom": 140
},
{
"id": 12,
"left": 0,
"right": 0,
"top": 130,
"bottom": 130
},
{
"id": 13,
"left": 0,
"right": 0,
"top": 122,
"bottom": 122
},
{
"id": 14,
"left": 0,
"right": 0,
"top": 114,
"bottom": 114
},
{
"id": 15,
"left": 0,
"right": 0,
"top": 104,
"bottom": 104
},
{
"id": 16,
"left": 0,
"right": 0,
"top": 94,
"bottom": 94
},
{
"id": 17,
"left": 0,
"right": 0,
"top": 86,
"bottom": 86
},
{
"id": 18,
"left": 0,
"right": 0,
"top": 76,
"bottom": 76
},
{
"id": 19,
"left": 0,
"right": 0,
"top": 68,
"bottom": 68
},
{
"id": 20,
"left": 0,
"right": 0,
"top": 58,
"bottom": 58
},
{
"id": 21,
"left": 0,
"right": 0,
"top": 50,
"bottom": 50
},
{
"id": 22,
"left": 0,
"right": 0,
"top": 40,
"bottom": 40
},
{
"id": 23,
"left": 0,
"right": 0,
"top": 30,
"bottom": 30
},
{
"id": 24,
"left": 0,
"right": 0,
"top": 22,
"bottom": 22
},
{
"id": 25,
"left": 0,
"right": 0,
"top": 14,
"bottom": 14
}
],
"edits": {
"all": 0,
"3260-16248": 1,
"17427-35823": 1,
"38206-39001": 1,
"39002-39002": 2,
"39003-39003": 3,
"39004-39004": 4,
"40640-60260": 1,
"61592-95714": 1,
"96264-112299": 1,
"112300-112300": 5,
"112301-112301": 6,
"112302-112302": 7,
"112303-112303": 8,
"112304-112304": 9,
"112305-112305": 10,
"112306-112306": 11,
"112307-112307": 12,
"112308-112308": 13,
"112309-112309": 14,
"112310-112310": 15,
"112311-112311": 16,
"112312-112312": 17,
"112313-112313": 18,
"112314-112314": 19,
"112315-112315": 20,
"112316-112316": 21,
"112317-112317": 22,
"112318-112318": 23,
"112319-112319": 24,
"112320-112320": 25,
"112321-112321": 4,
"141754-158601": 1,
"159672-169839": 1
}
}
}

GodzilaAvenger
24th November 2024, 00:53
I didn't check every value but overall looks good to me, you can try it out and then verify with the FILEINFO tool, then adjust values if needed.

DarkRepaer
24th November 2024, 22:09
I didn't check every value but overall looks good to me, you can try it out and then verify with the FILEINFO tool, then adjust values if needed.
Everything went as expected! The injection was successful (I'll post the log file). Now all that's missing is playback verification.
Thanks for the help! :thanks:

powered by quietvoids tools Copyright (c) 2021-2024 QfG

====================================
Dolby Vision Tool INJECTOR
====================================



== LOGFILE START =======================================================================================================

23/11/2024 21:41:20,72

== CUSTOM JSON =========================================================================================================

EditConfig {
"mode": 0,
"remove_cmv4": false,
"remove_mapping": false,
"active_area": {
"crop": false,
"presets": [
{
"id": 0,
"left": 0,
"right": 0,
"top": 0,
"bottom": 0
},
{
"id": 1,
"left": 0,
"right": 0,
"top": 204,
"bottom": 204
},
{
"id": 2,
"left": 0,
"right": 0,
"top": 138,
"bottom": 138
},
{
"id": 3,
"left": 0,
"right": 0,
"top": 70,
"bottom": 70
},
{
"id": 4,
"left": 0,
"right": 0,
"top": 4,
"bottom": 4
},
{
"id": 5,
"left": 0,
"right": 0,
"top": 194,
"bottom": 194
},
{
"id": 6,
"left": 0,
"right": 0,
"top": 184,
"bottom": 184
},
{
"id": 7,
"left": 0,
"right": 0,
"top": 176,
"bottom": 176
},
{
"id": 8,
"left": 0,
"right": 0,
"top": 168,
"bottom": 168
},
{
"id": 9,
"left": 0,
"right": 0,
"top": 158,
"bottom": 158
},
{
"id": 10,
"left": 0,
"right": 0,
"top": 150,
"bottom": 150
},
{
"id": 11,
"left": 0,
"right": 0,
"top": 140,
"bottom": 140
},
{
"id": 12,
"left": 0,
"right": 0,
"top": 130,
"bottom": 130
},
{
"id": 13,
"left": 0,
"right": 0,
"top": 122,
"bottom": 122
},
{
"id": 14,
"left": 0,
"right": 0,
"top": 114,
"bottom": 114
},
{
"id": 15,
"left": 0,
"right": 0,
"top": 104,
"bottom": 104
},
{
"id": 16,
"left": 0,
"right": 0,
"top": 94,
"bottom": 94
},
{
"id": 17,
"left": 0,
"right": 0,
"top": 86,
"bottom": 86
},
{
"id": 18,
"left": 0,
"right": 0,
"top": 76,
"bottom": 76
},
{
"id": 19,
"left": 0,
"right": 0,
"top": 68,
"bottom": 68
},
{
"id": 20,
"left": 0,
"right": 0,
"top": 58,
"bottom": 58
},
{
"id": 21,
"left": 0,
"right": 0,
"top": 50,
"bottom": 50
},
{
"id": 22,
"left": 0,
"right": 0,
"top": 40,
"bottom": 40
},
{
"id": 23,
"left": 0,
"right": 0,
"top": 30,
"bottom": 30
},
{
"id": 24,
"left": 0,
"right": 0,
"top": 22,
"bottom": 22
},
{
"id": 25,
"left": 0,
"right": 0,
"top": 14,
"bottom": 14
}
],
"edits": {
"112309-112309": 14,
"112321-112321": 4,
"112310-112310": 15,
"112314-112314": 19,
"39004-39004": 4,
"112301-112301": 6,
"17427-35823": 1,
"39002-39002": 2,
"112305-112305": 10,
"112306-112306": 11,
"112313-112313": 18,
"40640-60260": 1,
"112312-112312": 17,
"38206-39001": 1,
"112308-112308": 13,
"112315-112315": 20,
"112320-112320": 25,
"96264-112299": 1,
"3260-16248": 1,
"112303-112303": 8,
"112311-112311": 16,
"112317-112317": 22,
"112319-112319": 24,
"112304-112304": 9,
"112316-112316": 21,
"39003-39003": 3,
"112300-112300": 5,
"112302-112302": 7,
"159672-169839": 1,
"112307-112307": 12,
"61592-95714": 1,
"112318-112318": 23,
"all": 0,
"141754-158601": 1
}
}
}
Parsing RPU file...
Editing active area offsets...
Final metadata length: 169886
Writing RPU file...

== LOGFILE END =========================================================================================================

GodzilaAvenger
24th November 2024, 22:56
You're welcome :)

hidef_rec
12th December 2024, 22:23
Possible to use HDR info from a 1080p video into making a hybrid 2160p output also using a 2160p DV P5 only video? When I use DDVT_HYBRID, I get a 1080p output, not 2160p. Thanks.

matey
27th December 2024, 00:44
I'm currently mux them to Profile 5 with Base HDR/HDR10+, with Codec ID hev1. For many people is not "the way", but for me it does the job for my tv sets.

hi fuso

can you please give me step by step instructions to do this to convert mkv to mp4 to play it on lg c8, i tried but it doesn't work. also please let me know which version of the software you use?

thanks

-QfG-
27th December 2024, 02:19
-v0.64
*Minor Bugfixes.
*ADDED MEDIAINFO script (also quick video check for DV levels, included MEL/FEL analyse).
*ADDED SYNCCHECK (check frames and cropping borders between video and rpu).
*UPDATED dovi_tool to v2.1.3.
*UPDATED hdr10plus_tool to v1.6.1.
*UPDATED mkvtoolnix to v 88.0.0.0.
*UPDATED FFMPEG to 7.1

https://i.ibb.co/0c6fFf7/DDVT-Media-Info.png
https://i.ibb.co/z6X0CGM/DDVT-Quick-Info.png
https://i.ibb.co/H2VcgHT/DDVT-SYNCCHECK.png

-QfG-
27th December 2024, 23:13
-v0.64.1
*Minor Bugfixes.
*ADDED Custom JSON file directly Support (Injector) (also bin files).
*ADDED RPU Extracting via Demuxer Script. (bin files)
*FIXED Wrong L9 detection with MediaInfo.

Fuso
28th December 2024, 14:18
hi fuso

can you please give me step by step instructions to do this to convert mkv to mp4 to play it on lg c8, i tried but it doesn't work. also please let me know which version of the software you use?

thanks

Sure...

1. I use the latest tsmuxer (Nightly build from 2024-06-06-02-00-53) to extract the video and audio from MKV source.

2. Mux the .hevc and .ec3/.ac3 to profile 5 mp4

this is the script that I use
mp4muxer --dv-profile 5 --input-file 1.hevc --input-video-frame-rate 24000/1001 --input-file 1.ec3 --media-lang eng --output-file MOVIE.mp4
pause
you can change the framerate depending on the source, also the audio file extension to ac3.
I can't remember which version of the mp4muxer I use.

3. Then I rename the output file from .mp4 to .mkv. The output file is profile 5 with codec ID dvhe which will not play on non-DoVi TV like Samsung.

4. I use the DDVT_MKVTOMP4 script to convert the renamed file again to mp4, but this time it will have codec ID hev1.

I'm sure this not the perfect or correct way to do this, but for my needs it's enough.
Maybe someone can tell me a way of directly muxing the video and audio to Profile 5 mp4 with codec ID hev1.

Grimm
28th December 2024, 17:01
Please add an option to skip unsupported subtitles when converting mkv to mp4 and convert the video instead

matey
30th December 2024, 11:32
Sure...

1. I use the latest tsmuxer (Nightly build from 2024-06-06-02-00-53) to extract the video and audio from MKV source.

2. Mux the .hevc and .ec3/.ac3 to profile 5 mp4

this is the script that I use
mp4muxer --dv-profile 5 --input-file 1.hevc --input-video-frame-rate 24000/1001 --input-file 1.ec3 --media-lang eng --output-file MOVIE.mp4
pause
you can change the framerate depending on the source, also the audio file extension to ac3.
I can't remember which version of the mp4muxer I use.

3. Then I rename the output file from .mp4 to .mkv. The output file is profile 5 with codec ID dvhe which will not play on non-DoVi TV like Samsung.

4. I use the DDVT_MKVTOMP4 script to convert the renamed file again to mp4, but this time it will have codec ID hev1.

I'm sure this not the perfect or correct way to do this, but for my needs it's enough.
Maybe someone can tell me a way of directly muxing the video and audio to Profile 5 mp4 with codec ID hev1.

thanks very much for that.

when you get the chance if you could please let me know which version of mp4muxer you use so i can be sure and use that version.

appreciate it, cheers.

-QfG-
30th December 2024, 15:58
The output file is profile 5 with codec ID dvhe which will not play on non-DoVi TV like Samsung.

Profile 5 files will never played correctly on non-dv TVs like samsung. The base layer from L5 profiles uses not the HDR10 colorrrange BT.2020. L5 uses the DoVi specific colorrange ICtCp.

Please add an option to skip unsupported subtitles when converting mkv to mp4 and convert the video instead

I don't know the switches for FFMPEG to skip all non text subtitles, sorry :(

Also new release with many bugfixes:

-v0.64.2
*Major Bugfixes.
*FIXED MediaInfo bugs with AV1/VP1

Fuso
31st December 2024, 01:17
thanks very much for that.

when you get the chance if you could please let me know which version of mp4muxer you use so i can be sure and use that version.

appreciate it, cheers.

Here, I will upload it.


Profile 5 files will never played correctly on non-dv TVs like samsung. The base layer from L5 profiles uses not the HDR10 colorrrange BT.2020. L5 uses the DoVi specific colorrange ICtCp.

I know that. But my output has HDR10 as a base layer.

HDR format : Dolby Vision, Version 1.0, dvhe.05.06, BL+RPU / SMPTE ST 2086, HDR10 compatible
Codec ID : hev1