Log in

View Full Version : Granular video idea - newbie needs help


8pointer
4th December 2005, 11:49
hello.
being an avisynth scripting newbie/dufus
i hope somebody can help me here.

workin' on an art project that deals with 'granular' video
i want to process various videofiles in the following way:
the first three frames (frame 0 to 2) of a videofile
should loop - let's say - three times,
and then frame 1 to 3 three times,
then frame 2 to 4 three times,
and so on.

i feel this is a task
which could easily be mastered with avisynth.

i fooled around
with someting like:
loop(source,3,0,2)
loop(source,3,1,3)
loop(source,3,2,4)
loop(source,3,3,5)
loop(source,3,4,6)
loop(source,3,5,7)
loop(source,3,6,8)
loop(source,3,7,9)
etc.

but it didn't work.

i'd love to have a flexible script
that is dependent on the framecount of the sourceclip.
that way i could - kind of automate - the processing of various files.

please give me some hints.

cheers,
8pointer.

stickboy
4th December 2005, 12:54
i fooled around
with someting like:
loop(source,3,0,2)
loop(source,3,1,3)
loop(source,3,2,4)
loop(source,3,3,5)
loop(source,3,4,6)
loop(source,3,5,7)
loop(source,3,6,8)
loop(source,3,7,9)
etc.

but it didn't work.Please elaborate. It's not clear what you mean by "it didn't work", especially since you posted "something like" your script and not the exact script you actually used. (There are many ways in which things might not work!)

Anyhow. If you that's what you really did try doing, the result would be the output of the last Loop() call, because you didn't do anything with the previous results. You probably meant to do something like:
loop(source,3,0,2) + \
loop(source,3,1,3) + \
loop(source,3,2,4) + \
loop(source,3,3,5) + \
loop(source,3,4,6) + \
loop(source,3,5,7) + \
loop(source,3,6,8) + \
loop(source,3,7,9)Alternatively, my RemapFrames plug-in (http://www.avisynth.org/stickboy/) might be useful.

8pointer
4th December 2005, 15:36
stickboy,
thanks for yr correction.

i put some more efforts in understanding the loop function
and now i wrote a script that basically works like i want it:

source=avisource("D:\gg.avi")

trim(loop(source,3,0,2),0,8) + \
trim(loop(source,3,1,3),1,9) + \
trim(loop(source,3,2,4),2,10) + \
trim(loop(source,3,3,5),3,11) + \
trim(loop(source,3,4,6),4,12) + \
trim(loop(source,3,5,7),5,13) + \
trim(loop(source,3,6,8),6,14) + \
trim(loop(source,3,7,9),7,15) + \
trim(loop(source,3,8,10),8,16) + \
trim(loop(source,3,9,11),9,17) + \
trim(loop(source,3,10,12),10,18)

but this one isn't flexible at all.
i'd like to have a script that applies
this routine to a sourceclip (from its beginning to its end).
so it somehow should be dependent on framecount(source):
the 'trim(loop(source,int,int),int,int)' line should
automatically be applied repeatedly (framecount(source) - 2) times.
i hope this is understandable.

cheers,
8pointer.

8pointer
6th December 2005, 06:44
i'd like to have a script that applies
this routine to a sourceclip (from its beginning to its end).
so it somehow should be dependent on framecount(source):
the 'trim(loop(source,int,int),int,int)' line should
automatically be applied repeatedly (framecount(source) - 2) times.


is something like this possible or not.
do i have to edit the script per hand
according to the framecount of each single videofile?
or is there an elegant solution for writing an 'intelligent' script?
if there is please give me some hints.

cheers,
8pointer.

Mug Funky
6th December 2005, 07:26
so you want every group of 3 frames to loop 3 times?

try:

selectevery(3,0,1,2,0,1,2,0,1,2)

hopefully i've understood you correctly (and actually used selectevery correctly), as i've been stuck in hell's audio restoration all day and forgot to have lunch :)