lacing.adapters.otio#
OpenTimelineIO (OTIO) adapter — NLE / video editing interchange.
OTIO is the Academy Software Foundation’s standard for video timeline
interchange. Per OSS-DOC, lacing’s RationalTime design is directly
inspired by OTIO’s — this adapter is the place where that parity pays
off.
Mapping#
OTIO ↔ lacing
Timeline ↔ a project (one OTIO file = one store)
Track ↔ a tier (track name becomes tier name)
Clip ↔ Annotation (interval = source_range
offset onto the track timeline)
Clip.media_reference.target_url ↔ MediaRef.asset_id
Marker (on Track or Clip) ↔ point Annotation
Clip.metadata / Marker.metadata ↔ body['otio_metadata']
MarkerColor ↔ body['color']
Time#
OTIO RationalTime maps to lacing RationalTime directly — same
(value, rate) shape. We re-quantize to the requested project rate
on load if needed; raises LossyTimeConversionError on inexact
conversions.
Lossy on dump#
Per-annotation provenance (
was_attributed_to,was_derived_from) is dropped — OTIO carries no per-clip annotator field.Confidence is dropped — OTIO has no equivalent.
Track effects + transitions are dropped — out of lacing’s scope.
Clips are emitted with an
ExternalReferencewhosetarget_urlis theMediaRef.asset_id.
Spec: https://opentimelineio.readthedocs.io/
Functions
- lacing.adapters.otio.dump(store, target=None, *, name='lacing', **_kwargs)[source]#
Serialize
storeas an OTIO file.Each tier becomes one Track. Annotations whose body has
kind=='marker'are emitted asMarker``s on the track at their interval start. Annotations whose body has ``kind=='clip'(or no explicit kind) become Clips withExternalReferenceto theasset_idandsource_rangematching the lacing interval.Note
lacing intervals are absolute positions; OTIO clips are sequential within a track. We sort + place clips back-to-back per tier; gaps between intervals become explicit
Gapitems.
- lacing.adapters.otio.load(source, *, rate=24000, asset_id=None, attribution='anonymous', **_kwargs)[source]#
Load an OTIO file/JSON into a
MemoryStore.Each track becomes a tier. Each clip becomes one
AnnotationwithMediaRefpointing at the clip’s media reference (or theasset_idoverride). Markers on the timeline, track, or clip become pointAnnotation``s on a ``markerstier.- Parameters:
- Return type: