Hello.
Is there a way to loop through frames in a clip in an AviSynth script? Like a "For" or "While" loop structure, but in AVS? If there's no way to loop like this, is there any other way to loop through frames?
+ Reply to Thread
Results 1 to 14 of 14
-
-
-
-
If you don't need to loop infinitely you can just add the clip several times.
WhateverSource()
return(last+last+last+last+last...) -
-
-
Anonymous344Guest
I'm sorry to bump an old thread, but I have a related question. Can one make multiple calls to Loop()?
Code:x=whateversource() edit= \ x.Trim(0,40000).Loop(10,25000,25000) ++\ x.Trim(40000,80000) ++\ x.Trim(80000,90000).Loop(10,88000,88000) return edit
-
Code:
x.Trim(80000,90000).Loop(10,88000,88000)
Last edited by jagabo; 25th Apr 2014 at 07:17.
-
Anonymous344Guest
Oh, I understand now! Thanks.
Could I insert Loop() earlier to achieve the same effect?
Code:x=whateversource() edit= \ x.Trim(0,40000).Loop(10,25000,25000).Loop(10,88000,88000) ++\ x.Trim(40000,80000) ++\ x.Trim(80000,90000) return edit
Code:x=whateversource() edit= \ x.Trim(0,40000).Loop(10,25000,25000) ++\ x.Trim(40000,80000) ++\ x.Loop(10,88000,88000).Trim(80000,90000) return edit
-
This will have a similar problem. The output of the Trim() is a 40001 frame video. So you can't Loop() frame 88000. Further, the output of the first Loop() has 9 extra frames, so even if your second Loop() was within the trimmed video, you would need to account for the extra 9 frames.
That will work. Except you need to account for the extra 10 frames you added with the Loop(). Ie, as written, you are losing 9 frames at the end of the original video.Last edited by jagabo; 25th Apr 2014 at 08:08.
-
Anonymous344Guest
I really should have thought of that...
Further, the output of the first Loop() has 10 extra frames, so even if your second Loop() was within the trimmed video, you would need to account for the extra 10 frames...
...That will work. Except you need to account for the extra 10 frames you added with the Loop(). Ie, as written, you are losing 10 frames at the end of the original video. -
Yes, it's easiest to work from last to first in those circumstances. Ie, if you know you want to delete frames 10, 20 and 30 from the original video:
Code:DeleteFrame(30) DeleteFrame(20) DeleteFrame(10)
Code:DeleteFrame(10) DeleteFrame(19) DeleteFrame(28)
-
Anonymous344Guest
That's a good idea. I guess it would work with the situations I come across, in which my script is more like this.
Code:WhateverSource() DeleteFrame() DuplicateFrame() DeleteFrame() DuplicateFrame() DeleteFrame()
Code:x=WhateverSource() \ .ShowFrameNumber(scroll=true) edit= \ x.Trim(0,1000) ++\ x.Trim(1002,2000) ++ \ x.Trim(2000,1000) ++ \ return edit
Similar Threads
-
Will Avisynth 'Directshowsource' Produce Reduced Quality in Frames Served?
By Chakra in forum Newbie / General discussionsReplies: 4Last Post: 1st Nov 2011, 09:25 -
How to display .png just for (exam 3 seconds or 100 frames) with Avisynth?
By xicudiz in forum EditingReplies: 2Last Post: 9th Apr 2011, 21:41 -
How do you blur selected frames in AVIsynth?
By Nagashi in forum EditingReplies: 4Last Post: 9th Jan 2011, 19:30 -
Avisynth drops blank frames?
By wfael in forum EditingReplies: 3Last Post: 9th Dec 2008, 22:06 -
HDTV to DVD using DGIndex/AviSynth losing frames
By gadgetguy in forum Video ConversionReplies: 13Last Post: 3rd Sep 2008, 16:12