Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
Donpoku
Posts: 46
Joined: Wed Jul 03, 2019 3:43 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Donpoku »

Behemoth thanks to yusesope and Grencola, you guys are doing fantastic work for our dream of DV.mp4.atmos. I've also voted on the plex forum.
yusesope
Posts: 221
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope »

justinadams wrote:
Wed Nov 13, 2019 4:03 am
Here's logcat
Thanks for the logcat.
From what I understand, the first part takes place, it would seem, regularly (the log is pretty self explanatory)

Code: Select all

11-12 21:07:10.687 11868 11868 I ExoPlayerImpl: Init 48955d2 [ExoPlayerLib/2.10.7] [mdarcy, SHIELD Android TV, NVIDIA, 28]
11-12 21:07:10.726 11868 11868 D EventLogger: state [0.01, 0.00, window=0, true, BUFFERING]
11-12 21:07:10.829 11868 11868 D EventLogger: surfaceSizeChanged [0.12, 0.00, window=0, 1920, 1080]
11-12 21:07:10.835 11868 11868 D EventLogger: timelineChanged [0.12, 0.00, window=0, periodCount=1, windowCount=1, reason=PREPARED
11-12 21:07:10.835 11868 11868 D EventLogger:   period [?]
11-12 21:07:10.835 11868 11868 D EventLogger:   window [?, false, false]
11-12 21:07:10.835 11868 11868 D EventLogger: ]
11-12 21:07:10.917 11868 11868 D EventLogger: mediaPeriodCreated [0.20, 0.00, window=0, period=0]
11-12 21:07:10.918 11868 11868 D EventLogger: loading [0.21, 0.00, window=0, period=0, true]
11-12 21:07:14.528 11868 11868 D EventLogger: timelineChanged [3.82, 0.00, window=0, period=0, periodCount=1, windowCount=1, reason=DYNAMIC
11-12 21:07:14.529 11868 11868 D EventLogger:   period [8201.78]
11-12 21:07:14.529 11868 11868 D EventLogger:   window [8201.78, true, false]
11-12 21:07:14.529 11868 11868 D EventLogger: ]
11-12 21:07:14.624 11868 11868 D EventLogger: decoderEnabled [3.91, 0.00, window=0, period=0, video]
11-12 21:07:14.625 11868 11868 D EventLogger: decoderEnabled [3.91, 0.00, window=0, period=0, audio]
11-12 21:07:14.626 11868 11868 D EventLogger: tracksChanged [3.91, 0.00, window=0, period=0, 
11-12 21:07:14.626 11868 11868 D EventLogger:   Renderer:0 [
11-12 21:07:14.626 11868 11868 D EventLogger:     Group:0, adaptive_supported=N/A [
11-12 21:07:14.627 11868 11868 D EventLogger:       [X] Track:0, id=1, mimeType=video/dolby-vision, codecs=dvhe.05.06, res=3840x2160, fps=23.976023, supported=YES
11-12 21:07:14.627 11868 11868 D EventLogger:     ]
11-12 21:07:14.627 11868 11868 D EventLogger:   ]
11-12 21:07:14.627 11868 11868 D EventLogger:   Renderer:2 [
11-12 21:07:14.627 11868 11868 D EventLogger:     Group:0, adaptive_supported=N/A [
11-12 21:07:14.627 11868 11868 D EventLogger:       [X] Track:0, id=2, mimeType=audio/true-hd, channels=8, sample_rate=48000, language=und, supported=YES
11-12 21:07:14.627 11868 11868 D EventLogger:     ]
11-12 21:07:14.627 11868 11868 D EventLogger:   ]
11-12 21:07:14.627 11868 11868 D EventLogger: ]
11-12 21:07:14.631 11868 11868 D EventLogger: mediaPeriodReadingStarted [3.92, 0.00, window=0, period=0]
11-12 21:07:14.632 11868 11868 D EventLogger: downstreamFormatChanged [3.92, 0.00, window=0, period=0, id=1, mimeType=video/dolby-vision, codecs=dvhe.05.06, res=3840x2160, fps=23.976023]
11-12 21:07:14.694 11868 11868 D EventLogger: decoderInitialized [3.98, 0.00, window=0, period=0, video, OMX.Nvidia.DOVI.decode]
11-12 21:07:14.696 11868 11868 D EventLogger: decoderInputFormatChanged [3.98, 0.00, window=0, period=0, video, id=1, mimeType=video/dolby-vision, codecs=dvhe.05.06, res=3840x2160, fps=23.976023]
11-12 21:07:14.706 11868 11868 D EventLogger: downstreamFormatChanged [3.99, 0.00, window=0, period=0, id=2, mimeType=audio/true-hd, channels=8, sample_rate=48000, language=und]
11-12 21:07:14.865 11868 11868 D EventLogger: decoderInitialized [4.15, 0.00, window=0, period=0, audio, OMX.google.raw.decoder]
11-12 21:07:14.866 11868 11868 D EventLogger: decoderInputFormatChanged [4.15, 0.00, window=0, period=0, audio, id=2, mimeType=audio/true-hd, channels=8, sample_rate=48000, language=und]
11-12 21:07:15.160 11868 11868 D EventLogger: audioSessionId [4.45, 0.00, window=0, period=0, 8009]
11-12 21:07:15.172 11868 11868 D EventLogger: videoSizeChanged [4.46, 0.00, window=0, period=0, 3840, 2160]
11-12 21:07:15.192 11868 11868 D EventLogger: renderedFirstFrame [4.48, 0.00, window=0, period=0, Surface(name=null)/@0xadd393d]
After this last instruction (renderedFirstFrame) there are hundreds of lines that report

