Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
dmartinvera00
Posts: 4
Joined: Fri Oct 23, 2020 5:00 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by dmartinvera00 »

Doing the first post, will that be enough to have the best version? Or was there some advance in the entire discussion. I already tried with matrix and transformers, and everything ok with the tv
Buzzie
Posts: 18
Joined: Tue Oct 20, 2020 8:01 am

Re: Dolby Vision now possible through MP4 Mux.

Post by Buzzie »

Tomas wrote:
Fri Oct 23, 2020 4:17 pm
Buzzie wrote:
Fri Oct 23, 2020 3:17 pm
Tomas wrote:
Fri Oct 23, 2020 1:16 pm


Hello, I downloaded the version PLEX 8.8.0.21167, but when I release mkv, it doesn't start in Dolby Vision, but in HDR. Can you advise what it could be?

REMOVED earlier mediainfo
Did you update the media server also to the latest version?? 1.20.xxx
Yes
Do other DV movies play with DV?
Tomas
Posts: 46
Joined: Tue Aug 11, 2020 7:47 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Tomas »

Buzzie wrote:
Fri Oct 23, 2020 7:13 pm
Tomas wrote:
Fri Oct 23, 2020 4:17 pm
Buzzie wrote:
Fri Oct 23, 2020 3:17 pm


Did you update the media server also to the latest version?? 1.20.xxx
Yes
Do other DV movies play with DV?
Yes, the Dolby Vision movie works when I go over the modified Kodi.
DaMacFunkin
Posts: 312
Joined: Tue Oct 30, 2018 4:17 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by DaMacFunkin »

Tomas wrote:
Fri Oct 23, 2020 8:17 pm
Buzzie wrote:
Fri Oct 23, 2020 7:13 pm
Tomas wrote:
Fri Oct 23, 2020 4:17 pm


Yes
Do other DV movies play with DV?
Yes, the Dolby Vision movie works when I go over the modified Kodi.
Some people have said you need to force a re-scan of your metadata for all Dolby Files, as Plex has already stored them as HDR10 playback.
Tomas
Posts: 46
Joined: Tue Aug 11, 2020 7:47 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Tomas »

DaMacFunkin wrote:
Sat Oct 24, 2020 7:05 am
Tomas wrote:
Fri Oct 23, 2020 8:17 pm
Buzzie wrote:
Fri Oct 23, 2020 7:13 pm


Do other DV movies play with DV?
Yes, the Dolby Vision movie works when I go over the modified Kodi.
Some people have said you need to force a re-scan of your metadata for all Dolby Files, as Plex has already stored them as HDR10 playback.
I tried it in the evening and some movies play Dolby Vision and some only play HDR. What can it be?
MasterDude
Posts: 1
Joined: Sat Oct 24, 2020 9:54 am

Re: Dolby Vision now possible through MP4 Mux.

Post by MasterDude »

After Plex version 8.8.0.20999 most DV profile 6 movies play as HDR, but some still do play Dolby Vision. Apparently something changed. Re-scans etc dont help. If i go beyond this version it happens en when I go back DV activates normally again for all movies. So for now I stop updating the app. Using the latest server gives nog problems relating above isues.
yusesope
Posts: 221
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope »

ragico wrote:
Fri Oct 23, 2020 3:02 pm
After many trials and hours I am capable to make the mkv with audio and subs chosen by me.
From scratch to the final mkv it takes less than 1 hour. Excellent, Master Yusesope, your Gamma version of the Tool works very well.
Bravo!
I knew you could do it!
Come on, honestly, it's not that complicated.

I am happy to know that the GAMMA version is working properly. In the future I will try to make everything automated.

An hour seems too much! When you run the second command, FFmpeg should show you the speed with which it processes the data I send to it: I oscillate between 6x (mechanical HDD) and 15x (NVMe). It means that a 2hr movie is processed in 20min (120/6) or 8min (120/15). My current CPU is an i5-7500.



HongyuS wrote:
Fri Oct 23, 2020 1:38 pm
It plays in HDR10 mode, and works fine. Good job. Guess Apple does not support profile 8.1 after all....
I believe that too.
HongyuS wrote:
Fri Oct 23, 2020 1:38 pm
Please share a Mac version of your tool, or just the source code, so I can test it on my machine!
I'm sorry but not having a Mac I can't continue to support this platform.
You have several options though. The easiest and fastest (15 minutes and everything is ready) is to use VirtualBox (free) or Parallels (trial) with the image of a virtual machine (ready to be started) with Windows or Linux OS.

