How academysoftwarefoundation/opentimelineio works
Project Type and Purpose
• This is an open-source, dual-language library/toolset rather than a web app:
• Core implemented in C++ for an in-memory timeline data model (“opentime” + “opentimelineio”).
• Official Python bindings (py-opentimelineio) exposing the C++ core idiomatically.
• A plugin system for adapters (file I/O), media linkers, hook scripts, and schema definitions.
• Command-line tools (otiocat, otioconvert, etc.) and a minimal Qt-based viewer (opentimelineview).
• Examples, tests, docs bundled alongside build scripts (CMake, setup.py).
File-Structure Highlights
• Top-level tooling & governance: CMakeLists.txt, setup.py/pyproject.toml, Makefile, GitHub workflows.
• src/deps: third-party vendored libs (pybind11, rapidjson, Imath).
• src/opentime: standalone C++ time library (rationalTime, timeRange, timeTransform).
• src/opentimelineio: core C++ data model, algorithms, serialization/deserialization.
• src/py-opentimelineio:
a. CMake subdirs for building Python extension modules (opentime-bindings, otio-bindings).
b. Pure-Python wrapper packages (opentimelineio.adapters, .algorithms, .console, .core, .plugins, .schema).
• src/opentimelineview: PySide viewer widgets and console stub.
• tests: C++ & Python unit tests; baselines for adapter formats.
• examples: minimal C++ & Python usage demos, sample plugins.
• docs/tutorials: architecture, adapters, plugin tutorials on ReadTheDocs.
README Insights
• Emphasizes C++ core + Python API + plugin extensibility.
• Plugin points: adapters (I/O), media linkers, hook scripts, schema defs.
• Build/install via CMake/pip.
• Viewer program built on PySide2.
Components
a. Core C++ Library (“opentimelineio” + “opentime”)
• No external deps at runtime.
• Provides: SerializableObject, Timeline, Track, Clip, Effect, serialization APIs.
b. Build System
• CMake → produces:
• libopentime.a / .so
• libopentimelineio.a / .so
• Python extension modules (opentime_bindings, otio_bindings)
• setup.py (setuptools) wraps CMake build on pip install.
c. Python Binding Layer
• Extension modules loaded by Python packages under src/py-opentimelineio/opentimelineio.
• Exposes C++ classes/methods to Python.
d. Plugin System
• Entry points defined in plugin_manifest.json files.
• Adapters (read/write formats)
• Media linkers
• Hook scripts
• Schema defs
e. CLI Tools & Viewer
• otiocat, otioconvert, otiopluginfo, etc.
• opentimelineview (Qt widgets)
• Rely on Python API + plugins
f. External Dependencies
• Vendored: pybind11, rapidjson, Imath
• Python: PySide2 (viewer), click/argparse (console), setuptools entry points.
g. Examples & Tests (separate, not in production flow)
Relationships & Data Flow
• Developer writes C++ or Python code → links against C++ core or imports Python package.
• CLI tools & viewer import top-level Python package → invoke core functionality.
• Adapters/plugin loading: Python package discovers plugins via entry points → adapter code → calls into core deserialization.
• Core serialization writes .otio; adapters serialize to other formats.
• Build pipeline: source → CMake build → libraries + Python wheels via setup.py → PyPI.
Architectural Patterns & Principles
• Layered architecture: Core (C++) → Binding (C++ → Python) → Application (CLI, viewer, plugins).
• Plugin-based extensibility via standardized manifests & entry points.
• Separation of concerns: time library separate from timeline library.
• Vendored dependencies isolate third-party code.
• Single responsibility: each package/subdir has a clear role.