GES.Timeline

g Gst.Object Gst.Object Gst.Element Gst.Element Gst.Object->Gst.Element GES.MetaContainer GES.MetaContainer GES.Timeline GES.Timeline GES.MetaContainer->GES.Timeline GObject.GInterface GObject.GInterface GObject.GInterface->GES.MetaContainer GES.Extractable GES.Extractable GObject.GInterface->GES.Extractable Gst.ChildProxy Gst.ChildProxy GObject.GInterface->Gst.ChildProxy GObject.Object GObject.Object GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.Object->GObject.InitiallyUnowned Gst.Bin Gst.Bin Gst.Bin->GES.Timeline GObject.InitiallyUnowned->Gst.Object Gst.Element->Gst.Bin GES.Extractable->GES.Timeline Gst.ChildProxy->Gst.Bin

Subclasses:None

Methods

Inherited:Gst.Bin (17), Gst.Element (70), Gst.Object (27), GObject.Object (40), Gst.ChildProxy (8), GES.Extractable (3), GES.MetaContainer (37)
Structs:Gst.ElementClass (9), GObject.ObjectClass (5)
class new ()
class new_audio_video ()
class new_from_uri (uri)
  add_layer (layer)
  add_track (track)
  append_layer ()
  commit ()
  commit_sync ()
  get_auto_transition ()
  get_duration ()
  get_element (name)
  get_groups ()
  get_layer (priority)
  get_layers ()
  get_pad_for_track (track)
  get_snapping_distance ()
  get_track_for_pad (pad)
  get_tracks ()
  is_empty ()
  load_from_uri (uri)
  remove_layer (layer)
  remove_track (track)
  save_to_uri (uri, formatter_asset, overwrite)
  set_auto_transition (auto_transition)
  set_snapping_distance (snapping_distance)

Properties

Inherited:Gst.Bin (2), Gst.Object (2)
Name Type Flags Short Description
auto-transition bool r/w whether the transitions are added
duration int r The duration of the timeline
snapping-distance int r/w Distance from which moving an object will snap with neighboors

Signals

Inherited:Gst.Bin (5), Gst.Element (3), Gst.Object (1), GObject.Object (1), Gst.ChildProxy (2), GES.MetaContainer (1)
Name Short Description
commited This signal will be emitted once the changes initiated by GES.Timeline.commit have been executed in the backend.
group-added Will be emitted after a new group is added to to the timeline.
group-removed Will be emitted after a group has been removed from the timeline.
layer-added Will be emitted after a new layer is added to the timeline.
layer-removed Will be emitted after the layer was removed from the timeline.
select-tracks-for-object  
snapping-ended  
snapping-started  
track-added Will be emitted after the track was added to the timeline.
track-removed Will be emitted after the track was removed from the timeline.

Fields

Inherited:Gst.Bin (5), Gst.Element (3), Gst.Object (1), GObject.Object (1), Gst.ChildProxy (2), GES.MetaContainer (1)
Name Type Access Description
layers [GES.Layer] r A list of GES.Layer sorted by priority NOTE: Do not modify.
parent Gst.Bin r  
tracks [GES.Track] r A list of GES.Track sorted by priority NOTE: Do not modify.

Class Details

class GES.Timeline(**kwargs)
Bases:Gst.Bin, GES.Extractable, GES.MetaContainer
Abstract:No
Structure:GES.TimelineClass

GES.Timeline is the central object for any multimedia timeline.

Contains a list of GES.Layer which users should use to arrange the various clips through time.

The output type is determined by the GES.Track that are set on the GES.Timeline.

To save/load a timeline, you can use the GES.Timeline.load_from_uri() and GES.Timeline.save_to_uri() methods to use the default format. If you wish

Note that any change you make in the timeline will not actually be taken into account until you call the GES.Timeline.commit method.

classmethod new()[source]
Returns:The new timeline.
Return type:GES.Timeline

Creates a new empty GES.Timeline.

classmethod new_audio_video()[source]
Returns:The newly created GES.Timeline.
Return type:GES.Timeline

Creates a new GES.Timeline containing a raw audio and a raw video track.

classmethod new_from_uri(uri)[source]
Parameters:uri (str) – the URI to load from
Raises:GLib.Error
Returns:A new timeline if the uri was loaded successfully, or None if the uri could not be loaded.
Return type:GES.Timeline or None

Creates a timeline from the given URI.

add_layer(layer)[source]
Parameters:layer (GES.Layer) – the GES.Layer to add
Returns:True if the layer was properly added, else False.
Return type:bool

