Log in

View Full Version : AC3 async issue in AVI2SVCD


eaf
3rd January 2005, 04:52
Once in a while when converting 3rd party AVIs (totally legal, so no issues there :) ) I'm running into audio sync issues in the final MPG file. Generally I just trash the source and try to get it in a different format, but today's file was important, so I had to find a workaround.

I browsed this forum looking for an obvious solution, but neither of them helped. To make the story short, I fixed the desync eventually by prepending a 1.5 sec of silence to the demuxed .wav. It turned out that the length of the originally decoded .mp2 was 1.5sec shorter than the length of the video.

It's interesting that the AVI played perfectly in WM Player. It's interesting that just rewriting AVI in VirtualDub (with DirectStream copy) didn't change a thing. It's interesting that while decoding AC3 stream to PCM (as suggested on this forum) produced an AVI, with audio desynced exactly as in the AVI2SVCD's output MPEG. It's interesting that trying to delay PCM stream in VirtualDub via "Interleaving..." window produced totally screwed up sound (lots of noise and nothing more).

But what really puzzles me is how in the world was this AVI created: with audio track being 1.5 second shorter than the video, and multiplexed with a 1.5 second delay? How does WMP manage to play such a file properly and AVI2SVCD fails to detect the audio offset?

Matthew
3rd January 2005, 23:48
When you use the audio delay feature, xDub inserts 0s, not valid data. This maintains sync while the avi is kept intact, but when the extracted audio is re-encoded, the 0s at the start are ignored.

There are threads around telling you how you can calculate the audio delay.