AcademySoftwareFoundation / OpenTimelineIO

Open Source API and interchange format for editorial timeline information.
http://opentimeline.io
Apache License 2.0
1.47k stars 294 forks source link

Several adapters assume available_range is set on media references (FCP XML, EDL, SVG, more?) #629

Open reinecke opened 4 years ago

reinecke commented 4 years ago

When the FCP 7 XML adapter encounters a timeline where MediaReference objects have no available_range set (as common when loading EDLs), it errors out:

(redacted for brevity)
  File "/Users/username/envs/otiocppdev/lib/python3.7/site-packages/opentimelineio/adapters/fcp_xml.py", line 1483, in _build_file
    file_e.append(_build_rate(available_range.start_time.rate))
AttributeError: 'NoneType' object has no attribute 'start_time'

In this case, the adapter could fallback to the clip's source_range.

This also brings up some considerations generally about how the FCP XML adapter should be building file nodes in the XML, there is currently no resolution of two MediaReference instances with the same target_url but different available_range.

Relates to #627 - This area of code is strongly targeted at ExternalReference

ssteinbach commented 3 years ago

This OTIO file triggers this error.

no_source_range.tar.gz :

ssteinbach commented 3 years ago

The CMX EDL adapter appears to have the same bug.

ssteinbach commented 3 years ago

SVG adapter also has this bug in it:

https://github.com/PixarAnimationStudios/OpenTimelineIO/blob/aada787cdfcc2165a19cdcd46960ca5fe6d08d90/src/py-opentimelineio/opentimelineio/adapters/svg.py#L572

KarthikRIyer commented 3 years ago

Ohh. I'll look into fixing it this weekend.