From c570868e0e6e3b2bd2026dc67658137c53ce6e32 Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Tue, 5 Jun 2018 04:34:40 -0400 Subject: [PATCH] Update wipe-tests example to latest API The `src/effects/Openshot Wipe Tests.py` was no longer usable since the code was way out of date with respect to the current libopenshot APIs. This updates the code to execute properly. (Also: Output the frame numbers on a single line, instead of one per line, for readability.) --- src/examples/OpenShot Wipe Tests.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/examples/OpenShot Wipe Tests.py b/src/examples/OpenShot Wipe Tests.py index 4fb86c85..91b00917 100644 --- a/src/examples/OpenShot Wipe Tests.py +++ b/src/examples/OpenShot Wipe Tests.py @@ -1,16 +1,17 @@ import openshot -# Create a empty clip -t = openshot.Timeline(720, 480, openshot.Fraction(24,1), 44100, 2) +# Create an empty timeline +t = openshot.Timeline(720, 480, openshot.Fraction(24,1), 44100, 2, openshot.LAYOUT_STEREO) +t.Open() # lower layer -lower = openshot.ImageReader("/home/jonathan/apps/libopenshot/src/examples/back.png") +lower = openshot.QtImageReader("back.png") c1 = openshot.Clip(lower) c1.Layer(1) t.AddClip(c1) # higher layer -higher = openshot.ImageReader("/home/jonathan/apps/libopenshot/src/examples/front3.png") +higher = openshot.QtImageReader("front3.png") c2 = openshot.Clip(higher) c2.Layer(2) #c2.alpha = openshot.Keyframe(0.5) @@ -18,25 +19,26 @@ t.AddClip(c2) # Wipe / Transition brightness = openshot.Keyframe() -brightness.AddPoint(1, 100.0, openshot.BEZIER) -brightness.AddPoint(24, -100.0, openshot.BEZIER) +brightness.AddPoint(1, 1.0, openshot.BEZIER) +brightness.AddPoint(24, -1.0, openshot.BEZIER) contrast = openshot.Keyframe() contrast.AddPoint(1, 20.0, openshot.BEZIER) contrast.AddPoint(24, 20.0, openshot.BEZIER) -e = openshot.Wipe("/home/jonathan/apps/libopenshot/src/examples/mask.png", brightness, contrast) +reader = openshot.QtImageReader("mask.png") +e = openshot.Mask(reader, brightness, contrast) e.Layer(2) e.End(60) t.AddEffect(e) -e1 = openshot.Wipe("/home/jonathan/apps/libopenshot/src/examples/mask2.png", brightness, contrast) +reader1 = openshot.QtImageReader("mask2.png") +e1 = openshot.Mask(reader1, brightness, contrast) e1.Layer(2) e1.Order(2) e1.End(60) #t.AddEffect(e1) - for n in range(1,25): - print n + print(n, end=" ", flush=1) t.GetFrame(n).Save("%s.png" % n, 1.0)