Skip to main content

OpenTimelineIO adapter plugin for .drp files

Project description

OpenTimelineIO drp adapter plugin

This repository aims at storing an adapter for the OpenTimelineIO project allowing to import .drp files from the Blackmagic ATEM Mini ISO. The initial goal is to be able to import them directly in KDEnlive for further editing, but any OTIO adapter can be used, by design.

It works as is, for simple file based sources, and the .drp file generated by the ATEM Mini ISO. Do not expect it to work right away for every use-case, and obviously not for an actual DaVinci Resolve generated file.

Installation and Usage

Installation

The adapter is not included in OTIO, but is published on Pypi as otio-drp-adapter, so either you can clone the repository and run pip install ., or just install it using pip / PyPi (it will install OpenTimelineIO if needed):

pip install otio-drp-adpater

Usage

If you have a .drp file from the Blackmagic ATEM ISO, you can use otioconvert -i Video.drp -o Video.kdenlive once you've installed the adapter. It won't be available for now from KDEnlive menu, as it requires adapters to enable read and write to be listed, and we only implement reading for now.

Adapter Arguments

You can use arguments with otio tools (-a param=value) to modify the adapter's behaviour.

main_mix=False

This adds a Main Mix track with all the clips attached to it. By default all the sources are set on their track, the timeline is the main mix. It may help for further editing to have an explicit track there, this argument enables it. It's built while processing the .drp file, not using the flatten tools in OTIO.

full_tracks=False

Instead of having each source as a track with gaps, this fills each track source with the full length clip. This is mostly useful combined with main_mix=True, to make it possible to re-decide on the source selection, e.g. using the Multicam tool in KDEnlive.

Notes about .drp file format

Note: the .drp format here is the one generated by the BlackMagic ATEM ISO switcher, not DaVinci Resolve, though it may work for such files.

There wasn't an obvious spec for that file, so the adapter is written based on guesses about the file format itself. It seems the file is line-based, with the first line being some metadata, including the sources using JSON. Then each line represent a live switch between sources, using JSON as well.

Metadata

The header looks like this (taken from a simple ISO recording on the Blackmagic ATEM Mini Pro ISO):

{"version":1,"masterTimecode":"20:58:44:03","videoMode":"1080p25","sources":[{"name":"Camera 1","type":"Video","volume":"ATEM","projectPath":"Test 3","file":"Video ISO Files/Test CAM 1.mp4","startTimecode":"20:58:44:03","_index_":1},{"name":"Camera 2","type":"Video","volume":"ATEM","projectPath":"Test 3","file":"Video ISO Files/Test CAM 2.mp4","startTimecode":"20:58:44:03","_index_":2},{"name":"Camera 3","type":"Video","volume":"ATEM","projectPath":"Test 3","file":"Video ISO Files/Test CAM 3.mp4","startTimecode":"20:58:44:03","_index_":3},{"name":"Camera 4","type":"Video","volume":"ATEM","projectPath":"Test 3","file":"Video ISO Files/Test CAM 4.mp4","startTimecode":"20:58:44:03","_index_":4}]}"

We use the masterTimecode as the time reference for the frames. videoMode is used to determine the frame rate of the ISO files. Sources with a file attribute are then used to compute the tracks and media references for each file.

Switches

Each line represents a switch, giving out the timecode, and the source we're switching to

{"masterTimecode":"21:01:19:14","mixEffectBlocks":[{"source":2,"_index_":0}]}

Licensing

This plugin is licensed under the Apache License, Version 2.0

Tests

There is a a basic .drp file in sample_data/ that is parsed during the tests. It can be tried using:

# In the root folder of the repo
pip install -e .

# Test an adapter for instance
otioconvert -i some_timeline.drp -o some_timeline.ext

Github Actions (as from example repository)

A set of simple automation scripts are available in the .github/workflows folder.

  • ci.yaml - runs unit tests
  • create_draft_release - when a tag is pushed, it creates a draft for a release
  • deploy_package.yaml - simple packing an publishing of a plugin package. Make sure you have a valid token for your PyPi user added to your repos secrets.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

otio-drp-adapter-0.2.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

otio_drp_adapter-0.2.1-py2.py3-none-any.whl (11.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file otio-drp-adapter-0.2.1.tar.gz.

File metadata

  • Download URL: otio-drp-adapter-0.2.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for otio-drp-adapter-0.2.1.tar.gz
Algorithm Hash digest
SHA256 099e1816be6b3369ee16bb8d2d7487e701006d09560eacbf2e268132868346fa
MD5 4b00e225c208f0e55a7687f87b2427a7
BLAKE2b-256 774095a161e60f77d9c3d155dbdbcef229738bcb487993b6e2d080f1370bd934

See more details on using hashes here.

File details

Details for the file otio_drp_adapter-0.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: otio_drp_adapter-0.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for otio_drp_adapter-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 610e0b151b8c0827f7fcb5ed406e8246f6c7a7c5a7431cc6c85385bd88ce78b1
MD5 0054d69c6322c2638102a7e5ad3e5082
BLAKE2b-256 52b29755c6b69a16a151c043b5273b26893fb0ca854e2fc76efaf87b5b5074d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page