Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
HongyuS
Posts: 8
Joined: Sat Sep 05, 2020 6:27 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by HongyuS »

badrobot wrote:
Fri Oct 23, 2020 2:52 am
I have tried MBOX demo video files on my iPad Pro, it seems that P5 can be identified as DoVi by infuse 6, but P8.1 can not.
Result:P5 play as DoVi, P8.1 play as HDR, I have uploaded these screenshots.

https://screenshotcomparison.com/comparison/7316
I forgot to mention one very important info: Apple require the video track fourcc ID to be “dvh1” for Dolby Vision. So you need to change it manually using a Hex editor. (More info: the sample I recommended to you is “dvhe”, which cannot be played by QuickTime/Apple TV app)

Furthermore, Infuse only supports profile 5. If you want to test profile 8.x, you need to copy the the m4v file to the “Files” app, and preview with it. (And you must use iPadOS 14.1 or 14.2 beta 4, or later versions, in order to support profile 8.x)
yusesope
Posts: 221
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope »

ragico wrote:
Thu Oct 22, 2020 10:55 pm
2) src\Gpac\gpac.exe -i pipe://video:ext=hevc:audelim=true -o stdout:ext=ts:pes_pack=none | src\FFmpeg\ffmpeg_win_x64.exe -hide_banner -y -i - -i I:\BDMV\STREAM\00018.m2ts -map 0:0 -map 1:2 -c copy -bsf:v hevc_metadata=aud=insert -metadata title=
"Transformers_____________________________________"
D:\Transformers.mkv
The first command line is fine, in the second there are two invisible mistakes!
You entered two "newline" characters (sei andato a capo due volte): one immediately after title= and the other after the underscores and the quotation mark (before the address of the output file).
Look HERE.

The command line is a single long line and the only spacing character allowed is the space.
You can help yourself with THIS online tool for removing line breaks.

the second command line should be (look at the parts in red):
src\Gpac\gpac.exe -i pipe://video:ext=hevc:audelim=true -o stdout:ext=ts:pes_pack=none | src\FFmpeg\ffmpeg_win_x64.exe -hide_banner -y -i - -i I:\BDMV\STREAM\00018.m2ts -map 0:0 -map 1:2 -c copy -bsf:v hevc_metadata=aud=insert -metadata title="Transformers_____________________________________" D:\Transformers.mkv
No space between title= and the next quotation mark.
A simple space between the last quotation mark and the address of the output file.


HongyuS wrote:
Thu Oct 22, 2020 11:55 pm
However, sample made by yusesope's "-mode 2" triggers crash on macOS Big Sur, while encoding sample from MBox does not. So there are still room for improvements.
The mysterybox sample (the one with profile 8.1) is FHD (1920 × 1080): did we download the same file?
Mine are UHD (3840 x 2160): it would be an unequal comparison :mrgreen: !

Would you tell me exactly which sample produced by my tool you tried? It is important to know because "-mode 2" has undergone some changes over time!
I leave you a SAMPLE (video only - profile 8.1 derived from a FEL) obtained with the latest version of my tool and adapted to meet what I believe are the needs of macOS Big Sur. I don't know if it will be played but it doesn't hurt to try!
HongyuS wrote:
Fri Oct 23, 2020 3:40 am
I forgot to mention one very important info: Apple require the video track fourcc ID to be “dvh1” for Dolby Vision. So you need to change it manually using a Hex editor. (More info: the sample I recommended to you is “dvhe”, which cannot be played by QuickTime/Apple TV app)
The correct codec ID (for profile 8.1) should be "hvc1" in place of "hev1". But be careful, these boxes are not random: they indicate to the decoder how the information for the initialization of the latter is stored within the file. Changing the header with a hex editor isn't always enough!
Tomas
Posts: 46
Joined: Tue Aug 11, 2020 7:47 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Tomas »

Buzzie wrote:
Thu Oct 22, 2020 7:41 am
shawnc22 wrote:
Wed Oct 21, 2020 10:14 pm
Buzzie wrote:
Wed Oct 21, 2020 8:01 pm


