Log in

View Full Version : Odd/Even frame based interleaving


mgb
3rd September 2010, 18:00
I need to implement a slightly weird interleaving scheme
If E and O are two frame based streams, I need to combine alternate overlapping pairs eg.

E1 + O1
E2 + O1
E2 + O2
E3 + O2
E3 + O3
E4 + O3

I thought of using DuplicateFrame to make a stream of E1,E1,E2,E2 and delete the first E frame but the wiki page for DuplicateFrame isn't correct.

I wondered if there was a way to do this with one of the interlace/weave filters?
Although these are frames not fields, I could combine them as if they were fields and then split the resulting double height image out later.

Didée
3rd September 2010, 18:30
interleave( interleave(E,E).deleteframe(0),
\ interleave(O,O)
\ )

assumefieldbased().weave()

mgb
3rd September 2010, 20:41
Thanks that gave me the clue I needed.
Or at least it did once I worked out that it was a 'zero' not an 'Oh' to deleteframe - not my best choice of example!!!!

M

Didée
3rd September 2010, 20:49
Here's another possibility:

interleave(E,O)
SelectEvery(2,0,-1,0,1)
trim(2,0) # probably not needed ... just to be consistent with the pattern you posted