Log in

View Full Version : stretching audio to the length of the video


Funkdafied
21st July 2006, 11:36
I demuxed an XviD file but strangely the audio is shorter than the video. Theres nothing missing in the audio either.
I tried just using AudioDub() in my avisynth script anyway but it didnt turn out right.

How can I stretch the audio to the length of the video without affective the pitch? I noticed the TimeStretch filter but wasn't sure how to use to get the EXACT length I needed..

stickboy
21st July 2006, 11:51
Is the framerate of the video exactly what you expect it to be? Maybe you should adjust the video framerate instead?

But if you still want to mess with the audio, you could open the file in VirtualDub, note the video and audio durations, and then call:
TimeStretch(tempo=(100.0 * <video duration> / <audio duration>))

Alain2
21st July 2006, 14:44
Is the audio not in synch with the video once demuxed ? because if it is, it often happen that audio and video are not exactely the same length (example: LOTR DVDs), and the best way to handle this is to crop / add blank audio at the end so that it makes the same length as the video. If you have this problem for clips concatenation, you can use the alignedsplice (or ++) function to keep clips and audio in synch (audio crop / blanks automatically added between the clips)