opentimelineio / otio-fcp-adapter Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
hi friends.
using this OTIO file : Ava.otio.zip
with the built in adaptor from 0.16.0.dev1 I get the following error:
otioconvert -i /private/var/folders/ln/0p1sqrvj1nz5k0lr1y78_b7m0000gn/T/Ava.otio -o ~/Ava.xml
Traceback (most recent call last):
File "/Users/vade/miniconda3/envs/otio/bin/otioconvert", line 8, in <module>
sys.exit(main())
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/console/otioconvert.py", line 278, in main
otio.adapters.write_to_file(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/adapters/__init__.py", line 192, in write_to_file
return adapter.write_to_file(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/adapters/adapter.py", line 183, in write_to_file
result = self.write_to_string(input_otio, **adapter_argument_map)
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/adapters/adapter.py", line 274, in write_to_string
return self._execute_function(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/plugins/python_plugin.py", line 142, in _execute_function
return (getattr(self.module(), func_name)(**kwargs))
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_fcp_adapter/fcp_xml.py", line 2003, in write_to_string
_build_sequence_for_timeline(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_fcp_adapter/fcp_xml.py", line 1258, in wrapper
elem = func(item, *args, **kwargs)
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_fcp_adapter/fcp_xml.py", line 1883, in _build_sequence_for_timeline
_add_stack_elements_to_sequence(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_fcp_adapter/fcp_xml.py", line 1941, in _add_stack_elements_to_sequence
track_elements = _build_top_level_track(track, track_rate, br_map)
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_fcp_adapter/fcp_xml.py", line 1819, in _build_top_level_track
_build_item(item, timeline_range, transition_offsets, br_map)
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_fcp_adapter/fcp_xml.py", line 1773, in _build_item
return _build_clip_item(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_fcp_adapter/fcp_xml.py", line 1258, in wrapper
elem = func(item, *args, **kwargs)
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_fcp_adapter/fcp_xml.py", line 1645, in _build_clip_item
clip_item_e.append(_build_file(clip_item.media_reference, br_map))
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_fcp_adapter/fcp_xml.py", line 1258, in wrapper
elem = func(item, *args, **kwargs)
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_fcp_adapter/fcp_xml.py", line 1492, in _build_file
tc_element = _build_timecode_from_metadata(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_fcp_adapter/fcp_xml.py", line 1871, in _build_timecode_from_metadata
return _build_timecode(
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/otio_fcp_adapter/fcp_xml.py", line 1346, in _build_timecode
tc_string = opentime.to_timecode(tc_time, tc_fps, drop_frame)
File "/Users/vade/miniconda3/envs/otio/lib/python3.10/site-packages/opentimelineio/opentime.py", line 46, in to_timecode
else rt.to_timecode(rate, drop_frame)
ValueError: invalid timecode rate
Some notes
My OTIO file comes from my very WIP AVFoundation-OTIO bridge. To build the RationalTime im using CMTime rational numerator and denominator values almost directly.
@reinecke in Slack mentions:
ll need to peek at the use case. CMTime -> RationalTime is a bit tricky because there is a bit of an implication that RationalTime.rate is the media frame rate and often is some non-integer value. CMTime is fps-ignorant and takes rates like 24000/1001 and multiplies them up into the numerator.
In all the usual time math, this works fine with OTIO - it’s just an issue when you have to quantize to frame counts (in the to_timecode or to_frames methods).
Both those methods provide rate args to handle this, but, unfortunately, there really isn’t a way to get that context down to the adapter without curating the rate fields on your RationalTime
Aside from all that, I think there is a way for the adapter to handle this more gracefully - like not trying to set the start timecode value on the file element when it doesn’t know how to convert a MediaReference.available_source_range into timecode.
Note: Creating this ticket so we don't lose the PR closed on the core repo. We should fill this out with a better explanation of the issue.
See AcademySoftwareFoundation/OpenTimelineIO#1305 for proposed fix.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.