Thanks for the reply.
I checked the versions
Plex Player is latest version : 8.7.2.20952
Plex server is also latest version : 1.20.3.3437
After re-anilysing the file it showed the DoVi data. But playing the file was still in HDR :(
You need the latest 8.8 version of plex. If you weren’t on the beta, i think the public releases just came out today.
Thanks....gonna download that one tonight and see if it works.

EDIT: Update Plex app to 8.8 and worked indeed. Thanks!!
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?
Media info:
Video
ID: 1
ID in the original source medium: 4113 (0x1011)
Format: HEVC
Format / Info: High Efficiency Video Coding
Profile format: Main 10 @ L5.1 @ High
HDR format: Dolby Vision, Version 1.0, dvhe.07.06, BL + EL + RPU, Blu-ray compatible / SMPTE ST 2094 App 4, Version 1, HDR10 + Profile B compatible
Codec ID: V_MPEGH / ISO / HEVC
Duration: 1 h 56 min
Bit rate: 78.4 Mbps
Width: 3,840 pixels
Height: 2,160 pixels
Aspect ratio: 16: 9
Frame rate mode: Constant
Frame rate: 23,976 (24000/1001) FPS
Color space: YUV
Chroma subsampling: 4: 2: 0 (Type 2)
Bit depth: 10 bits
Bits / (Pixel * Frame): 0.394
Stream size: 63.6 GiB (94%)
Language: English
Default: No.
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
Original source medium: Blu-ray
HongyuS
Posts: 8
Joined: Sat Sep 05, 2020 6:27 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by HongyuS »

yusesope wrote:
Fri Oct 23, 2020 10:45 am
The mysterybox sample (the one with profile 8.1) is FHD (1920 × 1080): did we download the same file?
Mine are UHD (3840 x 2160): it would be an unequal comparison :mrgreen: !

Would you tell me exactly which sample produced by my tool you tried? It is important to know because "-mode 2" has undergone some changes over time!
I leave you a SAMPLE (video only - profile 8.1 derived from a FEL) obtained with the latest version of my tool and adapted to meet what I believe are the needs of macOS Big Sur. I don't know if it will be played but it doesn't hurt to try!
Tried your new sample, but it does not trigger DoVi on macOS Big Sur.
It plays in HDR10 mode, and works fine. Good job. Guess Apple does not support profile 8.1 after all (but still don't know why QuickTime can play the incorrect profile 8.1 files).

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!!!
Please share a Mac version of your tool, or just the source code, so I can test it on my machine!
yusesope wrote:
Fri Oct 23, 2020 10:45 am
The correct codec ID (for profile 8.1) should be "hvc1" in place of "hev1". But be careful, these boxes are not random: they indicate to the decoder how the information for the initialization of the latter is stored within the file. Changing the header with a hex editor isn't always enough!
Thanks for your reminding! You are right. I also double checked the iPhone 12 Pro sample, can confirm that profile 8 does not use "dv**" FourCC.

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.

However, change FourCC in profile 5 file ("dvhe" -> "dvh1") works (for both HD and UHD samples)!
ragico
Posts: 257
Joined: Fri Feb 15, 2019 1:09 am

Re: Dolby Vision now possible through MP4 Mux.

Post by ragico »

yusesope wrote:
Fri Oct 23, 2020 10:45 am
ragico wrote:
Thu Oct 22, 2020 10:55 pm
2) src\Gpac\gpac.exe -i pipe://video:ext=hevc:audelim=true -o stdout:ext=ts:pes_pack=none | src\FFmpeg\ffmpeg_win_x64.exe -hide_banner -y -i - -i I:\BDMV\STREAM\00018.m2ts -map 0:0 -map 1:2 -c copy -bsf:v hevc_metadata=aud=insert -metadata title=
"Transformers_____________________________________"
D:\Transformers.mkv
The first command line is fine, in the second there are two invisible mistakes!
You entered two "newline" characters (sei andato a capo due volte): one immediately after title= and the other after the underscores and the quotation mark (before the address of the output file).
Look HERE.

The command line is a single long line and the only spacing character allowed is the space.
You can help yourself with THIS online tool for removing line breaks.

the second command line should be (look at the parts in red):
src\Gpac\gpac.exe -i pipe://video:ext=hevc:audelim=true -o stdout:ext=ts:pes_pack=none | src\FFmpeg\ffmpeg_win_x64.exe -hide_banner -y -i - -i I:\BDMV\STREAM\00018.m2ts -map 0:0 -map 1:2 -c copy -bsf:v hevc_metadata=aud=insert -metadata title="Transformers_____________________________________" D:\Transformers.mkv
No space between title= and the next quotation mark.
A simple space between the last quotation mark and the address of the output file.
Thanks Yusesope again. Followed your advices and made an entire movie in prof 8.1 which plays DV in Firestick.
My remaining problem is how to choose the italian audio track from the m2ts. I know for you would be easy but for me is impossible to do.
Anyway you are simply an extraordinary man.

EDIT:
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.
Last edited by ragico on Fri Oct 23, 2020 10:25 pm, edited 2 times in total.
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 1:16 pm
Buzzie wrote:
Thu Oct 22, 2020 7:41 am
shawnc22 wrote:
Wed Oct 21, 2020 10:14 pm

You need the latest 8.8 version of plex. If you weren’t on the beta, i think the public releases just came out today.
Thanks....gonna download that one tonight and see if it works.

EDIT: Update Plex app to 8.8 and worked indeed. Thanks!!
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?
Media info:
Video
ID: 1
ID in the original source medium: 4113 (0x1011)
Format: HEVC
Format / Info: High Efficiency Video Coding
Profile format: Main 10 @ L5.1 @ High
HDR format: Dolby Vision, Version 1.0, dvhe.07.06, BL + EL + RPU, Blu-ray compatible / SMPTE ST 2094 App 4, Version 1, HDR10 + Profile B compatible
Codec ID: V_MPEGH / ISO / HEVC
Duration: 1 h 56 min
Bit rate: 78.4 Mbps
Width: 3,840 pixels
Height: 2,160 pixels
Aspect ratio: 16: 9
Frame rate mode: Constant
Frame rate: 23,976 (24000/1001) FPS
Color space: YUV
Chroma subsampling: 4: 2: 0 (Type 2)
Bit depth: 10 bits
Bits / (Pixel * Frame): 0.394
Stream size: 63.6 GiB (94%)
Language: English
Default: No.
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
Original source medium: Blu-ray
Did you update the media server also to the latest version?? 1.20.xxx
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 3:17 pm
Tomas wrote:
Fri Oct 23, 2020 1:16 pm
Buzzie wrote:
Thu Oct 22, 2020 7:41 am


Thanks....gonna download that one tonight and see if it works.

EDIT: Update Plex app to 8.8 and worked indeed. Thanks!!
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?
Media info:
Video
ID: 1
ID in the original source medium: 4113 (0x1011)
Format: HEVC
Format / Info: High Efficiency Video Coding
Profile format: Main 10 @ L5.1 @ High
HDR format: Dolby Vision, Version 1.0, dvhe.07.06, BL + EL + RPU, Blu-ray compatible / SMPTE ST 2094 App 4, Version 1, HDR10 + Profile B compatible
Codec ID: V_MPEGH / ISO / HEVC
Duration: 1 h 56 min
Bit rate: 78.4 Mbps
Width: 3,840 pixels
Height: 2,160 pixels
Aspect ratio: 16: 9
Frame rate mode: Constant
Frame rate: 23,976 (24000/1001) FPS
Color space: YUV
Chroma subsampling: 4: 2: 0 (Type 2)
Bit depth: 10 bits
Bits / (Pixel * Frame): 0.394
Stream size: 63.6 GiB (94%)
Language: English
Default: No.
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
Original source medium: Blu-ray
Did you update the media server also to the latest version?? 1.20.xxx
Yes
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: 311
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: 257
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.
Post Reply