Log in

View Full Version : Interlace progressive footage


loekverhees
13th August 2009, 20:19
I shot some 50i PAL footage on my camcorder. In order to proper stabilize the video, I deinterlaced it and used the Deshaker filter in VirtualDub. Now I want to reinterlace the video for displaying on TV. What is the best way to go? I also want to sharpen the video in Premiere Pro and export from there to MPEG-2.

Thanks in advance.

Alex_ander
13th August 2009, 20:58
Re-interlacing is only possible with double initial framerate (e.g. if you bob-deinterlaced your video to 50p before processing in DeShaker), then:
AssumeBFF()
DoubleWeave().SelectEvery(4,1)#TFF

In case you have 25p, it is only possible to previously interpolate to 50p with MVTools (its MFlowFPS function) - not as perfect.

kieranrk
13th August 2009, 21:19
It actually depends whether you want 50i or 25psf (which is 25p inside 50i) - probably the latter

(I can't remember how to do it) but you can double every frame and select the top and bottom fields.

loekverhees
13th August 2009, 21:22
Thanks for the quick replies. Now, the video is 25fps. But how to Bob-deinterlace to 50fps in the first place, what is the code in avisynth?
@kieranrk: yes, I want 25p inside 50i

thewebchat
14th August 2009, 02:04
There seems to be a case of "doing it wrong" here. 25p is the exact same thing as 25p stored as 50i. Just set the "interlaced mode" flag in your encoder. You can bob with Bob().

Alex_ander
14th August 2009, 06:29
Just set the "interlaced mode" flag in your encoder.
Why? This might instruct an encoder to treat the source as interlaced and use wrong block scanning order, different from optimal one for progressive. DVD players anyway output any frame type as interlaced (field by field).
Re-interlacing is useful for keeping 50 motion phases per second, in case of 25p it is only possible to interpolate to 50p, then re-interlace. If you apply Bob() to 25p (as you suggested), this will simply repeat frames and give the same progressive (or field shifted) frames after interlacing.

thewebchat
14th August 2009, 06:44
I really fail to see the point of upscaling the temporal resolution just so you can make it interlaced again. At best, every other frame will be some half-working motion-compensated crap and at worst this will be some kind of blendfest.

Gavino
14th August 2009, 09:12
I think what the OP was asking is how to bob-deinterlace the original clip and redo the Deshaker. He can then re-interlace to retain full temporal resolution.

loekverhees
14th August 2009, 09:29
I think what the OP was asking is how to bob-deinterlace the original clip and redo the Deshaker. He can then re-interlace to retain full temporal resolution.Yes, that's what I want to do.

One thing I still do not understand: When I deinterlace the DV-footage, deshake it, and burn it to DVD (so I have a 25fps progressive video), the video looks jerky om my TV. But when I watch a normal DVD from the store (also 25fps progressive PAL), it looks like the video is playing very smoothly. How is that possible, since both are 25fps progressive?

I notice that when I export all the time in the Panasonic DV codec, I get lots of compression artefacts (blocks). Is there a better codec?

Alex_ander
14th August 2009, 10:42
Yes, that's what I want to do.

Then you could try this:

LoadPlugin("LeakKernelDeint.dll")
AviSource("video.avi")
LeakKernelBob(order=0)#for BFF source

# send it to DeShaker and save avi e.g. using huffyuv codec

AviSource("deshaked.avi")
DoubleWeave().SelectEvery(4,1)#


It is possible (due to the shaked type of video) that single-field bob deinterlaces like nnedi2 (very slow) or even Bob() would behave better here - worth trying for comparison.

thewebchat
14th August 2009, 16:47
Yes, that's what I want to do.

One thing I still do not understand: When I deinterlace the DV-footage, deshake it, and burn it to DVD (so I have a 25fps progressive video), the video looks jerky om my TV. But when I watch a normal DVD from the store (also 25fps progressive PAL), it looks like the video is playing very smoothly. How is that possible, since both are 25fps progressive?

I notice that when I export all the time in the Panasonic DV codec, I get lots of compression artefacts (blocks). Is there a better codec?

1) The difference could be that native 25fps footage has more motion blur than your 50i source.

2) You could use uncompressed AVI.

shoopdabloop
14th August 2009, 23:59
I thought that if you wanted to 'interlace' 25/30p, you just have to blur it vertically slightly to prevent tv flicker and then you're done.

Blue_MiSfit
15th August 2009, 11:47
I'd suggest you try the Cedocida DV codec, as it's got lots of configuration options

If you aren't stuck with using the DV in general, H.264 lossless is an excellent choice, as is HuffYUV / Lagarith.

~MiSfit

2Bdecided
17th August 2009, 09:45
You are all overcomplicating things!

Deshaker has a "video type" selector - simply use the "interlaced" option.

What's built in to Deshaker is not the world's best deinterlacer (it's just a dumb bob), but it works.

The answer to the original question (external deinterlacing) is already covered in the Deshaker instructions - see the end of this page...
http://www.guthspot.se/video/deshaker.htm
...though assumeXff().selectevery(4,0,3) is "correct".

Cheers,
David.

loekverhees
17th August 2009, 10:08
Yeah, you're right. After doing some research, it turned out one could feed interlaced footage into DeShaker. But the motion smoothness values in Deshaker must be increased a lot then (because DeShaker apparently works on a frame basis, not a time basis). In the beginning I forgot that, so I then tried to feed progressive footage into Deshaker. But with raising the values, that is not necessary anymore.