In AVIsynth, what is the equiv of for/next or repeat/until or do/while or whatever
I need run several selectevery() but based on a value or else a condition--switch to diff select, etc. It should be simple, i hope.
i.e.
REPEAT
a = select(1)
b = select(2)
int counter = 0
inc(counter); if counter>1 then counter=0
if counter=0 then do a else b
UNTIL last_frame_found
..throughout the entire clip..
I searched, but http://avisynth.org/mediawiki/Special:Search?search=repeat&go=Go
seems to leave me beleaving there is no function or can not be done, so there must be some technique not yet discovered/used, I don't know.
I may turn it into a function, just not sure at this point, mainly debugging different ideas .. thanks for any leads.
-vhelp 5369
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
Last edited by vhelp; 30th Apr 2010 at 00:15.
-
In standard Avisynth, there is no looping in the script language - you have to do it using recursive functions.
The GScript plugin provides while/for loops as language extensions (also if/then/else blocks).
Note however that explicitly looping over all frames in the script is probably a bad idea, for performance reasons. For doing frame-dependent processing, it is better to use the ScriptClip function, which allows arbitrary script code to be run at each frame during rendering. -
Can't you just combine each selectevery into 1 selectevery?
if selectevery(a) is selectevery(5,0,3) and selectevery(b) is selectevery(4,1,3), just combine them to selectevery(9,0,3,6,8). -
update -- I know its been a while since i first posted the question, but .. unfortunately, gscript doesn't work on my system. "not an avisynth 2 C" error. Anyway, it must be a version problem, i'm running v2.57 so i'll assume that's the cause.
I found these twp pages on this plugin but didn't see this error reported there.
http://forum.doom9.org/showthread.php?t=147846
http://forum.doom9.org/showthread.php?t=147846&page=2
ah, found v2.5.8, downloading now..
file: http://www.afterdawn.com/software/general/download.cfm/avisynth?mirror_id=0&version_id...oftware_id=476
edit: turns out i used the loadplugin incorrectly..anyway, now have v2.5.8 running w/ GScript but can't seem to get it to do what I was trying to-to simulate the above first post--just yet.
-vhelp 5373Last edited by vhelp; 8th May 2010 at 00:32.
-
Post your script and I will take a look.
Actually, there is a logical error in your earlier pseudo-code:
REPEAT
a = select(1)
b = select(2)
int counter = 0
inc(counter); if counter>1 then counter=0
if counter=0 then do a else b
UNTIL last_frame_found
Could this be the problem?
Similar Threads
-
AVISynth function to darken an area
By kinglerch in forum EditingReplies: 13Last Post: 9th Apr 2012, 17:26 -
Avisynth function to TBC old VHS video?
By Asterra in forum CapturingReplies: 4Last Post: 4th Sep 2011, 02:35 -
AviSynth: No function named LeakKernelDeint
By user2008 in forum Video ConversionReplies: 4Last Post: 23rd May 2010, 16:42 -
AviSynth function to add SUP subtitles?
By MilesAhead in forum SubtitleReplies: 11Last Post: 3rd Feb 2010, 13:16 -
Overlay text at various positions via avisynth subtitle() function ?
By vhelp in forum EditingReplies: 3Last Post: 11th Jul 2009, 03:29