View Single Post
Old 5th October 2015, 11:18   #14  |  Link
vivan
/人 ◕ ‿‿ ◕ 人\
 
Join Date: May 2011
Location: Russia
Posts: 643
Quote:
Originally Posted by Music Fan View Post
I guess you mean another function.
I meant "unless" not "until", sorry. Yeah, that typo changed my explanation into a complete wrong one.
But no, you assign values to variables... Well, they will be objects in C#/Java, but still not functions. They have "clip" type, so lets simly call them clips.

You don't assign functions to anything, you assign their result. But that result is calculated "lazily", only when it's needed.
Just think about it as if clip was just a number.

Another thing to note is that every function uses "last" as first input if no input is specified. Or uses specified clip, if you write it like this: "clip.function()", which is equal to "function(clip)".

So this code
Code:
LWLibavVideoSource("Dji ext.mpg")
luma = SeparateFields().Trim(1, 0).Weave()
chroma = SeparateFields().SelectEvery(2, 1, 0).Trim(1, 0).Weave()
luma.MergeChroma(chroma)
actually means
Code:
last = LWLibavVideoSource("Dji ext.mpg")
luma = SeparateFields(last)
luma = Trim(luma, 1, 0)
luma = Weave(luma)
chroma = SeparateFields(last)
chroma = SelectEvery(chroma, 2, 1, 0)
chroma = Trim(chroma, 1, 0)
chroma = Weave(chroma)
last = MergeChroma(luma, chroma)
return last
Quote:
Originally Posted by Music Fan View Post
But if I really need to see both together, how tu use stack ?
It has same syntax.

UPD:
Quote:
Originally Posted by Music Fan View Post
After some tests I found how to make it ;
While this works opening video twice is not a "clean" solution. Probably this way it will be easier to modify:
Code:
source = LWLibavVideoSource("P:\Dji ext.mpg")
luma = source.SeparateFields().Trim(1, 0).Weave()
chroma = source.SeparateFields().SelectEvery(2, 1, 0).Trim(1, 0).Weave()
result = luma.MergeChroma(chroma)
StackHorizontal(source, result)
Quote:
Originally Posted by Music Fan View Post
I guess it's because last became BFF [with Trim(1, 0).Weave()] and last prevails over v2 which is thus forced to become bff.
Yes, after you do Weave() clip becomes BFF.

Quote:
Originally Posted by Music Fan View Post
edit 2 : the field inversion on v2 disappears when I simply reverse last and v2 in the stackhorizontal line ; stackhorizontal(v2,last) instead of stackhorizontal(last,v2)
Wiki says that
Quote:
Weave uses the frame-parity information in the source clip to decide which field to put on top. If it gets it wrong, use ComplementParity beforehand or SwapFields afterwards.
Honestly I have no idea how it works.

Last edited by vivan; 5th October 2015 at 11:34.
vivan is offline   Reply With Quote