GES.BaseEffect

g GES.BaseEffect GES.BaseEffect GES.Extractable GES.Extractable GES.TimelineElement GES.TimelineElement GES.Extractable->GES.TimelineElement GES.MetaContainer GES.MetaContainer GES.MetaContainer->GES.TimelineElement GES.Operation GES.Operation GES.Operation->GES.BaseEffect GES.TrackElement GES.TrackElement GES.TimelineElement->GES.TrackElement GES.TrackElement->GES.Operation GObject.GInterface GObject.GInterface GObject.GInterface->GES.Extractable GObject.GInterface->GES.MetaContainer GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->GES.TimelineElement GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned

Subclasses:

GES.Effect

Methods

Inherited:

GES.TrackElement (22), GES.TimelineElement (38), GObject.Object (37), GES.Extractable (3), GES.MetaContainer (40)

Structs:

GObject.ObjectClass (5)

is_time_effect ()

register_time_property (child_property_name)

set_time_translation_funcs (source_to_sink_func, sink_to_source_func)

Virtual Methods

Inherited:

GES.TrackElement (5), GES.TimelineElement (18), GObject.Object (7), GES.Extractable (3)

Properties

Inherited:

GES.TrackElement (5), GES.TimelineElement (9)

Signals

Inherited:

GES.TrackElement (2), GES.TimelineElement (3), GObject.Object (1), GES.MetaContainer (1)

Fields

Inherited:

GES.TrackElement (2), GES.TimelineElement (3), GObject.Object (1), GES.MetaContainer (1)

Name

Type

Access

Description

parent

GES.Operation

r

Class Details

class GES.BaseEffect(**kwargs)
Bases:

GES.Operation

Abstract:

Yes

Structure:

GES.BaseEffectClass

A GES.BaseEffect is some operation that applies an effect to the data it receives.

Time Effects

Some operations will change the timing of the stream data they receive in some way. In particular, the Gst.Element that they wrap could alter the times of the segment they receive in a Gst.EventType.SEGMENT event, or the times of a seek they receive in a Gst.EventType.SEEK event. Such operations would be considered time effects since they translate the times they receive on their source to different times at their sink, and vis versa. This introduces two sets of time coordinates for the event: (internal) sink coordinates and (internal) source coordinates, where segment times are translated from the sink coordinates to the source coordinates, and seek times are translated from the source coordinates to the sink coordinates.

If you use such an effect in GES, you will need to inform GES of the properties that control the timing with GES.BaseEffect.register_time_property(), and the effect’s timing behaviour using GES.BaseEffect.set_time_translation_funcs().

Note that a time effect should not have its GES.TrackElement :has-internal-source set to True.

In addition, note that GES only *fully* supports time effects whose mapping from the source to sink coordinates (those applied to seeks) obeys:

  • Maps the time 0 to 0. So initial time-shifting effects are excluded.

  • Is monotonically increasing. So reversing effects, and effects that jump backwards in the stream are excluded.

  • Can handle a reasonable #GstClockTime, relative to the project. So this would exclude a time effect with an extremely large speed-up that would cause the converted #GstClockTime seeks to overflow.

  • Is ‘continuously reversible’. This essentially means that for every time in the sink coordinates, we can, to ‘good enough’ accuracy, calculate the corresponding time in the source coordinates. Moreover, this should correspond to how segment times are translated from sink to source.

  • Only depends on the registered time properties, rather than the state of the Gst.Element or the data it receives. This would exclude, say, an effect that would speedup if there is more red in the image it receives.

Note that a constant-rate-change effect that is not extremely fast or slow would satisfy these conditions. For such effects, you may wish to use GES.EffectClass.register_rate_property().

is_time_effect()[source]
Returns:

True if self is considered a time effect.

Return type:

bool

Get whether the effect is considered a time effect or not. An effect with registered time properties or set translation functions is considered a time effect.

New in version 1.18.

register_time_property(child_property_name)[source]
Parameters:

child_property_name (str) – The name of the child property to register as a time property

Returns:

True if the child property was found and newly registered.

Return type:

bool

Register a child property of the effect as a property that, when set, can change the timing of its input data. The child property should be specified as in GES.TimelineElement.lookup_child().

You should also set the corresponding time translation using GES.BaseEffect.set_time_translation_funcs().

Note that self must not be part of a clip, nor can it have GES.TrackElement :has-internal-source set to True.

New in version 1.18.

set_time_translation_funcs(source_to_sink_func, sink_to_source_func)[source]
Parameters:
  • source_to_sink_func (GES.BaseEffectTimeTranslationFunc or None) – The function to use for querying how a time is translated from the source coordinates to the sink coordinates of self

  • sink_to_source_func (GES.BaseEffectTimeTranslationFunc or None) – The function to use for querying how a time is translated from the sink coordinates to the source coordinates of self

Returns:

True if the translation functions were set.

Return type:

bool

Set the time translation query functions for the time effect. If an effect is a time effect, it will have two sets of coordinates: one at its sink and one at its source. The given functions should be able to translate between these two sets of coordinates. More specifically, source_to_sink_func should *emulate* how the corresponding Gst.Element would translate the Gst.Segment time field, and sink_to_source_func should emulate how the corresponding Gst.Element would translate the seek query start and stop values, as used in Gst.Element.seek(). As such, sink_to_source_func should act as an approximate reverse of source_to_sink_func.

Note, these functions will be passed a table of time properties, as registered in GES.BaseEffect.register_time_property(), and their values. The functions should emulate what the translation *would* be *if* the time properties were set to the given values. They should not use the currently set values.

Note that self must not be part of a clip, nor can it have GES.TrackElement :has-internal-source set to True.

New in version 1.18.