Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
31st July 2005, 14:17 | #21 | Link |
C64
Join Date: Apr 2002
Location: Austria
Posts: 830
|
Indeed, you missed that you have to tell Zoom the variation with the frame number.
Try this: Code:
imagereader("kill_bill.bmp",0,500,fps=25) converttorgb32() #srcx/y is the CENTER of the source picture which is then mapped to a destination picture at dstx/dsty. #zoom(srcx="640", srcy="480", factor="1") #this gives the start picture #zoom(srcx="734", srcy="320", factor="4") #this gives the final picture #but you want to zoom so use variable "n" to vary the arguments (n is the same as "current_frame" in scriptClip) #best you use Spline as your function sf=10 #startframe ef=30 #endframe srcx = "spline(n, sf-1,640, sf,640, ef,734, ef+1,734, false)" srcy = "spline(n, sf-1,480, sf,480, ef,320, ef+1,320, false)" factor="spline(n, sf-1,1, sf,1, ef,4, ef+1,4, false)" zoom(srcx=srcx, srcy=srcy, factor=factor) #this varies factor, dstx, dsty from frame 10 to frame 20. ReduceBy2() # now...: downsize afterwards gives better antialiasing but is slower It's that complicated to allow any "path" functions (e.g. you can spiral or sine your picture by using srcx/y=sin/cos) Last edited by WarpEnterprises; 31st July 2005 at 14:20. |
31st July 2005, 15:11 | #22 | Link |
Registered User
Join Date: Oct 2004
Location: 'neutral' zone
Posts: 110
|
Thanks for re-writing that script! - It works fine although i don't know exaclty how and why...
It's great the zoom length can be easily defined now, initially i had no idea where to do this... At first sight i have the impression the zoom is flying a 'skyward bow' onto the eyes!? But before i post more thoughts i guess i have to learn more about these internal Avisynth functions like spline()... Last edited by AsTimeGoesBy; 31st July 2005 at 15:35. |
25th September 2005, 03:21 | #23 | Link |
Registered User
Join Date: Jun 2005
Posts: 1
|
I've been trying to make this work...but it's not doing what I want.
I have a 640X480 video made from a bmp using imagereader. I want it to zoom out instead of in. If I play it backwards, it does what I want but how do you make it work the other way? Code:
imagereader("E:\LM\IMG00022.bmp",0,100,fps=20) converttorgb32() sf=0 #startframe ef=100 #endframe srcx = "spline(n, sf-1,320, sf,320, ef,320, ef+1,240, false)" srcy = "spline(n, sf-1,240, sf,240, ef,240, ef+1,240, false)" factor="spline(n, sf-1,1, sf,1, ef,8, ef+1,8, false)" zoom(srcx=srcx, srcy=srcy, factor=factor) |
26th September 2005, 07:09 | #24 | Link |
C64
Join Date: Apr 2002
Location: Austria
Posts: 830
|
exchange the values from the number pairs with "sf" with those "ef":
Code:
srcx = "spline(n, sf-1,240, sf,320, ef,320, ef+1,320, false)" srcy = "spline(n, sf-1,240, sf,240, ef,240, ef+1,240, false)" factor="spline(n, sf-1,8, sf,8, ef,1, ef+1,1, false)" I think the srcx, srcy lines are not necessary as it centers the picture as default. |
8th June 2008, 10:29 | #25 | Link |
Resize Abuser
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
|
Sorry to dig this up.
I'm trying to make a clip move in a arc/circle (orbit), how could this be done? Math-wise to draw a circle: x^2+y^2= r^2 in zoom: +-Sq(#frames^2-n^2) ??? the last line is wrong, but i believe the top 2 are good. This is of course missing startF and endF which are the desired start and end points. Code:
String((endFrame-startFrame)/2.0) + ">n?" \+ " pow(" + String(pow((endFrame-startFrame)/2.0,2)) + "-pow(n,2),0.5)" + \" : pow(" + String(pow((endFrame-startFrame)/2.0,2)) + "-pow(" + String(endFrame-startFrame) + "-n,2),0.5)" + "" This will draw a straight line Code:
"spline(n, " \ + String(startFrame) + "," + String(startF) + ", " \ + String(endFrame) + "," + String(endF) + ", true)" Using this for my KenBurnsEffect Function Here is a function that i am currently developing Code:
Function SplineCalc(clip c, int mode, int startFrame, float startF, int endFrame, float endF) { splineString = mode==1 ? \ "spline(n, " \ + String(startFrame-1) + "," + String(startF) + ", " \ + String(startFrame) + "," + String(startF) + ", " \ + String(endFrame) + "," + String(endF) + ", " \ + String(endFrame+1) + "," + String(endF) + ", true)" \ : mode==2 ? "spline(n, " \ + String(startFrame) + "," + String(startF) + ", " \ + String(startFrame+(endFrame-startFrame)/3.0) + "," + String(startF) + ", " \ + String(endFrame-(endFrame-startFrame)/3.0) + "," + String(endF) + ", " \ + String(endFrame) + "," + String(endF) + ", true)" \ : mode==3 ? "spline(n, " \ + String(startFrame) + "," + String(startF) + ", " \ + String(startFrame+(endFrame-startFrame)/3.0) + "," + String(endF) + ", " \ + String(endFrame-(endFrame-startFrame)/3.0) + "," + String(startF) + ", " \ + String(endFrame) + "," + String(endF) + ", true)" \ : mode==4 ? "spline(n, " \ + String(startFrame) + "," + String(startF) + ", " \ + String((endFrame-startFrame)/2.0) + "," + String(startF) + ", " \ + String(endFrame) + "," + String(endF) + ", true)" \ : mode==5 ? "spline(n, " \ + String(startFrame) + "," + String(startF) + ", " \ + String((endFrame-startFrame)/2.0) + "," + String(endF) + ", " \ + String(endFrame) + "," + String(endF) + ", true)" \ : "spline(n, " \ + String(startFrame) + "," + String(startF) + ", " \ + String(endFrame) + "," + String(endF) + ", true)" Return splineString } Any example would be helpful, demonstrating a circle/arc. The example doesn't have to use my syntax, i just need anything. Doing a search got me this EDIT: Found an old script that uses layer to do this Here is my take on that code Code:
a = Colorbars().Trim(0,199) b = a.Invert().BilinearResize(320,240) Animate(0,199, "circlee", a,b,320,240,60.0,0.0 , a,b,320,240,0.0,50.0 ) # circle: gives a clip which is moved along (by varying "t") a circle with center (centerX,centerY) # with radius "axis" the resulting clip on a black background. function circlee(clip clip, clip "LClip", int "centerX", int "centerY", float "axis", float "t") { x = round((centerX-LClip.width/2)+axis*cos(Pi*t*0.5)) y = round((centerY-LClip.height/2)+axis*sin(Pi*t*0.5)-axis) return clip.Layer(LClip, "Add", 255, x,y) }
__________________
Mine: KenBurnsEffect/ZoomBox CutFrames Helped: DissolveAGG ColorBalance LQ Animation Fixer Last edited by mikeytown2; 8th June 2008 at 19:28. |
8th June 2008, 20:13 | #26 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,433
|
Quote:
A point (x, y) on the circle of radius r centred at (x0, y0) satisfies the equation (x-x0)^2 + (y-y0)^2 = r^2. This can be recast as x= x0 + r*cos(theta), y= x0+ r*sin(theta) for some angle theta. To trace out a circle, vary theta from 0 to 2*Pi. To trace out an arc, vary theta over some continuous range. The variation (of theta) can be done linearly with Animate, or in some arbitrary way with the Zoom plugin by deciding how you want theta to vary in terms of 'n' (the frame number); for linear variation (constant rotation speed) you would use theta = k*(n-startFrame) for some constant k. Then use the earlier equations to derive x and y from theta. Last edited by Gavino; 8th June 2008 at 23:17. Reason: Clarification + removed reference to Spline |
|
9th May 2015, 19:24 | #28 | Link |
Registered User
Join Date: Jun 2007
Posts: 417
|
Link in the first post is broken so here is the current location for the original x86 download:
http://www.avisynth.nl/users/warpenterprises/ Last edited by l33tmeatwad; 31st March 2017 at 15:17. |
Thread Tools | Search this Thread |
Display Modes | |
|
|