OpenTimelineIO / otio-aaf-adapter

OpenTimelineIO Advanced Authoring Format (AAF) Adapter
Apache License 2.0
18 stars 7 forks source link

source_range and available_range incorrect #53

Open jminor opened 5 days ago

jminor commented 5 days ago

Bug Report

Incorrect Functionality

Converting this AAF to OTIO produces the wrong source_range and available_range for the three clips included.

To Reproduce

  1. Unzip the attached ZIP
  2. Run otioconvert -i simple_timecode_test.aaf -o simple_timecode_test.otio
  3. Examine the source_range and available_range for each of the three clips with otiotool -i simple_timecode_test.otio --list-clips --inspect test_pattern
TIMELINE: simple_timecode_test.Exported.02
  ITEM: test_pattern_media_1920x1080_24_DNxHD-LB-tc-1-hour (<class 'opentimelineio._otio.Clip'>)
    source_range: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    trimmed_range: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    visible_range: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    available_range: TimeRange(RationalTime(0, 24), RationalTime(1.0368e+07, 24))
    range_in_parent: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    trimmed range in timeline: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    visible range in timeline: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    range in Sequence (<class 'opentimelineio._otio.Track'>): TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    range in tracks (<class 'opentimelineio._otio.Stack'>): TimeRange(RationalTime(0, 24), RationalTime(120, 24))
  ITEM: test_pattern_media_1920x1080_24_DNxHD-LB-tc-zero (<class 'opentimelineio._otio.Clip'>)
    source_range: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    trimmed_range: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    visible_range: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    available_range: TimeRange(RationalTime(0, 24), RationalTime(1.0368e+07, 24))
    range_in_parent: TimeRange(RationalTime(120, 24), RationalTime(120, 24))
    trimmed range in timeline: TimeRange(RationalTime(120, 24), RationalTime(120, 24))
    visible range in timeline: TimeRange(RationalTime(120, 24), RationalTime(120, 24))
    range in Sequence (<class 'opentimelineio._otio.Track'>): TimeRange(RationalTime(120, 24), RationalTime(120, 24))
    range in tracks (<class 'opentimelineio._otio.Stack'>): TimeRange(RationalTime(120, 24), RationalTime(120, 24))
  ITEM: test_pattern_media_1920x1080_24_DNxHD-LB-no-tc (<class 'opentimelineio._otio.Clip'>)
    source_range: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    trimmed_range: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    visible_range: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    available_range: TimeRange(RationalTime(0, 24), RationalTime(1.0368e+07, 24))
    range_in_parent: TimeRange(RationalTime(240, 24), RationalTime(120, 24))
    trimmed range in timeline: TimeRange(RationalTime(240, 24), RationalTime(120, 24))
    visible range in timeline: TimeRange(RationalTime(240, 24), RationalTime(120, 24))
    range in Sequence (<class 'opentimelineio._otio.Track'>): TimeRange(RationalTime(240, 24), RationalTime(120, 24))
    range in tracks (<class 'opentimelineio._otio.Stack'>): TimeRange(RationalTime(240, 24), RationalTime(120, 24))
TIMELINE: simple_timecode_test.Exported.02
  CLIP: test_pattern_media_1920x1080_24_DNxHD-LB-tc-1-hour
  CLIP: test_pattern_media_1920x1080_24_DNxHD-LB-tc-zero
  CLIP: test_pattern_media_1920x1080_24_DNxHD-LB-no-tc

Expected Behavior

The 1st clip test_pattern_media_1920x1080_24_DNxHD-LB-tc-1-hour source media has a starting timecode of 01:00:00:00 therefore:

The 2nd clip test_pattern_media_1920x1080_24_DNxHD-LB-tc-zero source media has a starting timecode of 00:00:00:00 therefore:

The 3rd clip test_pattern_media_1920x1080_24_DNxHD-LB-no-tc source media has no embedded starting timecode therefore:

Additional Context

The AAF was authored with Avid Media Composer 2023.12.0.58093.0

The attached ZIP has the source media for all three clips, the exported AAF from Avid Media Composer and the converted OTIO from that AAF which demonstrates the incorrect values.

simple_timecode_test_bug_repro.zip

jminor commented 5 days ago

More info: this test passes: https://github.com/OpenTimelineIO/otio-aaf-adapter/blob/main/tests/test_aaf_adapter.py#L593

and the source_range and available_range of this sample AAF are correct: https://github.com/OpenTimelineIO/otio-aaf-adapter/blob/main/tests/sample_data/timecode_test.aaf

So maybe there's something different about this AAF or the media used?

TIMELINE: OTIO_Timecode_Test.Exported.01.Exported.01
  ITEM: Sequence (<class 'opentimelineio._otio.Track'>)
    source_range: None
    trimmed_range: TimeRange(RationalTime(0, 24), RationalTime(48, 24))
    visible_range: TimeRange(RationalTime(0, 24), RationalTime(48, 24))
    available_range: TimeRange(RationalTime(0, 24), RationalTime(48, 24))
    range_in_parent: TimeRange(RationalTime(0, 24), RationalTime(48, 24))
    trimmed range in timeline: TimeRange(RationalTime(0, 24), RationalTime(48, 24))
    visible range in timeline: TimeRange(RationalTime(0, 24), RationalTime(48, 24))
    range in tracks (<class 'opentimelineio._otio.Stack'>): TimeRange(RationalTime(0, 24), RationalTime(48, 24))
  ITEM: Frame Debugger 0h.mov (<class 'opentimelineio._otio.Clip'>)
    source_range: TimeRange(RationalTime(24, 24), RationalTime(24, 24))
    trimmed_range: TimeRange(RationalTime(24, 24), RationalTime(24, 24))
    visible_range: TimeRange(RationalTime(24, 24), RationalTime(24, 24))
    available_range: TimeRange(RationalTime(0, 24), RationalTime(120, 24))
    range_in_parent: TimeRange(RationalTime(0, 24), RationalTime(24, 24))
    trimmed range in timeline: TimeRange(RationalTime(0, 24), RationalTime(24, 24))
    visible range in timeline: TimeRange(RationalTime(0, 24), RationalTime(24, 24))
    range in Sequence (<class 'opentimelineio._otio.Track'>): TimeRange(RationalTime(0, 24), RationalTime(24, 24))
    range in tracks (<class 'opentimelineio._otio.Stack'>): TimeRange(RationalTime(0, 24), RationalTime(24, 24))
  ITEM: Frame Debugger 1h.mov (<class 'opentimelineio._otio.Clip'>)
    source_range: TimeRange(RationalTime(86424, 24), RationalTime(24, 24))
    trimmed_range: TimeRange(RationalTime(86424, 24), RationalTime(24, 24))
    visible_range: TimeRange(RationalTime(86424, 24), RationalTime(24, 24))
    available_range: TimeRange(RationalTime(86400, 24), RationalTime(120, 24))
    range_in_parent: TimeRange(RationalTime(24, 24), RationalTime(24, 24))
    trimmed range in timeline: TimeRange(RationalTime(24, 24), RationalTime(24, 24))
    visible range in timeline: TimeRange(RationalTime(24, 24), RationalTime(24, 24))
    range in Sequence (<class 'opentimelineio._otio.Track'>): TimeRange(RationalTime(24, 24), RationalTime(24, 24))
    range in tracks (<class 'opentimelineio._otio.Stack'>): TimeRange(RationalTime(24, 24), RationalTime(24, 24))
TIMELINE: OTIO_Timecode_Test.Exported.01.Exported.01
  CLIP: Frame Debugger 0h.mov
  CLIP: Frame Debugger 1h.mov