Keep in mind that my BETA version returns a raw HEVC file while the GAMMA a full MKV file.
The MP4 I posted to you was obtained by modifying the source code of Dolby's mp4muxer (and using a raw HEVC stream obtained with BETA)).
HongyuS wrote:
Fri Oct 23, 2020 1:38 pm
Another interesting phenomenon is that your Terminator sample can be edited with Apple's Photos app, as well as latest version of iMovie on iOS. So I tried to re-encode the video with iMovie, and I got THIS file (DoVi profile 8.4 compatible with HLG, 30FPS, 1080p).
This proves that the latest version of your tool works perfectly with Apple devices! The RPU data is 100% compatible with Apple's Dolby certificated encoder!!!
This file is important for anyone who wants to encode (x265) their files with DoVi.
This is a correct encoding: not only the Base Layer has been changed but all the RPUs have been recalibrated.
The encoding was done through a certified encoder!
It is wrong to encode the Base Layer and "re-paste" the original RPUs through my tool!

I also took a closer look at your video (recorded with iPhone 12) and the file obtained with iMovie.
The coding scheme is virtually identical.
I then extracted all the RPUs present in your video, in my sample (Terminator) and those in the Terminator encoded with iMovie (zip HERE).
Open the CHECKSUM.md5 file (found in each folder) with a text editor. Inside are the md5 hashes of each individual RPU.
In files produced with iOS, there are many identical MD5s and therefore many identical RPUs.
The strength of Dolby Vision should be precisely that of dynamically varying the characteristics of the image (but I don't think it can happen if there are many identical RPUs).
Then I looked at some (not all) RPUs (the ones with different md5) and the only parameters that vary are max_PQ* and avg_PQ*.
The variations are also minimal.
It seems to me a fairly minimal implementation of Dolby Vision technology.
The UHD-BD RPUs are all different from each other and the parameters that change are multiple, frame after frame (see the CHECKSUM of my sample)
HongyuS wrote:
Fri Oct 23, 2020 1:38 pm
I also tried to change "dvh1" to "hvc1" of the MBox profile 8.1 sample. The resulting file can be played in QuickTime (contrast still wrong), but cannot be played on my iPad. This is what I could't understand. It should be at least backward compatible with HDR10, like your Terminator sample.
As I said, very often it is not enough to change the header of a box for the file to be played. QuickTime is perhaps smarter and can retrieve the information needed to initialize the decoder. The iPad player may not be capable of it!


**
max_PQ (maximum luminance value of current scene in 12-bit PQ encoding)
avg_PQ (midpoint luminance value of current scene in 12-bit PQ encoding)
ragico
Posts: 265
Joined: Fri Feb 15, 2019 1:09 am

Re: Dolby Vision now possible through MP4 Mux.

Post by ragico »

yusesope wrote:
Sat Oct 24, 2020 10:30 am

An hour seems too much! When you run the second command, FFmpeg should show you the speed with which it processes the data I send to it: I oscillate between 6x (mechanical HDD) and 15x (NVMe). It means that a 2hr movie is processed in 20min (120/6) or 8min (120/15). My current CPU is an i5-7500.
I am still refining the whole process, You are right, it takes less time. On my pc between 20 and 30 minutes, depends also if the original movie has got HDR10+ and I want to remove it for compatibility problem with Firestick. In that case the process takes a little more time.
My processor is an I3 6100.
HongyuS
Posts: 8
Joined: Sat Sep 05, 2020 6:27 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by HongyuS »

yusesope wrote:
Sat Oct 24, 2020 10:30 am
I'm sorry but not having a Mac I can't continue to support this platform.
Can you share your source code with me? I'm happy to help you compile a Mac version.
The performance of VM is very poor on my computer, so I have to reboot into Windows every time.
yusesope wrote:
Sat Oct 24, 2020 10:30 am
The MP4 I posted to you was obtained by modifying the source code of Dolby's mp4muxer (and using a raw HEVC stream obtained with BETA)).
Can you also share the modified source code of Dolby's mp4muxer? I cannot reproduce a working mp4 file. Please share the source code so I can know what you've changed.
yusesope
Posts: 221
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope »

ragico wrote:
Sat Oct 24, 2020 12:20 pm
I am still refining the whole process, You are right, it takes less time. On my pc between 20 and 30 minutes....
If you need a hand, as soon as I can, I'll answer you.


HongyuS wrote:
Sun Oct 25, 2020 7:23 am
Can you share your source code with me? I'm happy to help you compile a Mac version.
After the October 2 update on BETA, there is no longer any source code for Mac.
Then take the GAMMA version for example: for now it only works on Windows ... when I have time I will extend support to Linux as well.
Windows and Linux are the only platforms I can experiment with.
HongyuS wrote:
Sun Oct 25, 2020 7:23 am
The performance of VM is very poor on my computer, so I have to reboot into Windows every time.
I'm sorry for the inconvenience.
On my 400€ machine the VMs have the same performance as the primary OS: I can hardly believe that your Mac (iMac 2020 ??? ... MacBook Pro >= 2018 ???) struggles!
yusesope wrote:
Sat Oct 24, 2020 10:30 am
Can you also share the modified source code of Dolby's mp4muxer? I cannot reproduce a working mp4 file. Please share the source code so I can know what you've changed.
I simply forced the value of "sample_entry_name_flag" (setting it to 1) through the "p_usr_cfg_es" pointer.
Add the row

Code: Select all

p_usr_cfg_es->sample_entry_name_flag = 1;
on line 7012 of the mp4_muxer.c file.

This type of solution is fine for my experiments.
For something more dynamic, you'd better add a switch (something like --force-hvc1 1) in the frontend (mp4_muxer_app.c).
I have not checked but I think it is possible by modifying the ema_mp4_mux_set_input function in such a way that it accepts the value of the new switch and with the latter set usr_cfg_es->sample_entry_name_flag
kws53
Posts: 49
Joined: Sun May 04, 2014 9:09 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by kws53 »

FIRST - Very fine work Yusesope.

Ran GAMMA on 1917...
With no additional switches and Profile 8:
SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible
With -skip_hdr10plus:
SMPTE ST 2086, HDR10 compatible

Speed was 10.5x (AMD Ryzen 9 3900x), so 11minutes20seconds. No idea how to determine whether FEL or MEL (no MakeMKV...). And BDInfo doesn't provide this info either. 3rd party app?

Most importantly - how do I get DolbyVision?
yusesope
Posts: 221
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope »

kws53 wrote:
Sun Oct 25, 2020 4:20 pm
FIRST - Very fine work Yusesope.

Ran GAMMA on 1917...
With no additional switches and Profile 8:
SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible
With -skip_hdr10plus:
SMPTE ST 2086, HDR10 compatible

Speed was 10.5x (AMD Ryzen 9 3900x), so 11minutes20seconds. No idea how to determine whether FEL or MEL (no MakeMKV...). And BDInfo doesn't provide this info either. 3rd party app?

Most importantly - how do I get DolbyVision?
The input file must be a dual track dual layer profile 7 file (e.g. an m2ts file inside the decrypted folder of a UHD-BD)

The mkv file obtained after the program has finished is not recognized as a file with DoVi!
Needs to be patched!

Did you use the mkv patcher as indicated in the third step (HERE)?

I don't understand what you mean when you talk about FEL or MEL: if in the first command line you used "-mode 2" then, when the patcher asks you, type 8 otherwise your file (FEL or MEL, it doesn't matter) will be a profile 7 and you will have to type 7 when prompted by the patcher!
baohen1510
Posts: 1
Joined: Mon Mar 16, 2020 1:41 am

