View Full Version : Zoom with animate
lisztfr9
17th May 2012, 12:46
Hi,
I tested zoom, with color bars :
(colorbars(320,240).trim(0,500)).converttoyv12()
ScriptClip(last, "Subtitle(String(AverageLuma))")
# Affiche 'frame = le numéro d'image' sur un clip:
ScriptClip("""subtitle(" frame = " + string(current_frame))""")
clip = last
# BicubicResize(clip,320,240,1.0/3,1.0/3,80,60,60,80)
# Animate(100,300,"BicubicResize", clip,320,240,1.0/3,1.0/3,0,0,0,0, clip,320,240,1.0/3,1.0/3,80,60,60,80)
last.ConvertToRGB()
I can't figure out how to zoom in the center of the screen with magnifying x 2.
It usually zooms from infinite into the result crop parameter, but not from the previous clip to the desired result...
TIA, L
Gavino
17th May 2012, 14:17
Animate(100,300,"BicubicResize", clip,320,240,1.0/3,1.0/3,0,0,0,0, clip,320,240,1.0/3,1.0/3,80,60,60,80)
I can't figure out how to zoom in the center of the screen with magnifying x 2.
It usually zooms from infinite into the result crop parameter, but not from the previous clip to the desired result...
That's because the source region (except for the first animation frame) is being animated from a very small size. Instead of starting with (0,0), use the explicit (320,240).
Also, if you want x2, the final parameters are wrong.
And for a smoother variation, use floating point instead of integer.
Animate(100,300,"BicubicResize", clip,320,240,1.0/3,1.0/3,0,0,320.0,240.0,
\ clip,320,240,1.0/3,1.0/3,80.0,60.0,160.0,120.0)
lisztfr9
17th May 2012, 15:07
Ah ok thanks ! i read that too fast, and thought it was all about cropping :(
BicubicResize(clip clip, int target_width, int target_height, float b, float c, float src_left, float src_top, float src_width, float src_height)
By-the-way, the example here is not working :
http://avisynth.org/mediawiki/Animate
Animate(100,200,"BicubicResize", clip,320,240,0,0,320,240, clip,320,240,120,90,80,60)
they omitted the b and c parameters, or maybe should have use BilinearResize.
Using floating point improves it a lot :)
I came on this question while watching some videos with a lot of scene transition effects, like here :
http://www.youtube.com/watch?feature=endscreen&v=llgsag-B3N0&NR=1
zoom, fade, slide, and more. But i think ffmpeg can do some of them.
Gavino
17th May 2012, 16:47
Ah ok thanks ! i read that too fast, and thought it was all about cropping :(
Well, it is just like cropping, and the parameters have the same meaning as in Crop().
By-the-way, the example here is not working :
http://avisynth.org/mediawiki/Animate
Animate(100,200,"BicubicResize", clip,320,240,0,0,320,240, clip,320,240,120,90,80,60)
they omitted the b and c parameters, or maybe should have use BilinearResize.
Yes, you're right.
That's a trap for the unwary when using BicubicResize with Animate.
ajp_anton
17th May 2012, 22:29
Hijacking this thread...
What about when zooming something that is later going to be overlayed on another clip. I've animated a custom function that overlays the resized clip onto another, so it works so far.
But can I get floating point accuracy on the resized clip's size?
Gavino
17th May 2012, 23:10
But can I get floating point accuracy on the resized clip's size?
Not using the standard filters.
You would have to implement your own combined overlay/resizer to work with subpixel accuracy at the boundary of the overlaid region.
ajp_anton
18th May 2012, 03:14
Would this work:
Source is A pixels wide and I want it at B pixels at a given frame. I resize it to ceil(B) while padding the source so the actual image fits into B pixels.
Then I make a mask ceil(B) wide, where the outer edge is 255*(B-floor(B)), and overlay using this mask.
Assuming only one edge of the image actually moves during the zoom.
Gavino
18th May 2012, 09:27
I don't think that works, since the blended edge pixel will also have some proportion of the padding, which I presume you don't want.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.