AcademySoftwareFoundation / AcademySoftwareFoundation/OpenTimelineIO
Incorrect trimming of clips with LinearTimewarps
- Dominant language
- C++
- Stars
- 2k
- Forks
- 351
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 1
Description
When trimming a clip which contains a LinearTimewarp effect via `flatten_stack` or the underlying `track_trimmed_to_range` the resulting source_range on the trimmed clip is often incorrect.
To illustrate the problem see the screenshot below. When the tracks "Overlay B" and "Main B" are flattened to produce "Flattened B" the 2nd clip in the output (here named "Wrong Start") has the wrong start time. It should be "01:00:07:09" but instead it is "01:00:09:12".

For comparison, when I slice the timewarped clip in Avid Media Composer, I get the correct result in this screenshot. Here we see that the clip "Sliced in Avid" has the correct start time "01:00:07:09", and so does the resulting "Correct Start" clip after flattening.

This bug is due to the fact that `track_trimmed_to_range` makes no attempt to honor the timewarp effect on the clip.
Contributor guide
Research direction
Start by examining track_trimmed_to_range and the flatten_stack path mentioned in the report, focusing on how LinearTimewarp effects affect trimming. Reproduce the example with a timewarped clip and compare the resulting source_range with the expected start time. Done means trimmed clips preserve the correct source_range when processed through either entry point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100