array type and for loop in avisynth? 📝 Introductions 📝 Forum
Forum

Forum



SearchSearch   Users   Registration   Entrance
Today: 21.07.2025 - 15:52:20
Pages:  1  

array type and for loop in avisynth?

Advertising


AuthorMessage

ArcticSilver

user




Statistics:
Messages: 39
Registration: 04.12.2001

Greetings all. I'm working on an Avisynth script to use in my anime encodes and I was wondering if there was an array type or a for loop-like expression in Avisynth. I didn't find any mention of either in the documentation, but since I read somewhere in this forum that the documentation often lagged behind the reality I thought I'd ask.

----------------
Message # 1 31.08.21 - 21:03:15
RE: array type and for loop in avisynth?

mishaken

user




Statistics:
Messages: 162
Registration: 07.09.2003

I'm writing a function that iterates over a clip, performs an operation on each frame, and uses the results to create a metric. I want the number of samples it takes from the clip in question to be user-defined. This means that I need something to hold the values for me while the script takes a look at each frame in the clip. It's nonsense for me to use variables like this: Code:

----------------
Message # 2 31.08.21 - 21:12:06
RE: array type and for loop in avisynth?

Evan e21

user




Statistics:
Messages: 90
Registration: 01.23.2003

Well, if you really want to, you could use strings as a poor-man's array. First you'd write a recursive function with a string as its accumulator; something of the form: Code:

----------------
Only in a JEEP
Message # 3 31.08.21 - 21:15:51
RE: array type and for loop in avisynth?

ACS Rob

user




Statistics:
Messages: 221
Registration: 10.10.2001

Wow, that's a neat trick that I never thought of, but sweet jesus is it ever a hack ;) Thanks! -p

----------------
Message # 4 31.08.21 - 21:21:38
RE: array type and for loop in avisynth?

12:03

user




Statistics:
Messages: 8,092
Registration: 05.19.2003

The Kluge consists of writing a compare log to a file with: avisource( "movie.avi" ) v2 = trim( last, 1,0 ) Compare(last, v2, "", "compare.log", true) then run AWK $2 == 0 {print "DeleteFrame( " $1 " )" "\r" } now we have another AVS which deletes all the desired frames. If it was C I would write output( Frame[ FIRST_FRAME ] ) ; for( i = FIRST_FRAME + 1 ; i <= LAST_FRAME ; i++ ) { if( Frame[ i ] != Frame[ i - 1 ] ) output( Frame[ i ] ; /* Else skip this one */ }

----------------
Milltek pipes. Ground control coilovers. Conforti Tuned. V1 & iPod hardwired
Message # 5 31.08.21 - 21:26:40
RE: array type and for loop in avisynth?

brokeazz

user




Statistics:
Messages: 507
Registration: 07.28.2003

No, idea what the smartest way is. Maybe the following works: 1) subtract frame j and j+1 2) if averageluma of the resulting frame is close to 128 (check that by using ScriptClip) => delete that frame

----------------
Message # 6 31.08.21 - 21:35:20
RE: array type and for loop in avisynth?

sde39

user




Statistics:
Messages: 152
Registration: 12.20.2003

This is a nasty one. DeleteFrame reqires a frame number. What if you delete frame N ? How are they numbered after that ? I deleted them High numbers first to avoid that. Another problem with the Kluge method is that the first AVS that does the compare won't execute on all frames unless you frames serve to something that reads all the frames. The only thing I could think of was play it in Vdub. That takes 2 hours if it's a 2 hour movie. If I had /dev/null I could send it there as an AVI, does window have a null file ? Anybody know of a frameclient that requests frames as fast as it can go ? Another AVS might do. I don't really NEED to do this, I just want to solve the puzzle.

----------------
Message # 7 31.08.21 - 21:39:23
RE: array type and for loop in avisynth?

DHoang

user




Statistics:
Messages: 39
Registration: 11.17.2003

Hmmm... I need to think about this for a while. :)

----------------
Message # 8 31.08.21 - 21:45:12
RE: array type and for loop in avisynth?
Pages:  1  

The administrator has prohibited guests from replying to messages! To register, follow the link: register


Participants