Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
shawnc22
Posts: 222
Joined: Tue Jan 21, 2020 7:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by shawnc22 » Thu Mar 19, 2020 10:35 pm

yusesope wrote:
Thu Mar 19, 2020 7:03 pm
shawnc22 wrote:
Wed Mar 18, 2020 4:10 pm
yusesope wrote:
Wed Mar 18, 2020 10:58 am
This time it's not my fault :lol: !
There seems to be a little bit missing in the BL Layer: my program is in eternal expectation of a data that will never arrive! What is the title of the movie?
Ah odd that the temp version of the v2 tool worked and v3 did not.
v0.0.2 was bugged: for this reason has been replaced by version 0.0.3 (which has instead identified the problem)
The "The source file seems to be damaged" is quite explanatory.


############################################################
I also took a look at the tsMuxeR code and I think I have identified the reason why your .ts files are marked with the profile dvhe.08 (the profile dvhe.04 should be the right one since dvhe.08 does not have the Enhancement Layer).

I believe the problem occurs HERE: all Single Track Double Layer files are treated as Single Track Single Layer files.

Examples:
  • THIS LG demo (dvhe.04) is remuxed in a dvhe.05 file
  • Joker's BL + EL + RPU raw stream that I uploaded some time ago (HERE) is flagged as dvhe.08 (like your remuxes).
The choice of the profile is due to the value of "DVCompatibility"

The presence of EL should be used to distinguish a Double Layer file from a Single Layer file.

If any of you attend the tsMuxeR developer forum, could you please report it?
So they can check if I said a nonsense or not :mrgreen:
So one last thing with that problematic movie. I stripped out the BL layer from the mkv that I made out of the original disk, and it surprisingly mixed successfully (equal AUDs) with the EL layer I had extracted prior from the decrypted M2TS. But once muxed back into the TS container with the Atmos audio, there was definitely a hiccup in the video at the 0:43:35 mark and the audio became desynced thereafter. Odd that there was no hiccup in playback of the mkv file though at the same point, so the EL is seemingly the problematic source even though the original BL was the one with the missing AUD.

Anyways moving on, I wanted to test out your theory with the tsmuxer code but didn't really want to dig through the whole logic with DVCompatibility (nor do I really understand it), so I just commented out that entire conditional block with the "Duallayers" variable and simply forced the DV profile to 4 (bitWriter.putBits(7,4)). After compiling this small change in a5180007's latest build, i retested the Joker BL+EL+RPU file and out came with this:

Code: Select all

General
ID                                       : 1 (0x1)
Complete name                            : Z:\TS\Joker_BL_EL_RPU_PROF4.ts
Format                                   : MPEG-TS
File size                                : 93.8 MiB
Duration                                 : 23 s 607 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 33.1 Mb/s
Maximum Overall bit rate                 : 35.5 Mb/s

Video
ID                                       : 4117 (0x1015)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : Dolby Vision, Version 1.0, dvhe.04.06, BL+EL+RPU / SMPTE ST 2086, HDR10 compatible
Codec ID                                 : 36
Duration                                 : 23 s 648 ms
Bit rate                                 : 31.5 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
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.158
Stream size                              : 88.8 MiB (95%)
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              : 992 cd/m2
Maximum Frame-Average Light Level        : 120 cd/m2
Triggers DV on the shield and looks pretty much the same as the profile 8 video. Again, I know what I did was very hacky as I was just curious if changing the DV profile would do anything :lol: . Perhaps after the devs take a look at it and implement a real change, there will be some noticeable differences.

rosavanwinkle
Posts: 50
Joined: Fri Aug 09, 2019 11:10 am

Re: Dolby Vision now possible through MP4 Mux.

Post by rosavanwinkle » Thu Mar 19, 2020 10:56 pm

RESET_9999 wrote:
Thu Mar 19, 2020 10:24 pm
Alldu wrote:
Thu Mar 19, 2020 9:44 pm
Hy guys, anybody know what's the best way to embed sub/idx or ass subtitles into the DV mp4? I play my DV files via X700 and for some reason it can't read ass subs properly and sub/idx at all, if I put them in the same folder as DV mp4. Thanks!
You don't have to use the MP4 container anymore with the x700. You can remux your UHD bluray disc directly to .TS or .M2TS using this tsMuxer:

https://drive.google.com/file/d/1IWYPO4 ... sp=sharing

DV, Atmos and subs will work.

so wait you got all 3 to work together but on that X700 player not on the shield/build in LG player? or am i mistaken something?
Mediaplayer: Nvidia Shield TV Pro
TV: LG 55SK7900PLA
plex pass user

