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

cool advertise
30th January 2022, 02:28
OK, maybe now I understand.
So if I want to do an x265 encode and crop the top and bottom (or left and right) letterbox bars, dovi_tool allows this via the -c command or the CROP RPU "YES" option of the -QfG- tool. If you don't cut letterbox bars then don't use -c or use CROP RPU "NO" of the -QfG- tool.
There is no way or need to specify how many pixels these letterbox bars are via dovi_tool, if coding using crop.
The editor allows via a json configuration file, in case the encoding has letterbox bars and is therefore not cropped to specify the pixel size of these bars by skipping the default ones, or something like that.
I'm writing because I don't have a Dolby Vision TV, and I can't do tests, but I think I understand this.

halls
30th January 2022, 10:48
Hi!

Sorry, worng thread

-QfG-
30th January 2022, 16:13
v0.35 Online
-v0.35
*Added Active Area Editor in Injector.
*Updated hdr10plus_tool.exe to v1.2.2.

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

halls
30th January 2022, 17:20
Hi!

I know this isn't the specific thread, but i need a little help.

How can i extract the dolby vision meta datas to .xml format?

I have rpu.bin and .json files with using dovi_tool

I need this format /.xml/ for an program.

Thank You!

quietvoid
30th January 2022, 17:30
Hi!

I know this isn't the specific thread, but i need a little help.

How can i extract the dolby vision meta datas to .xml format?

I have rpu.bin and .json files with using dovi_tool

I need this format /.xml/ for an program.

Thank You!

You can't.

cool advertise
30th January 2022, 19:41
v0.35 Online
-v0.35
*Added Active Area Editor in Injector.
*Updated hdr10plus_tool.exe to v1.2.2.

Perfect, but your injector tool is still missing one main function, namely injecting hdr10+ metadata into a hevc or mkv file.

-QfG-
30th January 2022, 21:12
This is a Dolby Vision Tool, not a HDR10+ Tool. ;). I will look to add HDR10+ Injector support on the next Update.

GZZ
30th January 2022, 21:14
Hi!

I know this isn't the specific thread, but i need a little help.

How can i extract the dolby vision meta datas to .xml format?

I have rpu.bin and .json files with using dovi_tool

I need this format /.xml/ for an program.

Thank You!


You can use a online converter to convert from JSON to XML.
It might work, it might not.
https://www.freeformatter.com/json-to-xml-converter.html

-QfG-
30th January 2022, 22:43
-v0.35a
*Minor Bugfixes
*Changed colors of any strings

halls
30th January 2022, 23:17
You can use a online converter to convert from JSON to XML.
It might work, it might not.
https://www.freeformatter.com/json-to-xml-converter.html


Hi!

Yes, i tried.

.JSON file is to big.....

But Thank You!

GZZ
31st January 2022, 09:28
Hi!

Yes, i tried.

.JSON file is to big.....

But Thank You!

There are other free pages, just use Google and search on "Json to XML converter" and then try them all out.

cool advertise
1st February 2022, 04:37
This is a Dolby Vision Tool, not a HDR10+ Tool. ;). I will look to add HDR10+ Injector support on the next Update.
I know how to inject or extract HDR10+ metadata, but if you include in a future version also the extraction of HDR10+ metadata in the demuxer the tool would become a complete dolby vision and HDR10+ management tool.
Only if you want to of course.

shodan5000
1st February 2022, 17:28
I know how to inject or extract HDR10+ metadata, but if you include in a future version also the extraction of HDR10+ metadata in the demuxer the tool would become a complete dolby vision and HDR10+ management tool.
Only if you want to of course.

You might also be interested in HDR-Multi-Tool-Gui if HDR10+ is important to you. It does Dolby as well.

https://github.com/jlw4049/HDR-Multi-Tool-Gui

-QfG-
1st February 2022, 23:49
-v0.36
*HDR10+ Demuxing / Injecting Support.

cool advertise
2nd February 2022, 09:52
-v0.36
*HDR10+ Demuxing / Injecting Support.
Thank you, very good work.
I don't want to be wrong, but shouldn't it be possible to edit the active area while demuxing?

