View Full Version : Need to alter audio delay on certain part of video clip, how??
BlockABoots
23rd May 2015, 15:44
I am wanting to change the audio delay on the end part of a video clip, the first 8 minutes or so of the video file is fine just the last part is out of sync. Im using AvsPMod and the script i usually use for altering the delay of the audio for a whole click is usually as follows...
video=DirectShowSource("E:\blah blah.mp4")
video1=trim(video,0,13847) +trim(video,13848,0)
Video2=DelayAudio(video1,1.300)
video3=fadein(video1,50).fadeout(50)
return video2
now the actual part of the video i need to alter is from frame 13848 onwards, what script do i need to achieve this??
StainlessS
23rd May 2015, 16:01
Something like this should work ok
video=DirectShowSource("E:\blah blah.mp4")
V1=DelayAudio(video,???.???).trim(0,13847) # delay whole clip but select only required range
V2=DelayAudio(video,???.???).trim(13848,0) # Same again
V3=V1++V2
#V4=V3.fadein(50).fadeout(50)
return V3
#return V4
BlockABoots
23rd May 2015, 17:48
Would the following not just delay the audio from frame 13848 onwards??...
video=DirectShowSource("E:\Blah Blah.mp4")
video1=trim(video,0,13847) +DelayAudio(video,1.300).trim(13848,0)
return video1
StainlessS
23rd May 2015, 19:59
Yes, but as you kinda threw me a little with the Fadein/out, I kept as separate so you could mix & match to whatever you wanted out.
EDIT: Looking at it again, it was the Video1 thing also threw me, was not sure why you created a clip, have edited
post #1 to have two separate delays specified, with the ???.?? placements.
BlockABoots
23rd May 2015, 21:34
Yeah, frames 0-13847 had perfect sync but after that (frames 13848 onwards) the sync was out. So basically i only need to sync up all frames after 13848 and anything before that was fine
StainlessS
23rd May 2015, 22:38
You can still do as posted above, a v1 delayaudio of 0.0 secs would just return original audio to be trimmed (ie delayaudio filter would be skipped),
ie dont do anything. Same thing for eg BilinearResize where not cropping and resize to same size as original clip,
the filter would not be linked into the filter graph (the filter constructor would see that it would have zero effect, and so just returns the same clip it was
given instead of a filtered [resized] clip).
EDIT: Quite a few builtin filters check if there is any point in filtering if result will be same as input, and if so they return original clip.
External filters are probably not quite so careful to do the same.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.