opentimelineio.schema

User facing classes.

class opentimelineio.schema.Box2d None
class opentimelineio.schema.Box2d(arg0: opentimelineio._otio.V2d) None
class opentimelineio.schema.Box2d(arg0: opentimelineio._otio.V2d, arg1: opentimelineio._otio.V2d) None

Overloaded function.

  1. __init__(self: opentimelineio._otio.Box2d) -> None

  2. __init__(self: opentimelineio._otio.Box2d, arg0: opentimelineio._otio.V2d) -> None

  3. __init__(self: opentimelineio._otio.Box2d, arg0: opentimelineio._otio.V2d, arg1: opentimelineio._otio.V2d) -> None

center() opentimelineio._otio.V2d
extendBy(arg0: opentimelineio._otio.V2d) None
extendBy(arg0: opentimelineio._otio.Box2d) None

Overloaded function.

  1. extendBy(arg0: opentimelineio._otio.V2d) -> None

  2. extendBy(arg0: opentimelineio._otio.Box2d) -> None

intersects(arg0: opentimelineio._otio.V2d) bool
intersects(arg0: opentimelineio._otio.Box2d) bool

Overloaded function.

  1. intersects(arg0: opentimelineio._otio.V2d) -> bool

  2. intersects(arg0: opentimelineio._otio.Box2d) -> bool

property max
property min
class opentimelineio.schema.Clip(name: str = '', media_reference: opentimelineio._otio.MediaReference = None, source_range: Optional[opentimelineio._opentime.TimeRange] = None, metadata: object = None, active_media_reference: str = 'DEFAULT_MEDIA')

A Clip is a segment of editable media (usually audio or video).

Contains a MediaReference and a trim on that media reference.

DEFAULT_MEDIA_KEY = 'DEFAULT_MEDIA'
property active_media_reference_key
find_clips(search_range=None)
property media_reference
media_references() Dict[str, opentimelineio._otio.MediaReference]
set_media_references(arg0: Dict[str, opentimelineio._otio.MediaReference], arg1: str) None
class opentimelineio.schema.Effect(name: str = '', effect_name: str = '', metadata: object = None)
property effect_name
class opentimelineio.schema.ExternalReference(target_url: str = '', available_range: Optional[opentimelineio._opentime.TimeRange] = None, metadata: object = None, available_image_bounds: Optional[opentimelineio._otio.Box2d] = None)
property target_url
class opentimelineio.schema.FreezeFrame(name: str = '', metadata: object = None)

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

class opentimelineio.schema.Gap(name: str = '', source_range: opentimelineio._opentime.TimeRange = otio.opentime.TimeRange(start_time=otio.opentime.RationalTime(value=0, rate=1), duration=otio.opentime.RationalTime(value=0, rate=1)), effects: Optional[List[opentimelineio._otio.Effect]] = None, markers: Optional[List[opentimelineio._otio.Marker]] = None, metadata: object = None) None
class opentimelineio.schema.Gap(name: str = '', duration: opentimelineio._opentime.RationalTime = otio.opentime.RationalTime(value=0, rate=1), effects: Optional[List[opentimelineio._otio.Effect]] = None, markers: Optional[List[opentimelineio._otio.Marker]] = None, metadata: object = None) None

Overloaded function.

  1. __init__(self: opentimelineio._otio.Gap, name: str = ‘’, source_range: opentimelineio._opentime.TimeRange = otio.opentime.TimeRange(start_time=otio.opentime.RationalTime(value=0, rate=1), duration=otio.opentime.RationalTime(value=0, rate=1)), effects: Optional[List[opentimelineio._otio.Effect]] = None, markers: Optional[List[opentimelineio._otio.Marker]] = None, metadata: object = None) -> None

  2. __init__(self: opentimelineio._otio.Gap, name: str = ‘’, duration: opentimelineio._opentime.RationalTime = otio.opentime.RationalTime(value=0, rate=1), effects: Optional[List[opentimelineio._otio.Effect]] = None, markers: Optional[List[opentimelineio._otio.Marker]] = None, metadata: object = None) -> None

