Scrub API
POST/v1/tools/cut_videopriced

Cut a video

Cuts a video into the parts you keep and lays them at their times into one MP4, black in any gap. Give a sound and it plays under the picture in place of the parts' own, for as long as the longer of the two. Give an aspect ratio and each part fills it, cropped from the centre. It only cuts, shapes and lays sound under.

Takes timeline (sound clips on tracks), sound (file, optional). Returns video (the cut video as an MP4 that starts playing before it has downloaded, H.264 with AAC sound).

$0.02 a minute of video, up to 30 minutes.

Afterwards, change timeline with adjust; quote_adjustment prices the change.

Fields

FieldTypeDefaultWhat it is
soundstringNoneA file_id from create_upload, accepting audio/*, up to 2 GB. Get one with create_upload. Or the job_id of a finished job that made a file of this kind: that file is used. Pass the job_id rather than retyping its result.
timelineobjectRequiredThe video's parts as a mix's clips: {tracks: [{clips: [{file, at, from, to}]}]}. file is a video of yours (its file_id), from and to the part of it kept, in seconds, at where it starts in the result. Where parts overlap, the later track's is shown; where none is, the picture is black.
aspect_ratioone ofnullThe aspect ratio it is made in, width to height. 9:16 is upright for stories and reels, 1:1 square, 4:5 portrait for feeds, 16:9 wide. Every part fills it, cropped from its centre, its longer side up to 1920 pixels. Left out, the first part's own.
9:161:14:516:9

Call it

Request

curl -X POST https://app.scrub.app/v1/tools/cut_video \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{"timeline":{}}'

Answer

{
  "ok": true,
  "result": {
    "job_id": "job_…",
    "status": "running",
    "price_usd": "$…"
  }
}

It starts at once and answers running. Ask job_status with the job_id for its result. quote gives its price first, free.

Every call can also answer an error: what comes back. Try it with your key from Account.