[Kdenlive-devel] Operators and Properties
Rolf Dubitzky
dubitzky at pktw06.phy.tu-dresden.de
Mon Nov 4 10:51:17 UTC 2002
Hi,
Here a short idea of how I do things in piave.
I store the render setup in a single tree. This tree is made up of
"MediaElements". There are two Kinds of MediaElements: Nodes and Leaves.
All kinds of audio and video data is a Leave. E.g. a DV file , or a JPEG
image, or an audiofile.
There are two kind of nodes: unary and binary nodes. A unary node consists of
an UnaryOperator and a single MediaElement. A BinaryNode has a BinaryOp and
two MediaElements. You can already guess that a UnaryOp can take a Frame and
modify it, eg. deinterlace, chroma adjust, invert, draw a ColorFrame around,
etc. and a binary node can take two frames and do somehting like transitions
or picture in picture or whatever. You can easily verify, that you can build
_any_ kind of structure with this scheme. No limit of "number of video
tracks" or other stupid things. You can also stack many BinaryOps on top of
each other and have many source Frames for a single output frame. The only
place where this scheme reaches a limit is if you e.g. want to project three
frames on the three dimensinal picture of a dice. Then you need all three
source Frames in a single Operator. Of course it is a non-issue to implement
a TrinaryOp (or N-Op or whatever).
Every MediaElement has a local coordinate system (local time) which starts at
0 and a starting time relative to its parents local time. This way, you can
rearrange nodes without bothering where in te tree they end up. This is very
similar to local coordinates in Qt I guess? The length of a node is defined
as the union of the length of the children.
time 0________________________100_______________________200_____ _ _ _
node1 __________________________________________________________ _ _ _
- unaryOp1 _________
- node2 _________________________________________________
- binOp1 _____
- clip1 ____________________________
- clip2 __________________________
Clear? Questions? ;-)
Now PropertyPath: Every Operator needs a set of parameters which define its
behaviour. There are static operators which have a single set of parameters
and DynamicOperators. A dynamic operator owns a ProprtyPath, which is a
vector of Properties. Example: binOp1 from above. In it's parents localtime
it ranges from let's say 95 to 108. His own local time is from 0 to 13. The
PropertyPath has at least one node (that would qualify as a static op). If it
has two nodes, the first node must be at 0 and the second at 13. Let's say
binOp1 is AlphaBlendOp, i.e. the operator which can blend clip1 and clip2
with a certain alpha value, from 0 (opaque) to 1 (transparent). If you use a
propery path with two propery-nodes, the first would have alpha=1 the second
alpha=0. Then all intermediate values will be interpolated (linear only at
the moment). This system is _very_ flexible. You can build all kinds of
effects with a minimal set of building blocks.
Example: long sequence (clip1) , blend in a second scene (clip1) for a short
time in the upper right. Make node (node1) with AlphaBlendOp. make four
property nodes time=0;alpha=1 time=10;alpha=0.2 time=20;alpha=0.2
time=30;alpha=1 . Make second node with clip1 and node1 and a PicInPicOp.
Your Done. The small picture will fade in stay almost opaque for 10 Frames
and fade out again.
This can be used to animate every kind of property an Operator might have,
coordinates of the PicInPic, Color of a Frame, size of a scaling, speed of
motion, direction e.g. kooridnates of FlyIn or ShiftIn transitions...
In the timeline these property-nodes must be visible. You must be able to
insert new nodes, delete old nodes and popup a window to edit the values for
a node.
The usual separation in "transitions" and "effects" makes sense with analog
cutting mashines, it is just nonsense if you have a computer.
Cheers,
Rolf
***************************************************************
Rolf Dubitzky
e-mail: Rolf.Dubitzky at Physik.TU-Dresden.de
s-mail see http://hep.phy.tu-dresden.de/~dubitzky/
***************************************************************
More information about the Kdenlive
mailing list