OpenTimelineIO Media Linkers are plugins that allow OTIO to replace MissingReferences with valid, site specific MediaReferences after an adapter reads a file.
The current MediaLinker can be specified as an argument to otio.adapters.read_from_file or via an environment variable. If one is specified, then it will run after the adapter reads the contents of the file before it is returned back.
import opentimelineio as otio
mytimeline = otio.adapters.read_from_file("something.edl", media_linker_name="awesome_studios_media_linker")
After the EDL adapter reads something.edl, the media linker “awesome_studios_media_linker” will run and link the media in the file (if it can).
To write a media linker, write a python file with a “link_media_reference” function in it that takes two arguments: “in_clip” (the clip to try and add a media reference to) and “media_linker_argument_map” (arguments passed from the calling function to the media linker.
def link_media_reference(in_clip, media_linker_argument_map):
# you'll probably want to set it to something other than a missing reference
in_clip.media_reference = otio.schema.MissingReference(
name=in_clip.name + "_tweaked",