Add the layer to the timeline. The reference to the layer will be stolen by the self.

add_track(track)[source]
Parameters:track (GES.Track) – the GES.Track to add
Returns:True if the track was properly added, else False.
Return type:bool

Add a track to the timeline. The reference to the track will be stolen by the pipeline.

append_layer()[source]
Returns:The newly created GES.Layer, or the last (empty) GES.Layer of self.
Return type:GES.Layer

Append a newly created GES.Layer to self Note that you do not own any reference to the returned layer.

commit()[source]
Returns:True if pending changes were commited or False if nothing needed to be commited. This means that if False is returned then no “commited” signal will be emited.
Return type:bool

Commit all the pending changes of the clips contained in the self.

When changes happen in a timeline, they are not directly executed in the non-linear engine. Call this method once you are done with a set of changes and want it to be executed.

The GES.Timeline ::commited signal will be emitted when the (possibly updated) Gst.Pipeline is ready to output data again, except if the state of the timeline was Gst.State.READY or Gst.State.NULL.

Note that all the pending changes will automatically be executed when the timeline goes from Gst.State.READY to Gst.State.PAUSED, which usually is triggered by corresponding state changes in a containing GES.Pipeline.

You should not try to change the state of the timeline, seek it or add tracks to it during a commit operation, that is between a call to this function and after receiving the GES.Timeline ::commited signal.

See GES.Timeline.commit_sync if you don’t want to bother with waiting for the signal.

commit_sync()[source]
Returns:True if pending changes were commited or False if nothing needed to be commited
Return type:bool

Commit all the pending changes of the GES.Clips contained in the self.

Will return once the update is complete, that is when the (possibly updated) Gst.Pipeline is ready to output data again, or if the state of the timeline was Gst.State.READY or Gst.State.NULL.

This function will wait for any pending state change of the timeline by calling Gst.Element.get_state with a Gst.CLOCK_TIME_NONE timeout, you should not try to change the state from another thread before this function has returned.

See GES.Timeline.commit for more information.

get_auto_transition()[source]
Returns:True if transitions are automatically added, else False.
Return type:bool

Gets whether transitions are automatically added when objects overlap or not.

get_duration()[source]
Returns:The current duration of self
Return type:int

Get the current duration of self

get_element(name)[source]
Parameters:name (str) –
Returns:The GES.TimelineElement or None if not found.
Return type:GES.TimelineElement or None

Gets a GES.TimelineElement contained in the timeline

get_groups()[source]
Returns:the list of GES.Group that contain clips present in the timeline’s layers. Must not be changed.
Return type:[GES.Group]

Get the list of GES.Group present in the Timeline.

get_layer(priority)[source]
Parameters:priority (int) – The priority of the layer to find
Returns:A GES.Layer or None if no layer with priority was found
Return type:GES.Layer or None

Retrieve the layer with priority as a priority

get_layers()[source]
Returns:the list of GES.Layer present in the Timeline sorted by priority. The caller should unref each Layer once he is done with them.
Return type:[GES.Layer]

Get the list of GES.Layer present in the Timeline.

get_pad_for_track(track)[source]
Parameters:track (GES.Track) – The GES.Track
Returns:The corresponding Gst.Pad if it is found, or None if there is an error.
Return type:Gst.Pad or None

Search the Gst.Pad corresponding to the given self‘s track.

get_snapping_distance()[source]
Returns:The snapping_distance property of the timeline
Return type:int

Gets the configured snapping distance of the timeline. See the documentation of the property snapping_distance for more information.

get_track_for_pad(pad)[source]
Parameters:pad (Gst.Pad) – The Gst.Pad
Returns:The corresponding GES.Track if it is found, or None if there is an error.
Return type:GES.Track or None

Search the GES.Track corresponding to the given self‘s pad.

get_tracks()[source]
Returns:A list of GES.Track. The caller should unref each track once he is done with them.
Return type:[GES.Track]

Returns the list of GES.Track used by the Timeline.

is_empty()[source]
Returns:True if the timeline is empty False otherwize
Return type:bool

Check whether a GES.Timeline is empty or not

load_from_uri(uri)[source]
Parameters:uri (str) – The URI to load from
Raises:GLib.Error
Returns:True if the timeline was loaded successfully, or False if the uri could not be loaded.
Return type:bool

Loads the contents of URI into the given timeline.

