Created
March 14, 2018 22:50
-
-
Save aleb/b469640ea875d534501b802d47e2380d to your computer and use it in GitHub Desktop.
Shows: `CRITICAL **: ges_clip_move_to_layer: assertion 'GES_IS_LAYER (layer)' failed`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gi | |
gi.require_version('GES', '1.0') | |
from gi.repository import GES, Gst, GstPbutils | |
Gst.init(None) | |
GES.init() | |
p = GES.Project.new() | |
tl = p.extract() | |
vtrack = GES.VideoTrack.new() | |
tl.add_track(vtrack) | |
layer = tl.append_layer() | |
def add(start): | |
clip = GES.TitleClip() | |
clip.set_duration(100 * Gst.MSECOND) | |
clip.set_start(start) | |
layer.add_clip(clip) | |
return clip | |
def a(): | |
clips = [add(i * Gst.SECOND) for i in range(4)] | |
#print (clips) | |
group = None | |
for clip in clips: | |
if not group: | |
group = clip | |
else: | |
group = GES.Container.group([clip, group]) | |
return clips | |
for ii in [ | |
(0,1,2,3), (1,2,3,0), (2,3,0,1), | |
(3,0,1,2), (0,2,3,1), (3,2,0,1)]: | |
print () | |
print ("Deleting the 4 clips grouped as (3, (2, (1, 0))) in this order:", ii) | |
clips = a() | |
for i in ii: | |
print(i, layer.remove_clip(clips[i])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment