|
1 | 1 | import openshot |
2 | 2 |
|
3 | | -# Create a empty clip |
4 | | -t = openshot.Timeline(720, 480, openshot.Fraction(24,1), 44100, 2) |
| 3 | +# Create an empty timeline |
| 4 | +t = openshot.Timeline(720, 480, openshot.Fraction(24,1), 44100, 2, openshot.LAYOUT_STEREO) |
| 5 | +t.Open() |
5 | 6 |
|
6 | 7 | # lower layer |
7 | | -lower = openshot.ImageReader("/home/jonathan/apps/libopenshot/src/examples/back.png") |
| 8 | +lower = openshot.QtImageReader("back.png") |
8 | 9 | c1 = openshot.Clip(lower) |
9 | 10 | c1.Layer(1) |
10 | 11 | t.AddClip(c1) |
11 | 12 |
|
12 | 13 | # higher layer |
13 | | -higher = openshot.ImageReader("/home/jonathan/apps/libopenshot/src/examples/front3.png") |
| 14 | +higher = openshot.QtImageReader("front3.png") |
14 | 15 | c2 = openshot.Clip(higher) |
15 | 16 | c2.Layer(2) |
16 | 17 | #c2.alpha = openshot.Keyframe(0.5) |
17 | 18 | t.AddClip(c2) |
18 | 19 |
|
19 | 20 | # Wipe / Transition |
20 | 21 | brightness = openshot.Keyframe() |
21 | | -brightness.AddPoint(1, 100.0, openshot.BEZIER) |
22 | | -brightness.AddPoint(24, -100.0, openshot.BEZIER) |
| 22 | +brightness.AddPoint(1, 1.0, openshot.BEZIER) |
| 23 | +brightness.AddPoint(24, -1.0, openshot.BEZIER) |
23 | 24 |
|
24 | 25 | contrast = openshot.Keyframe() |
25 | 26 | contrast.AddPoint(1, 20.0, openshot.BEZIER) |
26 | 27 | contrast.AddPoint(24, 20.0, openshot.BEZIER) |
27 | 28 |
|
28 | | -e = openshot.Wipe("/home/jonathan/apps/libopenshot/src/examples/mask.png", brightness, contrast) |
| 29 | +reader = openshot.QtImageReader("mask.png") |
| 30 | +e = openshot.Mask(reader, brightness, contrast) |
29 | 31 | e.Layer(2) |
30 | 32 | e.End(60) |
31 | 33 | t.AddEffect(e) |
32 | 34 |
|
33 | | -e1 = openshot.Wipe("/home/jonathan/apps/libopenshot/src/examples/mask2.png", brightness, contrast) |
| 35 | +reader1 = openshot.QtImageReader("mask2.png") |
| 36 | +e1 = openshot.Mask(reader1, brightness, contrast) |
34 | 37 | e1.Layer(2) |
35 | 38 | e1.Order(2) |
36 | 39 | e1.End(60) |
37 | 40 | #t.AddEffect(e1) |
38 | 41 |
|
39 | | - |
40 | 42 | for n in range(1,25): |
41 | | - print n |
| 43 | + print(n, end=" ", flush=1) |
42 | 44 | t.GetFrame(n).Save("%s.png" % n, 1.0) |
0 commit comments