Trimming Video
Two approaches to show only part of a video source. Choose based on your workflow.
Relative Trimming (trimstart / trimend)
Remove time from the edges. Think: "cut off 2 seconds from the start."
Duration formula: sourceDuration - trimstart - trimend
A 10s source with trimstart="2s" trimend="3s" produces a 5s clip.
Absolute Trimming (sourcein / sourceout)
Specify exact timestamps. Think: "show seconds 2 through 6."
Duration formula: sourceout - sourcein
sourcein="2s" sourceout="6s" produces a 4s clip starting at the 2-second mark.
When to Use Each
| Approach | Use when... |
|---|---|
trimstart / trimend | Building UI with drag handles or sliders |
| Thinking "how much to cut off" | |
| Adjusting existing clip duration | |
sourcein / sourceout | Working with known timecodes |
| Referencing specific moments by timestamp | |
| Frame-perfect accuracy needed |
Trimmed Clips in a Sequence
Trimming is most useful when building sequences from different parts of source media:
Note: Both approaches produce the same visual result — they differ in mental model and how currentSourceTimeMs tracks source position. Relative trimming maps as trimstart + ownCurrentTimeMs, absolute as sourcein + ownCurrentTimeMs.