Dolby Vision now possible through MP4 Mux.

Please post here for issues related to UHD discs
Post Reply
DaMacFunkin
Posts: 314
Joined: Tue Oct 30, 2018 4:17 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by DaMacFunkin »

DaMacFunkin wrote: Sun Nov 10, 2019 7:38 am
yusesope wrote: Sun Nov 03, 2019 10:24 am
RESET_9999 wrote: Sat Nov 02, 2019 7:58 pmit works, AVR show atmos with my htpc.
FusionNeo wrote: Sun Nov 03, 2019 1:16 amThe new file you just posted has proper ATMOS support too when played back on a HTPC using your tutorial. Confirmed I am getting ATMOS audio and I was able to hear sound come out of my ATMOS speakers.
Thank you both for your feedback.
RESET_9999 wrote: Sat Nov 02, 2019 7:58 pmI tried again with a movie and it works with the htpc. i wonder why it didnt work when i tried a couple days ago(didnt update any software since then)
it's magic!
FusionNeo wrote: Sun Nov 03, 2019 1:16 amYusesope, you are the man!
Thanks but the credit also goes to the user likeadoc (look HERE).
FusionNeo wrote: Sun Nov 03, 2019 1:16 amJust tried the new Plex beta out on my Shield 2019 with your Dolby Vision DTS-X and DTS-HD MA and both files played back in Dolby Vision with DTS-X and DTS-HD MA audio.
I assume, the Single Layer files. Excellent news anyway!
FusionNeo wrote: Sun Nov 03, 2019 1:16 amThat same file will NOT play back on my NVIDIA Shield vía Plex...Do the PLEX devs need to add support?
Correct . We must inform the developers (Plex, MrMC, etc.) about the existence of this possibility and they will implement the correct decoding (as did the developers of LAV Filters).
FusionNeo wrote: Sun Nov 03, 2019 1:16 amOnce this file plays back on the SHIELD, then I would assume it would be trivial to use a Dolby Vision video track in place of the video track you used in that file for full TRUEHD + Dolby Vision support, is that correct?
Correct again. I've just updated my "HOW TO".
Sorry if this is a stupid question, what if there are dummy or obsvicated playlists? How does ffmpeg know which one to choose when you rip the dts-hd?
Thank you.
Hi,

You linked to a newer version of GPAC, everytime I go to the developers site the download links are always down, is there another place to get the pre-built 0.9.0 installer for Win64?

Thank you.
justinadams
Posts: 17
Joined: Sun Sep 08, 2019 4:31 am

Re: Dolby Vision now possible through MP4 Mux.

Post by justinadams »

DaMacFunkin wrote: Sun Nov 10, 2019 10:35 pm
DaMacFunkin wrote: Sun Nov 10, 2019 7:38 am
yusesope wrote: Sun Nov 03, 2019 10:24 am

Thank you both for your feedback.


it's magic!


Thanks but the credit also goes to the user likeadoc (look HERE).


I assume, the Single Layer files. Excellent news anyway!


Correct . We must inform the developers (Plex, MrMC, etc.) about the existence of this possibility and they will implement the correct decoding (as did the developers of LAV Filters).


Correct again. I've just updated my "HOW TO".
Sorry if this is a stupid question, what if there are dummy or obsvicated playlists? How does ffmpeg know which one to choose when you rip the dts-hd?
Thank you.
Hi,

You linked to a newer version of GPAC, everytime I go to the developers site the download links are always down, is there another place to get the pre-built 0.9.0 installer for Win64?

Thank you.
Here's a links to their good drive backup (link pulled from there download page)
https://drive.google.com/drive/folders/ ... 4sSsc1TIRL
yusesope
Posts: 221
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope »

