PDA

View Full Version : Using Loop to re-create a storyboard PGC


Dr.Khron
6th May 2007, 22:32
Ok, so I'm trying to make an AVI file out of a storyboard PGC. See my earlier thread for more info:
Encoding a storyboard PGC: AVS output runs way too fast (http://forum.doom9.org/showthread.php?t=124933)

Anyway, I have a D2V file with 238 frames, and I need to play each frame a certain number of times, all at 24 FPS. I now know the timing for each of those frames, thanks to Vobedit, and I've got em in a CSV file.

What I want to do is pretty simple, I just can't figure out the syntax.

1. play 15 black frames
2. play frame 1 1597 times
3. play frame 2 168 times
4. play frame 3 404 times
5. play the next frame x times...

The first problem is the blank clip:

src=last

blank=blankclip(length=15,width=720,height=480,fps=src.framerate)

blank +
\ loop(src,1597,0,0)+
\ loop(src,168,1,1)+
\ loop(src,404,2,2)

But this gives a "one clip has audio and the other doesn't (not allowed)" error. Since my source clip has no audio, I'm assuming the problem is the silent audio clip that is created with blankclip... I tried a bunch of different ways to combine these clips and nohting worked.

Ok, puttting that problem aside, if I skip the blank clip, the final output will loop the requested frame the right number of times, but then it plays the whole rest of the source frames for one frame each. I can't get it to work correctly.

IanB
6th May 2007, 23:41
To easily get BlankClip to match an existing clip provide the first clip as a template and then just modify what you need different....
BlankClip(src, length=15) # Same as src
...Loop leaves the head and tail intact and loops the range in the middle, you need to crop out your 1 frame and loop it.

To duplicate every frame X times, abuse ChangeFPS.X=100 # Default copies
...
\ trim(src,0,-1).loop(1597)+
\ trim(src,1,-1).loop(168)+
\ trim(src, 2,-1).loop(404)+
\ trim(src, 3, 0).AssumeScaledFPS(1, X).ChangeFPS(src)

Dr.Khron
7th May 2007, 01:26
Aha! I actually tried to trim out individual frames for looping, but since I'm no good with the dot syntax, I couldn't figure that out either. I was trying to nest the Trims directly into the Loops.

No need for the X value looping with ChangeFPS... I was just using X as placeholder for 238 Loops. This is my final AVS:

DGDecode_mpeg2source("D:\d2v.d2v")
AssumeFPS(24000,1001)
crop( 8, 0, -8, 0)
spline36resize(640,480)
limitedsharpenfaster(smode=4,strength=150)

#Add Timings back in
src=last
blnk=blankclip(src,length=15)

blnk +
\ trim(src,0,-1).loop(1597)+
\ trim(src,1,-1).loop(168)+
\ trim(src,2,-1).loop(404)+
(repeat about 235 more times)

Thanks very much for the help!