TITLE_FONT_DESC = "Georgia, 24"
class Timeline(object):
- def __init__(self):
+ def __init__(self, canvas_size=None):
self.project = GES.Project(extractable_type=GES.Timeline)
self.timeline = GES.Asset.extract(self.project)
audio_track = GES.AudioTrack.new()
video_track = GES.VideoTrack.new()
+ if canvas_size:
+ width, height = canvas_size
+ caps = Gst.Caps.new_empty_simple("video/x-raw")
+ caps.set_value("width", width)
+ caps.set_value("height", height)
+ video_track.set_restriction_caps(caps)
+
self.timeline.add_track(audio_track)
self.timeline.add_track(video_track)