View Full Version : Is it possible to do ramped slow motion?
Attack
10th July 2010, 14:55
Hi,
I've been using avisynth for quite a while now, but I cannot figure out how to do this, if at all possible.
This a technique used a lot in skateboard videos. I've found plenty of guides, but they all use Adobe After Effects and I don't have the money to buy it. Not even close.
In effect, what it is, is that you have a clip which is gradually slowed down and then gradually sped back up. How much it's slowed down and for how long the ramp last all differs depending on desired effect. Now getting a clip at half speed isn't an issue, even slower could be done alongside the regular speed clip.
Everything I've tried was exceptionally tedious. Splitting it apart, using assumefps and then changefps so they can be spliced back together. Aside from the results not being smooth and requiring massive amounts of tinkering, it's just not viable to do it again. So what I'm hoping is that someone can shed some light for me on how best to approach this? Maybe there are nifty filters and plugins out there I haven't yet noticed that could seriously help my cause.
At the end of it all I'd like a lovely function I can plug a clip into and the frames in between and have it all ramp it.
Gavino
10th July 2010, 17:17
This can be done using Animate and a suitable framerate changing function (eg ChangeFPS). Something similar was discussed in this thread. It's slightly tricky as there a number of subtle points involved - see my last post in that thread.
Here is a function that will help:
function RampSpeed(clip c, float v1, float v2) {
av = 0.5*(v1+v2) #average speed
count = round(c.FrameCount()/av) # result frames
Animate(c.Loop(), 0, count-1, "ChangeSpeed", v1, av).Trim(0, count-1)
}
function ChangeSpeed(clip c, float v) {
c.AssumeFPS(v*c.Framerate())
ChangeFPS(c)
}
For example, RampSpeed(1.0, 0.5) will gradually slow down from normal speed to half-speed, and RampSpeed(0.5, 1.0) will do the opposite. Use Trim and Splice to select the frames to be affected and to put the whole thing together. For extra points, you could modify the function to do that for you.
Of course the ChangeFPS() in ChangeSpeed can be replaced by ConvertFPS() or even MFlowFPS() if you want.
Attack
11th July 2010, 13:28
Thank you. I used the search, but couldn't find anything.
Would MVFlowFPS deliver better results than ConvertFPS or ChangeFPS?
Here's the thing, typically our clips are 60FPS and I like publishing in 60FPS. It's much smoother, especially for skating and allows people to do proper slow mo of the tricks with their media players. Can't ramp everything!
So which approach would be better? Having the clip at 30 frames and thus half speed and speeding it up, or at 60 and slowing it down? I'd guess the former, because for the latter you'll need to create duplicate frames or whatever fancy stuff mvflowfps does to keep the slow mo going at 60 as well.
Though again, rest of the clips would be 60, so I'd have to change it to 60 in the end anyway.
Thanks for the code. If I'm reading it correctly, then it would slow down the clip, but not speed it back up? I think with this base I can figure it out, so thanks a lot.
I have nothing to try it with right now, but should later today, I'll just use some skate (game) footage for the tests. The game has one advantage... I can upload the clips at 10/20/30/etc speed. If only I had a camera that could record that many frames a second :(
Gavino
11th July 2010, 14:51
Would MVFlowFPS deliver better results than ConvertFPS or ChangeFPS?
Possibly, especially if the clips have a lot of motion (which I assume they do).
But it will be slower to process, and is a bit more complex to script.
I would start with ChangeFPS and see if you are happy with the results.
Here's the thing, typically our clips are 60FPS and I like publishing in 60FPS. It's much smoother, especially for skating and allows people to do proper slow mo of the tricks with their media players. Can't ramp everything!
So which approach would be better? Having the clip at 30 frames and thus half speed and speeding it up, or at 60 and slowing it down? I'd guess the former, because for the latter you'll need to create duplicate frames or whatever fancy stuff mvflowfps does to keep the slow mo going at 60 as well.
Though again, rest of the clips would be 60, so I'd have to change it to 60 in the end anyway.
Not sure I understand your question here. Certainly shooting at 60fps will capture motion better to start with.
Thanks for the code. If I'm reading it correctly, then it would slow down the clip, but not speed it back up?
No, it's completely general and does either (though only one at a time) - to do both just call it twice. For example,
Trim(0, 200) + Trim(201, 300).RampSpeed(1.0, 0.5) + Trim(301, 400).ChangeSpeed(0.5) +
\ Trim(401, 500).RampSpeed(0.5, 1.0) + Trim(501, 0)
will ramp down to half-speed between frames 201 and 300, stay at half-speed for frames 301 to 400 and ramp back up to normal speed between frames 401 and 500.
Note that the original frame rate is preserved, so the output has more frames (since longer), the extra frames being introduced by ChangeFPS (or whatever alternative you use).
Attack
13th July 2010, 00:08
Not sure I understand your question here. Certainly shooting at 60fps will capture motion better to start with.It's shot at 60.
I'll try to be a bit clearer - I'm in the process of a move, so the last was written in haste. However, since then I've given it some though and realised what I was asking was a stupid question anyway.
No, it's completely general and does either (though only one at a time) - to do both just call it twice.Sorry, I think you misunderstood my question, though you did answer it! I was asking if it did the slow down and speed up in the same call, but it doesn't. Thanks ever so much for your help.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.