Re: Dolby Vision now possible through MP4 Mux.

Post by baohen1510 »

What wrong ? Pls help me
F:\DOLBYVISION\MAKEMKVDOLBYVISION>python-3.7.6.amd64\python.exe src\MKV_patcher.py


Please, drag and drop here the MKV file and press ENTER:
G:\DV.mkv

Please choose the profile to assign (7 or 8):
8
Traceback (most recent call last):
File "F:\DOLBYVISION\MAKEMKVDOLBYVISION\python-3.7.6.amd64\lib\site-packages\bitstring.py", line 833, in _initialise
init_without_length_or_offset[k](self, v)
KeyError: 'uint'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "src\MKV_patcher.py", line 243, in <module>
patched_data = mkv_patcher.inject_dolby_vision(dolby_vision_data)
File "src\MKV_patcher.py", line 217, in inject_dolby_vision
self.init_elements()
File "src\MKV_patcher.py", line 159, in init_elements
el_property["size"] = self.read_variable_size_int()
File "src\MKV_patcher.py", line 138, in read_variable_size_int
parsedValue = BitArray(uint=(self.mkv_data[pos:pos + 8] & (~self.get_len_mark(length))).uint,length=length)
File "src\MKV_patcher.py", line 127, in get_len_mark
return BitArray(uint=1 << (8 - int(length / 8)),length=8)
File "F:\DOLBYVISION\MAKEMKVDOLBYVISION\python-3.7.6.amd64\lib\site-packages\bitstring.py", line 3059, in __new__
y = Bits.__new__(BitArray, auto, length, offset, **kwargs)
File "F:\DOLBYVISION\MAKEMKVDOLBYVISION\python-3.7.6.amd64\lib\site-packages\bitstring.py", line 812, in __new__
x._initialise(auto, length, offset, **kwargs)
File "F:\DOLBYVISION\MAKEMKVDOLBYVISION\python-3.7.6.amd64\lib\site-packages\bitstring.py", line 838, in _initialise
init_with_length_only[k](self, v, length)
File "F:\DOLBYVISION\MAKEMKVDOLBYVISION\python-3.7.6.amd64\lib\site-packages\bitstring.py", line 1388, in _setuint
raise CreationError(msg, uint, length, (1 << length) - 1)
bitstring.CreationError: 256 is too large an unsigned integer for a bitstring of length 8. The allowed range is [0, 255].

