Closed MichaelPlug closed 2 years ago
Hi @MichaelPlug- Would it be possible to send an example using one of the sample files from our sample data so we can try and reproduce what's happening?
I have pasted the wrong code lines, I'm sorry. I have corrected it.
myale = otio.adapters.read_from_file("sample.ale")
otio.adapters.write_to_file(myale, "sample.aaf")
I'm using sample.ale from contrib directory. I think the problem is the library convert the .ale file to a _opentimelineio.otio.SerializableCollection, but to build an aaf i need a _opentimelineio.otio.Timeline object.
ALE is typically used to contain an ordered list of media, like a bin in an NLE, and so our ALE adapter reads that as a SerializableCollection. AAF can support this too, I think, but our AAF adapter currently only supports timelines with tracks. You can turn one into the other like this:
myale = otio.adapters.read_from_file("sample.ale")
mytimeline = otio.schema.Timeline()
mytrack = otio.schema.Track(children=myale.deepcopy())
mytimeline.tracks.append(mytrack)
otio.adapters.write_to_file(mytimeline, "mytimeline.aaf")
Note, however, that the AAF adapter also needs additional information about each media reference's available range, and sometimes MobIDs. You can read more about that here: https://github.com/AcademySoftwareFoundation/OpenTimelineIO/wiki/Working-with-OpenTimelineIO-and-AAF
I have tested your code, in this case the problem is mytimeline's clips doesn't contains information about duration
and start_time
. These informations are already in sample in sample ale, in a different format, as timecode, in columns Start
and Duration
.
Something<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.duration.rate does not exist, 'NoneType' object has no attribute 'duration'
Something<class 'opentimelineio._otio.Clip'> Clip.media_reference.available_range.start_time.rate does not exist, 'NoneType' object has no attribute 'start_time'
I have solved using directly pyaaf2 and skipping conversion to otio but I hope this report will be useful for some future developments. Thank you very much.
I'm glad you got it sorted out.
I'm tring to use an otio to convert an ale file to an aaf, using a simple adapter like this:
It looks like an OTIO from an ale doesn't have the attribute tracks that is necessary to build an aaf.