Log in

View Full Version : Dshowsource()+Dshowsource() = audio sync issue


DeathTheSheep
3rd August 2007, 18:00
I have 2 avi files I want to add together into one with AVISynth (they have different samplerates and formats, so no VDub). But because the audio cuts out a little early on the first one,

VVVVVVVVVVVVVVVV
AAAAAAAAAAAAAA00
the second streams audio starts immediately where the first leaves off, before the end of the first video stream! So when I add the second file:

VVVVVVVVVVVVVVVV
AAAAAAAAAAAAAAAA
The resulting file is fine up until the end of its audio stream, but then becomes out of sync:

VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA


My script was

directshowsource("file1.avi",25,convertfps=true).converttomono().ssrc(44100).ensurevbrmp3sync()+
directshowsource("file2.avi",25,convertfps=true).converttomono().ssrc(44100).ensurevbrmp3sync()
trim(500,8000)
bilinearresize(640,480)
ensurevbrmp3sync()

As you can see, I've tried to make them match up. But the audio from the second stream plugs the gap at the end of the first stream, making it out of sync for the second half of the file!

Ebobtron
3rd August 2007, 18:21
From AviSynth's documentation.
(++)
"AlignedSplice cuts off the first sound track or inserts silence as necessary to ensure that the second sound track remains synchronized with the video. "