class opentimelineio.schema.GeneratorReference(name: str = '', generator_kind: str = '', available_range: Optional[opentimelineio._opentime.TimeRange] = None, parameters: object = None, metadata: object = None, available_image_bounds: Optional[opentimelineio._otio.Box2d] = None)
property generator_kind
property parameters
class opentimelineio.schema.ImageSequenceReference(target_url_base: str = '', name_prefix: str = '', name_suffix: str = '', start_frame: int = 1, frame_step: int = 1, rate: float = 1, frame_zero_padding: int = 0, missing_frame_policy: opentimelineio._otio.ImageSequenceReference.MissingFramePolicy = <MissingFramePolicy.error: 0>, available_range: Optional[opentimelineio._opentime.TimeRange] = None, metadata: object = None, available_image_bounds: Optional[opentimelineio._otio.Box2d] = None)

An ImageSequenceReference refers to a numbered series of single-frame image files. Each file can be referred to by a URL generated by the ImageSequenceReference.

Image sequences can have URLs with discontinuous frame numbers, for instance if you’ve only rendered every other frame in a sequence, your frame numbers may be 1, 3, 5, etc. This is configured using the frame_step attribute. In this case, the 0th image in the sequence is frame 1 and the 1st image in the sequence is frame 3. Because of this there are two numbering concepts in the image sequence, the image number and the frame number.

Frame numbers are the integer numbers used in the frame file name. Image numbers are the 0-index based numbers of the frames available in the reference. Frame numbers can be discontinuous, image numbers will always be zero to the total count of frames minus 1.

An example for 24fps media with a sample provided each frame numbered 1-1000 with a path /show/sequence/shot/sample_image_sequence.%04d.exr might be

{
  "available_range": {
    "start_time": {
      "value": 0,
      "rate": 24
    },
    "duration": {
      "value": 1000,
      "rate": 24
    }
  },
  "start_frame": 1,
  "frame_step": 1,
  "rate": 24,
  "target_url_base": "file:///show/sequence/shot/",
  "name_prefix": "sample_image_sequence.",
  "name_suffix": ".exr"
  "frame_zero_padding": 4,
}

The same duration sequence but with only every 2nd frame available in the sequence would be

{
  "available_range": {
    "start_time": {
      "value": 0,
      "rate": 24
    },
    "duration": {
      "value": 1000,
      "rate": 24
    }
  },
  "start_frame": 1,
  "frame_step": 2,
  "rate": 24,
  "target_url_base": "file:///show/sequence/shot/",
  "name_prefix": "sample_image_sequence.",
  "name_suffix": ".exr"
  "frame_zero_padding": 4,
}

A list of all the frame URLs in the sequence can be generated, regardless of frame step, with the following list comprehension

[ref.target_url_for_image_number(i) for i in range(ref.number_of_images_in_sequence())]

Negative start_frame is also handled. The above example with a start_frame of -1 would yield the first three target urls as:

  • file:///show/sequence/shot/sample_image_sequence.-0001.exr

  • file:///show/sequence/shot/sample_image_sequence.0000.exr

  • file:///show/sequence/shot/sample_image_sequence.0001.exr

class MissingFramePolicy(value: int)

Behavior that should be used by applications when an image file in the sequence can’t be found on disk.

Members:

error : Application should stop and raise an error.

hold : Application should hold the last available frame before the missing frame.

black : Application should use a black frame in place of the missing frame

black = <MissingFramePolicy.black: 2>
error = <MissingFramePolicy.error: 0>
hold = <MissingFramePolicy.hold: 1>
property name
property value
abstract_target_url(symbol)

Generates a target url for a frame where symbol is used in place of the frame number. This is often used to generate wildcard target urls.

end_frame() int

Last frame number in the sequence based on the rate and available_range.

frame_for_time(time: opentimelineio._opentime.RationalTime) int

Given a RationalTime within the available range, returns the frame number.

frame_range_for_time_range(time_range)

Returns first and last frame numbers for the given time range in the reference.

