OpenShot Library | libopenshot  0.1.1
OpenShot Wipe Tests.py
Go to the documentation of this file.
1 import openshot
2 
3 # Create a empty clip
4 t = openshot.Timeline(720, 480, openshot.Fraction(24,1), 44100, 2)
5 
6 # lower layer
7 lower = openshot.ImageReader("/home/jonathan/apps/libopenshot/src/examples/back.png")
8 c1 = openshot.Clip(lower)
9 c1.Layer(1)
10 t.AddClip(c1)
11 
12 # higher layer
13 higher = openshot.ImageReader("/home/jonathan/apps/libopenshot/src/examples/front3.png")
14 c2 = openshot.Clip(higher)
15 c2.Layer(2)
16 #c2.alpha = openshot.Keyframe(0.5)
17 t.AddClip(c2)
18 
19 # Wipe / Transition
20 brightness = openshot.Keyframe()
21 brightness.AddPoint(1, 100.0, openshot.BEZIER)
22 brightness.AddPoint(24, -100.0, openshot.BEZIER)
23 
24 contrast = openshot.Keyframe()
25 contrast.AddPoint(1, 20.0, openshot.BEZIER)
26 contrast.AddPoint(24, 20.0, openshot.BEZIER)
27 
28 e = openshot.Wipe("/home/jonathan/apps/libopenshot/src/examples/mask.png", brightness, contrast)
29 e.Layer(2)
30 e.End(60)
31 t.AddEffect(e)
32 
33 e1 = openshot.Wipe("/home/jonathan/apps/libopenshot/src/examples/mask2.png", brightness, contrast)
34 e1.Layer(2)
35 e1.Order(2)
36 e1.End(60)
37 #t.AddEffect(e1)
38 
39 
40 for n in range(1,25):
41  print n
42  t.GetFrame(n).Save("%s.png" % n, 1.0)
This class uses the ImageMagick++ libraries, to open image files, and return openshot::Frame objects ...
Definition: ImageReader.h:67
This class represents a clip (used to arrange readers on the timeline)
Definition: Clip.h:108
This class represents a fraction.
Definition: Fraction.h:42
A Keyframe is a collection of Point instances, which is used to vary a number or property over time...
Definition: KeyFrame.h:64
This class represents a timeline.
Definition: Timeline.h:141