View Full Version : Delay audio keeping the good audio duration
Music Fan
22nd December 2010, 11:48
Hi,
I made some tests with the DelayAudio function.
I opened an avi containing sound (mp3) with avisource.
When the delay is positive, the audio duration stays the same than the original ; empty is added at the beginning and the end is cut.
The problem is with negative delay : the beginning is cut but nothing is added at the end.
How to add empty at the end to keep the same duration than the video ?
I know how to do with Vegas or Cool Edit Pro, but it's longer, and I guess we can do it with avisynth.
Thanks.
Gavino
22nd December 2010, 13:29
It can be done, but first, are you sure you really need to keep the audio length the same? A player should just continue playing the video after the audio runs out, and if you want to append another clip after it in Avisynth, use ++ (instead of +) and silence will be added to fill the gap and keep the second clip in sync.
Music Fan
22nd December 2010, 13:43
Thanks. There is also AlignedSplice.
are you sure you really need to keep the audio length the same?
It's probably not very important, but I like to have the same duration.
Are you sure that all (standalone) players can continue to play the video after the sound has stopped ?
It can be done
How ?
I can append a segment, so the blank part between the clips will be filled, and then I can trim the end (the 2nd clip), but there is probably simpler.
Gavino
22nd December 2010, 14:10
There is also AlignedSplice.
That's the same thing - ++ is just a shorthand for AlignedSplice.
How ?
Trim(0, 0) will extend the audio (if shorter) to match the video.
I didn't say that in the previous post as I was thinking you had to do something more complicated, but I believe that's all that's needed.
Music Fan
22nd December 2010, 17:38
Trim(0, 0) will extend the audio (if shorter) to match the video.
Thanks, it works !
That's the same thing - ++ is just a shorthand for AlignedSplice.
Ok, 2nd thing you learn me.;)
IanB
22nd December 2010, 22:49
Trim(0, 0) will extend the audio (if shorter) to match the video.And of course truncate the audio if it is longer.
All Trim() operations force Audio Duration == Video Duration.
Gavino
22nd December 2010, 23:04
All Trim() operations force Audio Duration == Video Duration.
By default, yes.
But if pad_audio=false,
- shorter audio will not be extended;
- longer audio will not be shortened when last_frame=0.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.