VOLUNTEER FOR TESTING FILES AND SCRIPTS.

planet_hoarder
Posts: 9
Joined: Tue Mar 17, 2020 10:32 am

Re: Dolby Vision now possible through MP4 Mux.

Post by planet_hoarder » Thu Mar 19, 2020 11:13 pm

rosavanwinkle wrote:
Thu Mar 19, 2020 10:56 pm
RESET_9999 wrote:
Thu Mar 19, 2020 10:24 pm
Alldu wrote:
Thu Mar 19, 2020 9:44 pm
Hy guys, anybody know what's the best way to embed sub/idx or ass subtitles into the DV mp4? I play my DV files via X700 and for some reason it can't read ass subs properly and sub/idx at all, if I put them in the same folder as DV mp4. Thanks!
You don't have to use the MP4 container anymore with the x700. You can remux your UHD bluray disc directly to .TS or .M2TS using this tsMuxer:

https://drive.google.com/file/d/1IWYPO4 ... sp=sharing

DV, Atmos and subs will work.

so wait you got all 3 to work together but on that X700 player not on the shield/build in LG player? or am i mistaken something?
Built-in LG player doesn't support Atmos, even on C9 with eARC (unless they updated)
but bitstreams Atmos with no problems if you can play it (e.g. HTPC)

RESET_9999
Posts: 154
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 » Thu Mar 19, 2020 11:21 pm

rosavanwinkle wrote:
Thu Mar 19, 2020 10:56 pm
so wait you got all 3 to work together but on that X700 player not on the shield/build in LG player? or am i mistaken something?
yep but so far, Dual layer DV + Atmos TS(or m2ts) only works on the x700 and the oppo.

A friend of mine tried the Philips and LG DV Bluray player which both support dual layer DV MP4 but no success.
Please forgive my weak English.
Sony x700 ----> Denon AVR ----> LG OLED C8

rosavanwinkle
Posts: 50
Joined: Fri Aug 09, 2019 11:10 am

Re: Dolby Vision now possible through MP4 Mux.

Post by rosavanwinkle » Fri Mar 20, 2020 12:10 am

i rather have a nice dolby vision that works perfect then a atmos sound,since i dont have a full atmos sound system atm xD
Mediaplayer: Nvidia Shield TV Pro
TV: LG 55SK7900PLA
plex pass user

VOLUNTEER FOR TESTING FILES AND SCRIPTS.

kamus
Posts: 2
Joined: Thu Mar 19, 2020 9:30 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by kamus » Fri Mar 20, 2020 1:19 am

Did anyone ever find a fix for the stutter problems using Grencola's tool?

I haven't been able to get a single working file with that tool, they all stutter like crazy on my LG B9.

Grencola
Posts: 340
Joined: Sun Jan 27, 2019 5:19 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Grencola » Fri Mar 20, 2020 3:40 am

kamus wrote:
Fri Mar 20, 2020 1:19 am
Did anyone ever find a fix for the stutter problems using Grencola's tool?

I haven't been able to get a single working file with that tool, they all stutter like crazy on my LG B9.
are you using mkv remux or m2ts? had a few remuxes that stuttered, all m2ts have been fine though. I don't own a B9 but many others who do have no problems. you can try yusesope's tool and make a bl+el-rpu hevc then run that through mp4 muxer via profile 7.

Deihnyx
Posts: 9
Joined: Mon Jan 29, 2018 11:31 am

Re: Dolby Vision now possible through MP4 Mux.

Post by Deihnyx » Fri Mar 20, 2020 7:44 am

Hello,
I've also been having stuttering issues.
Tested on a OLED C7 and C9 with Emby/Plex. Also tested on Nvidia shield (2019)
My goal would be to have DV work on devices that can fully support it, otherwise fallback to HDR. I'm fully aware that Atmos will not work on WebOS client and I'm ok with it.
I used Joker for testing.
So:
  • On C7 WebOS, It should play DV, AC3 5.1 Core
  • On C9 WebOS, It should play DV, AC3 5.1 Core
  • On Nvidia Shield it should play DV, Atmos
I used the method described in the past threads.
  • ffmpeg to decode the BL + EL layer

    Code: Select all

    ffmpeg -i bluray:H:\ -map 0:0 -c copy D:\output\BL.hevc -map 0:1 -c copy D:\output\EL.hevc
    
  • yusesope's script to merge the layers (all counters to 100%)

    Code: Select all

    python src\bl_el_rpu_builder.py -bl D:\output\BL.hevc -el D:\output\EL.hevc -of D:\output\Full.hevc
    
  • tsmuxer to remux the new hevc + truehd atmos to TS
