Trim end 184 on a 172-second source: it clamps and warns, no error
Video trim clamps an end past the source length and returns warning trim_clamped_to_source. A 4 to 184 cut of a 172.4 s clip yields 168.4 s for $0.02.

Send video trim a start of 4 and an end of 184 for a source that is 172.4 seconds long and the job does not fail. The end clamps to the source, the output is 172.4 - 4 = 168.4 seconds, and the result carries the warning trim_clamped_to_source. The job costs $0.02 either way.
This matters for Shorts: YouTube's page (read 2026-10-09) allows up to three minutes, so you might script a 180-second cut for every source without knowing each file's exact length. The clamp means a script that asks for 180 seconds gets the whole of any shorter file, and the warning tells you it happened.
What the doc says
The trim doc defines end as an out-point in seconds. If the value is after the end of the source, it clamps and the result gives the warning. Send only one of end or duration; sending both returns video_trim_range_conflict. Sending neither returns video_trim_range_required, and an end at or before the start returns video_trim_range_empty. The source must be 1,800 seconds or less and the output 900 seconds or less.
| Request | Result | Warning |
|---|---|---|
| start 4, end 184 | 168.4 s | trim_clamped_to_source |
| start 0, end 172.4 | 172.4 s | none |
| start 4, end 4 | refused | video_trim_range_empty |
| start 4, end 184, duration 60 | refused | video_trim_range_conflict |
| start 4 only | refused | video_trim_range_required |
Reading the result
The job result is kind video_trim with video_url (a new artf_), duration_seconds, actual_start_seconds, precision, audio, output and warnings[]. Do not trust the length you asked for; read duration_seconds. For exact precision the actual start equals your start. For keyframe precision, which is a stream copy, the cut can start a GOP early, so actual_start_seconds can be smaller than the start you sent.
A script should treat the warning as information. For a Short, check duration_seconds <= 180 after the call and decide whether anything shorter than, say, 15 seconds is worth posting.
Why the clamp is useful for Shorts
A Short can be up to three minutes, but your sources are different lengths: 172.4 seconds, 95 seconds, 214 seconds. Without a clamp you would need to probe each file before you could choose an end. With it, one request shape works for all of them: start 0, end 180. The 214-second file is cut to 180 with no warning; the 95-second file comes back whole with the warning. A downstream step can then branch on warnings[] instead of on a separate probe call.
Keep in mind what the clamp does not do. It does not pick a good out-point, so a hard cut at 180 can land mid-word. And it does not change the 900-second output limit or the 1,800-second source limit; a longer source fails with source_duration_exceeded. For those, trim a section first and then cut again from the artifact.
A batch pattern
For a folder of sources of unknown length, request start 0, end 180 for each, then sort by the returned duration_seconds. Anything with the warning is shorter than three minutes and already fits a Short. Anything without it was cut at exactly 180 seconds and might need a better out-point than a hard cut.
If you would rather fail than clamp, use duration instead of end and compare the returned duration_seconds with what you asked for. With either pattern, send a distinct Idempotency-Key per source, or the second request will return the first job.
Sources
Related posts
More in Media tools
- 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.
- 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.
Written by Sume