Log in

View Full Version : Animation without stairsteps?


Losko
22nd February 2014, 00:49
I'm new in using avisynth's "animate" filter and I think it's great in video creation.
I use it for achieving a "pan" effect over a huge picture (a 8 mega pixel photo) like in this statement:

clip2=Animate(1, 500, "Crop", video_base, 0,1252,1920,1080, video_base, 1344,1368,1920,1080)

so I get clip2 (hd video: 1920x1080 px) with 500 frames panning from middle left side to bottom right corner of the big photo.
The issue is (maybe I'm just a noob, warn me :o) the "stepping" during animation. You see, the "crop" filter takes only integer parameters and, whilst they grow uniformously from beginning to the end, the vertical displacement is limited and jumps are clear (the top offset increasing by one).
Every time the "pan" is obliquitois these jumps are there, and this is just ugly.
Is there a way for getting a smoother animation?

Guest
22nd February 2014, 00:57
Apply the pan in superresolution and then resize down?

raffriff42
22nd February 2014, 01:40
You need ... KenBurnsEffect!
http://forum.doom9.org/showthread.php?t=135776

Also, here are a couple of very simple animated zoom-and-pan functions from myself, along with a discussion of why animating Crop does not work:
http://forum.doom9.org/showthread.php?t=168266

Edit, yeah, see below, that's it in a nutshell.

vampiredom
22nd February 2014, 01:42
You can use the *Resize functions to do floating-point cropping:

Spline36Resize(clip clip, int target_width, int target_height, float src_left, float src_top, float src_width, float src_height)

clip2=Animate(1, 500, "Spline36Resize",
\ video_base, 1920,1080, 0,1252,1920,1080,
\ video_base, 1920,1080,1344,1368,1920,1080
\ )

Gavino
22nd February 2014, 09:44
You can use the *Resize functions to do floating-point cropping
Correct, but you also have to use floating point (not integer) values in the Animate() call, otherwise the steps will still be done in integers only.

clip2=Animate(1, 500, "Spline36Resize",
\ video_base, 1920,1080, 0.0,1252.0,1920,1080,
\ video_base, 1920,1080,1344.0,1368.0,1920,1080
\ )

vampiredom
22nd February 2014, 19:10
Correct, but you also have to use floating point (not integer) values in the Animate() call, otherwise the steps will still be done in integers only.

Ah, of course. Thanks for correcting my mistake!

Losko
22nd February 2014, 22:14
Guys, thank you all!
I replaced any Crop call with a Resize call, and fixed parameters in order to make clear they are now floating point numbers.
The new video is... well... unbelievable :cool:
It is really smooth, I love it now!
Well, it takes a little more time for encoding than before, though (crop filter is faster, ok). And it's 170 MB bigger too.
Again, thank you!