On the C7:
  • If I pick the TrueHD file, Emby goes into direct streaming (downgrade the sound) and HDR shows up
  • If I pick the Core AC3 file, black screen
On the C9:
  • If I pick the TrueHD file, Emby goes into direct streaming (downgrade the sound) and HDR shows up (e-ARC doesn't work as it should, but that's a known issue)
  • If I pick the Core AC3 file, Dolby Vision shows up, but it stutters really really bad
On Shield 2019 (DV is enabled)
  • If I pick the TrueHD file, HDR is triggered (direct play) on C7, Dolby Vision on C9. Only Plex works.
  • If I pick the Core AC3 file, HDR is triggered (direct play) on C7, Dolby Vision on C9. Only Plex works.
    Not sure why the result would be different between the C7 and the C9 while running on Shield though...
I'm really not sure what's going on. Are TS DV not working at all with the OLED or does it need a different dv profile?
I'd like to avoid having to make a mp4 and a ts version of each movie depending of the source.

MediaInfo:

Code: Select all

General
ID                             : 1 (0x1)
Complete name                  : \\192.168.0.200\movies\Movies\Joker (2019)\Joker (2019) - UHD.ts
Format                         : MPEG-TS
File size                      : 48.6 GiB
Duration                       : 2 h 1 min
Overall bit rate mode          : Variable
Overall bit rate               : 57.1 Mb/s
Maximum Overall bit rate       : 35.5 Mb/s

Video
ID                             : 4117 (0x1015)
Menu ID                        : 1 (0x1)
Format                         : HEVC
Format/Info                    : High Efficiency Video Coding
Format profile                 : Main 10@L5.1@High
HDR format                     : Dolby Vision, Version 1.0, dvhe.08.06, BL+EL+RPU / SMPTE ST 2086, HDR10 compatible
Codec ID                       : 36
Duration                       : 2 h 1 min
Bit rate                       : 53.7 Mb/s
Width                          : 3 840 pixels
Height                         : 2 160 pixels
Display aspect ratio           : 16:9
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.270
Stream size                    : 45.7 GiB (94%)
Language                       : English
Color range                    : Limited
Color primaries                : BT.2020
Transfer characteristics       : PQ
Matrix coefficients            : BT.2020 non-constant
Mastering display color primar : Display P3
Mastering display luminance    : min: 0.0050 cd/m2, max: 4000 cd/m2
Maximum Content Light Level    : 992 cd/m2
Maximum Frame-Average Light Le : 120 cd/m2

Audio
ID                             : 4352 (0x1100)
Menu ID                        : 1 (0x1)
Format                         : AC-3 MLP FBA 16-ch
Format/Info                    : Audio Coding 3 + Meridian Lossless Packing FBA with 16-channel presentation
Commercial name                : Dolby TrueHD with Dolby Atmos
Muxing mode                    : Stream extension
Codec ID                       : 131
Duration                       : 2 h 1 min
Bit rate mode                  : Variable
Bit rate                       : 640 kb/s
Maximum bit rate               : 7 158 kb/s
Channel(s)                     : 8 channels
Channel layout                 : L R C LFE Ls Rs Lb Rb
Sampling rate                  : 48.0 kHz
Frame rate                     : 31.250 FPS (1536 SPF)
Compression mode               : Lossy
Stream size                    : 558 MiB (1%)
Language                       : English
Service kind                   : Complete Main
Number of dynamic objects      : 15
Bed channel count              : 1 channel
Bed channel configuration      : LFE

yusesope
Posts: 118
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope » Fri Mar 20, 2020 10:58 am

baker99 wrote:
Thu Mar 19, 2020 9:12 pm
I have posted it on the forum for you
I really appreciate it. Thank you.



