Log in

View Full Version : Animating interframe


ficofico
10th May 2012, 17:56
I'm not able to create gradually slomotion to 100p to 25p with animate and interframe

In my brain it's very simple and logic.....:D

LoadPlugin("svpflow1.dll")
LoadPlugin("svpflow2.dll")
Import("InterFrame2.avs")

AviSource("c:\test50p.avi").converttoyv12()
assumefps(50)
InterFrame(Cores=2)
Animate(0,100,"assumefps",100,25)
changefps(25)

But I think that it's too simple to be true ...I've find this discussion

http://forum.doom9.org/archive/index.php/t-161835.html

but I'm not able to fully understand how to change the script....

Thanks.

Gavino
10th May 2012, 19:39
Using my VarSpeed function from this post in the thread you linked, try this:
LoadPlugin("svpflow1.dll")
LoadPlugin("svpflow2.dll")
Import("InterFrame2.avs")

AviSource("c:\test50p.avi").converttoyv12()
assumefps(50) # shouldn't be needed if source really is 50p
InterFrame(Cores=2)
VarSpeed(4.0, 1.0)
AssumeFPS(25)
This assumes your source is 50fps and you want your result to be 25fps, with the action appearing to start at double real-time and gradually slow to end at half real-time.

Note: Here InterFrame itself is not animated (I don't think it can be), but what happens is the rate is doubled to 100fps (producing extra frames) and the subsequent frame decimation is animated at a varying rate by the VarSpeed function to produce the variable speed.

ficofico
10th May 2012, 20:03
Ok, I've not understand why at the end it's need assumefps instead of changefps but it's ok... I've just tried with "VarSpeed(2.0, 1.0)" because I want to start with normal speed to 1/4

Great Gavino, now I can simple integrate your code in my personal avisynth gui for slow mo my nex-5n files gradually, I need to split my file in more istance and join them after with virtualdub becuase it's not possible to select start-stop but I'm happy with your script..

Gavino
10th May 2012, 21:10
Ok, I've not understand why at the end it's need assumefps instead of changefps but it's ok... I've just tried with "VarSpeed(2.0, 1.0)" because I want to start with normal speed to 1/4
Actually, I think my description above was wrong and VarSpeed(4.0, 1.0) should produce a start with normal speed and end at 1/4 (not double to 1/2 as I said) .

Assuming your source is 50fps, InterFrame changes the rate to 100fps (doubling the number of frames, so the playback duration remains the same).
VarSpeed(4.0,1.0) doesn't change the framerate, but drops frames (using ChangeFPS) at a varying rate to change the perceived speed from 4x to normal.
The final AssumeFPS(25) then slows the playback rate to 1/4, so the perceived speed goes from normal to 1/4.

However, if your source is actually 25fps (and you still have AssumeFPS(50) at the start), then VarSpeed(2.0, 1.0) should start at normal speed and end at 1/2.

ficofico
10th May 2012, 21:24
OK, I've seen that "4.0,1.0" it's right to 100 to 25p......There's a way to do this script without changefps that can produce jerky video but with some other smoother """frame dropper"""?

ficofico
10th May 2012, 21:41
Gavino, I think that "4.0,1.0" it's wrong... too fast, it's ok with "2.0,1.0"

Gavino
11th May 2012, 00:08
There's a way to do this script without changefps that can produce jerky video but with some other smoother """frame dropper"""?
As I suggested in the original linked post, VarSpeed2 could be changed to use MFlowFPS instead of ChangeFPS. To avoid a performance hit, you would need to calculate the motion vectors once only in VarSpeed and pass them as parameters to VarSpeed2. In this scenario, there's probably no point in using InterFrame as well. I don't have time to work out the detailed changes, so I'll leave that as an exercise. :)

Gavino, I think that "4.0,1.0" it's wrong... too fast, it's ok with "2.0,1.0"
That's puzzling.
What is the actual frame rate of your source and what does your script look like now?
Certainly, with "2.0,1.0", the speed at the start should be twice the speed at the end. How those speeds relate to 'normal' will depend on the other bits of the script (AssumeFPS, etc), but regardless of that, the ratio between starting and finishing speeds should end up the same as the ratio of the two VarSpeed arguments.