PDA

View Full Version : Syntax Problems


resonator
18th December 2002, 13:45
Hi there!

I've tried to use AviSynth to do sort of a manual IVTC. I captured my copy of the Star Wars Laserdisc at full NTSC resolution to put it on a DVDR.

The video is structured this way:

Frame1 - Progressive
Frame2 - Interlaced
Frame3 - Interlaced
Frame4 - Progressive
Frame5 - Progressive

and then the loop starts over.

I wanna keep the progressive frames and just use the resized bottom field from Frame2 to get the video at 23.976 progressive, so I wrote this script:


LoadPlugin("D:\TEST_SW\MPEG2DEC.DLL")
Clip=MPEG2Source("D:\TEST_SW\GRAB1.d2v")
Clip2=ShowSMPTE(Clip, 29.97)

Frame1=SelectEvery(Clip2,5,1)
Frame2=SelectEvery(Clip2,5,2,3)
Frame3=SelectEvery(Clip2,5,4,5)

Frame2Sep=SeparateFields(Frame2)
Frame2Sel=SelectEvery(Frame2Sep,4,2)
Frame2RIn=BicubicResize(Frame2Sel,720,480)

ProgOut=Frame1 + Frame2RIn + Frame3

return(ProgOut)


But that doesn't work because that way I get all the Frames from "Frame1" first, after that "Frame2RIn" and so on.

So my question is: How would a script look like that returns a structure like this -

Frame1
Resized Bottom Field of Frame2
Frame4
Frame5

Any ideas?

Bidoche
18th December 2002, 17:03
Did you try decomb before going to manual IVTC ?

for your script you should use something like,

ProgOut= Interleave (Frame1, Frame2RIn, Frame3, Frame4)

where
Frame3 = SelectEvery(Clip2,5,4)
Frame4 = SelectEvery(Clip2,5, 5)

neuron2
18th December 2002, 17:31
There will soon also be a full manual control over Telecide. You'll be able to set the pattern for all desired frame ranges.

resonator
18th December 2002, 17:39
I didn't try any automatic IVTC because I just wanted to play a bit with AviSynth.

Anyway, thanks a lot for the scripting advice!

jang0
18th December 2002, 18:18
The method of resizing the bottomfield of frame 2 seems pretty ineffiecient to me.
I assume that your video stream looks like that:

1t 1t 2t 3t 4t ...
1b 2b 3b 3b 4b ...

while the numbers represent the frame numbers of the original video (before telecine process) and b/t means bottom/top field.
So what makes most sense imho is to take frame 1,4,5 as they are and make them the new frames 1,3,4. as the new second frame
i would weave the bottom field of frame 2 with the top field of frame 3, so that the original 2nd frame is restored without
any quality losses.

i could also be totally wrong and i can't test it at the moment unfortunately


Frame1=selectevery(Clip2,5,1)
Frame2in=clip2.separatefields().selectevery(10,4,5).weave()
Frame3=SelectEvery(Clip2,5,4)
Frame4=SelectEvery(Clip2,5,5)
Output=Interleave(Frame1,Frame2in,Frame3,Frame4)
return(Output)


perhaps you also need to put a swapfields() behind weave (i really can't check it where i am at the moment)

by the way, automatic itvc filters like decomb are very efficient for common stuff (and even on many weird sources), furthermore
they are adaptive to pattern changes and you can tweak them pretty well.

just my 2 euro cents

jang0

resonator
18th December 2002, 19:14
jang0: You're right, it is pretty inefficient, actually it doesn't work at all. So much for fuzzing around, I'll go for the Telecide/Decimate solution. Thanks anyway!