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.

3 min readSume
All posts

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

Sume docs, read 2026-10-08
exactkeyframe
MethodFrame-accurate re-encode (libx264, yuv420p)Stream copy
Start of the cutAt startCan be a GOP earlier
AudioKept audio remuxed as AACPer audio setting
output conform (width, height, fps)AllowedRefused: 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

All Media tools posts

Written by Sume