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.
- 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.
- TTS word timestamps for captions: timestamps.words and what you get
Set timestamps.words true on Sume TTS and the result carries words[] with start and end seconds. A 600-character caption script costs $0.02850.
- Vertical clip as long-form YouTube: 1920x1080 blur keeps 31.6% sharp
YouTube says use 16:9 to keep a video from becoming a Short. A 9:16 clip in 1920x1080 with blur fit keeps 608 px (31.6%) sharp; a 5-minute render is $0.50.
Written by Sume