Trim a Reel clip's dead start and end from first and last word
Take the first word's start and the last word's end from STT, then add 0.15 s lead and 0.30 s tail: a 29.9 s clip becomes 1.69-27.92 s for $0.03.

The simplest cut a short-form clip needs is the dead air at both ends, before you speak and after you stop. Run STT once, take the first word's start and the last word's end, widen them by a lead (0.15 s) and a tail (0.30 s) and trim once: a 29.9 s clip with words at 1.84 s and 27.62 s becomes 1.69 to 27.92 s, a $0.03 job including STT.
The numbers
Example numbers, not a measurement. Keep full precision from the transcript; rounding the start up can clip the first syllable.
| Quantity | Value |
|---|---|
| Clip length | 29.90 s |
| First word starts | 1.84 s |
| Last word ends | 27.62 s |
| Trim start (1.84 - 0.15) | 1.69 s |
| Trim end (27.62 + 0.30) | 27.92 s |
| Kept | 26.23 s |
| Removed | 3.67 s |
| Cost: STT $0.01 + trim $0.02 | $0.03 |
Code
The tail is longer than the lead because words trail off; the trim end is clamped to the clip by the API, which adds the warning trim_clamped_to_source if you overshoot.
def dead_ends(words, lead=0.15, tail=0.30, clip_s=None):
timed = [w for w in words if "start" in w and "end" in w]
if not timed:
return None
start = max(timed[0]["start"] - lead, 0)
end = timed[-1]["end"] + tail
if clip_s:
end = min(end, clip_s)
return {"start": round(start, 3), "end": round(end, 3)}Gotchas
- Silent clips have no words; STT on a silent clip fails with
inspect_source_has_no_audio, so readprobe.has_audiofirst. - A speech-to-text pass reserves one minute when you omit
duration_seconds, so a 30 s clip costs $0.01. - The result must be at least 0.2 s, which a spoken clip always clears.
Sources
Related posts
More in Media tools
- Trim end 184 on a 172-second source: it clamps and warns, no error
Video trim clamps an end past the source length and returns warning trim_clamped_to_source. A 4 to 184 cut of a 172.4 s clip yields 168.4 s for $0.02.
- Trim the first 0.6 s off an avatar clip: exact vs keyframe, $0.02
Cut a lead-in off a 22-second Sume avatar video with video-trim: exact re-encode or keyframe copy, what actual_start_seconds means, and the total cost.
- Fast video cut API: precision keyframe and actual_start_seconds
Sume video trim has two modes. Keyframe copies the stream and can start a GOP early; exact re-encodes. Both cost $0.02. Re-base on actual_start_seconds.
- Dim a 20-minute video: trim to four 300 s pieces, then filter, $0.16
Video filter takes sources up to 300 seconds, video trim up to 1,800. A 20-minute video needs four trims and four filter jobs: 8 x $0.02 = $0.16.
Written by Sume