Log in

View Full Version : Remove cyclic frames


MatLz
29th August 2009, 13:12
Hi guys. Is there a function or a script I can make for remove double frames with a cycle like that :

0-1
16
16-17
16
32-33
16
48-49
17
65-66
16
81-82
16
97-98
16
113-114
16
129-130
17
146-147
16
162-163
16
178-179
16
194-195
17
211-212
16
227-228
16
243-244
16
259-260
16
275-276
17
292-293

It seems to be 3 times every 16frames, 1 time after 17frames, 4 times every 16frames and 1frame after 17frames...all the video length...
Thanks.

Guest
29th August 2009, 15:11
Use TDecimate()'s M-in-N decimation.

Myrsloik
29th August 2009, 17:43
Your problem sounds ideal for SelectEvery(), unfortunately for you the maximum number of arguments an avisynth filter can have is around 50 or so and not the almost 300 you'd need.

If I were you I would either write a recursive function to repeatedly apply trim+splice to the clip to delete the frames you want, or just open visual studio and write my own filter for it.

An interesting third option without looping would be if there existed an "InterleaveEvery" function, but there isn't one.

Gavino
29th August 2009, 18:41
Actually, you'd only need 138 parameters to do it with SelectEvery, still too many, unfortunately. :)

What you want is actually a converse RejectEvery(146, 1, 17, 33, 49, 66, 82, 98, 114, 130) which is probably what a decimation filter like TDecimate will do for you.

If it doesn't, and you don't feel up to writing a recursive function, you could use the loop facilities of GScript.

MatLz
29th August 2009, 20:33
I have try tdecimate but unfortunately it doesn't work, maybe cause the multiple cycles number?

I have do a check again with always the first double frame removed with "deleteframe(xxx)". (For technical reason I can't write too many caracters in my posts, so take a look to the "deleteframe.txt" in attachment)
It doesn't matche with my first post because I hadn't remove the frames, just checked the doubles.

So...can be this "recursive function" written in a .avsi with deleteframe(n) or else?

Guest
30th August 2009, 01:24
I have try tdecimate but unfortunately it doesn't work, maybe cause the multiple cycles number? C'mon man. If you're going to diss a program like that, at least post your script so we can see if you're just clueless. tritical does not build crap!

TDecimate will work fine if you do it right.

Post an unprocessed source clip and I'll prove it to you. Oh, yeah, you're on a phone. Excuses, excuses.

MatLz
30th August 2009, 03:51
Yes maybe I had write wrong parameter in tdecimate.
I used the mode 2. It removed some doubles but not all.
In fact I had resolve my problem with simple script:
Trim(1,0)
Changefps(24000,1001)
I noticed after the removing of ~20frames the rapport (nb of frames remaining after removing double / original time) gived me approximately 23.98 fps. But dammit first frame! It was the bigger problem I think.

Gavino
30th August 2009, 15:55
Just to clear up an earlier point raised in this thread:the maximum number of arguments an avisynth filter can have is around 50 or so
I have discovered the real limit is 1024, so the common belief that it is about 50-60 (which I also believed having read it so often) seems to be a myth, perhaps based on ancient history.