OpenTimelineIO / otio-aaf-adapter

OpenTimelineIO Advanced Authoring Format (AAF) Adapter
Apache License 2.0
16 stars 6 forks source link

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

Closed austinwitherspoon closed 6 months ago

austinwitherspoon commented 7 months ago

Fixes #40

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

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 Signed

The committers listed above are authorized under a signed CLA.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (00ca601) 90.00% compared to head (e13b3f7) 90.12%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #41 +/- ## ========================================== + Coverage 90.00% 90.12% +0.11% ========================================== Files 3 3 Lines 1121 1124 +3 ========================================== + Hits 1009 1013 +4 + Misses 112 111 -1 ``` | [Flag](https://app.codecov.io/gh/OpenTimelineIO/otio-aaf-adapter/pull/41/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenTimelineIO) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/OpenTimelineIO/otio-aaf-adapter/pull/41/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenTimelineIO) | `90.12% <100.00%> (+0.11%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OpenTimelineIO#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

reinecke commented 7 months ago

Fixes AcademySoftwareFoundation/OpenTimelineIO/issues/1696.