Exact or keyframe video trim: which to pick and what changes
Sume video-trim defaults to a frame-accurate exact re-encode; keyframe is a stream copy that can start a GOP early. How to choose and re-base the times.

Use precision: "exact" (the default) when the cut point must land on the frame, and precision: "keyframe" when you only need a fast rough cut and can live with a start that is early. Exact re-encodes the range with libx264 in yuv420p. Keyframe is a stream copy, so the cut can begin a GOP earlier than the start you asked for.
Both modes cost the same on Sume: Video trim lists a public rate of $0.02 per job, with no provider inference, only worker ffmpeg.
The two modes side by side
| exact | keyframe | |
|---|---|---|
| Method | Frame-accurate re-encode (libx264, yuv420p) | Stream copy |
| Start of the cut | At start | Can be a GOP earlier |
| Audio | Kept audio remuxed as AAC | Per audio setting |
output conform (width, height, fps) | Allowed | Refused: video_trim_output_requires_exact |
| Price | $0.02 per job | $0.02 per job |
Re-basing after a keyframe cut
The result carries actual_start_seconds. Suppose you asked for start: 12 and the job reports 10.4 (an example, not a measured value). A moment that you planned at 3 s into the new file now sits at 4.6 s, because the file begins 1.6 s earlier. Add the difference to any caption or overlay time before you place the clip.
curl -X POST https://api.sume.com/v1/video-trim \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: trim-keyframe-001" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4",
"start": 12,
"duration": 20,
"precision": "keyframe"
}'A simple rule
- Cutting a clip that goes into a caption or lip-sync pipeline: exact.
- Need a different size or frame rate on the way out: exact, because keyframe refuses
output. - Throwaway preview of a long source: keyframe, then re-cut exact for the keeper.
Limits that apply to both
The source can be up to 1800 s, the output at most 900 s and at least 0.2 s, and you send exactly one of end or duration. The source must already be on media.sume.com; import it first with POST /v1/media-imports.
Sources
Related posts
More in Media tools
- Extract 6 thumbnail candidates from a clip with video-frames
Send POST /v1/video-frames with an at list of up to 24 timestamps and get durable image URLs at source size. Python polling example, formats and limits.
- Extract the first 90 seconds of a video's audio: audio-detach range
Send audio-detach range {start 0, end 90} for $0.01: 17.28 MB as 48 kHz stereo wav or 1.44 MB as 128 kbps mp3, a Shorts Audio Library song's 90 s.
- Five caption looks on one clip: one transcription, four restyles
Test five caption styles on one video for $1.00: the first job transcribes, four source_caption_id restyles reuse the word timings. Request bodies included.
- Five people in the clip: Recast takes four photos, 12 s costs $4.50
H3 Max Recast on Sume accepts 1 to 4 person photos. A five-person source needs a plan: a 12-second clip is 12 x $0.375 = $4.50 at 768p.
Written by Sume