shawnc22 wrote:
Thu Mar 19, 2020 10:35 pm
So one last thing with that problematic movie. I stripped out the BL layer from the mkv that I made out of the original disk, and it surprisingly mixed successfully (equal AUDs) with the EL layer I had extracted prior from the decrypted M2TS. But once muxed back into the TS container with the Atmos audio, there was definitely a hiccup in the video at the 0:43:35 mark and the audio became desynced thereafter. Odd that there was no hiccup in playback of the mkv file though at the same point, so the EL is seemingly the problematic source even though the original BL was the one with the missing AUD.
It's a cursed movie. It is the only explanation. :twisted: :twisted: :twisted:
shawnc22 wrote:
Thu Mar 19, 2020 10:35 pm
I just commented out that entire conditional block with the "Duallayers" variable and simply forced the DV profile to 4 (bitWriter.putBits(7,4))
...
Triggers DV on the shield and looks pretty much the same as the profile 8 video. Again, I know what I did was very hacky as I was just curious if changing the DV profile would do anything :lol: . Perhaps after the devs take a look at it and implement a real change, there will be some noticeable differences.
Yes, it was exactly what I meant.
Changing the profile does not affect the visual quality ( :wink: ) but I think it is important to correctly signal the Dolby Vision track to the hardware decoder.
In the case of an MPEG-2 TS it is important that a Registration Descriptor with the value 0x0504444F5649 is created (
you can search for these 6 bytes in your ts files with any hex editor like HxD) and that the DOVI_video_stream_descriptor (the part of the program you edited) is constructed with a precise semantics.
In the official document it says that "The el_present_flag set according to the profile. Note that certain profiles defined in Signaling Dolby Vision Profiles and Levels do not include an EL."
Profile 8 does not have the EL layer, 4 does.

As for the DVCompatibility value, it was used to choose between profile 8 and 5 (the part of the program you excluded).

In the case of a profile 4, according to the guidelines, cross-compatibility should be set to SDR (DVCompatibility = 2). My files are reported as compatible with HDR10: tsMuxeR correctly manages the VUIs (0,9,16,9,2) while my file is slightly out of standard (as it is derived from a UHD-BD). But the behavior of the decoder is not dependent on these Dolby Vision defined crosscompatibility IDs, so we're safe!



Deihnyx wrote:
Fri Mar 20, 2020 7:44 am
I used the method described in the past threads.
  • ffmpeg to decode the BL + EL layer

    Code: Select all

    ffmpeg -i bluray:H:\ -map 0:0 -c copy D:\output\BL.hevc -map 0:1 -c copy D:\output\EL.hevc
    
  • yusesope's script to merge the layers (all counters to 100%)

    Code: Select all

    python src\bl_el_rpu_builder.py -bl D:\output\BL.hevc -el D:\output\EL.hevc -of D:\output\Full.hevc
    
  • tsmuxer to remux the new hevc + truehd atmos to TS
Everything seems OK to me.

To try to understand where the problem lies, I recommend you:
Download version_0.0.3_revision_1 of my tool and start it with the command:

Code: Select all

python bl_el_rpu_builder_v0.0.3_rev_1.py -bl D:\output\BL.hevc -el D:\output\EL.hevc -of D:\output\New_Full.hevc
It is important that all the counters reach 100%, that the total number of BL AUDs is equal to those of EL Layer and that the program ends with the invitation to "press a button to exit".

If everything was ok, I recommend, before using tsMuxeR, to test only the video with mp4muxer (HERE) by trying both profile 4 and profile 7 (it takes some time).

Code: Select all

mp4muxer -i D:\output\New_Full.hevc --dv-profile 4 -o D:\output\New_Full_dvhe04.mp4

Code: Select all

mp4muxer -i D:\output\New_Full.hevc --dv-profile 7 -o D:\output\New_Full_dvhe07.mp4
If the video is displayed correctly on your devices then add the audio with tsMuxeR (as you did previously).
If that doesn't work, try creating a BL + RPU file by adding the "-mode 2" switch to my script.

Code: Select all

python bl_el_rpu_builder_v0.0.3_rev_1.py -mode 2 -bl D:\output\BL.hevc -el D:\output\EL.hevc -of D:\output\BL_RPU.hevc

MastaG
Posts: 42
Joined: Thu Aug 08, 2019 11:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by MastaG » Fri Mar 20, 2020 1:18 pm

yusesope wrote:
Fri Mar 20, 2020 10:58 am
To try to understand where the problem lies, I recommend you:
Download version_0.0.3_revision_1 of my tool and start it with the command:

Code: Select all

python bl_el_rpu_builder_v0.0.3_rev_1.py -bl D:\output\BL.hevc -el D:\output\EL.hevc -of D:\output\New_Full.hevc
It is important that all the counters reach 100%, that the total number of BL AUDs is equal to those of EL Layer and that the program ends with the invitation to "press a button to exit".

If everything was ok, I recommend, before using tsMuxeR, to test only the video with mp4muxer (HERE) by trying both profile 4 and profile 7 (it takes some time).

Code: Select all

mp4muxer -i D:\output\New_Full.hevc --dv-profile 4 -o D:\output\New_Full_dvhe04.mp4

Code: Select all

