PDA

View Full Version : Script to stack fields from adjacent frames (half framerate, double height)


SleepEXE
20th October 2002, 09:14
I'm trying to convert a 640 x 240 capture at 59.94fps to a 640 x 480 clip at 29.97fps. Basically take two adjacent frames and separate them into fields and then stack those fields to double the vertical height and halve the framerate.

---------Frame 1 Field 1---------
---------Frame 2 Field 1---------
---------Frame 1 Field 2---------
---------Frame 2 Field 2---------
---------Frame 1 Field 3---------
---------Frame 2 Field 3---------

Or visualize it this way. Think of your left hand as one frame and your right hand as another. Your fingers are the fields. Separate your fingers slightly and then interleave them. That's it.

I keep thinking it should be some combination of SeparateFields, Interleave, Weave, and/or StackVertical. Seems straightforward enough but the longer I think about it the more confused I get :)

Can one of you AviSynth gurus enlighten me?

Best regards,
SleepEXE

stickboy
20th October 2002, 10:31
Doesn't Weave by itself do what you want?

Richard Berg
20th October 2002, 13:24
Hello again SleepEXE,

Your first sentence seems to contradict the rest of the post. Going by the former, stickboy's exactly right. If I understand what you go on to say, however, I'm led to believe each 640x240 frame in your source is constructed of 640x120 fields??

SleepEXE
20th October 2002, 19:07
Thanks, stickboy and Richard. Your comments made me go back and try weave alone, and simply inserting AssumeFieldBased() before it took care of the problem.

AVISource("d:\bclub.avi")
AssumeFieldBased()
ComplementParity()
Weave()

You probably gathered what I'm trying to do. I have an ATI All-in-Wonder 128 (non-Pro) that has a Brooktree 829 onboard. It will capture 640 pixels horizontally but only 240 pixels vertically. If the chipset is capable of capturing 480 vertically (and according to a google search, it can), I haven't figured out the secret to making it work. I've tried several different WDM capture drivers on both Win2k and WinXP as well as WDM- and VFW-based (using the wrapper) capture programs.

So I figured it might be possible to capture at twice the broadcast framerate and then weave adjacent frames together to yield a 640x480 clip. Unfortunately, there remains a good deal of interlacing artifacts behind in the weaved clip. Now, of course I realize there will be some interlacing, but if I capture something that has been telecined, it will not IVTC properly evidently because of some timing discrepancies that result in inverted field order every so often.

If you think it should be possible, let me know and I'll post a HuffYUV clip demonstrating the problem. Better still, if anyone knows of a magic bullet that will enable full 640x480 captures with the BT829, I'd be elated. ;)

Best regards,
SleepEXE