Video APIv1 Home OpenAPI spec

Docs › Trim, stitch & splice

Trim, stitch & splice

An edit makes a new video from clips of your finished videos (status SUCCEEDED). Send POST /videos with an edit instead of a file. There's nothing to upload; poll the new video's status as usual.

Clip fieldDescription
videoIdOne of your finished videos. The same video may appear several times.
start, endSeconds into that video (default: all of it).
transitionHow the clip starts from the previous one: omitted = hard cut; {"type": "fade" | "fadeblack", "seconds": 0.1–3}.

Also accepted: fileName, maxHeight, and redactions (on the edit's own timeline). Up to 50 clips. The first clip sets the frame size; differently shaped clips are letterboxed.

Recipes

// Cut 1:00–1:30 out of a video
{ "edit": { "clips": [ { "videoId": "AAAA…", "end": 60 }, { "videoId": "AAAA…", "start": 90 } ] } }

// Stitch an intro, a lesson and an outro, with soft joins
{ "fileName": "Lesson 1", "edit": { "clips": [
  { "videoId": "INTRO…" },
  { "videoId": "LESSON…", "transition": { "type": "fade", "seconds": 0.75 } },
  { "videoId": "OUTRO…",  "transition": { "type": "fadeblack", "seconds": 1 } } ] } }

// Splice a clip into another at 2:00
{ "edit": { "clips": [
  { "videoId": "MAIN…", "end": 120 },
  { "videoId": "INSERT…", "transition": { "type": "fadeblack", "seconds": 0.5 } },
  { "videoId": "MAIN…", "start": 120, "transition": { "type": "fadeblack", "seconds": 0.5 } } ] } }
201 Created
{ "videoId": "9a8b…", "status": "SUBMITTED", "clips": 3, "statusPath": "/videos/9a8b…" }

A clip from someone else's video gets 404 NOT_FOUND; a video still processing gets 409 EDIT_SOURCE_NOT_READY. To trim a new upload, use the trim option on complete instead: it's faster.