These are the current schemas, from OpenTimelineIO’s autogenerated list. Each object also
has its OTIO_SCHEMA
field. Media references and effects are on
their own page.
Common fields
Most schemas share name, a string, and metadata, a
dictionary. Objects derived from Item also have these fields.
| Field | Type | Meaning |
|---|---|---|
source_range | TimeRange or null | The part of the item used. Default null. |
effects | list of Effect | Effects on the item. Default empty. |
markers | list of Marker | Markers on the item. Default empty. |
enabled | boolean | If true, the item contributes to compositions. A disabled clip is muted or hidden. Default true. |
color | Color or null | A colour for the item. Default null. |
Length of an item with no source_range
An item’s trimmed range is its source_range when that is set, and otherwise
its available range; its duration is the duration of the trimmed range
(item.h, item.cpp). A Clip’s available range is the
available_range of its active media reference (the one named by
active_media_reference_key). If the clip has no active reference, or that reference’s
available_range is null, no length can be computed (an error when asked), so such a clip
has no length of its own. A Gap adds no available range of its own (its constructor
makes a source_range from a duration), so a gap with a null source_range
has no length. A Transition is not an Item; see below.
Required and optional fields
Read from the C++ library’s read_from functions (current source). A required
field that is absent makes the whole read fail; an optional one keeps its default. Writers
always write every field. A key that no schema field uses is not an error: it is kept as a
dynamic field and written back out unchanged.
| Schema | Required | Optional (with default) |
|---|---|---|
every schema derived from SerializableObjectWithMetadata | name (empty string), metadata (empty dictionary) | |
every Item | source_range, effects, markers, enabled, color | |
Timeline.1 | tracks | global_start_time (null) |
Composition.1, Stack.1, Track.1 | children (Composition, so also Stack and Track) | |
Track.1 | kind | |
Clip.2 | media_references, active_media_reference_key | |
Gap.1 | ||
Transition.1 | in_offset, out_offset, transition_type | enabled (true) |
Marker.3 and Marker.2 | marked_range | color, comment (empty) |
SerializableCollection.1 | children |
Media references and effects are listed on their page, with their own required fields.
Timeline.1
| Field | Type | Meaning |
|---|---|---|
name | string | Name. |
metadata | dictionary | Extra data. |
global_start_time | RationalTime or null | The time the timeline starts at. |
tracks | Stack | The contents of the timeline. |
Stack.1
Common item fields, and children, a list of composable objects. Children
are layered on top of each other.
From stack.cpp (current main branch; the v0.18.1 file is the same in these functions).
Every child is placed at start time 0 (in a RationalTime at the child’s own rate), with the
child’s own duration, so the children overlap from the beginning. The stack’s own available range is
0 to the longest child duration; an empty stack has an empty range. As with any
item, a source_range on the stack overrides this length (see
length of an item).
Track.1
Common item fields, children, and kind, a string. The library
defines two constants for it, Video and Audio (track.h), but
the reader accepts any string (track.cpp reads kind as a
plain string and checks nothing), and kind is required. Children play one after another.
From track.cpp (current main branch). A child’s range in the track starts at the sum of the
durations of the children before it that are not overlapping (a Transition is
overlapping; clips and gaps are not), so items follow each other with no gap, and a transition adds
nothing to the running total. For a Transition child the start is then moved earlier
by its in_offset, and its duration is in_offset + out_offset.
The track’s own available range starts at 0 and lasts the sum of the durations of its
Item children (transitions excluded), plus the in_offset of a transition that is
the first child and the out_offset of a transition that is the
last child. With a source_range set, that range is the track’s length instead.
Clip.2
Common item fields, and these.
| Field | Type | Meaning |
|---|---|---|
media_references | dictionary of MediaReference | The available references, by key. |
active_media_reference_key | string | The key in use. The library’s default is DEFAULT_MEDIA. |
Clip.1 and Clip.2: upgrade and downgrade
From typeRegistry.cpp (current main branch). Clip.1 has a single
media_reference field.
- Upgrade 1 to 2 (on read): the value of
media_referenceis put in a newmedia_referencesdictionary under the keyDEFAULT_MEDIA;active_media_reference_keyis set to"DEFAULT_MEDIA"; andmedia_referenceis removed. Ifmedia_referenceis missing,nullor anything other than an object, a newMissingReferenceis used instead (the oldClipconstructor’s behaviour). - Downgrade 2 to 1 (on write, when a target version map asks for
Clipversion 1): ifmedia_referencesandactive_media_reference_keyare both present and the key names an entry, that entry is written asmedia_reference. Both new fields are then removed, so every media reference other than the active one is lost, and with no matching entry nomedia_referenceis written at all.
Gap.1
Common item fields. A gap is empty time; its length comes from
source_range. Old files may use the alias Filler.
Transition.1
| Field | Type | Meaning |
|---|---|---|
name, metadata | As usual. | |
enabled | boolean | If false, the adjacent clips are cut together with no transition. |
transition_type | string | The kind of transition, any string: the library defines the constants SMPTE_Dissolve and Custom_Transition (transition.h), but the reader (transition.cpp) accepts any string and does not check it. Required. |
in_offset | RationalTime | How much of the previous clip the transition overlaps, exclusive. |
out_offset | RationalTime | How much of the next clip the transition overlaps, exclusive. |
A transition’s duration is in_offset + out_offset
(transition.cpp); it has no source_range.
Marker.3
| Field | Type | Meaning |
|---|---|---|
name, metadata | As usual. | |
marked_range | TimeRange | The range the marker applies to, relative to the item it is attached to. |
color | Color or null | The marker’s colour; the constructor’s default is green. |
comment | string | An optional comment. |
Marker.2 (and Marker.1)
Released libraries (0.14.0 to 0.18.1) write Marker.2. It has the same fields except for the colour:
| Field | Type | Meaning |
|---|---|---|
name, metadata | As usual. | |
marked_range | TimeRange | Required. The range the marker applies to. |
color | string | Optional when reading; a file without it reads as GREEN (the C++ default). The value is free text: the reader stores any string. The released library (v0.18.1, marker.h) names eleven colours as constants: PINK, RED, ORANGE, YELLOW, GREEN, CYAN, BLUE, PURPLE, MAGENTA, BLACK and WHITE. TRANSPARENT is not one of them; it exists only for the Color type of Marker.3 and in the 2-to-3 and 3-to-2 conversions. In Marker.3 the value is a Color.1 object instead. |
comment | string | An optional comment. |
The default colour when a marker is made in code is GREEN in the C++ constructor
and RED in the released Python binding ("color"_a = Marker::Color::red),
but a file that has no color key always reads as the C++ default,
GREEN (marker.cpp, read_if_present on a marker built with
that default). Sources: v0.18.1 marker.h, marker.cpp and the Python
binding in otio_serializableObjects.cpp.
Marker.1 (older) names the range range; the library’s upgrade to version 2
renames it to marked_range. Upgrade 2 to 3 turns the colour name (compared
without regard to case) into the matching named colour with its r, g, b, a and name; an
unknown name becomes white with the original name kept. Downgrading 3 to 2 turns a colour
whose name matches one of the twelve into that name in capitals, and keeps any other name
as it is.
SerializableCollection.1
name, metadata and children, a list of any
objects. It is the recommended way to store more than one timeline in a file.
Base types
These appear in a file only when written directly. They define fields that the types above inherit.
| Schema | Fields |
|---|---|
SerializableObjectWithMetadata.1 | name, metadata. |
Composable.1 | name, metadata. |
Item.1 | The common item fields. |
Composition.1 | The common item fields, and children, a list of composable objects (required when reading). Stack and Track add nothing to it except kind on Track. |
SerializableObject.1 | No fields of its own. It is the root of every schema and registered by name; any key it does not otherwise know is kept as a dynamic field and written back. |
Test.1 | name, metadata only. Not a timeline type: it is the library’s test schema (a TestObject in the Python bindings’ test module) and shows up in the version maps from 0.15.0 on. |
UnknownSchema.1 | What a reader creates for an OTIO_SCHEMA it does not know; its original schema name and version and all of its fields are kept and written back out unchanged. |
Object references
By default an object reached twice is simply written out twice, and an object that
contains itself is an error (a cycle). A library built with instancing support (the build flag
OTIO_INSTANCING_SUPPORT) instead writes OTIO_REF_ID
as the first key of each object, a string of the form SchemaName-n
(for example Clip-1, counting per schema name), and writes any later reference
to the same object as {"OTIO_SCHEMA": "SerializableObjectRef.1", "id": "Clip-1"},
where id is the string of an earlier OTIO_REF_ID. Standard
builds do not write either.
Every build reads them, with no build flag involved
(deserialization.cpp, current main branch):
- An
OTIO_REF_IDkey on any object that is not one of the seven value types must hold a string (otherwise a type-mismatch error). The reader remembers the object under that id. - A second object with the same
OTIO_REF_IDis an error (“duplicate object reference”) and the read fails. SerializableObjectRef.1needs a stringid(a missing or non-stringidis an error). After the whole file is read, each reference is replaced by the object holding that id.- A reference whose id no object carries is an error (“unresolved object reference”, with the line number). Because the references are resolved after the whole file is read, a reference may appear before the object it names.
- An empty-string
OTIO_REF_IDis not remembered.
Plugin types
These describe library plugins rather than timelines. They live in a plugin manifest
file, found through the environment variable OTIO_PLUGIN_MANIFEST_PATH.
| Schema | Fields |
|---|---|
Adapter.1 | name, filepath (absolute, or relative to the JSON), suffixes (file suffixes for this adapter). |
HookScript.1 | name, filepath. |
MediaLinker.1 | name, filepath. |
SchemaDef.1 | name, filepath. |
PluginManifest.1 | adapters, media_linkers, schemadefs, hook_scripts, hooks, version_manifests. |