Keyframe trim starts early: fix it with actual_start_seconds
A video-trim with precision keyframe can begin a GOP before your start time. The result reports actual_start_seconds; use it to re-base the next step.

If a video-trim with precision: "keyframe" gives you a clip that starts a little before the time you asked for, that is how stream copy works: the cut begins at the nearest earlier keyframe. The job result tells you where it really began in actual_start_seconds, and the docs say to re-base against that value. If you need the exact frame instead, use precision: "exact", the default.
The two modes
Trim takes a start and exactly one of end or duration (0.2 to 900 s) and always returns a new artifact.
| Mode | What happens | Notes |
|---|---|---|
exact (default) | Frame-accurate re-encode (libx264, yuv420p) | output {width,height,fps} works here only |
keyframe | Stream copy; may start a GOP early | Re-base against actual_start_seconds |
| Price | $0.02 per job | Source up to 1800 s |
| Past the end | Clamps and warns trim_clamped_to_source |
Re-basing
Say you asked for start: 100 and the result reports actual_start_seconds: 98.2. The new file begins 1.8 s earlier than you wanted. Anything that used source time 100 as its anchor now sits 1.8 s into the new file. In a Timeline 1.0 slot that means source_in: 1.8 skips the early part and lands on the frame you asked for. The same offset applies to caption timings or cue points that you measured on the original.
- New position in the clip = old position -
actual_start_seconds. - Use
source_inon the timeline slot, so you do not need a second trim. - If the offset is more than you can tolerate, switch to
exactand pay the re-encode time.
When to pick which
Use keyframe mode for a first pass over many long sources where speed matters and a second or two of lead-in is harmless, for example when you are going to place the file in a timeline slot with source_in anyway. Use exact mode for final cuts that start on a spoken word or a visual beat. If a clip will be captioned, remember the captions run on the file you give them, so caption the trimmed result, not the original.
Limits
Keyframe mode is for speed and for keeping the source quality bit for bit, not for precision. A source with sparse keyframes can start several seconds early. output conforming (resize, fps) is not available in this mode, and the audio option keep or drop still applies. Check warnings[] on each result.
Related posts
More in Media tools
- Korean caption styles compared: weight-shift to editorial-emphasis
Sume has six Hangul caption identities plus korean-ad. Compare black-outline, weight-shift, highlight, pill-karaoke, clip-wipe and editorial-emphasis.
- Korean subtitle fonts for a video API: 29 faces on Sume
Sume's caption font field names 29 Hangul faces, all SIL OFL 1.1, from Pretendard to Gmarket Sans. Which suit which style, and what fails on a Latin style.
- Add a launch date plate to a teaser video with compose overlay
Put a launch-date card on the bottom of a teaser with Timeline compose overlay: width_ratio, margin_ratio, a 300-second ceiling and $0.02 a job.
- Launch teaser music on Lyria 3.5: section markers, 30 seconds
Write a 30-second launch-teaser track on Sume Music Router: section markers, one named moment and no duration field. $0.125 per generation.
Written by Sume