Seamless Branching Audio Overhang

Post Reply
DAE avatar
karbre
Posts: 4
Joined: Mon Aug 23, 2021 6:42 pm

Seamless Branching Audio Overhang

Post by karbre »

Hello everyone!

I have the following problem with the otherwise great tool DGDemux :bow: :

I am trying to demux Twin Peaks S01E01 (standard cut, not international cut) from "The Entire Mystery" set (https://www.blu-ray.com/movies/Twin-Pea ... ray/93181/) with the original Dolby Digital 2.0 Stereo track. Because there are two different versions of that episode on the disc, seamless branching is utilized. For the standard version, the segments are 0, 1, 2, 41.

Now the Dolby Digital tracks on this release are often strangely encoded, because for many episodes the DD audio is ca. 30 seconds longer (containing silence) than the available video. This is not a huge issue when there is no seamless branching involved, but the same applies to (some of) those M2TS files that are used within seamless branching, specifically to segment 0. That means that between segments 0 and 1, those ~30 seconds of audio must be erased to maintain sync.

Here comes the problem: DGDemux does maintain sync, but for the first ~30s of segment 1, it uses the silent audio overhang from segment 0, resulting in ~30s of silence in the demuxed audio when there should actually be dialog.

So I would propose that in such cases, DGDemux should use the audio from the segment without overhang.

I tested other demux tools as well: MakeMKV 1.16.4 has exactly the same issue, eac3to 3.34 does not, it correctly uses the audio from segment 1. However, I don't want to use the track from eac3to because it is not as nicely synced later in the track in comparison to the DGDemux output.

Here is a visual comparison of the three different outputs, where only the eac3to output contains the encircled part of the audio:
dgdemux-problem.png
MakeMKV log:

Code: Select all

AV sync issue in stream 1 at 0:52:45.245 with duration of 28.098s : encountered overlapping frame, audio skew is +28.098s
AV sync issue in stream 1 at 0:53:13.344 with duration of 28.096s : 878 frame(s) dropped to reduce audio skew to +2.583ms
AV sync issue in stream 1 at 1:30:39.809 with duration of 28.041ms : encountered overlapping frame, audio skew is +30.625ms
User avatar
Rocky
Posts: 3555
Joined: Fri Sep 06, 2019 12:57 pm

Seamless Branching Audio Overhang

Post by Rocky »

Welcome to the forum karbre!

Please check your PM.
User avatar
Rocky
Posts: 3555
Joined: Fri Sep 06, 2019 12:57 pm

Seamless Branching Audio Overhang

Post by Rocky »

Where is that extra audio coming from? Is it at the start of segment 1? I don't see how DGDemux could skip that. I could understand if there was just the extra silence inserted. I will need to get the disk to investigate this.

It would be interesting also to see what domy's tool does with it.

https://github.com/domyd/mlp
DAE avatar
karbre
Posts: 4
Joined: Mon Aug 23, 2021 6:42 pm

Seamless Branching Audio Overhang

Post by karbre »

Segment 0 has 28 seconds silence after the end of the video. Segment 1 starts with video and audio normally (without any offset / delay). So there is 28 seconds of duplicate audio. DGDemux compensates this by removing the first 28 seconds from segment 1's (legitimate) audio and instead uses the silence overhang from segment 0.

Does domy's tool work with DD? I thought it would only work with TrueHD. I can give it a try tomorrow.
User avatar
Rocky
Posts: 3555
Joined: Fri Sep 06, 2019 12:57 pm

Seamless Branching Audio Overhang

Post by Rocky »

I see. Thank you for the explanation. I have some ideas for solving it. One idea is to have "garbage stripping" for audio. We currently have it only for video. Definition of garbage could be audio without video. Disk is on the way so we'll need to wait for it to arrive.

Yeah I forgot you can't use domy's tool as the audio is not TrueHD.
User avatar
Rocky
Posts: 3555
Joined: Fri Sep 06, 2019 12:57 pm

Seamless Branching Audio Overhang

Post by Rocky »

I have a working fix for this but I discovered a video regression in 1.0.0.53 that I have to repair before I can give you a test version.
User avatar
Rocky
Posts: 3555
Joined: Fri Sep 06, 2019 12:57 pm

Seamless Branching Audio Overhang

Post by Rocky »

I released the fixed-up 1.0.0.53 but it doesn't include audio overhang processing. I am still verifying that.
User avatar
Rocky
Posts: 3555
Joined: Fri Sep 06, 2019 12:57 pm

Seamless Branching Audio Overhang

Post by Rocky »

Please test this fix for the audio overhang.

http://rationalqm.us/misc/DGDemux_karbre.rar
DAE avatar
karbre
Posts: 4
Joined: Mon Aug 23, 2021 6:42 pm

Seamless Branching Audio Overhang

Post by karbre »

Nice job, works great! :bravo:

Out of interest: Did you generalize this for all instances where there is audio without video during seamless branching? Also for other audio formats than Dolby Digital?

Nevertheless, thank you for the really quick fix.
User avatar
Rocky
Posts: 3555
Joined: Fri Sep 06, 2019 12:57 pm

Seamless Branching Audio Overhang

Post by Rocky »

You are welcome.

Yes, of course it is generalized to all audio types. Who do you think you are dealing with? ;)
DAE avatar
karbre
Posts: 4
Joined: Mon Aug 23, 2021 6:42 pm

Seamless Branching Audio Overhang

Post by karbre »

Sorry for having doubted you :D
User avatar
Rocky
Posts: 3555
Joined: Fri Sep 06, 2019 12:57 pm

Seamless Branching Audio Overhang

Post by Rocky »

Made it optional and released as 1.0.0.54.
Post Reply