View Single Post
Old 26th June 2017, 21:40   #1  |  Link
Richard1485
Guest
 
Posts: n/a
Stretching Audio: N+1,2,3,etc Frames in AviSynth

I wonder if it's possible to stretch a section of audio and video so that it occupies the same number of frames as the original +1,2,3 etc. The important thing is for the audio to be stretched in as high a quality method as possible so that it occupies its new length; the video can make up the difference by adding duplicates (as long as it is returned in sync along with the audio). At present, I approximate the effect that I want by trimming out a section and doing the following.

Code:
#Assuming a 23.976fps A/V source...
Trim()
ChangeFPS(25000,1001)
AssumeFPS(24000,1001, sync_audio=true)
SSRC(48000)# or ResampleAudio(48000) or whatever
Then I call AlignedSplice() to reinsert the clip. Obviously, I change the numerator and denominator in ChangeFPS() if I want to vary the extent to which the clip is stretched. This works for very short clips but has obvious limitations, not least the fact that the stretched section stands out a bit. Surely it's possible to write a function that stretches longer sections by a frame or so and results in less obvious distortion. Any help with this would be appreciated!
  Reply With Quote