remove_layer(layer)[source]
Parameters:layer (GES.Layer) – the GES.Layer to remove
Returns:True if the layer was properly removed, else False.
Return type:bool

Removes the layer from the timeline. The reference that the self holds on the layer will be dropped. If you wish to use the layer after calling this method, you need to take a reference before calling.

remove_track(track)[source]
Parameters:track (GES.Track) – the GES.Track to remove
Returns:True if the track was properly removed, else False.
Return type:bool

Remove the track from the self. The reference stolen when adding the track will be removed. If you wish to use the track after calling this function you must ensure that you have a reference to it.

save_to_uri(uri, formatter_asset, overwrite)[source]
Parameters:
  • uri (str) – The location to save to
  • formatter_asset (GES.Asset or None) – The formatter asset to use or None. If None, will try to save in the same format as the one from which the timeline as been loaded or default to the formatter with highest rank
  • overwrite (bool) – True to overwrite file if it exists
Raises:

GLib.Error

Returns:

True if the timeline was successfully saved to the given location, else False.

Return type:

bool

Saves the timeline to the given location

set_auto_transition(auto_transition)[source]
Parameters:auto_transition (bool) – whether the auto_transition is active

Sets the layer to the given auto_transition. See the documentation of the property auto_transition for more information.

set_snapping_distance(snapping_distance)[source]
Parameters:snapping_distance (int) – whether the snapping_distance is active

Sets the snapping_distance of the timeline. See the documentation of the property snapping_distance for more information.

do_group_added(group) virtual
Parameters:group (GES.Group) –
do_layer_added(layer) virtual
Parameters:layer (GES.Layer) –
do_layer_removed(layer) virtual
Parameters:layer (GES.Layer) –
do_track_added(track) virtual
Parameters:track (GES.Track) –
do_track_removed(track) virtual
Parameters:track (GES.Track) –

Signal Details

GES.Timeline.signals.commited(timeline)
Signal Name:commited
Flags:RUN_LAST
Parameters:timeline (GES.Timeline) – The object which received the signal

This signal will be emitted once the changes initiated by GES.Timeline.commit have been executed in the backend. Use GES.Timeline.commit_sync if you don’t need to do anything in the meantime.

GES.Timeline.signals.group_added(timeline, group)
Signal Name:

group-added

Flags:

RUN_FIRST

Parameters:

Will be emitted after a new group is added to to the timeline.

GES.Timeline.signals.group_removed(timeline, group, children)
Signal Name:

group-removed

Flags:

RUN_FIRST

Parameters:

Will be emitted after a group has been removed from the timeline.

GES.Timeline.signals.layer_added(timeline, layer)
Signal Name:

layer-added

Flags:

RUN_FIRST

Parameters:

Will be emitted after a new layer is added to the timeline.

GES.Timeline.signals.layer_removed(timeline, layer)
Signal Name:

layer-removed

Flags:

RUN_FIRST

Parameters:

Will be emitted after the layer was removed from the timeline.

GES.Timeline.signals.select_tracks_for_object(timeline, clip, track_element)
Signal Name:

select-tracks-for-object

Flags:

RUN_LAST

Parameters:
Returns:

a GLib.PtrArray of GES.Track-s where that object should be added

Return type:

[GES.Track]

GES.Timeline.signals.snapping_ended(timeline, object, p0, p1)
Signal Name:

snapping-ended

Flags:

RUN_LAST

Parameters:
GES.Timeline.signals.snapping_started(timeline, object, p0, p1)
Signal Name:

snapping-started

Flags:

RUN_LAST

Parameters:
GES.Timeline.signals.track_added(timeline, track)
Signal Name:

track-added

Flags:

RUN_FIRST

Parameters:

Will be emitted after the track was added to the timeline.

GES.Timeline.signals.track_removed(timeline, track)
Signal Name:

track-removed

Flags:

RUN_FIRST

Parameters:

Will be emitted after the track was removed from the timeline.

Property Details

GES.Timeline.props.auto_transition
Name:auto-transition
Type:bool
Default Value:False
Flags:READABLE, WRITABLE

Sets whether transitions are added automagically when clips overlap.

GES.Timeline.props.duration
Name:duration
Type:int
Default Value:18446744073709551615L
Flags:READABLE

Current duration (in nanoseconds) of the GES.Timeline

GES.Timeline.props.snapping_distance
Name:snapping-distance
Type:int
Default Value:0
Flags:READABLE, WRITABLE

Distance (in nanoseconds) from which a moving object will snap with it neighboors. 0 means no snapping.