Log in

View Full Version : AlignedSplice and Audio drift


SunShock
21st July 2003, 02:11
I apologize if this was covered in some other post. What I'm doing is pretty simple, actually. I have encoded a few clips, and I wanted to join them together, convert to DivX, and conver the audio to MP3. I figured the easiest way to do the joining part would be to use AlignedSplice in AviSynth to make sure I don't botch the audio sync. My AVI's are all in HuffYUV format encoded with the convert to YUY2 option selected, and my script is as follows:

AVISource(TempDir+"BGCIntro2.avi", pixel_type="YUY2") ++ AVISource(TempDir+"tempHuffy1.avi", pixel_type="YUY2") ++ AVISource(TempDir+"BGCCommercial.avi", pixel_type="YUY2") ++ AVISource(TempDir+"tempHuffy2.avi", pixel_type="YUY2") ++ AVISource(TempDir+"BGCEnd2.avi", pixel_type="YUY2")

The AviSynth documentation said the ++ operator as opposed to + would use AlignedSplice instead of UnalignedSplice. However, the audio slowly drifts out of sync with the video, particularly noticable after the BGCCommercial clip. Each source file has the audio perfectly in sync. The video gets ahead of the audio. I thought AlignedSplice was supposed to keep things in sync?

DoW
22nd July 2003, 17:51
hmmm.. are the sampling rates of the audio the same?

Bidoche
22nd July 2003, 17:57
Strange, I thought + was AlignedSplice and ++ UnAligned.
Maybe you misread, or it is the documentation (or it is me)

Wilbert
22nd July 2003, 23:33
Every doc (also Ben's original) says: + = unaligned and ++ = aligned

Richard Berg
23rd July 2003, 00:42
According to expressions.cpp Wilbert is correct.

SunShock
25th July 2003, 23:26
I figured it out, and it was a really stupid mistake. The first clip was 24.000 fps and the rest were 23.976 (the first clip was originally interlaced, and the rest were Telecined). I'm used to getting the error in vDub when you try to combine two clips of different framerate, but AVISynth doesn't tell you and the difference was so small that you can't notice it til halfway through.