timeline = GES.Timeline.new_audio_video()
layer = timeline.append_layer()
- video_uri = "file://" + video_path
+ video_uri = Gst.filename_to_uri(video_path)
asset = GES.UriClipAsset.request_sync(video_uri)
clip = layer.add_asset(asset, 0, 0, asset.get_duration(), GES.TrackType.UNKNOWN)
print("Note name: %s start_time: %f duration: %f" %
(note.name, start_time, duration))
- video_sample_uri = "file://%s/sample_%s.mkv" % (video_font_path, note.name)
+ video_sample_path = "%s/sample_%s.mkv" % (video_font_path, note.name)
- timeline.add_clip(video_sample_uri, start_time, duration)
+ timeline.add_clip(video_sample_path, start_time, duration)
return timeline
timeline = timeline_from_midi(midi_file, video_font_path)
if len(sys.argv) > 3:
- destination_uri = 'file://' + os.path.realpath(sys.argv[3])
- timeline.save(destination_uri)
+ timeline.save(sys.argv[3])
else:
timeline.play()
self.layer = self.timeline.append_layer()
- def add_clip(self, clip_uri, start_time, duration):
+ def add_clip(self, clip_path, start_time, duration):
+ clip_uri = Gst.filename_to_uri(clip_path)
asset = GES.UriClipAsset.request_sync(clip_uri)
self.layer.add_asset(asset, start_time * Gst.SECOND, 0,
duration * Gst.SECOND, GES.TrackType.UNKNOWN)
ges_pipeline.set_timeline(self.timeline)
Player(ges_pipeline).play()
- def save(self, uri):
+ def save(self, path):
+ uri = Gst.filename_to_uri(path)
self.project.save(self.timeline, uri, None, False)