Code: Select all

11-12 21:07:15.209 11868 11906 E AudioTrack: Discontinuity detected [expected 226666, got 14166]
11-12 21:07:15.250 11868 11906 E AudioTrack: Discontinuity detected [expected 240833, got 28333]
11-12 21:07:15.276 11868 11906 E AudioTrack: Discontinuity detected [expected 255000, got 42500]
11-12 21:07:15.305 11868 11906 E AudioTrack: Discontinuity detected [expected 269166, got 56666]
11-12 21:07:15.326 11868 11906 E AudioTrack: Discontinuity detected [expected 283333, got 70833]
11-12 21:07:15.346 11868 11906 E AudioTrack: Discontinuity detected [expected 297500, got 85000]
11-12 21:07:15.366 11868 11906 E AudioTrack: Discontinuity detected [expected 311666, got 99166]
11-12 21:07:15.388 11868 11906 E AudioTrack: Discontinuity detected [expected 325833, got 113333]
11-12 21:07:15.408 11868 11906 E AudioTrack: Discontinuity detected [expected 340000, got 127500]
11-12 21:07:15.428 11868 11906 E AudioTrack: Discontinuity detected [expected 354166, got 141666]
11-12 21:07:15.448 11868 11906 E AudioTrack: Discontinuity detected [expected 368333, got 155833]
11-12 21:07:15.475 11868 11906 E AudioTrack: Discontinuity detected [expected 382500, got 170000]
....................................................
..........................................
...................................
.......................
What happens is explained HERE (starting from line 650).
Translated into human language:
if the difference between the expected playback time and the playback time obtained from the audio analysis is greater than 200000 (microseconds) then calculate the "adjustmentUs" value (line 659) and add it to startMediaTimeUs (line 660).

This operation is repeated for hundreds of times.
I noticed that the difference between the expected value and the one obtained is always 212500 μs (slightly higher than the value in the code).
If you do the maths, the value of adjustmentUs will always be equal to -212500 μs and consequently the value of startMediaTimeUs will be constantly decreased.

What does this mean?
At some point, this line appears in the log

Code: Select all

