Jared %!s(int64=2) %!d(string=hai) anos
pai
achega
ab61c6af94
Modificáronse 2 ficheiros con 28 adicións e 0 borrados
  1. 28 0
      openshot/examples/beginner.py
  2. BIN=BIN
      openshot/examples/tt.jpg

+ 28 - 0
openshot/examples/beginner.py

@@ -0,0 +1,28 @@
+import openshot
+
+def video_writer_init(path):
+    w = openshot.FFmpegWriter(path)
+    w.SetAudioOptions(True, "aac", 44100, 2, openshot.LAYOUT_STEREO, 3000000)
+    w.SetVideoOptions(True, "libx264", openshot.Fraction(30000, 1000), 1280, 720,
+        openshot.Fraction(1, 1), False, False, 3000000)
+    return w
+
+
+t = openshot.Timeline(1280, 720, openshot.Fraction(30000, 1000), 44100, 2, openshot.LAYOUT_STEREO)
+t.Open()
+text_title = openshot.QtImageReader("/app/tt.jpg")
+clip = openshot.Clip(text_title)
+t.AddClip(clip)
+
+w = video_writer_init("/app/test.mp4")
+w.Open()
+
+frames = t.info.fps.ToInt ()*3
+for n in range(frames):
+    f=t.GetFrame(n)
+    w.WriteFrame(f)
+
+t.Close()
+w.Close()
+
+

BIN=BIN
openshot/examples/tt.jpg