Trim the first 0.6 s off an avatar clip: exact vs keyframe, $0.02
Cut a lead-in off a 22-second Sume avatar video with video-trim: exact re-encode or keyframe copy, what actual_start_seconds means, and the total cost.
To cut a short lead-in off a finished Sume avatar video, send the clip to Video trim with start: 0.6 and end: 21.5, and leave precision at its default, exact. The result is a new MP4 of 20.9 seconds; the source is untouched. Trim is $0.02 per job, so a 22-second standard avatar clip costs $4.048 plus $0.02, $4.068 in all.
You would do this when a take starts a beat too late or ends on a pause you do not want. Re-rendering the avatar video to fix that costs the full per-second price again. Trimming costs two cents.
Exact or keyframe
Video trim has two precision modes. exact is the default and gives a frame-accurate cut by re-encoding. keyframe copies the stream, so the cut can start a group of pictures early. Sume says to re-base your times against the actual_start_seconds field in the result when you use keyframe.
| Mode | How it cuts | Start accuracy | Allows output conform |
|---|---|---|---|
| exact (default) | Frame-accurate re-encode, libx264 yuv420p, kept audio as AAC | Frame accurate | Yes: output width, height, fps |
| keyframe | Stream copy | Can start a GOP early; read actual_start_seconds | No: output with keyframe is refused |
The request
start is required, and you send only one of end or duration. Duration must be 0.2 to 900 seconds. The video has to be a media.sume.com artifact or asset in your workspace, and an Idempotency-Key is required. Avatar results are already public media.sume.com artifacts, so you can use the result URL directly.
curl -X POST https://api.sume.com/v1/video-trim \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: avatar-trim-001" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/avatar.mp4",
"start": 0.6,
"end": 21.5
}'Things that go wrong
If end is past the end of the source, it clamps and the result carries the warning trim_clamped_to_source. Sending both end and duration returns video_trim_range_conflict, and an end at or before start returns video_trim_range_empty. Sending ffmpeg fields such as codec or crf is refused with ffmpeg_fields_rejected, because the server compiles ffmpeg itself.
Trim changes the clip length, so do it before you burn on captions with the separate video-captions job. Inline captions from the avatar job are already in the pixels and will be cut with the video. If you need a clip at a certain frame size or rate for a placement, output can conform width, height and fps in the same exact-mode job.
Trim versus regenerate
A 22-second standard clip with a bad first 0.6 seconds costs $4.048 to regenerate and $0.02 to trim. If the lead-in is the only problem, trim wins by a wide margin. If the problem is in the delivery itself, such as a wrong word, trimming cannot fix it and you need a new script. For tail dead air, set end earlier, and for a middle cut, run two trims and join them with Timeline.
Sources
Related posts
More in Media tools
- 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.
- Dim a 20-minute video: trim to four 300 s pieces, then filter, $0.16
Video filter takes sources up to 300 seconds, video trim up to 1,800. A 20-minute video needs four trims and four filter jobs: 8 x $0.02 = $0.16.
- 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.
- Upscale is $0.20: 1K Nano Banana 2.1 plus upscale $0.30 vs 4K $0.20
On Sume a 1K Nano Banana 2.1 image plus Image Upscale costs $0.30, while a native 4K render costs $0.20. When upscaling is worth paying for and when it is not.
Written by Sume