Log in

View Full Version : Stream errors cause audio to go out of sync?


Leak
24th October 2004, 17:29
I ripped a DVD ("Dorfer's Donnerstalk Vol. 1") I bought last week so I could encode an episode for a friend who missed it when he recorded it from TV when it was originally broadcast.

Since they crammed all episodes into a single title, I just used DVD Decrypter to demux the whole title set to an M2V and an AC3 file.

After this, I used BeSweet to convert the whole AC3 file to MP3 and later added this file as a stream in VirtualDubMod, as I always do - only that this time the audio was out of sync by about 3/4 of a second... :(

I found a number of "Stream error : Sync found after 767 bytes" error messages in BeSweet's log, so I guess that this is what gradually caused more desyncing, as all those errors were exactly at the points where one episode ends and the next begins, which means that the first episode was perfectly in sync and every following one is a bit more out-of-sync.

So my question is: what does BeSweet do if it can't decode a part of the audio? I have the feeling that it just leaves out (part of) the broken audio, as the MP3 file was about 688ms shorter than the AC3 file. Is this what it does? Couldn't it just add silence for the broken frame?

If I directly add the AC3 file as a stream in VirtualDubMod and make it do the MP3 encoding itself, the audio stays in sync, so is there a reason why BeSweet doesn't?

Matthew
25th October 2004, 00:14
Besplit/besweet does not add silence, it justs removes the "bad" frame.

Technical/programming considerations aside, adding silence is not as simple as it sounds, it involves value judgements, e.g. say there is 200 bytes of junk in a file. If that means say the other ~568 bytes of the frame were somehow removed, then ideally besplit/besweet should add silence. However, if that 200 bytes shouldn't be there at all, replacing it with silence would lead to desync.

If I recall correctly delaycut supports replacing bad frames with silence.

Anyway, in the case at hand, it sounds rather odd. If I recall correctly, when besplit finds XXX bytes of junk then it reports the XXX-1 error message. So that would make it 768 bytes of junk. Which is exactly 1 frame of 192 kbps audio (4x192=768).

The bottom line: I don't know why this is happening, but fixing the ac3 with delaycut before using besweet may help.

keithmac
25th October 2004, 11:53
I had a bad AC3 file, 3 seconds shorter after a besplit fix! All I did was use the log from besplit and go along splitting the ac3 and adding a delat to the 2nd half and -joining it back up, a real nightmare of a job but the audio was ok.

If I were you I`d split the video into episodes and split the adio at the error points (unfixed AC3), you may have to add a delay to the start of every ac3 but it`s alot easiet than with 2hrs plus of audio to sync!

"If I recall correctly delaycut supports replacing bad frames with silence." good tip that, I`ll have to try it out!