Cut a 3-minute Short from a longer render with video trim

YouTube Shorts and Instagram's recommended Reel length both stop at three minutes. Cut 180 seconds from a longer clip with video trim, using start and duration.

4 min readSume
All posts

A 7-minute vertical render is too long for a YouTube Short and, per Instagram, over the length that is recommended to new audiences. Cutting a 180-second window is a one-call job.

The call

Video trim takes video_url, start, and exactly one of end or duration. duration runs from 0.2 to 900 s. The source may be up to 1,800 s. The default precision is exact, a frame-accurate re-encode; keyframe is a stream copy that can start a GOP early. The rate is $0.02 per job.

read 2026-10-05
FieldValue
start60
duration180
precisionexact (default)
audiokeep (default)

Request

import json, os, urllib.request

body = {
    "video_url": "https://media.sume.com/artifacts/example/long.mp4",
    "start": 60,
    "duration": 180,
}
req = urllib.request.Request(
    "https://api.sume.com/v1/video-trim",
    data=json.dumps(body).encode(),
    headers={
        "Authorization": "Bearer " + os.environ["SUME_API_KEY"],
        "Content-Type": "application/json",
        "Idempotency-Key": "trim-180-001",
    },
    method="POST",
)
print(urllib.request.urlopen(req).read().decode())

Edge cases

If end is past the source it clamps and returns trim_clamped_to_source. Sending end and duration together is refused with video_trim_range_conflict. Use the new video_url from the result, never the source.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume