View Full Version : Avusynth new feature request
Zarxrax
8th November 2002, 05:04
Could someone add a command to use a filter on just a certain frame range?
Say I'm encoding a movie, and I want use say, tweak on frames 5000-5100.
It would be nice if I could do something like
Range(Tweak(whatever settings), 5000,5100)
This would be a lot simpler than having to use 3 trim commands.
ErMaC
8th November 2002, 07:42
I think you can write a function to do this on your own, but I'm not sure. Worst thing is you could write a plugin to do it, and it wouldn't be too difficult. I was actually thinking of the same thing the other day and the only thing I'm not sure how to do in AVISynth's scripting language is pass the actual command. But I'll try something tonight and see what I come up with.
ErMaC
8th November 2002, 08:14
Well I've run into a bit of a stumbling block here in my scripting and my programming isn't quite good enough to figure out what's wrong.
Here's the function I'm trying to write:
function Range(clip c,string Command,int In, int Out)
{
before = c.Trim(0,In - 1)
rangeclip = c.Trim(In,Out)
after = c.Trim(Out+1,0)
rangeclip = rangeclip.Command
return (before + rangeclip + after)
}
Unfortunately, no matter what I throw in for the "Command" line I always am told that the filter is being given invalid arguments. Can someone tell me what's wrong here?
BTW I know it'll mess up on the first or last frames, I haven't bothered adding error handling to it yet.
LigH
8th November 2002, 08:25
Please look for my "Array4x4" snippet here - I was successfully able to execute a command which is delivered to a function as parameter. You'll probably not need to do it so complicated, I needed to use different variable arguments, you may just use one simple command string.
hakko504
8th November 2002, 12:49
Untested, but this should work:function Range(clip c,string Command,int In, int Out)
{
before = c.Trim(0,In - 1)
rangeclip = c.Trim(In,Out)
after = c.Trim(Out+1,0)
rangeclip = rangeclip.EVAL (http://www.avisynth.org/index.php?page=ScriptFunctions)(Command)
return (before + rangeclip + after)
}
ErMaC
8th November 2002, 13:02
Unfortunately that doesn't seem to work. When I do that I'm told that it does know what "Insert function name here" is. I've tried telecide, ShowFrameNumber, tweak with some wacky values, nothing seems to work.
LigH
8th November 2002, 14:34
The problem here seems to be, that "Eval()" does not work in "object method" syntax, only in "basic function" syntax:
result = clip.Eval(filter + "(" + arguments + ")")
does not work, instead
result = Eval(filter + "(clip," + arguments + ")")
may work - provided that the name of the clip is known in this scope. I see that my snipped is a bit complicated, but the Function TestClip(clip c, string cmd, string args) is the place you may find some answers.
http://forum.doom9.org/showthread.php?s=&threadid=33866
Xenoproctologist
8th November 2002, 15:10
function range(clip clip, string command, int first, int last)
{
pre = clip.trim(0,first-1)
processed = clip.trim(first,last)
post = clip.trim(last+1,0)
processed = eval("processed." + command)
return pre + processed + post
}
avisource("i:\new folder\[raw-jpn]molly hi star racer[trailer].avi")
range("levels(0,1,255,255,0)",100,200)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.