Cut a 10-minute recording into 3-minute Reels with video trim
A 600 s recording becomes four trims: 180, 180, 180 and 60 s, $0.08 in total. Python loop with a safe Idempotency-Key per segment; run it with an imported file.

Reels run to 3 minutes, as NapoleonCat reports. A 10-minute recording therefore needs four cuts: three of 180 seconds and one of 60. Each video trim is $0.02, so the set is $0.08.
The loop
The source must already be on media.sume.com (import it first), every call needs an Idempotency-Key, and you send start plus only one of end or duration. A key built from the video name, start and duration makes a retry safe.
import os, requests
key = os.environ.get("SUME_API_KEY", "")
assert key, "set SUME_API_KEY"
SRC = "https://media.sume.com/artifacts/artf_demo/talk.mp4"
def plan(total, seg=180):
return [(s, min(seg, total - s)) for s in range(0, total, seg)]
for start, dur in plan(600):
r = requests.post(
"https://api.sume.com/v1/video-trim",
headers={"Authorization": f"Bearer {key}",
"Idempotency-Key": f"talk-{start}-{dur}"},
json={"video_url": SRC, "start": start, "duration": dur},
timeout=60,
)
r.raise_for_status()
print(start, dur, r.json()["request_id"])After the call
The default mode is async, so each call returns a job. Poll GET /v1/jobs/:id/status and read GET /v1/jobs/:id/result, which holds the new video_url. If a segment ends near a sentence, shift start by a second; also note a final piece shorter than 0.2 seconds is rejected.
Limits
Trim output is capped at 900 seconds and the source at 1800, so this loop covers a recording up to 30 minutes.
Sources
Related posts
More in Developers
- Cut a YouTube Short on the beat: BPM to cut times in Python
Turn a music bed's BPM into cut start times for a 30-second Short. Runnable Python, plus the $0.10 Timeline render and $0.125 bed.
- Cut hold music from a call recording before STT: one concat job
Drop a hold-music stretch with one Sume timeline audio concat job that reuses the file twice via source_in and duration, then send the result to STT.
- Dart dart:io: POST /v1/images on Sume from a command-line script
A Dart script that calls Sume's image API with dart:io HttpClient, applies a 40-second timeout, and handles 200, 202 and error responses.
- Sume default queue capacity: max(3, 5 x concurrency), checked per plan
Sume's default queue capacity is max(3, concurrency x 5). Checking the rule against Free, Pro, Startup and Scale, plus the org floor and the wave hint.
Written by Sume