Log in

View Full Version : puzzled by DoubleWeave and SeparateFields


Wilbert
21st August 2005, 13:58
I'd like some help in understanding the behaviour of DoubleWeave and SeparateFields.

Consider the following script:

b = blankclip(width=720, height=288, color=$000000)
w = blankclip(width=720, height=288, color=$ffffff)
Interleave(b,w).AssumeFieldBased.Weave

all frames are the same. First line is white, second line black, third line white, etc ...

Next script:

b = blankclip(width=720, height=288, color=$000000)
w = blankclip(width=720, height=288, color=$ffffff)
Interleave(b,w).AssumeFieldBased.Weave
DoubleWeave

all frames are the same. First line is white, second line black, third line white, etc ... The number of frames is doubled though.

Ok, it all makes sense up to here. Next script:

b = blankclip(width=720, height=288, color=$000000)
w = blankclip(width=720, height=288, color=$ffffff)
Interleave(b,w).AssumeFieldBased.Weave
DoubleWeave
SeparateFields

Ok, now I'm a bit confused. I would expect a black frame, followed by a white frame, followed by a black frame, etc ... But instead i get the following: black, white, white, black, black, etc ... How can that be, i thought that BFF or TFF is a property of the clip itself, not a frame property? (If it would be a frame property it would make sense i guess, as a result of DoubleWeave.)

scharfis_brain
21st August 2005, 14:02
that is correct!

assume this:
assumefieldbased.weave() -> every frame is BFF

an additional doubleweave() lets every other frame being TFF (fieldorder reversed!)

this is, why doubleweave().selectodd() can change the fieldorder seamlessly

mg262
21st August 2005, 14:33
... but that is a bit troubling because as Wilbert says, a clip (or more precisely a VideoInfo) contains top field first/bottom field first information...

Edit: congrats on 2000, scharfis!

scharfis_brain
21st August 2005, 14:44
huh, completely missed the 2nd thousand post.

try

doubleweave().info()

and you'll see, that TFF and BFF are alternating, which is correct.

mg262
21st August 2005, 14:58
Yup, I believe you, it's just that (as well as whatever per frame stuff) it is possible for filters to request this information for the entire clip -- which means that there is an implicit assumption that either the entire clip is TFF or that it is BFF. So finding out that it can vary from frame to frame is a bit troubling...

I could be wrong here! I will check more carefully when I have some more time...

scharfis_brain
21st August 2005, 15:05
doubleweave().assume?ff() should restore the bwbwbwbw - pattern for Wilbert.
without assume?ff() it remains bwwbbwwbbwwb

Wilbert
21st August 2005, 15:36
doubleweave().info()

and you'll see, that TFF and BFF are alternating, which is correct.
I thought TFF and BFF are clip properties, but i guess that's not the case.

So, it is possible to write a filter with returns the first three frames as BFF, next two as TFF, next ten as BFF, etc ... ? Just to give an example :)

Is there a way of knowning whether frame X is BFF or TFF?

Wilbert
21st August 2005, 16:03
Ok, another question which is bothering me.

Consider

b = blankclip(width=720, height=288, color=$000000)
w = blankclip(width=720, height=288, color=$ffffff)
Interleave(b,w).AssumeFieldBased.Weave # white, black, white, ...

The clip is BFF (as scharfis noticed), because after using SeparateFields we get bwbw...

Next script:

b = blankclip(width=720, height=288, color=$000000)
w = blankclip(width=720, height=288, color=$ffffff)
Interleave(b,w).AssumeFieldBased.Weave # white, black, white, ...
ReverseFieldDominance(false) # black, white, black, ...

The clip is TFF, because after SeparateFields we get: wbwb...

The problem is that if i put

subtitle(string(GetParity())) # false = BFF; true = TFF

after both scripts, both return to false. But the latter should return true, no?

edit: oh god, i'm getting complete nuts. I thought that GetParity indicates the field-dominance, right?

b = blankclip(width=720, height=288, color=$000000)
w = blankclip(width=720, height=288, color=$ffffff)
Interleave(b,w).AssumeFieldBased.Weave # white, black, white, ...
Subtitle(string(GetParity())) # false = BFF; true = TFF

returns false. Well, that's good.

b = blankclip(width=720, height=288, color=$000000)
w = blankclip(width=720, height=288, color=$ffffff)
Interleave(b,w).AssumeFieldBased.Weave # white, black, white, ...
AssumeTFF # white first after SeparateFields
Subtitle(string(GetParity())) # false = BFF; true = TFF

returns true. Also good.

But if i use SwapFields (which doesn't change the field dominance) GetParity returns true:

b = blankclip(width=720, height=288, color=$000000)
w = blankclip(width=720, height=288, color=$ffffff)
Interleave(b,w).AssumeFieldBased.Weave # white, black, white, ...
SwapFields
Subtitle(string(GetParity())) # false = BFF; true = TFF

returns true. (Although the first field is black after SeparateFields.)