Return type:

tuple[int]

Raises:

ValueError – if the provided time range is outside the available range.

property frame_step

Step between frame numbers in file names.

property frame_zero_padding

Number of digits to pad zeros out to in frame numbers.

property missing_frame_policy

Directive for how frames in sequence not found during playback or rendering should be handled.

property name_prefix

Everything in the file name leading up to the frame number.

property name_suffix

Everything after the frame number in the file name.

number_of_images_in_sequence() int

Returns the number of images based on the rate and available_range.

presentation_time_for_image_number(image_number: int) opentimelineio._opentime.RationalTime

Given an image number, returns the RationalTime at which that image should be shown in the space of available_range.

property rate

Frame rate if every frame in the sequence were played back.

property start_frame

The first frame number used in file names.

property target_url_base

Everything leading up to the file name in the target_url.

target_url_for_image_number(image_number: int) str

Given an image number, returns the target_url for that image.

This is roughly equivalent to:

f"{target_url_prefix}{(start_frame + (image_number * frame_step)):0{value_zero_padding}}{target_url_postfix}"
class opentimelineio.schema.LinearTimeWarp(name: str = '', time_scalar: float = 1.0, metadata: object = None)

A time warp that applies a linear speed up or slow down across the entire clip.

property time_scalar

Linear time scalar applied to clip. 2.0 means the clip occupies half the time in the parent item, i.e. plays at double speed, 0.5 means the clip occupies twice the time in the parent item, i.e. plays at half speed.

Note that adjusting the time_scalar of a LinearTimeWarp does not affect the duration of the item this effect is attached to. Instead it affects the speed of the media displayed within that item.

class opentimelineio.schema.Marker(name: str = '', marked_range: opentimelineio._opentime.TimeRange = otio.opentime.TimeRange(start_time=otio.opentime.RationalTime(value=0, rate=1), duration=otio.opentime.RationalTime(value=0, rate=1)), color: str = 'RED', metadata: object = None)

A marker indicates a marked range of time on an item in a timeline, usually with a name, color or other metadata.

The marked range may have a zero duration. The marked range is in the owning item’s time coordinate system.

class Color
BLACK = 'BLACK'
BLUE = 'BLUE'
CYAN = 'CYAN'
GREEN = 'GREEN'
MAGENTA = 'MAGENTA'
ORANGE = 'ORANGE'
PINK = 'PINK'
PURPLE = 'PURPLE'
RED = 'RED'
WHITE = 'WHITE'
YELLOW = 'YELLOW'
property color

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

property 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).

class opentimelineio.schema.MissingReference(name: str = '', available_range: Optional[opentimelineio._opentime.TimeRange] = None, metadata: object = None, available_image_bounds: Optional[opentimelineio._otio.Box2d] = None)

Represents media for which a concrete reference is missing.

Note that a MissingReference may have useful metadata, even if the location of the media is not known.

class opentimelineio.schema.SchemaDef
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().

plugin_info_map()

Adds extra schemadef-specific information to call to the parent fn.

class opentimelineio.schema.SerializableCollection(name: str = '', children: Optional[List[opentimelineio._otio.SerializableObject]] = None, metadata: object = None)

A container which can hold an ordered list of any serializable objects. Note that this is not a Composition nor is it Composable.

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

A SerializableCollection is useful for serializing multiple timelines, clips, or media references to a single file.

find_children(descended_from_type: object = None, search_range: Optional[opentimelineio._opentime.TimeRange] = None, shallow_search: bool = False) List[opentimelineio._otio.SerializableObject]
find_clips(search_range: Optional[opentimelineio._opentime.TimeRange] = None, shallow_search: bool = False) List[opentimelineio._otio.SerializableObject]
insert(index, item)
class opentimelineio.schema.Stack(name: str = '', children: Optional[List[opentimelineio._otio.Composable]] = None, source_range: Optional[opentimelineio._opentime.TimeRange] = None, markers: Optional[List[opentimelineio._otio.Marker]] = None, effects: Optional[List[opentimelineio._otio.Effect]] = None, metadata: object = None)
find_clips(search_range: Optional[opentimelineio._opentime.TimeRange] = None, shallow_search: bool = False) List[opentimelineio._otio.SerializableObject]
class opentimelineio.schema.TimeEffect(name: str = '', effect_name: str = '', metadata: object = None)

