traitsui.editors.video_editor module

Traits UI ‘display only’ video editor.

class traitsui.editors.video_editor.VideoEditor(*args, **traits)[source]

Bases: BasicEditorFactory

Traits UI ‘display only’ video editor.

This editor only displays the video stream, and does not attempt to provide UI elements for controlling playback. It does provide a rich set of trait references that can be synchronised with the internal state of the video player.

aspect_ratio = AspectRatio()

The behaviour of the video display when the widget aspect ratio doesn’t match the aspect ratio of the video stream.

buffer = Instance(

An integer percentage representing how much of the player’s buffer is filled.

duration = Instance(

Duration of the loaded video in seconds

image_func = CVType(Callable, sync_value='from')

Callable to apply to video frames. Takes ref to new frame and a size tuple. Must return a QImage and a numpy array.

klass = Property()

The editor class to be created:

media_status = Instance(

The status of the loaded video (see MediaStatus)

muted = CVType(Bool, default_value=False, sync_value='from')

True if the audio is muted, False otherwise

notify_interval = CVType(Float, default_value=1.0, sync_value='from')

The name of a trait to synchronise with the player’s notify interval. The referenced trait should be a Float representing time in seconds.

playback_rate = CVType(Float, default_value=1.0, sync_value='from')

The playback speed of the video. Negative values are allowed but may not be supported by the underlying implementation.

position = CVType(Float, default_value=0.0, sync_value='both')

The current position, in seconds, in the video.

state = CVType(PlayerState, default_value='stopped', sync_value='both')

The state (stopped, playing, paused) of the player

video_error = Instance(

A string describing an error encountered by the player

volume = CVType(Range(0.0, 100.0), default_value=75.0, sync_value='from')

Audio volume on a logarithmic scale