Trim, filter, or detach audio from a video with the Sume API
Video trim cuts a range into a new MP4, video filter dims or crops into a new MP4, and audio detach extracts a wav or mp3. Each takes one Sume-hosted clip.

To trim, filter, or detach audio from a video with Sume, call one of three APIs: video trim cuts a [start, end) range into a new MP4, video filter dims, crops, or runs an allowlisted filtergraph into a new MP4, and audio detach extracts the audio track as a durable wav or mp3. Each takes one Sume-hosted clip and leaves the source untouched.
The facts below are from the Video trim, Video filter, and Audio detach docs, read on 2026-09-25.
What do trim, filter, and detach have in common?
The docs call trim and filter “Material preparation, not timeline placement”: sequencing, transitions, and the audio spine stay on Timeline 1.0 (see How to assemble a long-form video). All three share these rules:
video_urlmust be your workspace'smedia.sume.comartifact or asset. Off-host URLs are rejected at admit; import first withPOST /v1/media-imports.- Every create requires
Idempotency-Key. The defaultmodeisasync;mode: "sync"waits up to 30 seconds for a200finished job, otherwise you get202and poll. - There is no per-tool GET. Poll
GET /v1/jobs/:id/statusandGET /v1/jobs/:id/result. On the hosted MCP server, callvideo_trim,video_filter, oraudio_detach, thenjobs_waitandjobs_result. - The server compiles ffmpeg. Sending ffmpeg fields such as
filter,ffmpeg,cmd, orcodecreturnsffmpeg_fields_rejected. - Each is billed per job and runs worker ffmpeg only, with no provider inference; the filter check is free. Rates are on API pricing; confirm them in
GET /v1/catalog.
| Tool | Endpoint | Returns | Caps |
|---|---|---|---|
| Video trim | POST /v1/video-trim | A new MP4 holding only [start, end) | Source ≤ 1800 s; output ≥ 0.2 s and ≤ 900 s |
| Video filter | POST /v1/video-filter | A new MP4 after ops[] and/or filtergraph | Source ≤ 300 s |
| Audio detach | POST /v1/audio-detach | A new wav or mp3 audio artifact | Source ≤ 1800 s; output ≤ 900 s |
How do I trim a clip?
Send video_url, start (seconds, ≥ 0), and exactly one of end or duration (0.2–900). An end past the source clamps, and the result warns trim_clamped_to_source.
precision: "exact" (the default) is a frame-accurate re-encode (libx264, yuv420p). "keyframe" is a stream copy, so the cut may start a GOP early; re-base against actual_start_seconds. audio is keep (default) or drop. An optional output of { width, height, fps } works with exact precision only: width and height 256–2160, fps 24, 25, 30, or 60.
The result (kind: video_trim) carries a new video_url, never the source, and actual_start_seconds. Drop that MP4 into timeline_create video[] with source_in 0.
curl -X POST https://api.sume.com/v1/video-trim \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: video-trim-001" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4",
"start": 2,
"duration": 8
}'How do I dim or crop a clip, and check the program first?
A filter program is ops[], a filters-only filtergraph, or both; ops[] runs first. Output inherits the source geometry, frame rate, and audio unless the program changes them.
To validate first, send the program to POST /v1/video-filter/check. It runs the same schema, op and filtergraph allowlists, and source preflight as the encode, and returns diagnostics instead of a 400: valid, diagnostics[], an estimate when valid, and next_action (submit_video_filter or fix_program_and_recheck). It creates no job, reserves no credits, and needs no Idempotency-Key. A program that passes can still fail on the box (bad expression, memory, time), as a structured job error.
dim: whole-clip luma multiply,amountin (0, 1].0.45is darker,1is unchanged, and black stays black.crop: a rectangle in fractions of the source frame.xandyin [0, 1],widthandheightin [0.05, 1], withx+width ≤ 1andy+height ≤ 1.- At most 8 ops.
filtergraph: at most 2048 characters and 32 named filters, with no inputs, outputs, or paths. Only allowlisted tone, blur, geometry, fade, and internal compositing filters;trim,setpts,drawtext,subtitles,movie,lut3d, and anything that reads a file or a socket are not on the list.
curl -X POST https://api.sume.com/v1/video-filter/check \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/talk.mp4",
"ops": [{ "op": "dim", "amount": 0.45 }]
}'How do I detach the audio track from a video?
The default output of POST /v1/audio-detach is sample-exact wav (pcm_s16le), which is what timeline_create audio.url, POST /v1/timeline-1.0/audio, and speech-to-text want. It returns a new audio_url.
format:wav(default) ormp3(128 kbps).range: optional{ start, end? }in seconds. Omit it for the whole track, unless the track runs past 900 s.channels:source(default) ormono.sample_rate:16000,44100, or48000;16000withmonois the STT shape.- A source with no audio track fails
detach_source_has_no_audio. Checkprobe.has_audiofirst with video inspect (frames: falseis enough). - For many ranges from one track, detach once, then split with timeline audio.
Why was my trim, filter, or detach refused?
- Trim:
video_trim_range_required(neitherendnorduration),video_trim_range_conflict(both),video_trim_range_empty(end≤start, or longer than 900 s),video_trim_output_requires_exact, andsource_duration_exceeded(source longer than 1800 s). - Filter:
video_filter_ops_empty,video_filter_too_many_ops,unsupported_filter_op(onlydimandcrop),video_filter_amount_out_of_range,video_filter_crop_out_of_bounds,invalid_filtergraph,source_too_large, andoutput_duration_exceeded(source longer than 300 s). - Detach:
audio_detach_range_empty,detach_source_has_no_audio, anddetach_start_past_source. - All three:
unsupported_media_source(not on the Sume media host),source_not_found(a dead or foreignmedia.sume.comURL), andunsupported_media_type(HEAD is not a video).
Sources
Related posts
Written by Sume