opentimelineio.schema package

User facing classes.

Submodules

opentimelineio.schema.clip module

Implementation of the Clip class, for pointing at media.

class opentimelineio.schema.clip.Clip(name=None, media_reference=None, source_range=None, markers=[], effects=[], metadata=None)

Bases: opentimelineio.core.item.Item

The base editable object in OTIO.

Contains a media reference and a trim on that media reference.

available_range()

Implemented by child classes, available range of media.

each_clip(search_range=None)

Yields self.

media_reference
name

Name of this clip.

transform

Deprecated field, do not use.

opentimelineio.schema.effect module

Implementation of Effect OTIO class.

class opentimelineio.schema.effect.Effect(name=None, effect_name=None, metadata=None)

Bases: opentimelineio.core.serializable_object.SerializableObject

effect_name

Name of the kind of effect (example: ‘Blur’, ‘Crop’, ‘Flip’).

metadata

Metadata dictionary.

name

Name of this effect object. Example: ‘BlurByHalfEffect’.

class opentimelineio.schema.effect.FreezeFrame(name=None, metadata=None)

Bases: opentimelineio.schema.effect.LinearTimeWarp

Hold the first frame of the clip for the duration of the clip.

class opentimelineio.schema.effect.LinearTimeWarp(name=None, time_scalar=1, metadata=None)

Bases: opentimelineio.schema.effect.TimeEffect

A time warp that applies a linear scale across the entire clip

time_scalar

Linear time scalar applied to clip. 2.0 = double speed, 0.5 = half speed.

class opentimelineio.schema.effect.TimeEffect(name=None, effect_name=None, metadata=None)

Bases: opentimelineio.schema.effect.Effect

Base Time Effect Class

opentimelineio.schema.external_reference module

Implementation of the ExternalReference media reference schema.

class opentimelineio.schema.external_reference.ExternalReference(target_url=None, available_range=None, metadata=None)

Bases: opentimelineio.core.media_reference.MediaReference

Reference to media via a url, for example “file:///var/tmp/foo.mov

target_url

URL at which this media lives. For local references, use the ‘file://’ format.

opentimelineio.schema.gap module

class opentimelineio.schema.gap.Gap(name=None, duration=None, source_range=None, effects=None, markers=None, metadata=None)

Bases: opentimelineio.core.item.Item

static visible()

Return the visibility of the Item. By default True.

opentimelineio.schema.generator_reference module

Generators are media references that _produce_ media rather than refer to it.

class opentimelineio.schema.generator_reference.GeneratorReference(name=None, generator_kind=None, available_range=None, parameters=None, metadata=None)

Bases: opentimelineio.core.media_reference.MediaReference

Base class for Generators.

Generators are media references that become “generators” in editorial systems. For example, color bars or a solid color.

generator_kind

Kind of generator reference, as defined by the schema.generator_reference.GeneratorReferenceTypes enum.

parameters

Dictionary of parameters for generator.

opentimelineio.schema.marker module

Marker class. Holds metadata over regions of time.

class opentimelineio.schema.marker.Marker(name=None, marked_range=None, color='RED', metadata=None)

Bases: opentimelineio.core.serializable_object.SerializableObject

Holds metadata over time on a timeline

color

Color string for this marker (for example: ‘RED’), based on the otio.schema.marker.MarkerColor enum.

marked_range

Range this marker applies to, relative to the Item this marker is attached to (e.g. the Clip or Track that owns this marker).

metadata

Metadata dictionary.

name

Name of this marker.

range

Deprecated field, do not use.

class opentimelineio.schema.marker.MarkerColor

Bases: object

Enum encoding colors of markers as strings.

BLACK = 'BLACK'
BLUE = 'BLUE'
CYAN = 'CYAN'
GREEN = 'GREEN'
MAGENTA = 'MAGENTA'
ORANGE = 'ORANGE'
PINK = 'PINK'
PURPLE = 'PURPLE'
RED = 'RED'
WHITE = 'WHITE'
YELLOW = 'YELLOW'

opentimelineio.schema.missing_reference module

Implementation of the MissingReference media reference schema.

class opentimelineio.schema.missing_reference.MissingReference(name=None, available_range=None, metadata=None)

Bases: opentimelineio.core.media_reference.MediaReference

Represents media for which a concrete reference is missing.

is_missing_reference

opentimelineio.schema.schemadef module

class opentimelineio.schema.schemadef.SchemaDef(name=None, execution_scope=None, filepath=None)

Bases: opentimelineio.plugins.python_plugin.PythonPlugin

module()

Return the module object for this schemadef plugin. If the module hasn’t already been imported, it is imported and injected into the otio.schemadefs namespace as a side-effect. (redefines PythonPlugin.module())

opentimelineio.schema.schemadef.available_schemadef_names()

Return a string list of the available schemadefs.

opentimelineio.schema.schemadef.from_name(name)

Fetch the schemadef object by the name of the schema directly.

opentimelineio.schema.serializable_collection module

A serializable collection of SerializableObjects.

class opentimelineio.schema.serializable_collection.SerializableCollection(name=None, children=None, metadata=None)

Bases: opentimelineio.core.serializable_object.SerializableObject, collections.abc.MutableSequence

A kind of composition which can hold any serializable object.

This composition approximates the concept of a bin - a collection of SerializableObjects that do not have any compositing meaning, but can serialize to/from OTIO correctly, with metadata and a named collection.

each_child(search_range=None, descended_from_type=<class 'opentimelineio.core.composable.Composable'>)
each_clip(search_range=None)
insert(index, item)

S.insert(index, value) – insert value before index

