AcademySoftwareFoundation / AcademySoftwareFoundation/OpenTimelineIO

Incorrect trimming of clips with LinearTimewarps

Open
#1,464 0 comments 0 reactions 0 assignees View on GitHub
bug
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".

![image](https://user-images.githubusercontent.com/169599/198154445-1c635924-e1f7-4419-b982-6643b9492775.png)

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.

![image](https://user-images.githubusercontent.com/169599/198154625-264ac31b-e8a4-491e-b9dd-4586ab949d4a.png)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.