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.

To cut a clip quickly with an API, send precision: "keyframe" to POST /v1/video-trim. Sume copies the stream instead of re-encoding it, but the cut can start one GOP early, so read actual_start_seconds from the result and re-base your times against it. The default, exact, is a frame-accurate re-encode. Both cost $0.02 per job.
Exact versus keyframe
The trim input is a media.sume.com clip in your workspace, a start in seconds, and exactly one of end or duration. The source is never changed; the result is a new MP4.
| Mode | How it cuts | Start accuracy | Output conform |
|---|---|---|---|
| exact (default) | Frame-accurate re-encode (libx264, yuv420p); kept audio remuxed as AAC | Frame accurate | Allowed: width, height 256-2160; fps 24, 25, 30, 60 |
| keyframe | Stream copy | Can start a GOP early | Refused: video_trim_output_requires_exact |
Re-basing after a keyframe cut
The docs say a keyframe cut "can start a GOP early". On typical sources the Video inspect page puts a keyframe snap at roughly 0 to 5 seconds, though that figure is for stills, not trims, so treat it as an order of magnitude. The safe pattern is to read the real value.
The result carries video_url, duration_seconds, actual_start_seconds, precision, and audio. Suppose you asked for start: 12, and actual_start_seconds came back lower. Every caption cue or overlay time you planned relative to second 12 must be shifted by the difference. If you then place the clip in a timeline render, use source_in: 0 on the new file, as the docs suggest.
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-fast-001" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4",
"start": 12,
"duration": 20,
"precision": "keyframe"
}'When to choose which
Pick keyframe for rough cuts, previews, or when you will trim again later. Pick exact when the cut point matters, such as removing a claimed song bar, or when you need the output conform to set width, height, or frame rate. Because both modes bill $0.02 per job, there is no price reason to prefer the fast one; the difference is accuracy and whether re-encoding is acceptable.
Clamping works the same way in both: an end past the source end clamps and the result warns trim_clamped_to_source. The output must be at least 0.2 seconds and at most 900 seconds.
Worked example of a re-base
Say you request start: 12 and a 20-second duration with keyframe precision, and the result reports an actual_start_seconds of 10.0 (an illustrative value, not a measurement). The file now begins two seconds earlier than you asked. A caption cue you planned for second 3 of your intended cut is at second 5 of the new file, so add the 2-second difference to every time you planned.
The cleanest alternative is to avoid the problem. If your next step needs times that are exact to the frame, such as burning cues or aligning to an audio spine, use the default exact mode at the same $0.02 price. Use keyframe only when a rough cut is acceptable or you will trim again.
Submit and read
The default mode is async. Pass mode: "sync" to wait up to 30 seconds for a 200; otherwise you receive 202 and poll GET /v1/jobs/:id/status and then GET /v1/jobs/:id/result. There is no GET /v1/video-trim/:id.
Sources
More in Media tools
- 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.
- Video filter check passed but the encode failed: what to do next
Sume's free video-filter check covers schema, allowlist and source, not the worker. A valid program can still fail on expressions, memory or time. Next steps.
- Video filter limits: 8 ops, 2,048 characters, 32 filters
Video filter takes up to 8 dim/crop ops plus a filters-only graph of 2,048 characters and 32 filters. See what is allowed, what is refused, and the free check.
Written by Sume