11-12 21:07:19.035 11868 11868 D EventLogger: loading [8.32, -27.61, window=0, period=0, false]
the second value (the meaning of the others can be found HERE) indicates the current playback time and is negative.
Instead, it should be positive and it should increase over time (as it happens in all media players).

Here's what happens, the audio is played but the video track is not because it is constantly delayed (it practically never starts).

How do I try to solve the problem?
Increasing the value present in the code (from 200000 μs to 400000 μs).

I don't know why 200000 was chosen (maybe someone can explain it to me).
It seems to me an arbitrary value useful to keep the audio in sync: what could go wrong if I change it slightly? :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen:
I don't know if this will solve the problem but there is no harm in trying! :D

Anyone who agrees with my reasoning can download the new version of the app HERE.
You should already have the server, so I won't upload it this time.

As always let me know (and if possible attach the logs).
baker99
Posts: 84
Joined: Wed Oct 30, 2019 7:05 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by baker99 »

yusesope wrote:
Wed Nov 13, 2019 6:44 pm
justinadams wrote:
Wed Nov 13, 2019 4:03 am
Here's logcat
Thanks for the logcat.
From what I understand, the first part takes place, it would seem, regularly (the log is pretty self explanatory)

Code: Select all

11-12 21:07:10.687 11868 11868 I ExoPlayerImpl: Init 48955d2 [ExoPlayerLib/2.10.7] [mdarcy, SHIELD Android TV, NVIDIA, 28]
11-12 21:07:10.726 11868 11868 D EventLogger: state [0.01, 0.00, window=0, true, BUFFERING]
11-12 21:07:10.829 11868 11868 D EventLogger: surfaceSizeChanged [0.12, 0.00, window=0, 1920, 1080]
11-12 21:07:10.835 11868 11868 D EventLogger: timelineChanged [0.12, 0.00, window=0, periodCount=1, windowCount=1, reason=PREPARED
11-12 21:07:10.835 11868 11868 D EventLogger:   period [?]
11-12 21:07:10.835 11868 11868 D EventLogger:   window [?, false, false]
11-12 21:07:10.835 11868 11868 D EventLogger: ]
11-12 21:07:10.917 11868 11868 D EventLogger: mediaPeriodCreated [0.20, 0.00, window=0, period=0]
11-12 21:07:10.918 11868 11868 D EventLogger: loading [0.21, 0.00, window=0, period=0, true]
11-12 21:07:14.528 11868 11868 D EventLogger: timelineChanged [3.82, 0.00, window=0, period=0, periodCount=1, windowCount=1, reason=DYNAMIC
11-12 21:07:14.529 11868 11868 D EventLogger:   period [8201.78]
11-12 21:07:14.529 11868 11868 D EventLogger:   window [8201.78, true, false]
11-12 21:07:14.529 11868 11868 D EventLogger: ]
11-12 21:07:14.624 11868 11868 D EventLogger: decoderEnabled [3.91, 0.00, window=0, period=0, video]
11-12 21:07:14.625 11868 11868 D EventLogger: decoderEnabled [3.91, 0.00, window=0, period=0, audio]
11-12 21:07:14.626 11868 11868 D EventLogger: tracksChanged [3.91, 0.00, window=0, period=0, 
11-12 21:07:14.626 11868 11868 D EventLogger:   Renderer:0 [
11-12 21:07:14.626 11868 11868 D EventLogger:     Group:0, adaptive_supported=N/A [
11-12 21:07:14.627 11868 11868 D EventLogger:       [X] Track:0, id=1, mimeType=video/dolby-vision, codecs=dvhe.05.06, res=3840x2160, fps=23.976023, supported=YES
11-12 21:07:14.627 11868 11868 D EventLogger:     ]
11-12 21:07:14.627 11868 11868 D EventLogger:   ]
11-12 21:07:14.627 11868 11868 D EventLogger:   Renderer:2 [
11-12 21:07:14.627 11868 11868 D EventLogger:     Group:0, adaptive_supported=N/A [
11-12 21:07:14.627 11868 11868 D EventLogger:       [X] Track:0, id=2, mimeType=audio/true-hd, channels=8, sample_rate=48000, language=und, supported=YES
11-12 21:07:14.627 11868 11868 D EventLogger:     ]
11-12 21:07:14.627 11868 11868 D EventLogger:   ]
11-12 21:07:14.627 11868 11868 D EventLogger: ]
11-12 21:07:14.631 11868 11868 D EventLogger: mediaPeriodReadingStarted [3.92, 0.00, window=0, period=0]
11-12 21:07:14.632 11868 11868 D EventLogger: downstreamFormatChanged [3.92, 0.00, window=0, period=0, id=1, mimeType=video/dolby-vision, codecs=dvhe.05.06, res=3840x2160, fps=23.976023]
11-12 21:07:14.694 11868 11868 D EventLogger: decoderInitialized [3.98, 0.00, window=0, period=0, video, OMX.Nvidia.DOVI.decode]
11-12 21:07:14.696 11868 11868 D EventLogger: decoderInputFormatChanged [3.98, 0.00, window=0, period=0, video, id=1, mimeType=video/dolby-vision, codecs=dvhe.05.06, res=3840x2160, fps=23.976023]
11-12 21:07:14.706 11868 11868 D EventLogger: downstreamFormatChanged [3.99, 0.00, window=0, period=0, id=2, mimeType=audio/true-hd, channels=8, sample_rate=48000, language=und]
11-12 21:07:14.865 11868 11868 D EventLogger: decoderInitialized [4.15, 0.00, window=0, period=0, audio, OMX.google.raw.decoder]
11-12 21:07:14.866 11868 11868 D EventLogger: decoderInputFormatChanged [4.15, 0.00, window=0, period=0, audio, id=2, mimeType=audio/true-hd, channels=8, sample_rate=48000, language=und]
11-12 21:07:15.160 11868 11868 D EventLogger: audioSessionId [4.45, 0.00, window=0, period=0, 8009]
11-12 21:07:15.172 11868 11868 D EventLogger: videoSizeChanged [4.46, 0.00, window=0, period=0, 3840, 2160]
11-12 21:07:15.192 11868 11868 D EventLogger: renderedFirstFrame [4.48, 0.00, window=0, period=0, Surface(name=null)/@0xadd393d]
After this last instruction (renderedFirstFrame) there are hundreds of lines that report

Code: Select all

11-12 21:07:15.209 11868 11906 E AudioTrack: Discontinuity detected [expected 226666, got 14166]
11-12 21:07:15.250 11868 11906 E AudioTrack: Discontinuity detected [expected 240833, got 28333]
11-12 21:07:15.276 11868 11906 E AudioTrack: Discontinuity detected [expected 255000, got 42500]
11-12 21:07:15.305 11868 11906 E AudioTrack: Discontinuity detected [expected 269166, got 56666]
11-12 21:07:15.326 11868 11906 E AudioTrack: Discontinuity detected [expected 283333, got 70833]
11-12 21:07:15.346 11868 11906 E AudioTrack: Discontinuity detected [expected 297500, got 85000]
11-12 21:07:15.366 11868 11906 E AudioTrack: Discontinuity detected [expected 311666, got 99166]
11-12 21:07:15.388 11868 11906 E AudioTrack: Discontinuity detected [expected 325833, got 113333]
11-12 21:07:15.408 11868 11906 E AudioTrack: Discontinuity detected [expected 340000, got 127500]
11-12 21:07:15.428 11868 11906 E AudioTrack: Discontinuity detected [expected 354166, got 141666]
11-12 21:07:15.448 11868 11906 E AudioTrack: Discontinuity detected [expected 368333, got 155833]
11-12 21:07:15.475 11868 11906 E AudioTrack: Discontinuity detected [expected 382500, got 170000]
....................................................
..........................................
...................................
.......................
What happens is explained HERE (starting from line 650).
Translated into human language:
if the difference between the expected playback time and the playback time obtained from the audio analysis is greater than 200000 (microseconds) then calculate the "adjustmentUs" value (line 659) and add it to startMediaTimeUs (line 660).

