AcademySoftwareFoundation / OpenTimelineIO

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

Add marker to timeline when we can't find valid track #1697

Closed austinwitherspoon closed 7 months ago

austinwitherspoon commented 7 months ago

Fixes #1696

See issue #1696 , certain AAF files generated by Avid Media Composer with "Use Selected Tracks" may contain markers with invalid PhysicalTrackNumber properties.

The current behavior is to raise an exception when this occurs, but it seems preferable to handle this situation gracefully. Avid currently handles these AAFs by dropping the marker entirely. DaVinci Resolve handles these AAFs by adding the marker to the timeline, rather than a clip.

I personally prefer the Resolve approach, since we don't delete the data entirely. It means we always have somewhere where the marker data will end up.

I have update the AAF parser to do this approach - instead of raising an exception when OTIO can't find a matching track, we apply the marker to the timeline itself (or rather, the tracks property on the timeline. This is how OTIO files generated by Resolve represent timeline markers.)

Here is a screenshot of otioview running on this AAF, where the marker is applied to the timeline itself rather than the clip: image

Reference associated tests.

I've added a test for this case in contrib/opentimelineio_contrib/adapters/tests/test_aaf_adapter.py called test_aaf_marker_with_bad_track() This test currently only ensures that we don't raise an exception when parsing a file like this.

linux-foundation-easycla[bot] commented 7 months ago

CLA Missing ID CLA Not Signed

markreidvfx commented 7 months ago

@austinwitherspoon thanks for the PR! we are in the process of moving all the adapters to separate repositories. Are you able to port your change to this repo? https://github.com/OpenTimelineIO/otio-aaf-adapter

Your change might conflict with some recent changes made there related to markers. Maybe this is already fixed, https://github.com/OpenTimelineIO/otio-aaf-adapter/pull/20 but it does sound like a different issue.

austinwitherspoon commented 7 months ago

@austinwitherspoon thanks for the PR! we are in the process of moving all the adapters to separate repositories. Are you able to port your change to this repo? https://github.com/OpenTimelineIO/otio-aaf-adapter

Your change might conflict with some recent changes made there related to markers. Maybe this is already fixed, OpenTimelineIO/otio-aaf-adapter#20 but it does sound like a different issue.

Ah okay, I'll take a look and see if I can move my changes over there! Thanks.