Open luochaojing opened 2 years ago
Does the LInearTimeWarp address your question?
https://sandflow.github.io/otio-core-specification/#object-model-LinearTimeWarp
@meshula thanks for replying。
LinearTimeWarp is an effect descrition speed up or slow down。I kown it。
But my question is:when has a time_effect。Clip duration is not correct no more。I need 【display_range】to description the timerange show in UI。
When you ask a clip about its range, it is always in the clip's time coordinate system. So the clip doesn't know about the time warp. The time warp is between the clip coordinate system, and the parent coordinate system. Usually the clip's parent is a track. So if you call clip.range_in_parent()
, you would see the result you expect, a shorter or longer time, because the clip is only shorter or longer from the parent's point of view.
https://opentimelineio.readthedocs.io/en/latest/tutorials/time-ranges.html
It mean that,I can define a new class named MyClip extern from otio::Clip。And override "range" method to calculate UI duration with LinearTimeWarp Effect?
Eventually OTIO will include API to compute this, but today we recommend that you write a function to compute the duration you want, not by subclassing. If you subclass Clip, then that will affect serialization which you probably don't want.
Also, we should clarify that when you adjust the time_scalar
of a LinearTimewarp, this does not change the duration of the clip, rather it changes the speed of the media played during that clip. So a Clip that is 10 frames long, normally plays 10 frames of media, but with a 200% speed up (time_scalar = 2.0
) that Clip is still 10 frames long, but plays 20 frames of media. That is why the Clip's duration() does not change.
In OpentimelineIO Code
// Item
RationalTime
Item::duration(ErrorStatus* error_status) const
{
return trimmed_range(error_status).duration();
}
TimeRange trimmed_range(ErrorStatus* error_status = nullptr) const
{
return _source_range ? *_source_range : available_range(error_status);
}
accordance the code,the clip is 200% speed up, source_range is 20 frames long, but the duration() method return 20 frames. But it should return 10 frames.
Did I understand true?
Can you should me the values of source_range、trimmed_range、duration in this case? thanks a lot!
Feature Request
Did OpentimelineIO support clip duration when speed up or slow down?
Description
For example,
How to description speed and Display_Range?
opentime-io Timerange donnot consider speed now? maybe..
Context