F:\DOLBYVISION\MAKEMKVDOLBYVISION>pause
Press any key to continue . . .
Manixx2020beyound
Posts: 127
Joined: Thu Oct 08, 2020 5:19 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Manixx2020beyound »

So I got curious about the iPhone 12 pro doblyvision which I haven’t gotten yet,
But I do have the pro11 MAX, so I uploaded the captured I phone 12 clip dovi on the pro max 11 & ran I movie on the max 11pro
And I movie on the 11 produce a doblyvision
File slightly different from the original.
Produced an profile 8 id36 doblyvision hlg.
So I phone 11pro can encode dovi/rpu/bl
Which played in doblyvision on my dv devices.
I’ll post a media info later today.
My second test is to use uhbd dual to single layer mp4 in I move to encode in doblyvision
My question is does any further minuplation needed to uhd mp4s so I movie can accept them.
I’m also going to try on my MacBook Pro.
Attachments
FA0D3FB3-6C03-4DE6-B7E4-38AE4323DCC9.jpeg
FA0D3FB3-6C03-4DE6-B7E4-38AE4323DCC9.jpeg (1.24 MiB) Viewed 30171 times
D6767639-1DEB-43D3-979E-442BB0E5FB2C.jpeg
D6767639-1DEB-43D3-979E-442BB0E5FB2C.jpeg (832.31 KiB) Viewed 30288 times
11B5908D-6EE0-454C-BDC4-43D945514154.png
11B5908D-6EE0-454C-BDC4-43D945514154.png (2.87 MiB) Viewed 30289 times
Last edited by Manixx2020beyound on Mon Oct 26, 2020 8:03 pm, edited 1 time in total.
kws53
Posts: 49
Joined: Sun May 04, 2014 9:09 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by kws53 »

The input file must be a dual track dual layer profile 7 file (e.g. an m2ts file inside the decrypted folder of a UHD-BD)
It is a dual track, dual layer m2ts file from the original - see Image 1. How can I tell whether it is a profile 7 file?
Specifically: \BDMV\STREAM\00294.m2ts from the 1917 ISO [US]
The mkv file obtained after the program has finished is not recognized as a file with DoVi!
Needs to be patched!

Did you use the mkv patcher as indicated in the third step (HERE)?
Indeed - see Image 2.
I don't understand what you mean when you talk about FEL or MEL: if in the first command line you used "-mode 2" then, when the patcher asks you, type 8 otherwise your file (FEL or MEL, it doesn't matter) will be a profile 7 and you will have to type 7 when prompted by the patcher!
I didn't use any switches other than the "-skip_hdr10plus" for my comparison.
Attachments
EAC3TO Output
EAC3TO Output
Dual Layer.png (10.85 KiB) Viewed 30266 times
Patch Verification
Patch Verification
PatchScreen.png (14.88 KiB) Viewed 30266 times
Post Reply