Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th May 2014, 03:55   #1  |  Link
ect5150
Registered User
 
Join Date: Dec 2006
Posts: 39
Audio Sync Issues

Hey guys! Running into a problem that I've never really noticed on some of my encodes.

The short version of the story is my audio gets out of sync with the video after certain chapter points. The video has 5 real chapters. First, I rip all chapters as VOB files and index the video while extracting the audio. If I do this, the audio becomes out of sync after the first chapter point.

However, if I decide to just rip the middle chapters (2,3,4) into VOB files and extract the audio, the audio is now correctly in sync with chapter two. Just to note, there is a calculated offset for the audio in this scenario that is different from the first scenario.

It's almost like there are supposed to be some extra frames/fields in the video or something that aren't being placed into the VOB file. Thought I would post my troubles here and see what advice I could dig up.

Let me know if you need more info or example files. Thanks in advance!
ect5150 is offline   Reply With Quote
Old 13th May 2014, 07:28   #2  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
What do you precisely mean by "rip all chapters as VOB files"? Since you could describe the ripping of the whole movie other ways, I assume you rip chapter by chapter into separate VOBs.
Since you need to do this I further assume these are sort of music videos or animes, which have multiple videos in a single VTS. It may also be that there is a movie and other PGCs in the same VTS contain studio logos or FBI warnings and the like, again each with its own delay. Should this be the case, then it is perfectly possible that each chapter has its own audio delay (also confirmed by your findings).

Now, what is the purpose of your enterprise? Sometimes people follow the wrong guides because they have no idea of what to do.
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 13th May 2014, 19:37   #3  |  Link
ect5150
Registered User
 
Join Date: Dec 2006
Posts: 39
Quote:
Originally Posted by Ghitulescu View Post
What do you precisely mean by "rip all chapters as VOB files"? Since you could describe the ripping of the whole movie other ways, I assume you rip chapter by chapter into separate VOBs.
Since you need to do this I further assume these are sort of music videos or animes, which have multiple videos in a single VTS. It may also be that there is a movie and other PGCs in the same VTS contain studio logos or FBI warnings and the like, again each with its own delay. Should this be the case, then it is perfectly possible that each chapter has its own audio delay (also confirmed by your findings).

Now, what is the purpose of your enterprise? Sometimes people follow the wrong guides because they have no idea of what to do.
Fair enough.

DVDs are anime from Japan. I've had to add my own subtitles (I'm just hardcoding them onto the video) to create files that work on a variety of devices around my own home (TV, PC, iPads, etc... you get the idea). I've been ripping the audio stream (AC3 files) and encoding them with the audio offset.

I'm not really using a guide, just own experience at this point. To further clarify what I mentioned in the first post, here is a screen shot.

Each disc contains 6 episodes.



The first two GPC's contain versions of watching everything on the disc. Then each episode is contained in an PGC itself (as seen in PGC 3 through PGC 8).

In this particular screenshot I've selected the first episode from the disc (PGC 3) and I've only selected Chapters 2, 3 & 4. Chapter 1 is the opening sequence. If I leave Ch 1 unselected, then rip the disc. The resulting VOB file (or AVI Synth script - which is where this is ultimately going) has no problem with the audio.

However, if I include Chapter 1 in the selection (I select all chapters within PCG 3) then the audio during Chapter 2 is not in sync.

While I am away that the audio may have a delay, I wasn't aware there could be another delay within the same PGC. This appears to be the case (although I'm not 100% certain).

If this is the case, is there a way to test for this? Without ripping each chapter separately and and extracting the audio to have meGUI (or some other program) calculate the delay? I can adjust for this if I need to... it's not that big of a problem. The problem comes in doing multiple episodes and having to check the long way.

Again, thanks for any feedback.

Last edited by ect5150; 13th May 2014 at 19:46.
ect5150 is offline   Reply With Quote
Old 14th May 2014, 08:01   #4  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
Yeah, that's the problem.
The intros are not specific to this episode (or any off them) and thus they have their own delay.
Rip them "logically" then put them back.

FYI the delay is dynamic, two consecutive audioframes are allowed to have non-consecutive delays, in practice however it's almost impossible to find this scenario.

PS: I don't understand people that hardub movies, when more elegant solutions exist.
__________________
Born in the USB (not USA)

Last edited by Ghitulescu; 14th May 2014 at 14:17. Reason: forgotten concept
Ghitulescu is offline   Reply With Quote
Old 14th May 2014, 12:02   #5  |  Link
ect5150
Registered User
 