-QfG-
2nd February 2022, 14:59
Thank you, very good work.
I don't want to be wrong, but shouldn't it be possible to edit the active area while demuxing?

You need the resolution of the target video, i think in the injector is the better solution.

quietvoid
2nd February 2022, 15:16
All static edits that don't require modifying a specific frame can technically be done, but it's not implemented in dovi_tool currently.
So, you can't edit anything other than doing mode/crop right now.

von Suppé
3rd February 2022, 11:53
-v0.36
*HDR10+ Demuxing / Injecting Support.
Cool!

A big :thanks: to both quietvoid and -QfC- for continually improving tools and scripts. Highly appreciated!

-QfG-
5th February 2022, 10:51
-v0.37
*Updated dovi_tool.exe to v1.4.6.
*Added DDVT_FRAMEINFO.cmd.

-QfG-
5th February 2022, 11:29
@quietvoid

I have seen that in any RPU.bin's CM29 Metadata not Level5 specified.
Is that the same if i set Active Area to 0,0,0,0?

For example:

"cmv29_metadata": {
"num_ext_blocks": 3,
"ext_metadata_blocks": [
{
"Level1": {
"min_pq": 12,
"max_pq": 2105,
"avg_pq": 819
}
},
{
"Level2": {
"target_max_pq": 2081,
"trim_slope": 2048,
"trim_offset": 2048,
"trim_power": 2048,
"trim_chroma_weight": 2048,
"trim_saturation_gain": 2048,
"ms_weight": 2048
}
},
{
"Level6": {
"max_display_mastering_luminance": 4000,
"min_display_mastering_luminance": 50,
"max_content_light_level": 444,
"max_frame_average_light_level": 393
}
}
]
}
},
"rpu_data_crc32": 1251925187
}

von Suppé
5th February 2022, 14:03
As quietvoid's standalone dovi_tool accepts elementary streams only, I am quite surprised to find out they aren't supported in your scripts, -QfC-. Do you have plans for it?

quietvoid
5th February 2022, 15:28
I have seen that in any RPU.bin's CM29 Metadata not Level5 specified.
Is that the same if i set Active Area to 0,0,0,0?

Probably, but Dolby recommends that L5 should always be present to avoid issues.

-QfG-
5th February 2022, 20:45
As quietvoid's standalone dovi_tool accepts elementary streams only, I am quite surprised to find out they aren't supported in your scripts, -QfC-. Do you have plans for it?

INJECTOR handles RAW Streams, in the next Update i will add DEMUXER RAW Stream support. Also i'm working on an AutoCrop Function.

Probably, but Dolby recommends that L5 should always be present to avoid issues.

Thanks. I'm wondering, because that was in an official Profile 5 RPU.

-QfG-
6th February 2022, 15:11
-v037a
*Added AutoDetect Borders in AA Editor (works only with containers).
*Added Profile 8 to Profile 7 Conversion.

cool advertise
6th February 2022, 16:54
-v037a
*Added AutoDetect Borders in AA Editor (works only with containers).
*Added Profile 8 to Profile 7 Conversion.
Hi, version 0.37a has a problem, in the demuxer, opening a file with dolby vision profile 7, option 4 (Convert RPU), shows only Profile 8 and it is not possible to change it as in previous versions ( Leave untouched).

-QfG-
6th February 2022, 17:28
-v0.37a - FIXED
*Fixed troubleshooting with profile switch in Profile 7 options.

Thx for the response.

cool advertise
6th February 2022, 19:59
If I want to crop a video with source resolution 3840x2160p in dolby vision 8.1, and the letterboxes bars are above 277 px and below 277 px, can I use the -c command of dovi_tool (or the crop RPU option of the -QfG- tool) with avisynth+ and crop like this?
crop(0, 276, 0, -276)
to be compatible with the height (divisible by 2) rule (mod 2) of avisynth?
Without resizing and with a final resolution of the re-encoded video of
3840x1608p
?
Is this correct?

-QfG-
7th February 2022, 02:56
Yes. Simply use the Crop RPU Function of the DEMUXER or use the Active Area Editor in INJECTOR and set all entries to 0.

-v0.37b
*Minor Bugfixes
*Updated mkvtoolnix to v 65.0.0.0

