Log in

View Full Version : How to interlace progressive footage in Avisynth?


rikun
20th November 2009, 23:51
Hi,

I would need to interlace two separate avi files in avisynth and then combine the odd fields from the other one, and the even fields from the other one to the output stream.

The goal is to create interlaced stereo output from separate L&R camera progressive files. Any tips?

I know how to combine two clips together, but have been unable to find a way to interlace progressive material in avisynth. There is really no need to recreate the time difference between the fields.

The source footage is usually 25P, sometimes originally shot in 50i, sometimes 25P straight from the camera.

Gavino
21st November 2009, 00:02
Interleave(clip1, clip2)
SeparateFields()
SelectEvery(4, 0, 3)
Weave()

wonkey_monkey
21st November 2009, 00:03
source1=...
source2=...

source1even=separatefields(source1).selecteven
source2odd=separatefields(source2).selectodd

interleave(source1even,source2odd)

weave

...will probably do what you want. I think that an "assumebff" or "assumetff" immediately before the weave which change which way round the fields get weaved.

David

Gavino
21st November 2009, 00:51
I think that an "assumebff" or "assumetff" immediately before the weave which change which way round the fields get weaved.
No, it would have to come earlier, before each of the SeparateFields (and for both source1 and source2), so that the fields have the right parity.

I think your solution is correct, but if you work it through, it is just a longer way of doing what mine does.

rikun
21st November 2009, 02:03
It works... Sort of. All stationary parts of the clips look correct in stereo depth, but all the moving parts look like they are double interlaced. I'm assuming this is because I've deinterlaced the source footage already first..

wonkey_monkey
21st November 2009, 02:08
How are you viewing it? Some kind of shutter-glasses system?

David

rikun
21st November 2009, 02:09
On the other hand, the footage looks like it's missing half of its' resolution (which it is). I would need a way to make the both sources look like they had both of the fields in tact. So, I think I should be interlacing AND converting the footage back to 50i before interleaving...

rikun
21st November 2009, 02:31
Ok, I probably know what's going on... When I'm taking only half of the lines, I'm losing half of the vertical resolution.

That's ok, but I don't want to see any spaces between the lines, so I should probably resize the footage vertically before interleaving...? The solution is probably really simple, but I just can't get my head around it..

I have a 22" Zalman polarized stereoscopic monitor and with circularly polarized glasses.

rikun
21st November 2009, 03:13
Hmmmm, stereoscopic player shows the output stream correctly. Maybe media player classic does some kind of resizing and breaks the interlacing...

wonkey_monkey
21st November 2009, 03:46
Maybe media player classic does some kind of resizing and breaks the interlacing...

Quite likely. You may have to resize up the height of your monitor before weaving, unless you can some player for your monitor that can resize and weave by itself.

David

Alex_ander
21st November 2009, 10:11
Media player classic deinterlaces (I can't even find turning it off). Try VLC.
A 1 line shorter script doing the same (formal field order is the opposite, but is doesn't matter here - both fields carry the same phase):

Interleave(clip1, clip2)
DoubleWeave()
Select Every(4,1)

BTW, I suspect it may be useful (for keeping more sharpness in stationary scenes) to alternate frames like top1/bottom2 and top2/bottom1 - by interleaving 2 interlaced sequences created with different assumed field order:

a=Interleave(clip1, clip2).DoubleWeave().Select Every(8,1)
b=Interleave(clip2, clip1).DoubleWeave().Select Every(8,5)
interleave(a,b)

But I don't know if it's compatible with the playback methods used.