This operation is repeated for hundreds of times.
I noticed that the difference between the expected value and the one obtained is always 212500 μs (slightly higher than the value in the code).
If you do the maths, the value of adjustmentUs will always be equal to -212500 μs and consequently the value of startMediaTimeUs will be constantly decreased.

What does this mean?
At some point, this line appears in the log

Code: Select all

11-12 21:07:19.035 11868 11868 D EventLogger: loading [8.32, -27.61, window=0, period=0, false]
the second value (the meaning of the others can be found HERE) indicates the current playback time and is negative.
Instead, it should be positive and it should increase over time (as it happens in all media players).

Here's what happens, the audio is played but the video track is not because it is constantly delayed (it practically never starts).

How do I try to solve the problem?
Increasing the value present in the code (from 200000 μs to 400000 μs).

I don't know why 200000 was chosen (maybe someone can explain it to me).
It seems to me an arbitrary value useful to keep the audio in sync: what could go wrong if I change it slightly? :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen:
I don't know if this will solve the problem but there is no harm in trying! :D

Anyone who agrees with my reasoning can download the new version of the app HERE.
You should already have the server, so I won't upload it this time.

As always let me know (and if possible attach the logs).
unfortunately I get the same result as before, negative time is shown on the navigation bar. Sooo close, keep up the great work, sorry I don't have a debug file, need to set that up but too late tonight.
justinadams
Posts: 17
Joined: Sun Sep 08, 2019 4:31 am

Re: Dolby Vision now possible through MP4 Mux.

Post by justinadams »

Looks like same result.
logcat.txt
(1014.66 KiB) Downloaded 506 times
Grencola
Posts: 343
Joined: Sun Jan 27, 2019 5:19 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Grencola »

yusesope, I've tried a few of your test files using YusesoPlayer on the Amazon Fire TV Stick 4k and I get the same result: working hd-audio and dolby vision flag on the tv but just black video. However the single layer dvhe 5.06 mp4 sample files from LG play perfectly in dolby vision, both with your player and in mx player. getting close :)
baker99
Posts: 84
Joined: Wed Oct 30, 2019 7:05 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by baker99 »

Following the single layer DV guide with DTS audio is working great but the file sizes seem a lot smaller than the original m2ts files, is some compression going on or is it just due to less streams being in the output? Wondering if I have something set wrong in DVDFab, although it does say it's just copying.
agentreza
Posts: 6
Joined: Fri Nov 15, 2019 2:06 am

Re: Dolby Vision now possible through MP4 Mux.

Post by agentreza »

Hello peepz! Need some pointers - I have a dual layer dv movie remux in mp4, would like to convert that to a single layer mp4 with DVDFab to test on the new shield TV.
RESET_9999
Posts: 1853
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

baker99 wrote:
Thu Nov 14, 2019 8:52 pm
Following the single layer DV guide with DTS audio is working great but the file sizes seem a lot smaller than the original m2ts files, is some compression going on or is it just due to less streams being in the output? Wondering if I have something set wrong in DVDFab, although it does say it's just copying.
the process is lossless.
agentreza wrote:
Fri Nov 15, 2019 2:09 am
Hello peepz! Need some pointers - I have a dual layer dv movie remux in mp4, would like to convert that to a single layer mp4 with DVDFab to test on the new shield TV.
I don't think you can do that. You need to rip from the ISO/folder structure.
superfans124
Posts: 33
Joined: Fri Oct 04, 2019 3:26 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by superfans124 »