cool advertise
7th February 2022, 07:32
Yes. Simply use the Crop RPU Function of the DEMUXER or use the Active Area Editor in INJECTOR and set all entries to 0.

-v0.37b
*Minor Bugfixes
*Updated mkvtoolnix to v 65.0.0.0

Thanks for the answer, ffmpeg 64bit is up to version 5.00 while 32bit is not. ;)

von Suppé
8th February 2022, 14:26
the letterboxes bars are above 277 px and below 277 px
crop(0, 276, 0, -276)
Thinking about this example, it does raise some questions about RPU's usage with under- and overcropped video.

Undercropping your video (containing 277px black bars) with 276px would leave 2 black lines. As such, shouldn't you better set TOP and BOTTOM crop values both to "1" in -QfC- injector? Using --crop switch would set all offsets to zero. No intention to being pedant here, but I wouldn't know how precise these values need to be and what the chances are of introducing artefacts.

On te opposite side, when overcropping video (even slightly), I also wonder whether (cropped) RPU can get corrupted .
Imagine your same video, but cropping with 280 instead, leaving 3840x1600, which is widely used. Extract RPU with --crop switch: great, no offsets.
But what about this "active area"? I don't know exactly how further this is used in DV's metadata. But I can imagine cropped RPU being left incompatible because of "shrunk active area" as invoked by the overcrop.

cool advertise
9th February 2022, 19:23
DDVT Tool

I think there is a bug in the injector, if you open a simple hdr10 file in mkv (and maybe mp4 as well) and then first inject hdr10+ metadata, enabling mux stream in mkv, and then reopen the created file in the injector, injecting dolby vision 8 (8.1) metadata, and enabling mux stream in mkv again, it fails.
And vice versa, injecting dolby vision metadata first and then hdr10+, with mux stream in mkv enabled it fails.
It works instead without enabling mux stream in mkv.
My mkv test file was 10 seconds long and had a hevc track, an ac3 audio track and a jpg attachment.
I think the error occurs because the injector treats the ac3 audio track as if it were the video track.
Attached log

powered by quietvoids tools Copyright (c) 2021 DonaldFaQ

====================================
Dolby Vision Tool INJECTOR
- HDR10+ INJECTOR -
====================================


== SETTINGS ============================================================================================================

Mux Stream in MKV : [YES]

== INJECTING ===========================================================================================================

ATTENTION! You need many HDD Space for this operation.

Please wait. Extracting the Video Layer ...
Extracting track 0 with the CodecID 'A_AC3' to the file 'E:\Dolby Vision Test\dolby_[TEMP].hevc'. Container format: Dolby Digital (AC-3)
Progress: 100%
Done.

Please wait. Injecting the HDR10+ Metadata into stream...
Processing input video for frame order info...

Warning: mismatched lengths. video 0, metadata 229
Metadata will be skipped at the end to match video length

Computing frame indices..
Rewriting file with interleaved HDR10+ NALUs..
Done.

Deleting Temp File - Done.

Please wait. Injecting Videostream into MKV...
Warning: 'E:\Dolby Vision Test\dolby_[HDR10+ INJECTED].hevc' track 0: This audio track contains 859 bytes of invalid data which were skipped before timestamp 00:00:00.000000000. The audio/video synchronization may have been lost.
Warning: 'E:\Dolby Vision Test\dolby_[HDR10+ INJECTED].hevc' track 0: This audio track contains 1 byte of invalid data which was skipped before timestamp 00:00:03.456007968. The audio/video synchronization may have been lost.
Done.

Please wait. Cleaning and Moving files ...
Deleting Temp File - Done.

All Operations successful.

== EXIT ================================================================================================================

Press [ENTER] to Exit.


mediainfo of final file

General
Unique ID : 263580156875075198637991821584341121842 (0xC64BB112698BD4E74B26AD2DB5CBBB32)
Complete name : E:\Downloads\Dolby Vision Test\dolby_[HDR10+ INJECTED].mkv
Format : Matroska
Format version : Version 4
File size : 1.33 MiB
Duration : 9 s 632 ms
Overall bit rate mode : Constant
Overall bit rate : 1 159 kb/s
Encoded date : UTC 2022-02-10 15:58:37
Writing application : mkvmerge v65.0.0 ('Too Much') 64-bit
Writing library : libebml v1.4.2 + libmatroska v1.6.4
Cover : Yes
Attachments : cover.jpg