Base class for all effects that alter the timing of an item.

class opentimelineio.schema.Timeline(name: str = '', tracks: Optional[List[opentimelineio._otio.Composable]] = None, global_start_time: Optional[opentimelineio._opentime.RationalTime] = None, metadata: object = None)
audio_tracks() List[opentimelineio._otio.Track]
duration() opentimelineio._opentime.RationalTime
find_children(descended_from_type: object = None, search_range: Optional[opentimelineio._opentime.TimeRange] = None, shallow_search: bool = False) List[opentimelineio._otio.SerializableObject]
find_clips(search_range: Optional[opentimelineio._opentime.TimeRange] = None, shallow_search: bool = False) List[opentimelineio._otio.SerializableObject]
property global_start_time
range_of_child(arg0: opentimelineio._otio.Composable) opentimelineio._opentime.TimeRange
property tracks
video_tracks() List[opentimelineio._otio.Track]
class opentimelineio.schema.Transition(name: str = '', transition_type: str = '', in_offset: opentimelineio._opentime.RationalTime = otio.opentime.RationalTime(value=0, rate=1), out_offset: opentimelineio._opentime.RationalTime = otio.opentime.RationalTime(value=0, rate=1), metadata: object = None)

Represents a transition between the two adjacent items in a Track. For example, a cross dissolve or wipe.

class Type

Enum encoding types of transitions.

Other effects are handled by the Effect class.

Custom = 'Custom_Transition'
SMPTE_Dissolve = 'SMPTE_Dissolve'
duration() opentimelineio._opentime.RationalTime
property in_offset

Amount of the previous clip this transition overlaps, exclusive.

property out_offset

Amount of the next clip this transition overlaps, exclusive.

range_in_parent() Optional[opentimelineio._opentime.TimeRange]

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

property transition_type

Kind of transition, as defined by the Type enum.

trimmed_range_in_parent() Optional[opentimelineio._opentime.TimeRange]

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

class opentimelineio.schema.V2d None
class opentimelineio.schema.V2d(arg0: float) None
class opentimelineio.schema.V2d(arg0: float, arg1: float) None

Overloaded function.

  1. __init__(self: opentimelineio._otio.V2d) -> None

  2. __init__(self: opentimelineio._otio.V2d, arg0: float) -> None

  3. __init__(self: opentimelineio._otio.V2d, arg0: float, arg1: float) -> None

static baseTypeEpsilon() float
static baseTypeLowest() float
static baseTypeMax() float
static baseTypeSmallest() float
cross(arg0: opentimelineio._otio.V2d) float
static dimensions() int
dot(arg0: opentimelineio._otio.V2d) float
equalWithAbsError(arg0: opentimelineio._otio.V2d, arg1: float) bool
equalWithRelError(arg0: opentimelineio._otio.V2d, arg1: float) bool
length() float
length2() float
normalize() opentimelineio._otio.V2d
normalizeExc() opentimelineio._otio.V2d
normalizeNonNull() opentimelineio._otio.V2d
normalized() opentimelineio._otio.V2d
normalizedExc() opentimelineio._otio.V2d
normalizedNonNull() opentimelineio._otio.V2d
property x
property y
opentimelineio.schema.timeline_from_clips(clips)

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

Modules

opentimelineio.schema.box2d

opentimelineio.schema.clip

opentimelineio.schema.effect

opentimelineio.schema.external_reference

opentimelineio.schema.generator_reference

opentimelineio.schema.image_sequence_reference

opentimelineio.schema.marker

opentimelineio.schema.schemadef

opentimelineio.schema.serializable_collection

opentimelineio.schema.timeline

opentimelineio.schema.transition

opentimelineio.schema.v2d