AcademySoftwareFoundation / OpenTimelineIO

Open Source API and interchange format for editorial timeline information.
http://opentimeline.io
Apache License 2.0
1.47k stars 293 forks source link

OpenTimelineIO raises exception when trying to load AAF exported from Avid with "Use Selected Tracks" selected #1696

Closed austinwitherspoon closed 8 months ago

austinwitherspoon commented 9 months ago

Bug Report

I’ve found a bug in Avid Media Composer AAF file generation:

Currently OTIO will raise an exception when trying to load this AAF:

raise AAFAdapterError(
    "Marker '{}' cannot be attached to an item. SlotID: '{}', "
    "PhysicalTrackNumber: '{}'".format(
        marker.name, slot_id, track_number
    )
)

Since this is a "valid" aaf generated by Avid Media Composer, OpenTimelineIO shouldn't explode when reading in the file.

To Reproduce

Here's an AAF file generated by Avid Media Composer 2021.12.2.55649.0, using the instructions above: bad_marker_track_from_avid.aaf.zip

Logs

Traceback (most recent call last):
  File "/Users/awitherspoon/src/studio/laika-editorial/venv/bin/otioview", line 8, in <module>
    sys.exit(main())
  File "/Users/awitherspoon/src/studio/laika-editorial/venv/lib/python3.9/site-packages/opentimelineview/console.py", line 300, in main
    window.load(args.input)
  File "/Users/awitherspoon/src/studio/laika-editorial/venv/lib/python3.9/site-packages/opentimelineview/console.py", line 191, in load
    file_contents = otio.adapters.read_from_file(
  File "/Users/awitherspoon/src/studio/laika-editorial/venv/lib/python3.9/site-packages/opentimelineio/adapters/__init__.py", line 137, in read_from_file
    return adapter.read_from_file(
  File "/Users/awitherspoon/src/studio/laika-editorial/venv/lib/python3.9/site-packages/opentimelineio/adapters/adapter.py", line 125, in read_from_file
    result = self._execute_function(
  File "/Users/awitherspoon/src/studio/laika-editorial/venv/lib/python3.9/site-packages/opentimelineio/plugins/python_plugin.py", line 153, in _execute_function
    return (getattr(self.module(), func_name)(**kwargs))
  File "/Users/awitherspoon/src/studio/laika-editorial/venv/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 1590, in read_from_file
    result = _attach_markers(result)
  File "/Users/awitherspoon/src/studio/laika-editorial/venv/lib/python3.9/site-packages/opentimelineio_contrib/adapters/advanced_authoring_format.py", line 1245, in _attach_markers
    raise AAFAdapterError(
opentimelineio.adapters.AAF.AAFAdapterError: Marker 'Marker on Track 3! When exported with Track 2 deselected and exported with "Selected Tracks Only", this marker will incorrectly point at track 2 in the AAF even though it doesn't exist (since the original track 2 was ommitted, and track 3 was renamed to 2 by avid!)' cannot be attached to an item. SlotID: '9', PhysicalTrackNumber: '3'
reinecke commented 9 months ago

PR OpenTimelineIO/otio-aaf-adapter/pull/41 in the AAF adapter repo addresses this

reinecke commented 8 months ago

PR https://github.com/OpenTimelineIO/otio-aaf-adapter/pull/41 merged - thanks!