Audio #1
ID : 1
Format : AC-3
Format/Info : Audio Coding 3
Commercial name : Dolby Digital
Codec ID : A_AC3
Duration : 9 s 632 ms
Bit rate mode : Constant
Bit rate : 640 kb/s
Channel(s) : 6 channels
Channel layout : L R C LFE Ls Rs
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Compression mode : Lossy
Stream size : 752 KiB (55%)
Language : Italian
Service kind : Complete Main
Default : Yes
Forced : No

Audio #2
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Commercial name : Dolby Digital
Codec ID : A_AC3
Duration : 7 s 328 ms
Bit rate mode : Constant
Bit rate : 640 kb/s
Channel(s) : 6 channels
Channel layout : L R C LFE Ls Rs
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Compression mode : Lossy
Stream size : 572 KiB (42%)
Service kind : Complete Main
Default : Yes
Forced : No

-QfG-
11th February 2022, 20:44
Please wait. Extracting the Video Layer ...
Extracting track 0 with the CodecID 'A_AC3' to the file 'E:\Dolby Vision Test\dolby_[TEMP].hevc'. Container format: Dolby Digital (AC-3)
Progress: 100%
Done.

Why is the first Track [0] an Audio Track?
Please Remux the container first and check if the first Track [0] is an Video Track.

Is that file the result of my tool?

cool advertise
11th February 2022, 21:14
Is that file the result of my tool?

Yes the final file is obtained using your tool, the original file was an mkv and had a hevc video track, an ac3 audio track, and a jpg attachment.
After injecting the dolby vision metadata, I get an mkv with a video track, an audio track and a jpg attachment.
mediainfo log

General
Unique ID : 142179199423562187515235590156012874399 (0x6AF6B7BF5FB93FE33E32113790C5EA9F)
Complete name : E:\Downloads\Dolby Vision Test\dolby_[DV INJECTED].mkv
Format : Matroska
Format version : Version 4
File size : 12.3 MiB
Duration : 9 s 632 ms
Overall bit rate : 10.7 Mb/s
Encoded date : UTC 2022-02-09 21:21:03
Writing application : mkvmerge v65.0.0 ('Too Much') 64-bit
Writing library : libebml v1.4.2 + libmatroska v1.6.4
Cover : Yes
Attachments : cover.jpg

Video
ID : 2
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L5.1@Main
HDR format : Dolby Vision, Version 1.0, dvhe.08.06, BL+RPU, HDR10 compatible / SMPTE ST 2086, HDR10 compatible
Codec ID : V_MPEGH/ISO/HEVC
Duration : 9 s 551 ms
Bit rate : 10.1 Mb/s
Width : 3 840 pixels
Height : 2 076 pixels
Display aspect ratio : 1.85:1
Frame rate mode : Constant
Frame rate : 23.976 (23976/1000) FPS
Original 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.053
Stream size : 11.5 MiB (94%)
Writing library : x265 3.5+1-ce882936d:[Windows][MSVC 1928][64 bit] 10bit
Encoding settings : hidden
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: 4000 cd/m2
Maximum Content Light Level : 1000 cd/m2
Maximum Frame-Average Light Level : 755 cd/m2

Audio
ID : 1
Format : AC-3
Format/Info : Audio Coding 3
Commercial name : Dolby Digital
Codec ID : A_AC3
Duration : 9 s 632 ms
Bit rate mode : Constant
Bit rate : 640 kb/s
Channel(s) : 6 channels
Channel layout : L R C LFE Ls Rs
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Compression mode : Lossy
Stream size : 752 KiB (6%)
Language : Italian
Service kind : Complete Main
Default : Yes
Forced : No



After opening the latter in the injector, to inject hdr10+ I get 2 ac3 audio tracks contained in one mkv file.
And vice versa, injecting first hdr10+ and then dolby vision i get the same result.
After the first injection the file I get is correct, but as you can see from the mediainfo log, the video track has id 2, the audio track has id 1.
So I think your tool at this point makes the error and the bug occurs at the second injection.

