Log in

View Full Version : Audio padding in WavSource?


andy_blah
3rd November 2012, 19:39
I have a video script that looks like this:

vid01 = AudioDub(ImageSource("01.png", end=56, fps=1), WAVSource("01.wav"))
vid02 = AudioDub(ImageSource("02.png", end=41, fps=1), WAVSource("02.wav"))
vid03 = AudioDub(ImageSource("03.png", end=65, fps=1), WAVSource("03.wav"))
vid04 = AudioDub(ImageSource("04.png", end=106, fps=1), WAVSource("04.wav"))
vid05 = AudioDub(ImageSource("05.png", end=89, fps=1), WAVSource("05.wav"))
vid06 = AudioDub(ImageSource("06.png", end=63, fps=1), WAVSource("06.wav"))
vid07 = AudioDub(ImageSource("07.png", end=63, fps=1), WAVSource("07.wav"))
vid08 = AudioDub(ImageSource("08.png", end=123, fps=1), WAVSource("08.wav"))
vid09 = AudioDub(ImageSource("09.png", end=66, fps=1), WAVSource("09.wav"))
vid10 = AudioDub(ImageSource("10.png", end=66, fps=1), WAVSource("10.wav"))
vid11 = AudioDub(ImageSource("11.png", end=108, fps=1), WAVSource("11.wav"))
vid12 = AudioDub(ImageSource("12.png", end=97, fps=1), WAVSource("12.wav"))
vid13 = AudioDub(ImageSource("13.png", end=88, fps=1), WAVSource("13.wav"))
vid14 = AudioDub(ImageSource("14.png", end=76, fps=1), WAVSource("14.wav"))
vid15 = AudioDub(ImageSource("15.png", end=91, fps=1), WAVSource("15.wav"))
vid16 = AudioDub(ImageSource("16.png", end=72, fps=1), WAVSource("16.wav"))
vid17 = AudioDub(ImageSource("17.png", end=107, fps=1), WAVSource("17.wav"))
vid18 = AudioDub(ImageSource("18.png", end=85, fps=1), WAVSource("18.wav"))
vid19 = AudioDub(ImageSource("19.png", end=116, fps=1), WAVSource("19.wav"))
vid20 = AudioDub(ImageSource("20.png", end=75, fps=1), WAVSource("20.wav"))
vid21 = AudioDub(ImageSource("21.png", end=100, fps=1), WAVSource("21.wav"))

video = vid01 + vid02 + vid03 + vid04 + vid05 + vid06 + vid07 + vid08 + vid09 + vid10 + vid11 + vid12 + vid13 + vid14 + vid15 + vid16 + vid17 + vid18 + vid19 + vid20 + vid21
return video.ConvertToYV12().dup()

Basically what I'm trying to do is to have an image play through the duration of the audio file. That works okay in the first few images/songs, but after that, it gets delayed, so the audio ends up playing earlier than when it's image is supposed to show up. Is there any way to make Avisynth in the above script add padding to the audio? The video stream ends up being 29min:34sec while the audio is 29min:24sec.

StainlessS
3rd November 2012, 19:56
you could try '++' instead of '+' ie aligned splice.

edit maybe trim(0,0) after audiodub

andy_blah
3rd November 2012, 20:40
The ++ trick did it for me, thanks! ^^