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.
- video-frames fps limit: 24 frames, fps up to 2, what it covers
Sume video-frames takes fps from just above 0 up to 2 and caps each call at 24 frames at mid-bin times. Table of sample times and the span 24 frames reach.
- Video filter /check is free: validate 8 ops before you pay $0.02
POST /v1/video-filter/check runs the same validation as the encode and bills nothing. See what it catches, the 8-op limit, and when a valid program still fails.
- Half-banner video: a still stacked over a clip for $0.02
Sume timeline compose stacks one still and one video in a single frame for a flat $0.02 per job. Layout ratio, overlay mode, 300 s ceiling and a ready request.
Written by Sume