Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source_range and available_range incorrect #53

Open
jminor opened this issue Nov 22, 2024 · 2 comments
Open

source_range and available_range incorrect #53

jminor opened this issue Nov 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jminor
Copy link
Member

jminor commented Nov 22, 2024

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:

  • source_range should be TimeRange(RationalTime(86400, 24), RationalTime(120, 24)) instead of TimeRange(RationalTime(0, 24), RationalTime(120, 24))
  • available_range should be TimeRange(RationalTime(86400, 24), RationalTime(120, 24)) instead of TimeRange(RationalTime(0, 24), RationalTime(1.0368e+07, 24))

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

  • available_range should be TimeRange(RationalTime(0, 24), RationalTime(120, 24)) instead of TimeRange(RationalTime(0, 24), RationalTime(1.0368e+07, 24))

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

  • available_range should be TimeRange(RationalTime(0, 24), RationalTime(120, 24)) instead of TimeRange(RationalTime(0, 24), RationalTime(1.0368e+07, 24))

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 jminor added the bug Something isn't working label Nov 22, 2024
@jminor
Copy link
Member Author

jminor commented Nov 22, 2024

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

@jminor
Copy link
Member Author

jminor commented Dec 7, 2024

FYI, I have confirmed that #44 mostly fixes this bug. Specifically, using the code in the the linked PR, the source_range of these clips is fixed, and the available_range of most of the media references is correct.

Running this conversion:

% uvx --from opentimelineio --with git+https://github.com/markreidvfx/otio-aaf-adapter.git@mastermob_refactor_v1 otioconvert -i simple_timecode_test.aaf -o fixed.otio

then this inspection...

% uvx --from opentimelineio otiotool -i fixed.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(86400, 24), RationalTime(120, 24))
    trimmed_range: TimeRange(RationalTime(86400, 24), RationalTime(120, 24))
    visible_range: TimeRange(RationalTime(86400, 24), RationalTime(120, 24))
    available_range: TimeRange(RationalTime(86400, 24), RationalTime(120, 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 TimelineMobSlot (<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(120, 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 TimelineMobSlot (<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(120, 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 TimelineMobSlot (<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

In the updated AAF, there are now multiple media references for each clip, and one of the inactive media references still has the incorrect/unexpected available_range. Here is an example:

"test_pattern_media_1920x1080_24_DNxHD-LB.mov": {
    "OTIO_SCHEMA": "ExternalReference.1",
    "metadata": {
        "AAF": {
            "ClassName": "SourceMob",
            "CreationTime": "2024-11-22 07:04:53",
            "EssenceDescription": {
                "ClassName": "ImportDescriptor",
                "Locator": {}
            },
            "LastModified": "2024-11-22 07:04:53",
            "MobAttributeList": {
                "_PJ": "joshm project"
            },
            "MobID": "urn:smpte:umid:060a2b34.01010105.01010f10.13000000.9ecffceb.06369806.aee320a5.cbd40190",
            "Name": "test_pattern_media_1920x1080_24_DNxHD-LB.mov",
            "Slots": {}
        }
    },
    "name": "test_pattern_media_1920x1080_24_DNxHD-LB.mov",
    "available_range": {
        "OTIO_SCHEMA": "TimeRange.1",
        "duration": {
            "OTIO_SCHEMA": "RationalTime.1",
            "rate": 24.0,
            "value": 10368000.0
        },
        "start_time": {
            "OTIO_SCHEMA": "RationalTime.1",
            "rate": 24.0,
            "value": 0.0
        }
    },
    "available_image_bounds": null,
    "target_url": "file:///jumpcut/Users/edit/Desktop/time_warp_test_v3%20-%20no%20audio/test_pattern_media_1920x1080_24_DNxHD-LB.mov"
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant