Log in

View Full Version : How to reorder every 10 frames thusly: (0,1,2,3,4,6,5,8,7,10,9) ???


Sinsearach
3rd September 2013, 01:34
(1st: noticed funny thing.... is my 1st post, but join date feb, 2006 hahaha)

So....
Raw preprocessed avi, some 6gb, loads and plays no problem, but
QTGMC has left some disordering....

This task is just barely beyond my currently understanding, but I know it certainly involves SelectRangeEvery, SelectEvery, and something with interleave, but I'm basically lost beyond that.

Thanks for your attention.

-Laters

JELSTUDIO
3rd September 2013, 02:00
Not that I want to pretend my own understanding of avisynth is pretty great, I'd still chip in with what I think might be correct:

Avisynth doc says: "SelectEvery (clip, int step_size, int offset1 [, int offset2 [, ...]])"

So perhaps this is what you need:

SelectEvery(11, 0,1,2,3,4,6,5,8,7,10,9)

I haven't tried it though. Hope it works :)

EDIT: maybe this one: SelectEvery(10, 1,2,3,4,6,5,8,7,10,9)

Sinsearach
3rd September 2013, 03:24
EDIT:
GOT IT
had to manually step through 1st 15 frames ad-nauseum and work out the sequence in my head and finally succeeded with:
"SelectEvery(clip1, 10, 0, 1, 2, 3, 5, 4, 7, 6, 9, 8)"

YAY
------
Im speechless, could it really be so simple?

Let us check...

damn, doesn't work, nor this:
SelectEvery(clip1, 1, 0, 1, 2, 3, 4, 6, 5, 8, 7, 10, 9)

JELSTUDIO
3rd September 2013, 04:18
I just tested it and it does indeed work.

I placed the command after a command to show frames and it does pick exactly the entered frames.

I don't know what goes wrong in your script, but if it's the sequence then it should be simple to enter (provided the disordering of frames you have in your video is not random or change over time)

If you load your clip into a variable, then make sure you transfer the video into the 'last' variable before feeding it into the 'SelectEvery' command (or replace 'clip1' with the name of your variable)

The first number in 'SelectEvery' (the 11 or 10) is the range of frames that you adjust. This must be a repeatable sequence.

This command: SelectEvery(10, 1,2,3,4,6,5,8,7,10,9)
will run on each set of 10 frames and select frame 1, then 2, 3,4,6,5,8,7,10,9, then 11,12,13,14,16,15, etc

TheFluff
3rd September 2013, 06:02
Frame number arguments to selectevery() are 0-indexed, and out-of-bounds arguments do not raise an error. In other words, selecteven() is the equivalent of selectevery(2, 0) (i.e. select the 0th frame of every 2-frame cycle), selectodd() is the equivalent of selectevery(2, 1), and selectevery(2, 2) has undefined behavior.

gyth
3rd September 2013, 13:06
selectevery(2, 2) has undefined behavior.
Undefined how?
I use selectevery(1,-1) and selectevery(1,1) quite a bit.
Could that explode some day?

Didée
3rd September 2013, 17:40
Per definition of SelectEvery, an undefined behaviour is not possible. It is perfectly allowed for the offset arguments to fall outside of the increment window. I.e. SelectEvery(2,2) selects each third frame of the start position incremented by 2.

Guest
3rd September 2013, 17:44
SelectEvery() used to re-order frames will presumably perform non-linear frame access, and so your source filter must be reliably frame accurate.

TheFluff
4th September 2013, 01:16
Per definition of SelectEvery, an undefined behaviour is not possible. It is perfectly allowed for the offset arguments to fall outside of the increment window. I.e. SelectEvery(2,2) selects each third frame of the start position incremented by 2.

Right. I was wrong in my earlier post, you can indeed select frames outside of the cycle.