RESET_9999 wrote:
Fri Nov 15, 2019 3:05 am
baker99 wrote:
Thu Nov 14, 2019 8:52 pm
Following the single layer DV guide with DTS audio is working great but the file sizes seem a lot smaller than the original m2ts files, is some compression going on or is it just due to less streams being in the output? Wondering if I have something set wrong in DVDFab, although it does say it's just copying.
the process is lossless.
quick question, how do you deselect audio track in DVDfab? I'm demoing the software, I found the single-layer/dual-layer options in settings, but for the life of me, I don't see any option to not select any audio stream to create just the video stream for mp4box. god I feel dumb...
Grencola
Posts: 343
Joined: Sun Jan 27, 2019 5:19 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Grencola »

agentreza wrote:
Fri Nov 15, 2019 2:09 am
Hello peepz! Need some pointers - I have a dual layer dv movie remux in mp4, would like to convert that to a single layer mp4 with DVDFab to test on the new shield TV.
you could try Dolby's mp4demuxer, and then use tsMuxer to create an m2ts file from that to feed dvdfab.
https://github.com/DolbyLaboratories/dl ... /master?q=
RESET_9999
Posts: 1853
Joined: Mon Aug 05, 2019 7:12 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by RESET_9999 »

superfans124 wrote:
Fri Nov 15, 2019 4:04 am

quick question, how do you deselect audio track in DVDfab? I'm demoing the software, I found the single-layer/dual-layer options in settings, but for the life of me, I don't see any option to not select any audio stream to create just the video stream for mp4box. god I feel dumb...
With DVDFAB, you cant. You remove the first audio when you add the lossless audio with mp4box:

Code: Select all

mp4box.exe -add X:\dvdfab-single-layer.mp4#1 -add X:\lpcm.mov#audio:lang=en-EN -tmp X:\ -brand mp42isom -ab dby1 -no-iod X:\dolbyvision-remux.mp4
baker99
Posts: 84
Joined: Wed Oct 30, 2019 7:05 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by baker99 »

RESET_9999 wrote:
Fri Nov 15, 2019 3:05 am
baker99 wrote:
Thu Nov 14, 2019 8:52 pm
Following the single layer DV guide with DTS audio is working great but the file sizes seem a lot smaller than the original m2ts files, is some compression going on or is it just due to less streams being in the output? Wondering if I have something set wrong in DVDFab, although it does say it's just copying.
the process is lossless.

Thank you :)
yusesope
Posts: 221
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope »

Before continuing on the path taken, I would like to test a new idea.
Those interested can download the new app and the new server HERE and the new sample file HERE.
I recommend limiting yourself to the file I uploaded (it's special :D ). You will find in the archive a TrueHD/ATMOS track and a DV dvhe.05 track. Both must be loaded into the server in the usual way.
The IP address of the server remains 192.168.1.130 and to change it use the previous instructions.
If the idea proves to be successful, I will explain to you how to rework the files you own.

As always I thank you for your feedback.
baker99
Posts: 84
Joined: Wed Oct 30, 2019 7:05 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by baker99 »

yusesope wrote:
Fri Nov 15, 2019 7:18 pm
Before continuing on the path taken, I would like to test a new idea.
Those interested can download the new app and the new server HERE and the new sample file HERE.
I recommend limiting yourself to the file I uploaded (it's special :D ). You will find in the archive a TrueHD/ATMOS track and a DV dvhe.05 track. Both must be loaded into the server in the usual way.
The IP address of the server remains 192.168.1.130 and to change it use the previous instructions.
If the idea proves to be successful, I will explain to you how to rework the files you own.

As always I thank you for your feedback.

It's working with Atmos and Dolby Vision, I had to select Atmos on my AV receiver though, on previous demos it automatically triggered Atmos but this may just be an issue with my setup. Using a Shield TV Pro 2019, LGC6 and Denon X2500
justinadams
Posts: 17
Joined: Sun Sep 08, 2019 4:31 am

Re: Dolby Vision now possible through MP4 Mux.

Post by justinadams »

Can confirm this split method (sample file) does work no problem. Vizio Quantum X, Denon AVR-S750H, and shield tv pro 2019.
Post Reply