PDA

View Full Version : How to repeat frames / slideshow with mpeg2source?


Harley Quin
2nd November 2005, 17:34
Hi,

I'm struggling with this: Between two parts I want the first one to be still for two seconds. Which means I want to repeat the last frame of the first part 50 times, before the next part starts. Best thing I got so far is this script (it's a hoot, but it works):

...
mpeg2source("F:\movie.d2v",idct=0)
trim(28438,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(33180,33180)+trim(48156,51872)
...

Is there a chance to simplify the second line? Editing would be so much easier, as I want many parts to end this way. I searched the AviSynth manual, and tried search with "slideshow" and "repeating frames" but couldn't get a solution for this particular issue.

Thanks a lot

Leak
2nd November 2005, 19:45
Is there a chance to simplify the second line? Editing would be so much easier, as I want many parts to end this way. I searched the AviSynth manual, and tried search with "slideshow" and "repeating frames" but couldn't get a solution for this particular issue.

Thanks a lot
Ummm...

src=mpeg2source("F:\movie.d2v",idct=0)

src.Trim(0815,4711) + \
src.Loop(50,16384,16384) + \
src.Trim(32767,49152) + \
...
It's Loop you're looking for, and don't open the same source multiple times, that's just instant bad karma... :p

(For further info, consult the Nice and Accurate HTML Documentation that should've been packaged within your AVISynth Limited Collector's Edition box ;))

np: Jimi Tenor - Going For The Gold (Beyond The Stars)

Harley Quin
2nd November 2005, 20:55
Thank you very much, that's what I need.
I had searched the online-manual, but the closest option I had found was Duplicate, which was of no use.
Problem solved.
Greetings

Elic
2nd November 2005, 21:04
Harley Quin
But can I help you with FreezeFrame()? :)

Harley Quin
4th November 2005, 12:06
I got it to work, but had difficulties with the originally proposed script.
LoadPlugin("C:\path\DGDecode.dll")
src=mpeg2source("F:\movie.d2v",idct=0)
src.Trim(1601,1700) + \
src.Loop(50,1700,1700) + \
src.Trim(1801,1900) + \
src.Loop(50,1900,1900)
With this, I get frames 1601-1700, then the entire movie where frame #1700 is shown 50 times within, then frames 1801 to 1900 appended, and again the whole movie where #1900 is there 50 times.
As no other clip is defined in the loop command, it seemes to take the src as clip, thus the whole movie.
And the 50 loop-frames are not added as the first of them counts with, so it is repeated only 49 times.
But it worked out this way:
LoadPlugin("C:\path\DGDecode.dll")
src=mpeg2source("F:\movie.d2v",idct=0)
src.Trim(1601,1700).Loop(51,1700,1700) + \
src.Trim(1801,1900).Loop(51,1900,1900)
Now I get 300 frames (1601-1700 + 50x1700 + 1801-1900 + 50x1900) and can add other parts the same way.

So for slideshow purposes, this would be a possible solution, resulting in 150 frames of three kinds:
LoadPlugin("C:\path\DGDecode.dll")
mpeg2source("F:\movie.d2v",idct=0)
Trim(100,100).Loop(50,100,100) + \
Trim(600,600).Loop(50,600,600) + \
Trim(900,900).Loop(50,900,900)

@Leak
Thanks for pointing my nose into the way of Loop and the manual on my harddisk, I wasn't aware of its existence as I always consulted a (different) online edition. I found lots of answers. Again, thank you.

@Elic
Thanks for your reply, this
src.Trim(1601,1750).FreezeFrame(99,150,100) + \
src.Trim(1801,1950).FreezeFrame(99,150,100)
will deliver the same results as
src.Trim(1601,1700).Loop(51,1700,1700) + \
src.Trim(1801,1900).Loop(51,1900,1900)

greetings