Skip to content

Commit aa85c1b

Browse files
authored
Merge pull request #102 from ferdnyc/example
Update wipe-tests example to latest API
2 parents c5fff85 + b4be3dc commit aa85c1b

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
11
import openshot
22

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()
56

67
# lower layer
7-
lower = openshot.ImageReader("/home/jonathan/apps/libopenshot/src/examples/back.png")
8+
lower = openshot.QtImageReader("back.png")
89
c1 = openshot.Clip(lower)
910
c1.Layer(1)
1011
t.AddClip(c1)
1112

1213
# higher layer
13-
higher = openshot.ImageReader("/home/jonathan/apps/libopenshot/src/examples/front3.png")
14+
higher = openshot.QtImageReader("front3.png")
1415
c2 = openshot.Clip(higher)
1516
c2.Layer(2)
1617
#c2.alpha = openshot.Keyframe(0.5)
1718
t.AddClip(c2)
1819

1920
# Wipe / Transition
2021
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)
2324

2425
contrast = openshot.Keyframe()
2526
contrast.AddPoint(1, 20.0, openshot.BEZIER)
2627
contrast.AddPoint(24, 20.0, openshot.BEZIER)
2728

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)
2931
e.Layer(2)
3032
e.End(60)
3133
t.AddEffect(e)
3234

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)
3437
e1.Layer(2)
3538
e1.Order(2)
3639
e1.End(60)
3740
#t.AddEffect(e1)
3841

39-
4042
for n in range(1,25):
41-
print n
43+
print(n, end=" ", flush=1)
4244
t.GetFrame(n).Save("%s.png" % n, 1.0)

0 commit comments

Comments
 (0)