mp4muxer -i D:\output\New_Full.hevc --dv-profile 7 -o D:\output\New_Full_dvhe07.mp4
If the video is displayed correctly on your devices then add the audio with tsMuxeR (as you did previously).
If that doesn't work, try creating a BL + RPU file by adding the "-mode 2" switch to my script.

Code: Select all

python bl_el_rpu_builder_v0.0.3_rev_1.py -mode 2 -bl D:\output\BL.hevc -el D:\output\EL.hevc -of D:\output\BL_RPU.hevc
So if I understand correctly, by muxing the hevc file first into mp4 container with dolby's mp4muxer, it will get the correct profile (eg 04 or 07).
So this is like a workaround when muxing the hevc file directly using TSMuxeR's causing profile 08 to be set?

yusesope
Posts: 118
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope » Fri Mar 20, 2020 1:55 pm

MastaG wrote:
Fri Mar 20, 2020 1:18 pm
So if I understand correctly, by muxing the hevc file first into mp4 container with dolby's mp4muxer, it will get the correct profile (eg 04 or 07).
So this is like a workaround when muxing the hevc file directly using TSMuxeR's causing profile 08 to be set?
No, it's only for testing purpose.

kazuma
Posts: 37
Joined: Fri Nov 08, 2019 9:51 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by kazuma » Fri Mar 20, 2020 3:37 pm

why dvdfab isn't work well anymore? is this because the new updates? i have problems with 1917 and more others. i have a black screen on my lg c9. anyone else?

shawnc22
Posts: 222
Joined: Tue Jan 21, 2020 7:40 am

Re: Dolby Vision now possible through MP4 Mux.

Post by shawnc22 » Fri Mar 20, 2020 3:38 pm

Deihnyx wrote:
Fri Mar 20, 2020 7:44 am
Hello,
I've also been having stuttering issues.
Tested on a OLED C7 and C9 with Emby/Plex. Also tested on Nvidia shield (2019)
My goal would be to have DV work on devices that can fully support it, otherwise fallback to HDR. I'm fully aware that Atmos will not work on WebOS client and I'm ok with it.
I used Joker for testing.
So:
  • On C7 WebOS, It should play DV, AC3 5.1 Core
  • On C9 WebOS, It should play DV, AC3 5.1 Core
  • On Nvidia Shield it should play DV, Atmos
I may be wrong but I don't believe that the "AC3 core" is an actual track that can be played. You'd either have to convert that truehd track into LPCM like you'd do for the mp4 method or include one of the other non-truehd tracks from the original disk into the TS container.
yusesope wrote:
Fri Mar 20, 2020 10:58 am
As for the DVCompatibility value, it was used to choose between profile 8 and 5 (the part of the program you excluded).
Right, I saw that part and started to backtrack the code to see how I can correctly change DualLayers and m_hdr->isHDR10 to fall into the other side of the conditional and choose profile 4 on its own, but it eventually got too much for my understanding of the subject and hence the hacky change :lol: . I'll leave it up the real devs to make the correct changes

jcdr428
Posts: 31
Joined: Fri Mar 20, 2020 6:55 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by jcdr428 » Fri Mar 20, 2020 7:30 pm

shawnc22 wrote:
Fri Mar 20, 2020 3:38 pm
Right, I saw that part and started to backtrack the code to see how I can correctly change DualLayers and m_hdr->isHDR10 to fall into the other side of the conditional and choose profile 4 on its own, but it eventually got too much for my understanding of the subject and hence the hacky change :lol: . I'll leave it up the real devs to make the correct changes
Hi all, so I registered to the forum, as it will certainly be more efficient than members notifying of discussions from here on the tsMuxer forum (thanks @baker99). By the way I am far from being a 'real dev'...

Patch for tsMuxer profile 4 / single track double layer has been pushed here.

@yusesope, according to the DV profile & level document, profile 4 is normally limited to BL signal cross-compatibility ID 2 = SDR with VUI BL 0, 1, 1, 1, 0 EL 1, 2, 2, 2, 0. Your profile 4 single track files created from Blu-ray double tracks have VUI BL & EL 0, 9, 16, 9, 2. I don't have any DV hardware to test lecture of the files, should I keep BL signal cross-compatibility ID to 6, or change it to 2 ?

oldirtydog
Posts: 3
Joined: Fri Mar 20, 2020 9:09 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by oldirtydog » Fri Mar 20, 2020 9:17 pm

with eactogui i create a 1.hevc 2.hevc and 3.ac3 but when i trying to make it in 1 i had error ac3 something... http://alfa.kachi-snimka.info/vij.php?i ... 8992o.jpeg

Post Reply