View Full Version : Making 1 frame into 1000 frames?
AviUser
23rd May 2009, 19:17
Hi,
Sorry if this is a noob question, but how can I open an .avi file, take the first frame and duplicate it 1000 times to make a video that has 1000 frames and only that one frame.
A few ways I thought of [and the disadvantages]:
1. Save that frame as an image and use ImageSource() to open it [waste of space on the hard drive]
2. Do something like
a = vid.Trim(1, 1)
a = a ++ a ++ a ++ a ++ a
a = a ++ a ++ a ++ a ++ a
[confusing and screws up the whole avisynth script]
Anyone know of any easy way to do this?
:thanks:
kemuri-_9
23rd May 2009, 19:25
to get the exact first frame and repeat it 1000 times it would be something like:
trim(0,-1)
Loop(1000)
AviUser
23rd May 2009, 22:45
It works great!
:thanks:
Floatingshed
23rd May 2009, 23:58
to get the exact first frame and repeat it 1000 times it would be something like:
trim(0,-1)
Loop(1000)
Then there is:
freezeframe(1,1000,0)
AviUser
24th May 2009, 03:29
Ok that works too thanks!
kemuri-_9
24th May 2009, 16:08
Then there is:
freezeframe(1,1000,0)
no that doesn't work as the OP intended/requested originally.
A. it does 1001 copies
B. it does not affect the length of the clip
point B is basically:
whatever length of video you start with is what you end up with, as FreezeFrame does not add/drop frames to match the frame sequence you requested.
so if you started with 5000 frames, you'll end up with a clip where the first 1001 frames are the same as the first frame, and then the rest are unaffected (same from source)
staring with a 5 frame clip, you'll end up with only a 5 frame clip where they're all the same
Floatingshed
24th May 2009, 18:43
no that doesn't work as the OP intended/requested originally.
A. it does 1001 copies
B. it does not affect the length of the clip
That would be true if the OP was opening an image but he/she states that it is an avi, it is possible that the avi has only one frame but that would be a little unusual. So assuming that the avi is more than 1000 frames long it will do the job.
kemuri-_9
24th May 2009, 19:35
That would be true if the OP was opening an image but he/she states that it is an avi, it is possible that the avi has only one frame but that would be a little unusual. So assuming that the avi is more than 1000 frames long it will do the job.
still violates what s/he requested:
to make a video that has 1000 frames and only that one frame.
as if the original video has more than 1000 frames, your solution will have the end result also have more than 1000 frames, and frames past the 1001st will likely not be the same frame.
Gavino
24th May 2009, 19:45
That's right. In fact, the solution works as requested only if the input has exactly 1000 frames to start with.
MadRat
26th May 2009, 10:13
Would either of those lines work to add a few frames to a .avi if a lower number were used?
Gavino
26th May 2009, 11:37
As kemuri-_9 points out, FreezeFrame does not change the length of a clip, so can't be used (on its own) to add frames.
But Loop can be used for this purpose.
Loop(n, a, b) repeats frames a to b (inclusive) n times, effectively adding (n-1) copies of that range.
As an aside, note that n can be zero, which gives a neat way to delete a range of frames (easier than using Trim).
MadRat
27th May 2009, 06:25
Thank you, Gavino. That's very interesting, very interesting indeed. :goodpost:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.