logo Sign In

Duplicating frames in AviSynth

Author
Time

I have a problem.

I have a time-coded capture of a concert. After an analysis I found out that beginning with frame 2884 every 221th frame is missing (the timecode is a pretty usefull thing :) )

 

So now I would need a script which takes frames 0-2883, duplicates frame 2884 and then duplicates every 221th frame.

Or in other words I need to duplicate frames 2884, 3105, 3326, 3547, 3768, 3989 and so on.

 

Is here some AviSynth "guru" who can help me with this script ?

Author
Time
 (Edited)
pittrek said:

I have a problem.

I have a time-coded capture of a concert. After an analysis I found out that beginning with frame 2884 every 221th frame is missing (the timecode is a pretty usefull thing :) )

 

So now I would need a script which takes frames 0-2883, duplicates frame 2884 and then duplicates every 221th frame.

Or in other words I need to duplicate frames 2884, 3105, 3326, 3547, 3768, 3989 and so on.

 

Is here some AviSynth "guru" who can help me with this script ?

the easiest way is just to use:

DuplicateFrame(2884,
3105,
3326,
3547,
3768,
3989,
4210,
4431,
4652,
4873,
5094,
5315,
5536,
5757,
5978,
6199,
6420,
6641,
6862,
7083,
7304,
7525,
7746,
7967,
8188,
8409,
8630,
8851,
9072,
9293,
9514,
9735,
9956,
10177,
10398,
10619,
10840,
11061)

etc. etc. until the number is within 221 of the total number of frames. this will add in frames but not effect the soundtrack.

I was going to do it a more elegant way but that would involve thinking and I'm not in the mood for that right now. :)

to get the list of numbers just use Excel

with cell A1 =2884, cell A2 = A1+221 then fill down, copy the list straight into your avs file and add a comma after each one.

 

 

 

Author
Time

Well I'm too lazy for this :) Isn't there a more "programmer-like" solution ? :)