PDA

View Full Version : ImageWriter to "write" a specific number of image very fast?


Gargalash
30th June 2009, 17:34
Hello all,
I keep turning this in my head, but I can't figure out a way to do what I want to do, I'm still to much of a beginner with avisynth. I am now asking for your help!

What I want to do is imagewrite 250 frames from various clips. The frames that will be written will be evenly distributed, so there has to some calculation made to define the number of frame between each imagewriting. I guess this is just fine:
increment = clip.framecount()/250

The source clips are AVIs and I do not need a video output. Idealy, I want a to modify the clip in a way that every x frame will be aligned one after the other and processed it as fast as my computer can take it, while imagewriting all frames.

I was thinking of doing this to start:
Selectevery(increment,0)
and I end up with an FPS of 0,278. Not exactly what I'm looking for. I played around but was never able to create a clip that was made out of only the frames I need to imagewrite. Maybe this is not the right way to do this.

Also, is there a way to "process" an AVS script without getting a video output? I only need those images.

Any thoughts or ideas? Thanks for helping!

Gavino
30th June 2009, 18:08
I was thinking of doing this to start:
Selectevery(increment,0)
and I end up with an FPS of 0,278. Not exactly what I'm looking for. I played around but was never able to create a clip that was made out of only the frames I need to imagewrite. Maybe this is not the right way to do this.
Also, is there a way to "process" an AVS script without getting a video output? I only need those images.
Your SelectEvery is correct and should give you the frames you want. The FPS doesn't matter, as you are not going to play the video in real time, but if it bothers you, just add AssumeFPS(whatever).

To process the script, load it into VirtualDub and run the 'video analysis pass'. That will cause any ImageWriter calls in the filter chain to be actioned.

Gargalash
30th June 2009, 19:49
Thanks for your reply Gavino!

My Selectevery(increment,0) was indeed fine since the beginning, but I was not paying attention to the resulting clip: When I played it, I thought all frames where repeated increment number of times, it didn't occured to me that it was just the FPS that went crawling. ...:o

Otherwise, thanks a lot for the 'video analysis pass' trick, solved my troubles.

I'm now ready to go!