opentimelineio / otio-aaf-adapter Goto Github PK
View Code? Open in Web Editor NEWOpenTimelineIO Advanced Authoring Format (AAF) Adapter
License: Apache License 2.0
OpenTimelineIO Advanced Authoring Format (AAF) Adapter
License: Apache License 2.0
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.
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
Traceback (most recent call last):
File "/Users/awitherspoon/src/studio/otio-aaf-adapter/.venv/bin/otioview", line 8, in <module>
sys.exit(main())
File "/Users/awitherspoon/src/studio/otio-aaf-adapter/.venv/lib/python3.9/site-packages/opentimelineview/console.py", line 300, in main
window.load(args.input)
File "/Users/awitherspoon/src/studio/otio-aaf-adapter/.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/otio-aaf-adapter/.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/otio-aaf-adapter/.venv/lib/python3.9/site-packages/opentimelineio/adapters/adapter.py", line 116, in read_from_file
result = self._execute_function(
File "/Users/awitherspoon/src/studio/otio-aaf-adapter/.venv/lib/python3.9/site-packages/opentimelineio/plugins/python_plugin.py", line 142, in _execute_function
return (getattr(self.module(), func_name)(**kwargs))
File "/Users/awitherspoon/src/studio/otio-aaf-adapter/src/otio_aaf_adapter/adapters/advanced_authoring_format.py", line 1609, in read_from_file
result = _attach_markers(result)
File "/Users/awitherspoon/src/studio/otio-aaf-adapter/src/otio_aaf_adapter/adapters/advanced_authoring_format.py", line 1259, 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'
Code formatting using black
has become a bit of a standard in the Python community and it would be great to see the us adopt it. We could apply it to the entire codebase and then add the commit to .git-blame-ignore-revs
so it won't mess with the git blame output.
Currently the AAF writer doesn't translate user comments generated by the AAF reader (or manually by the user).
The adapter should translate comments from the clip / media reference onto the MasterMob
and comments from the timeline onto the CompositionMob
.
The following tasks need to be resolved before AAF Adapter can safely be removed from OpenTimelineIO.
Please let me know if there are any other blocking issues to add to this task list.
The pull request to remove the AAF Adapter from OTIO is here
AcademySoftwareFoundation/OpenTimelineIO#1348
Currently the AAF adapter doesn't assign a track kind
to adapters that aren't audio or video. This makes it harder to work with / filter them.
Attempting to convert https://dpel.aswf.io/aws-picchu-edit/
fails using both release OTIO and OTIO 0.17-dev and associated plugins
In a clean v-env or conda env, install OTIO:
pip install opentimelineio==v0.17.0.dev1
pip install opentimelineio-plugins==0.17.0.dev1
Then run
otioconvert -i ~/Downloads/aws-picchu-edit-4096x2048.otioz -o ~/Downloads/aws-picchu-edit-4096x2048.aaf -O 'AAF' -A use_empty_mob_ids="True"
macOS 13.4
3.10.0
0.17.0.dev1
Successful AAF conversion
Description of the expected behavior.
otioconvert
which fails on transitions and timing:Traceback (most recent call last):
File "/Users/vade/miniconda3/envs/otio/bin/otioconvert", line 8, in <module>
sys.exit(main())
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/console/otioconvert.py", line 278, in main
otio.adapters.write_to_file(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/adapters/__init__.py", line 192, in write_to_file
return adapter.write_to_file(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/adapters/adapter.py", line 189, in write_to_file
result = self._execute_function(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/plugins/python_plugin.py", line 142, in _execute_function
return (getattr(self.module(), func_name)(**kwargs))
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_aaf_adapter/adapters/advanced_authoring_format.py", line 1604, in write_to_file
aaf_writer.validate_metadata(timeline)
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_aaf_adapter/adapters/aaf_adapter/aaf_writer.py", line 179, in validate_metadata
raise AAFValidationError("\n" + "\n".join(
otio_aaf_adapter.adapters.aaf_adapter.aaf_writer.AAFValidationError:
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['PointList'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['DataDefinition']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Description'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['CutPoint'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['PointList'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['DataDefinition']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Description'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['CutPoint'] does not exist, 'AAF'
Carolina_Galarza_11 years old.mov<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate not equal to 24.0 (expected) != 59.94005994005994 (actual)
Carolina_Galarza_11 years old.mov<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate not equal to 24.0 (expected) != 59.94005994005994 (actual)
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['PointList'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['DataDefinition']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Description'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['CutPoint'] does not exist, 'AAF'
250376-Pigs_shriek_and_squeals_chewing_and_rumble_sheep_bells.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate not equal to 24.0 (expected) != 30.0 (actual)
250376-Pigs_shriek_and_squeals_chewing_and_rumble_sheep_bells.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate not equal to 24.0 (expected) != 30.0 (actual)
250376-Pigs_shriek_and_squeals_chewing_and_rumble_sheep_bells.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate not equal to 24.0 (expected) != 30.0 (actual)
250376-Pigs_shriek_and_squeals_chewing_and_rumble_sheep_bells.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate not equal to 24.0 (expected) != 30.0 (actual)
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['PointList'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['DataDefinition']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Description'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['CutPoint'] does not exist, 'AAF'
519291-139337-felix-blume-wind-is-blowing-in-the-grass-of-a-patagonian-plain-wind-is-blowing-in-the-trees-in-background-tier.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate not equal to 24.0 (expected) != 25.0 (actual)
519291-139337-felix-blume-wind-is-blowing-in-the-grass-of-a-patagonian-plain-wind-is-blowing-in-the-trees-in-background-tier.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate not equal to 24.0 (expected) != 25.0 (actual)
519291-139337-felix-blume-wind-is-blowing-in-the-grass-of-a-patagonian-plain-wind-is-blowing-in-the-trees-in-background-tier.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate not equal to 24.0 (expected) != 25.0 (actual)
519291-139337-felix-blume-wind-is-blowing-in-the-grass-of-a-patagonian-plain-wind-is-blowing-in-the-trees-in-background-tier.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate not equal to 24.0 (expected) != 25.0 (actual)
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['PointList'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['DataDefinition']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Description'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['CutPoint'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['PointList'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['DataDefinition']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Description'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['CutPoint'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['PointList'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['DataDefinition']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Description'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['OperationGroup']['Operation']['Name'] does not exist, 'AAF'
Cross Fade 0 dB<class 'opentimelineio._otio.Transition'> Transition.metadata['AAF']['CutPoint'] does not exist, 'AAF'
250376-Pigs_shriek_and_squeals_chewing_and_rumble_sheep_bells.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate not equal to 24.0 (expected) != 30.0 (actual)
250376-Pigs_shriek_and_squeals_chewing_and_rumble_sheep_bells.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate not equal to 24.0 (expected) != 30.0 (actual)
otiotool -i ~/Downloads/aws-picchu-edit-4096x2048/content.otio --remove-transitions -o ~/Downloads/aws-picchu-edit-4096x2048/content-no-transition.otio
(I did this on an unzipped otioz structure, just for clarity)
And then running otioconvert again removes the transition errors, but of course timing is still a concern:
otioconvert -i ~/Downloads/aws-picchu-edit-4096x2048/content-no-transition.otio -o ~/Downloads/aws-picchu-edit-4096x2048/content-no-transition.aaf -O 'AAF'
Traceback (most recent call last):
File "/Users/vade/miniconda3/envs/otio/bin/otioconvert", line 8, in <module>
sys.exit(main())
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/console/otioconvert.py", line 278, in main
otio.adapters.write_to_file(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/adapters/__init__.py", line 192, in write_to_file
return adapter.write_to_file(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/adapters/adapter.py", line 189, in write_to_file
result = self._execute_function(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/plugins/python_plugin.py", line 142, in _execute_function
return (getattr(self.module(), func_name)(**kwargs))
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_aaf_adapter/adapters/advanced_authoring_format.py", line 1604, in write_to_file
aaf_writer.validate_metadata(timeline)
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_aaf_adapter/adapters/aaf_adapter/aaf_writer.py", line 179, in validate_metadata
raise AAFValidationError("\n" + "\n".join(
otio_aaf_adapter.adapters.aaf_adapter.aaf_writer.AAFValidationError:
Carolina_Galarza_11 years old.mov<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate not equal to 24.0 (expected) != 59.94005994005994 (actual)
Carolina_Galarza_11 years old.mov<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate not equal to 24.0 (expected) != 59.94005994005994 (actual)
250376-Pigs_shriek_and_squeals_chewing_and_rumble_sheep_bells.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate not equal to 24.0 (expected) != 30.0 (actual)
250376-Pigs_shriek_and_squeals_chewing_and_rumble_sheep_bells.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate not equal to 24.0 (expected) != 30.0 (actual)
250376-Pigs_shriek_and_squeals_chewing_and_rumble_sheep_bells.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate not equal to 24.0 (expected) != 30.0 (actual)
250376-Pigs_shriek_and_squeals_chewing_and_rumble_sheep_bells.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate not equal to 24.0 (expected) != 30.0 (actual)
519291-139337-felix-blume-wind-is-blowing-in-the-grass-of-a-patagonian-plain-wind-is-blowing-in-the-trees-in-background-tier.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate not equal to 24.0 (expected) != 25.0 (actual)
519291-139337-felix-blume-wind-is-blowing-in-the-grass-of-a-patagonian-plain-wind-is-blowing-in-the-trees-in-background-tier.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate not equal to 24.0 (expected) != 25.0 (actual)
519291-139337-felix-blume-wind-is-blowing-in-the-grass-of-a-patagonian-plain-wind-is-blowing-in-the-trees-in-background-tier.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate not equal to 24.0 (expected) != 25.0 (actual)
519291-139337-felix-blume-wind-is-blowing-in-the-grass-of-a-patagonian-plain-wind-is-blowing-in-the-trees-in-background-tier.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate not equal to 24.0 (expected) != 25.0 (actual)
250376-Pigs_shriek_and_squeals_chewing_and_rumble_sheep_bells.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate not equal to 24.0 (expected) != 30.0 (actual)
250376-Pigs_shriek_and_squeals_chewing_and_rumble_sheep_bells.wav<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate not equal to 24.0 (expected) != 30.0 (actual)
otiostat ~/Downloads/aws-picchu-edit-4096x2048/content.otio
parsed: True
top level object: Timeline.1
number of tracks: 26
There was a system error: track 5 is not the same duration as the other tracks. Track RationalTime(10547, 24) duration, vs: RationalTime(10588, 24)
deepest nesting: 4
number of clips: 508
total duration: RationalTime(10588, 24)
total duration in timecode: 00:07:21:04
top level rate: 24.0
clips with cdl data: 0
Tracks with non standard types: 0
Any insight is helpful!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.