View Single Post
Old 4th March 2008, 03:31   #8  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
@Gavion I was planing on using a sort array method, to order the array from largest to smallest, inside the ProcessCutPoints() function. Without your helpful input, i probably would have done it another way, with a lot of math calc involved.

After looking at [http://avisynth.org/mediawiki/Arrays] and [http://avslib.sourceforge.net/functi...raycreate.html], i have decided to drop the idea of processing multiple clips simultaneously. The ProcessCutPoints() function should clear the arrays, so that it can still do cuts on multiple clips; just not all at the same time. Speaking of arrays i think 4 single dim arrays would be the easiest to do with the avisynth language. I just need a way to sort this, otherwise as Gavion has pointed out, my simple method is quite adequate.

Any input would greatly be appreciated, should i go for the 2 step process or should i leave this as is?


EDIT
Multiple options can be passed to the blending function now
Code:
function CutFrames(clip c, int start, int end, int "duration", string "transition", string "opt1", string "opt2", string "opt3")
{
	duration = default(duration, 0)
	transition = default(transition, "Dissolve")
	return 
	\	Defined(opt3) ? Eval(transition + "(c.trim(0, " + string(start) + "), c.trim(" + string(end) + ", c.Framecount()), " + string(duration) + ", " + String(opt1) + ", " + String(opt2) + ", " + String(opt3) + ")") :
	\	Defined(opt2) ? Eval(transition + "(c.trim(0, " + string(start) + "), c.trim(" + string(end) + ", c.Framecount()), " + string(duration) + ", " + String(opt1) + ", " + String(opt2) + ")") :
	\	Defined(opt1) ? Eval(transition + "(c.trim(0, " + string(start) + "), c.trim(" + string(end) + ", c.Framecount()), " + string(duration) + ", " + String(opt1) + ")") :
	\	Eval(transition + "(c.trim(0, " + string(start) + "), c.trim(" + string(end) + ", c.Framecount()), " + string(duration) + ")")
}


CutFrames(200, 800, 60, "TransSwing", "false", "1", "1")
http://avisynth.org/vcmohan/TransAll...ransSwing.html


You can also use this as a quick, apply effect to range function, that takes 2 clips as input
Code:
CutFrames(200, 150, 50, "EffectName")
Or instant replay
Code:
CutFrames(300, 150)
Or "Drunk Effect"
Code:
CutFrames(800, 100, 695)

Last edited by mikeytown2; 4th March 2008 at 04:39.
mikeytown2 is offline   Reply With Quote