justinadams wrote: Sun Nov 10, 2019 9:58 pm...only plus is that it does trigger DV and ATMOS.
:lol: :lol: :lol: :lol:
In Italy when we start a sentence with "only", most of the time, it has a sarcastic and negative meaning.
I'm the one who showed you how to insert ALL lossless audio formats into an MP4 container along with a Dolby Vision track (at least one frame :mrgreen: :mrgreen: ).
What else do you want? My heart?
:lol: :lol: :lol: :lol:
baker99 wrote: Sun Nov 10, 2019 6:39 pm...all I get is a message saying cleartext traffic not supported...
justinadams wrote: Sun Nov 10, 2019 9:58 pm...was having the "Cleartext traffic not permitted" issue...
Seriously, thank you for your feedback.
The error is determined by the fact that the server does not include any SSL certificate and Android prevents my app from communicating with it.
I thought that by leaving the app in debug mode, Android would turn a blind eye. I was wrong, my fault!
I will fix the bug when I return from the University or at most in the next few days (in the meantime, those who want can follow justinadams 's advice)
Grencola wrote: Sun Nov 10, 2019 9:48 pmis there a way you / we can make it play local files directly from the device?
For now I am using the demo version of their code as a structure and there is no possibility to choose a local file. I thought it was simpler and more functional to code a local streaming server: less work for me and then not everyone has available many GB of space on their devices (see new SHIELD)



Regarding the problem of video freeze, I only modified the "audio part" of the source code of the ExoPlayer library (remember, I'm the audio guy).
As far as I'm concerned, my goal is reached:
DV + ATMOS inside MP4.
If the video doesn't work it's Google's fault!

To try to figure out what's wrong, I need the app logs. As I said earlier, the player is in debug mode.
With adb it is possible to recover them.
THIS VIDEO shows how to enable debugging on SHIELD.
HERE it explains how to install adb on all operating systems.

I'm interested in the command:

Code: Select all

adb logcat > logcat.txt
Run the command (after "adb connect IP_ADDRESS") and then try to start the video on the device.
the logcat.txt file will be created in the same adb folder. You must attach this to your post (use pastebin) so that I can read it.

Who wants to help, can take a look at the source code and with the logs available help me understand what's wrong.

I remind you that I cannot compete with a team of full-time developers. I worked on the app 3h in total over three days and I can spend a few minutes each day (it's still a hobby).

I remind everyone to go and vote for FusionNeo's request because DV + ATMOS inside MP4 is possible!
Last edited by yusesope on Mon Nov 11, 2019 2:45 pm, edited 2 times in total.
THX-UltraII
Posts: 9
Joined: Fri Feb 06, 2015 7:50 am
Location: REMOVEACCOUNT
Contact:

Re: Dolby Vision now possible through MP4 Mux.

Post by THX-UltraII »

Hi guys,

I bought the Nvidia Shield 2015 + Denon x3600h + Sony OLED tv. I have a bunch of BDMV structure folder Blu-Ray rips on my local HDD that have Dolby Vision. Is my only option the Oppo 203 to get Dolby Vision with the Shield and these Blu-Ray rips?

I tried to get it working with Kodi 18.4 but only the HDR is played
REMOVEACCOUNT
SamuriHL
Posts: 2802
Joined: Mon Jun 14, 2010 5:32 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by SamuriHL »

First the 2015 shield has no dv support at all. Second kodi doesn't support dv on the 2019 shield at this time.

Sent from my SM-G975U using Tapatalk


kws53
Posts: 49
Joined: Sun May 04, 2014 9:09 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by kws53 »

Is there a piece of software (perhaps a driver for WIN8.1) that could determine whether a video file is producing compliant Dolby Atmos and compliant Dolby Vision? For example, something that would acknowledge that ATMOS would be shown on an equipped AVR, and DV on an equipped TV.

My 4K set is not DV compliant, but I plan to grab one during the Black Friday/Cyber Tuesday rush. In the meantime, I'd like to determine if my muxed files comply.
Grencola
Posts: 343
Joined: Sun Jan 27, 2019 5:19 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by Grencola »

yusesope wrote: Mon Nov 04, 2019 3:14 pm Who wants ATMOS + MP4 on Android? :lol: :lol: :lol:

I created a custom codec for MX Player (based on the work of USBhost from XDA).
My Android tablet (Huawei Mediapad M3) is now able to correctly reproduce the TrueHD/ATMOS track inside the MP4 file.

To confirm what I said in my previous posts, the implementation is purely software.

HERE you will find the codec
the file has been removed from the host site, and I didn't manage to snag it quick enough. could you reupload it when you get a chance?
dubsta
Posts: 1
Joined: Tue Nov 12, 2019 9:06 am

Re: Dolby Vision now possible through MP4 Mux.

Post by dubsta »

I would like to thank all of you guys for working on this and everyone testing and providing feedback. Big thanks to yusesope. Since the first time I have seen a Dolby Vision clip it has been my dream to be able to enjoy DV content directly from my Shield and it seems that we are getting closer to this by the day.
yusesope
Posts: 221
Joined: Sun Jul 28, 2019 3:34 am

Re: Dolby Vision now possible through MP4 Mux.

Post by yusesope »

Grencola wrote: Tue Nov 12, 2019 5:06 amthe file has been removed from the host site, and I didn't manage to snag it quick enough. could you reupload it when you get a chance?
Of course, HERE are the codecs for MX Player.


baker99 wrote: Sun Nov 10, 2019 6:39 pm...all I get is a message saying cleartext traffic not supported...
justinadams wrote: Sun Nov 10, 2019 9:58 pm...was having the "Cleartext traffic not permitted" issue...
I also fixed the "CleartextTraffic" issue.
Find the new player HERE.
Let me know in case of problems (For the DV freeze issue I need the logs).

PS:
I update the download links also in the original posts (both for MX and for the custom player)
hydrad
Posts: 8
Joined: Wed Oct 02, 2019 8:41 pm

Re: Dolby Vision now possible through MP4 Mux.

Post by hydrad »

yusesope wrote: Tue Nov 12, 2019 11:16 am
Grencola wrote: Tue Nov 12, 2019 5:06 amthe file has been removed from the host site, and I didn't manage to snag it quick enough. could you reupload it when you get a chance?
Of course, HERE are the codecs for MX Player.


baker99 wrote: Sun Nov 10, 2019 6:39 pm...all I get is a message saying cleartext traffic not supported...
justinadams wrote: Sun Nov 10, 2019 9:58 pm...was having the "Cleartext traffic not permitted" issue...
I also fixed the "CleartextTraffic" issue.
Find the new player HERE.
Let me know in case of problems (For the DV freeze issue I need the logs).

PS:
I update the download links also in the original posts (both for MX and for the custom player)
I tested your demo file and another one I generated myself with your new Exoplayer.

My receiver shows the correct Audio info and the TV shows the Dolby Vision logo but the image goes black and it won't play.
justinadams
Posts: 17
Joined: Sun Sep 08, 2019 4:31 am

Re: Dolby Vision now possible through MP4 Mux.

Post by justinadams »

Here's logcat.
logcat.txt
(1.52 MiB) Downloaded 1982 times
Donpoku
Posts: 66
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 amHere'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 amHere'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 1928 times
Post Reply