metadata

Metadata dictionary for this SerializableCollection.

name

SerializableCollection name.

opentimelineio.schema.stack module

Implement Track and Stack.

class opentimelineio.schema.stack.Stack(name=None, children=None, source_range=None, markers=None, effects=None, metadata=None)

Bases: opentimelineio.core.composition.Composition

available_range()

Implemented by child classes, available range of media.

each_clip(search_range=None)
range_of_child_at_index(index)

Return the range of a child item in the time range of this composition.

For example, with a track:
[ClipA][ClipB][ClipC]
The self.range_of_child_at_index(2) will return:
TimeRange(ClipA.duration + ClipB.duration, ClipC.duration)

To be implemented by subclass of Composition.

trimmed_range_of_child_at_index(index, reference_space=None)

Return the trimmed range of the child item at index in the time range of this composition.

For example, with a track:

[ ]

[ClipA][ClipB][ClipC]

The range of index 2 (ClipC) will be just like range_of_child_at_index() but trimmed based on this Composition’s source_range.

To be implemented by child.

opentimelineio.schema.timeline module

Implementation of the OTIO built in schema, Timeline object.

class opentimelineio.schema.timeline.Timeline(name=None, tracks=None, global_start_time=None, metadata=None)

Bases: opentimelineio.core.serializable_object.SerializableObject

audio_tracks()

This convenience method returns a list of the top-level audio

duration()

Duration of this timeline.

each_child(search_range=None, descended_from_type=<class 'opentimelineio.core.composable.Composable'>)
each_clip(search_range=None)

Return a flat list of each clip, limited to the search_range.

metadata

Metadata dictionary.

name

Name of this timeline.

range_of_child(child)

Range of the child object contained in this timeline.

tracks

Stack of tracks containing items.

video_tracks()

This convenience method returns a list of the top-level video

opentimelineio.schema.timeline.timeline_from_clips(clips)

Convenience for making a single track timeline from a list of clips.

opentimelineio.schema.track module

Implement Track sublcass of composition.

class opentimelineio.schema.track.NeighborGapPolicy

Bases: object

enum for deciding how to add gap when asking for neighbors

around_transitions = 1
never = 0
class opentimelineio.schema.track.Track(name=None, children=None, kind='Video', source_range=None, markers=None, effects=None, metadata=None)

Bases: opentimelineio.core.composition.Composition

available_range()

Implemented by child classes, available range of media.

each_clip(search_range=None)
handles_of_child(child)

If media beyond the ends of this child are visible due to adjacent Transitions (only applicable in a Track) then this will return the head and tail offsets as a tuple of RationalTime objects. If no handles are present on either side, then None is returned instead of a RationalTime.

Example usage

>>> head, tail = track.handles_of_child(clip)
>>> if head:
...     print('do something')
>>> if tail:
...     print('do something else')
kind

Composition kind (Stack, Track)

neighbors_of(item, insert_gap=0)

Returns the neighbors of the item as a namedtuple, (previous, next).

Can optionally fill in gaps when transitions have no gaps next to them.

with insert_gap == NeighborGapPolicy.never: [A, B, C] :: neighbors_of(B) -> (A, C) [A, B, C] :: neighbors_of(A) -> (None, B) [A, B, C] :: neighbors_of(C) -> (B, None) [A] :: neighbors_of(A) -> (None, None)

with insert_gap == NeighborGapPolicy.around_transitions: (assuming A and C are transitions) [A, B, C] :: neighbors_of(B) -> (A, C) [A, B, C] :: neighbors_of(A) -> (Gap, B) [A, B, C] :: neighbors_of(C) -> (B, Gap) [A] :: neighbors_of(A) -> (Gap, Gap)

range_of_all_children()

Return a dict mapping children to their range in this track.

range_of_child_at_index(index)

Return the range of a child item in the time range of this composition.

For example, with a track:
[ClipA][ClipB][ClipC]
The self.range_of_child_at_index(2) will return:
TimeRange(ClipA.duration + ClipB.duration, ClipC.duration)

To be implemented by subclass of Composition.

trimmed_range_of_child_at_index(index, reference_space=None)

Return the trimmed range of the child item at index in the time range of this composition.

For example, with a track:

[ ]

[ClipA][ClipB][ClipC]

The range of index 2 (ClipC) will be just like range_of_child_at_index() but trimmed based on this Composition’s source_range.

To be implemented by child.

class opentimelineio.schema.track.TrackKind

Bases: object

Audio = 'Audio'
Video = 'Video'

opentimelineio.schema.transition module

Transition base class

class opentimelineio.schema.transition.Transition(name=None, transition_type=None, in_offset=None, out_offset=None, metadata=None)

Bases: opentimelineio.core.composable.Composable

Represents a transition between two items.

duration()
in_offset

Amount of the previous clip this transition overlaps, exclusive.

out_offset

Amount of the next clip this transition overlaps, exclusive.

static overlapping()

Return whether an Item is overlapping. By default False.

range_in_parent()

Find and return the range of this item in the parent.

transition_type

Kind of transition, as defined by the schema.transition.TransitionTypes enum.

trimmed_range_in_parent()

Find and return the timmed range of this item in the parent.

class opentimelineio.schema.transition.TransitionTypes

Bases: object

Enum encoding types of transitions.

This is for representing “Dissolves” and “Wipes” defined by the multi-source effect as defined by SMPTE 258M-2004 7.6.3.2

Other effects are handled by the schema.Effect class.

Custom = 'Custom_Transition'
SMPTE_Dissolve = 'SMPTE_Dissolve'