-QfG-
12th February 2022, 07:14
the video track has id 2

-v0.37c
*Fixed wrong ID by video track if muxing with INJECTOR
*Updated FFMPEG to v5.0

cool advertise
12th February 2022, 07:39
-v0.37c
*Fixed wrong ID by video track if muxing with INJECTOR
*Updated FFMPEG to v5.0

There are still bugs, if I first inject dolby vision metadata by enabling mux stream in mkv, the ids are correct, but if I later open the file obtained in the injector to inject hdr10+ metadata, enabling mux stream in mkv, the final file you get from your tool is still an mkv with video track ID 2 and audio track ID 1.
And again, if I first inject hdr10+ metadata by enabling mux stream in mkv, the final file you get from your tool is still an mkv with video track ID 2 and audio track ID 1.

-QfG-
12th February 2022, 08:03
Oh my God i fixed the bug only in the DV Area... Give me few seconds i will upload a fixed version of 0.37c

EDIT:

Done!
Please reupload v0.37c and test again.

cool advertise
12th February 2022, 08:27
Oh my God i fixed the bug only in the DV Area... Give me few seconds i will upload a fixed version of 0.37c

EDIT:

Done!
Please reupload v0.37c and test again.

Now it works, at least for sure with mkv.
Thanks

-QfG-
12th February 2022, 20:51
-v0.38
*Updated MP4Box.exe.
*Added MP4 Mux Support in Injector (only if Input file is MP4 und only for Profile8).
*Added DDVT REMOVER.cmd (Remove HDR10+ and/or DoVi Metadata from MP4/MKV Container)
*Minor Bugfixes

Balling
15th February 2022, 16:32
Dilby Vision IPTPQc2 decoder now works in mpv. Including mmr and poly reshaping.

von Suppé
17th February 2022, 09:36
Is it possible to convert RPU profile of an already extracted RPU.bin file? Or does converting need to take place during demux?
Forgive my ignorance.

zzreel
18th February 2022, 23:54
Is it possible to convert RPU profile of an already extracted RPU.bin file? Or does converting need to take place during demux?
Forgive my ignorance.

I was able to drag and drop the .hevc and replace the RPU with the extract converted one. But for some reason it doesn't work on mkvs directly.

zzreel
18th February 2022, 23:55
Registered just to say thank you for this great tool - this has been fantastic to use, I really appreciate it and the HDR10+ full inclusion is especially much appreciated!

There's no MP4 muxer tool like this yet right? ffmpeg added support for lossless audio tracks now, so I wonder if a MP4 muxer would now be the ultimate solution for DV encodes. (I can't get Visual Studio 2010 to install on my machine so I can't try out dlb_mp4base.)

GPhil
19th February 2022, 10:41
Hey folks,

tried to convert HDR10+ to DV with the newest version, but the following error appeared:

https://thumbs4.imagebam.com/af/78/5c/ME7Z18D_t.png (https://www.imagebam.com/view/ME7Z18D)

What's going wrong?

Best regards
GPhil

Hackerjac
19th February 2022, 11:20
I ran into the same problem a couple of days ago, it was caursed by max_content_light_level & max_frame_average_light_level info was missing

GPhil
19th February 2022, 14:21
And is there a way to fix it?

-QfG-
19th February 2022, 15:21
This happens by HDR10+ Profile B streams. I think because missing HDR values like Max/Min CLL.

von Suppé
19th February 2022, 16:53
This happens by HDR10+ Profile B streams.HDR10+ Profile B from BL movie Jaws seems to work like a charm. No errors, putting out RPU profile 8.

quietvoid
19th February 2022, 17:01
dovi_tool requires complete L6 metadata, there is no default used when the JSON is missing "level6".
A decent default might be MDL 1000/1, with MaxCLL/MaxFALL set to 0.

It is up to the user (or in this case the script) to handle this case.

-QfG-
19th February 2022, 19:29
Thx quietvoid, i take a look how i can handle this problem in the next update.

-QfG-
20th February 2022, 09:28
-v0.39
*Fixed HDR10+ converting without HDR metadata strings.