When flattening multiple tracks into one, there are sometimes clips which overlap transitions on lower tracks, which leads to an error preventing the flattening operation. Specifically an exception is thrown and no result is returned.
Here is a repro case. This is a production example that was redacted with otiotool --redact to remove sensitive names, but the structure is left intact.
redacted.otio.zip
Repro steps:
- Download and unzip the attached redacted.otio file
- Run
otiotool -i redacted.otio --flatten video -o flat.otio
Actual result:
Traceback (most recent call last):
File "/Users/joshm/.local/bin/otiotool", line 8, in <module>
sys.exit(main())
File "/Users/joshm/.local/share/uv/tools/opentimelineio/lib/python3.9/site-packages/opentimelineio/console/otiotool.py", line 98, in main
flatten_timeline(
File "/Users/joshm/.local/share/uv/tools/opentimelineio/lib/python3.9/site-packages/opentimelineio/console/otiotool.py", line 601, in flatten_timeline
flat_track = otio.algorithms.flatten_stack(tracks_to_flatten[:])
ValueError: cannot trim transition: Cannot trim in the middle of a transition
Expected result:
A flat.otio with one video track.
For the case of the bisected transition, the transition itself should be shortened, or discarded with a warning.
When flattening multiple tracks into one, there are sometimes clips which overlap transitions on lower tracks, which leads to an error preventing the flattening operation. Specifically an exception is thrown and no result is returned.
Here is a repro case. This is a production example that was redacted with
otiotool --redactto remove sensitive names, but the structure is left intact.redacted.otio.zip
Repro steps:
otiotool -i redacted.otio --flatten video -o flat.otioActual result:
Expected result:
A flat.otio with one video track.
For the case of the bisected transition, the transition itself should be shortened, or discarded with a warning.