Join Date: Dec 2006
Posts: 39
Quote:
Originally Posted by Ghitulescu View Post
The intros are not specific to this episode (or any off them) and thus they have their own delay.
Rip them "logically" then put them back.
Actually, the intros are episode specific, but the delay is there none the less (credits change with each one). Either way this is a moot point. Not all episodes in the series have the delay problem. Only certain ones. I just need to check each one and adjust accordingly.

So, I'm using something like this I can easily use from one episode to the next. While not each episode has this problem, this particular one had a delay at each chapter break.
Code:
LoadPlugin("C:\Video\Programs\megui\tools\dgindex\DGDecode.dll")
LoadPlugin("C:\Video\Programs\megui\tools\avisynth_plugin\ColorMatrix.dll")

V1 = DGDecode_mpeg2source(".\1\VTS_01_1.d2v", info=3).tfm(d2v=".\1\VTS_01_1.d2v",slow=2,PP=0,mode=5).tdecimate(mode=1,hybrid=1)
V2 = DGDecode_mpeg2source(".\2\VTS_01_1.d2v", info=3).tfm(d2v=".\2\VTS_01_1.d2v",slow=2,PP=0,mode=5).tdecimate(mode=1,hybrid=1)
V3 = DGDecode_mpeg2source(".\3\VTS_01_1.d2v", info=3).tfm(d2v=".\3\VTS_01_1.d2v",slow=2,PP=0,mode=5).tdecimate(mode=1,hybrid=1)
V4 = DGDecode_mpeg2source(".\4\VTS_01_1.d2v", info=3).tfm(d2v=".\4\VTS_01_1.d2v",slow=2,PP=0,mode=5).tdecimate(mode=1,hybrid=1)
V5 = DGDecode_mpeg2source(".\5\VTS_01_1.d2v", info=3).tfm(d2v=".\5\VTS_01_1.d2v",slow=2,PP=0,mode=5).tdecimate(mode=1,hybrid=1)

A1 = DirectShowSource(".\1\VTS_01_1 T80 2_0ch 448Kbps DELAY 0ms.ac3").DelayAudio(-0.0)
A2 = DirectShowSource(".\2\VTS_01_1 T80 2_0ch 448Kbps DELAY -659ms.ac3").DelayAudio(-0.659)
A3 = DirectShowSource(".\3\VTS_01_1 T80 2_0ch 448Kbps DELAY -224ms.ac3").DelayAudio(-0.244)
A4 = DirectShowSource(".\4\VTS_01_1 T80 2_0ch 448Kbps DELAY -232ms.ac3").DelayAudio(-0.232)
A5 = DirectShowSource(".\5\VTS_01_1 T80 2_0ch 448Kbps DELAY -273ms.ac3").DelayAudio(-0.273)

AV1 = AudioDub(V1,A1)
AV2 = AudioDub(V2,A2)
AV3 = AudioDub(V3,A3)
AV4 = AudioDub(V4,A4)
AV5 = AudioDub(V5,A5)

video = AV1 + AV2 + AV3 + AV4 + AV5
return video
Quote:
Originally Posted by Ghitulescu View Post
PS: I don't understand people that hardub movies, when more elegant solutions exist.
It's simple really, not all of my hardware devices will display subtitles if they are softcoded. It's the only "one-size-fits-all" solution I can find for all devices in the house. It's just for these particular videos anyways.

Thanks for the feedback!
ect5150 is offline   Reply With Quote
Old 14th May 2014, 14:20   #6  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,769
Exactly, use this logical splitting, as usually each chapter/cell belonging to the same scene should have the same delay (correct DTS/PTS difference). There is no other solution to my knowledge, as demuxing/remuxing them as a whole would rewrite the individual DTS/PTS to the same delay, as you noticed.
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 14th May 2014, 18:54   #7  |  Link
ect5150
Registered User
 
Join Date: Dec 2006
Posts: 39
Quote:
Originally Posted by Ghitulescu View Post
There is no other solution to my knowledge
Thanks for the help and feedback. I did notice using Handbrake dealt with the audio delays properly (but using Handbrake then caused some frame differences - which I'm not going to investigate).

But I want to keep everything in AVISynth because I run some funky video filters across it.

Thanks again! This proves to be the most useful forums time after time for any issue across any subject I can think of.
ect5150 is offline   Reply With Quote
Reply

Tags
audio sync

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.