Log in

View Full Version : Speeding Up A Certain Section Of A Video??


BlockABoots
17th February 2013, 20:33
I have a part of a video capture that i want to speed up (the end credits), the starting frame on the section i want to speed up is 18898 and the last frame is 48075. I know the command changefps but im not sure if this can be applied to a certain section of a video clip. Is there a command for this?

Rumbah
17th February 2013, 21:01
Just trim your video to two parts (start-18897 and 18898-end) and only speed up the second part. Then just put them together again (part1+part2).

IanB
17th February 2013, 21:34
You will also need to set the final FPS of part2 to match part1 i.e. part1++part2.AssumeFPS(part1)

BlockABoots
17th February 2013, 21:59
I am still relatively new to Avisynth, infact im actually using AvsPmod. So what script do i need to use if im wanting to speed frames 18898 to 48075 up, there is a total of 49408 altogether. This is what i currently have....

video=AVISource("E:\CAPTURES\My Records\amarec(20130217-1858).avi")
video1=fadein(video,50)
video2=fadeout(video1,50
video3=lanczos4resize(video2,1920,1080)
video4=converttoRGB32(video3,matrix="rec709")

Return video4

What do i need to add to that script?

IanB
17th February 2013, 22:29
video=AVISource("E:\CAPTURES\My Records\amarec(20130217-1858).avi")
video=Trim(video, 0, 18897)++Trim(video, 18898, 48075).ChangeFPS(9.99).AssumeFPS(video)++Trim(video, 48076, 0)
video1=fadein(video, 50)
...

BlockABoots
18th February 2013, 20:28
That works a treat thanks, can you explain how that actually works, what do the '.' mean/do?. Is it anything before the '.' and after is applied to each other?? So for the script above we have determined a section of frames (18898 and 48075) and the added a '.' and the changeFPS, so because we have added a '.' to the scripted then the 2 are added together??

ajk
19th February 2013, 07:47
The dot indicates that a filter is "chained" to act on the previous item on the same line.




return AVISource("something.avi").ChangeFPS(...).AssumeFPS(...)



is the same as



AVISource("something.avi")

ChangeFPS(...)
AssumeFPS(...)

return last



or you can use names for the clips



video = AVISource("something.avi")

return video.ChangeFPS(...).AssumeFPS(...)





video1 = AVISource("something1.avi")
video2 = AVISource("something2.avi")

video1 = video1.SomeFilter(...)

video2 = video2.AnotherFilter(...)

return video1 + video2



Check the Avisynth Mediawiki for instructions on the syntax. You can't really use or make effective scripts unless you understand the basics :)

BlockABoots
30th May 2013, 20:23
Ok i have done this but noticed after the section i have speeded up the audio is out of sync, so the audio didnt keep up with the video, how to i sync the audio?

paradoxical
30th May 2013, 20:37
Ok i have done this but noticed after the section i have speeded up the audio is out of sync, so the audio didnt keep up with the video, how to i sync the audio?

You need to resample it.

BlockABoots
30th May 2013, 21:26
Ok, how do i do that, within avisynth?

IanB
30th May 2013, 22:04
ResampleAudio() (http://avisynth.org/mediawiki/ResampleAudio) or TimeStretch() (http://avisynth.org/mediawiki/TimeStretch)

BlockABoots
30th May 2013, 22:10
This is my current script, how would i add that in?...

video=AVISource("E:\CAPTURES\My Records\amarec(20130529-2131).avi")
video1=lanczos4resize(video,1920,1080)
video2=trim(video1,0,18270) + trim(video1,18270,22150).ChangeFPS(2.88).AssumeFps(video1) +trim(video1,22151,48518) +trim(video1,53024,0)
video3=fadein(video2,50).fadeout(50)
return video3
ConvertToYV12()

StainlessS
30th May 2013, 23:43
I think maybe this part may need a little extra


AssumeFps(video1,sync_audio=true)

IanB
30th May 2013, 23:48
... ++ trim(video1,18270,22150).ChangeFPS(2.88).AssumeFps(video1, True).ResampleAudio(AudioRate(Video1)) ++ ...

BlockABoots
31st May 2013, 00:14
... ++ trim(video1,18270,22150).ChangeFPS(2.88).AssumeFps(video1, True).ResampleAudio(AudioRate(Video1)) ++ ...

That sorted it, thanks.