Documentation
Guides and API reference for uploads, image transforms and video.
npm install @cd2/fileboy-react API https://api.fileboy.io
Documentation menu
Edit a video
Trim, clip, cut, stitch, blur and replace a video without uploading it again, from the dashboard's Edit tab or the API. Fileboy makes the edit in the background and swaps it in under the same id. For uploading, see Upload and process video.
What you can do
Every edit is on the video's Edit tab in the dashboard, and has an API call. Edits that change the video itself make a new version of it, under the same id. Clips and stitches make a new video.
- Trim keeps one range and drops the start and end:
POST /videos/:id/trim. See Trim a video. - Cut removes sections from the middle:
POST /videos/:id/cuts, andPOST /videos/:id/fillers/applyfor filler words and silences. See Cut sections out. - Blur hides a region for part of the video:
PUT /videos/:id/blurs. See Blur a region. - Clip saves a range as a new video:
POST /videos/:id/clips. See Make a clip. - Stitch joins whole videos into a new one:
POST /videos/stitch. See Stitch videos together. - Replace swaps in a new file:
POST /videos/:id/replace. See Replace a video.
Replace a video
Upload a new file for a video you already have: a corrected edit, a better export, a new take. The video keeps its id, so its watch page, embeds, expiring links, playlists, captions, chapters, poster choice, branding, privacy, description, tags and metadata stay exactly as they are. Only the picture and sound change.
In the dashboard, open the video's Edit tab and use Replace video. From your server, send the file to POST /videos/:id/replace with your private key. Fileboy stores it and encodes it while the current version keeps playing. When every new rendition is ready they are swapped in at once, the video's version goes up by one and the old files are deleted, so you are only charged for one copy. Segment, audio and MP4 URLs carry the version from 2 on, as v=2, and an older version's URL answers 410 version_replaced, so nothing cached of the old version is served for the new one. A player that is part way through picks up the new version where it was, with fileboy-player 1.5.0 or later. The SDKs' audio and MP4 URL helpers take the version too.
The new file can be as large as a video upload on your plan. The storage check counts what the replacement adds: the new file, plus renditions estimated in proportion to the current ones. Both versions are stored while the new one is processed, which isn't held against your limit. An upload from the dashboard take up to two hours (keep the tab open); encoding takes about as long as a first upload of the same file, and the current version plays throughout.
A video.replaced webhook says when the new version plays. If the new file can't be used, the old version stays, the new file is deleted and video.replacement_failed is sent; the reason is on the Edit tab and in the video's replacement.message. Captions are kept as they are, so check their timing if the new cut is different. Chapters that start after the new end are kept too, and the replacement's message counts them. Seek-preview thumbnails, poster suggestions, the animated preview and the MP4 downloads are made again from the new file.
Replace a video's file
Multipart form data with the new file as file. Needs your private key. Answers 202 with the video (as the management API lists it) as soon as the file is stored; its replacement.status is pending, then processing, then ready or failed. 409 video_not_ready while the video's first upload is still processing, 409 replacement_in_progress while another replacement runs, 403 storage_limit_reached when the new file is bigger than the old by more than the app has left, 413 file_too_large for a file over the 5 GB upload size limit.
URL Params
id string
The video id.
Body
file binary
The new video. Its content type must start with video/.
Response
data.id string
The video id, unchanged.
data.version number
1 for the first upload, one more each time a replacement is swapped in.
data.replacement object
status (pending, processing, ready or failed), message (why it failed, or a note such as chapters past the new end) and replacedAt.
Example
1curl https://api.fileboy.io/videos/VIDEO_ID/replace -H "Authorization: token YOUR_SIGNED_TOKEN" -F "file=@./clips/launch-v2.mp4;type=video/mp4"
1 2 3 4 5 6 7 8 9{ "data": { "id": "9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10", "status": "ready", "version": 1, "replacement": { "status": "pending", "message": "", "replacedAt": null }, ... } }
Editing in the dashboard
Everything below that changes a video itself is on the video's Edit tab, under the player. Owners, Admins and Developers see it; Viewers don't, and the dashboard refuses them the edits too. The tab starts with the version that plays and what made it, then the Trim, cut and blur card, stitching, filler removal, Replace video and the watermark.
The card is a timeline. At the top is the scrubber: a strip of the video's seek-preview thumbnails (a plain bar until they are made) with a yellow line at the playhead, the time under it and the length at the end. Drag or click it to move the player. Under it is the range bar, with a blue handle at each end of what to keep and red, hatched bands for the sections to cut out, each with its own handles. Every handle is a labelled slider, and each has a time field beside it, so you can type 1:15.250 instead of dragging. Under the bars is the Blur section: the paused frame, where you drag a box over what to hide and set when it shows.
With the timeline focused, I and O set the start and end at the playhead, the left and right arrows step a frame (a second with Shift), Space plays and pauses, and Ctrl+Z (Cmd+Z on a Mac) undoes.
Nothing changes until you apply it. Each change is listed in the Edit list at the bottom of the card, for example “Trim to 0:02–0:58”, “Cut out 0:12–0:15” and “Blur 1: 0:20–0:24 · medium”, each with Undo (its last change) and Remove. Apply asks once, saying what happens to chapters and captions, then sends the edits one after another, as the API takes them: the blurs first (PUT /videos/:id/blurs), and, once the blurred version is in, the trim or cut (POST /videos/:id/trim, or POST /videos/:id/cuts when there are sections, which trims the ends in the same cut). Each makes a new version. While they run the list shows each step as waiting, processing or done, and the player loads each new version as it goes live. Keep the page open until the last step has started.
Errors from the API are shown in place, with what to do: a plan's storage limit, a video that is still processing or already has an edit running, one that was moved to the trash meanwhile, and one whose upload the virus scan found infected (it can't be edited at all). A watermarked video can be edited: each new version is encoded with the watermark as it is set then. Fileboy doesn't keep older versions to go back to. Reset trim puts the whole upload back, and blurs can be removed from the edit list.
Trim a video
Cut the start or end off a video without uploading it again: a slow intro, a countdown, the moment someone forgot to stop recording. In the dashboard, open the video's Edit tab and use Trim, cut and blur: drag the two handles on the bar (or type the times, or press I and O at the playhead), preview the range, then Apply from the edit list (see Editing in the dashboard). From your server, send POST /videos/:id/trim with { "start": 12.5, "end": 95 }, seconds of the video as it plays now. The range must be inside the video, at least a second long, and not the whole video.
A trim works like a replacement. Fileboy cuts the range from the video's upload and encodes it while the current version keeps playing, then swaps it in under the same id: the watch page, embeds, links and playlists all play the trimmed video, its version goes up by one, and video.replaced is sent with replacement.reason trim. If it can't be made, the video plays as before, replacement.message says why and video.replacement_failed is sent. Only one replacement or trim or cut runs at a time: another answers 409 replacement_in_progress. While a trim or reset waits or runs, the video's caption tracks can't be uploaded, edited or deleted either (409 replacement_in_progress), as the trim moves them to the new times when it swaps.
Chapters and captions move with the picture. Every time moves back by start. A chapter that is already running when the range starts begins at 0:00; chapters that end before the range, or start at or after its end, are removed. A caption cue that overlaps an edge is shortened to fit, and cues wholly outside the range are removed. The trim's message (and chaptersRemoved and cuesRemoved in the webhook) counts what was removed.
The trimmed cut becomes the video's original: it is what the original download and rawFileId give you, so what you cut out can't be downloaded. Fileboy keeps the upload you trimmed from, so you can trim again with a different range (it is cut afresh from the upload, never from the earlier cut) or reset the trim with POST /videos/:id/trim/reset or Reset trim. That plays the whole upload again; chapters and cues the trim removed don't come back. The kept upload is only ever served with a signature, and it counts towards your storage as a video original until you reset the trim, replace the video or delete it. The video's trim says how it is cut: start and end in seconds of the upload, and the upload's untrimmedDuration. After a cut it also has keep, the edit list (see below). Uploading a new file with POST /videos/:id/replace ends the trim, and the kept upload is deleted with the old version.
Trim a video's start and end
JSON with start and end, in seconds of the video as it plays now. Needs your private key. Answers 202 with the video, its replacement.status pending and replacement.reason trim. 400 invalid_range, 409 video_not_ready while the video is processing, 409 replacement_in_progress while a replacement or trim runs, 403 storage_limit_reached when the trimmed version would take storage past the app's limit.
1https://api.fileboy.io/videos/{id}/trim
URL Params
id string
The video id.
Body
start number
Where the trimmed video starts, in seconds.
end number
Where it ends, in seconds.
Response
data.replacement object
status (pending, processing, ready or failed), reason (trim), message (why it failed, or what fell outside the trim) and replacedAt.
data.trim object | null
Once a trim is done: start, end and untrimmedDuration, in seconds of the upload.
Example
1curl https://api.fileboy.io/videos/VIDEO_ID/trim -H "Authorization: token YOUR_SIGNED_TOKEN" -H "Content-Type: application/json" -d '{ "start": 12.5, "end": 95 }'
1 2 3 4 5 6 7 8 9 10{ "data": { "id": "9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10", "status": "ready", "version": 1, "replacement": { "status": "pending", "reason": "trim", "message": "", "replacedAt": null }, "trim": null, ... } }
Cut sections out
Remove mistakes, pauses or anything else from the middle of a video, as many sections as you like, and keep the rest joined up. On the Edit tab's Trim, cut and blur card, use Add a section at the playhead, drag the red handles (or type the times), check it with Preview without them, then Apply. If you have also moved the range handles in, the same cut trims the ends. From your server, send POST /videos/:id/cuts with { "remove": [{ "start": 12.5, "end": 20 }, { "start": 61, "end": 64.25 }] }, in seconds of the video as it plays now.
Each section must be inside the video. Sections that overlap or touch are merged, at least a second of the video must be left, and a cut that removes nothing is refused (400 invalid_range). A cut works exactly like a trim, which is the one-section-at-each-end case: the current version plays until the cut is encoded, then it is swapped in under the same id and video.replaced is sent with replacement.reason cut and replacement.cut.removed, the merged sections. While it waits or runs, other replacements, trims and cuts, and caption track changes, answer 409 replacement_in_progress.
Chapters and captions follow the edit. A chapter that starts inside a removed section starts at the cut instead, and one that is wholly removed is dropped. A caption cue across a cut is shortened by what was removed (its parts either side of the cut join up, as the picture does), and a cue wholly inside a section is dropped. Every cut is made afresh from the upload Fileboy keeps, never from an earlier cut, so quality doesn't drop as you edit, and Reset trim (POST /videos/:id/trim/reset) undoes every trim and cut at once. The video's trim.keep is the edit list it plays: the ranges of the upload that are kept, in order.
Remove sections of a video
JSON with remove, 1 to 100 sections of { start, end } in seconds of the video as it plays now. Needs your private key. Answers 202 with the video, its replacement.status pending and replacement.reason cut. 400 invalid_range, 409 video_not_ready, 409 replacement_in_progress while a replacement, trim or cut runs, 403 storage_limit_reached.
1https://api.fileboy.io/videos/{id}/cuts
URL Params
id string
The video id.
Body
remove array
The sections to remove, each { start, end }, in any order.
Response
data.replacement object
status, reason (cut), message (why it failed, or what the cut removed) and replacedAt.
data.trim object | null
Once a cut is done: start, end, untrimmedDuration and keep, the ranges of the upload that play.
Example
1curl https://api.fileboy.io/videos/VIDEO_ID/cuts -H "Authorization: token YOUR_SIGNED_TOKEN" -H "Content-Type: application/json" -d '{ "remove": [{ "start": 12.5, "end": 20 }, { "start": 61, "end": 64.25 }] }'
1 2 3 4 5 6 7 8{ "data": { "id": "9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10", "version": 1, "replacement": { "status": "pending", "reason": "cut", "message": "", "replacedAt": null }, ... } }
Remove filler words and silences
Screen recordings and talks are full of pauses and “um”s. On the video's Edit tab, the Remove filler words and silences card finds them for you: press Detect, then review what it found. Each region is ticked to start with; play it in place with Play, untick what should stay (or every pause, or every filler word, at once), check the result with Preview with them removed, and see the time it saves. Apply cuts the ticked regions out as one cut. Nothing is ever cut until you apply it.
Pauses are found in the video's sound with ffmpeg, without AI: any pause longer than minSilence (a second by default, 0.3 to 10) is proposed, keeping padding (a quarter of a second by default) at each end so speech doesn't start or stop abruptly. Filler words (“um”, “uh”, “erm”, “you know” in English; French, German, Spanish and Dutch have their own lists, or send fillerWords) need to know when each word is said. Speech-to-text tidies fillers away, so when your Fileboy server has an OpenAI key, pressing Detect with Filler words ticked (or sending fillers: true) sends the video's speech to OpenAI (whisper-1) once more, asking it to keep every filler. It counts in your transcription usage, like auto captions, and detecting the same version again with other settings reuses those words. Without a key, if OpenAI fails, or if auto captions are turned off for the video or app, nothing is sent: the words of the video's auto captions are used if it has them (they often leave fillers out), and otherwise only pauses are found. The API looks for pauses only unless you send fillers: true.
Regions never cut into a word that stays: each keeps a few hundredths of a second from the words either side. Word timings are coarse, so a filler next to a measured pause widens to where its sound starts or stops. Pauses close together merge, and so do fillers, but a pause and a filler stay separate so you can keep either; edges move inward to whole frames. A “you know” only counts when it is set off by pauses (or a pause and the start or end of the speech), so “do you know what” is left alone. One cut removes at most 100 sections, so a scan proposes at most 100 regions, the longest, and says when it found more: apply them, then detect again for the rest.
Applying is a cut like any other (above): the current version plays until the new one is ready, chapters, captions, translated captions, the transcript and blurs move with it, and Reset trim (POST /videos/:id/trim/reset) puts the whole upload back. A scan is of one version of the video: once it changes (the cut is applied, or the video is trimmed, reset or replaced) the scan is stale and applying it again answers 409 fillers_stale. Apply sends the scan's scanId with the region ids, so if someone detects again before you apply, you get fillers_stale rather than another scan's regions.
// find the pauses and "um"s; it only proposes (private key, or videos:write)
// filler words only with fillers: true, which can send the speech to OpenAI
await fileboy.detectVideoFillers(video.id, { fillers: true, minSilence: 1 }) // status "pending"
const scan = await fileboy.getVideoFillers(video.id) // once status is "done"
scan.regions // [{ id: "r1", kind: "silence" or "filler", start, end, text }]
scan.totals.seconds // what removing them all saves
// cut the ones you keep, as one cut; resetVideoTrim puts the whole upload back
const keep = scan.regions.filter(r => r.kind === "filler" || r.end - r.start > 1.5)
await fileboy.applyVideoFillers(video.id, scan.scanId, keep.map(r => r.id))fileboy.detect_video_fillers(video.id, fillers: true, min_silence: 1)
scan = fileboy.fetch_video_fillers(video.id)
scan.totals["seconds"] # what removing them all saves
fileboy.apply_video_fillers(video.id, scan.scan_id, scan.regions.map(&:id))client.detect_video_fillers(video.id, fillers=True, min_silence=1)
scan = client.get_video_fillers(video.id)
scan.totals["seconds"] # what removing them all saves
client.apply_video_fillers(video.id, scan.scan_id, [r.id for r in scan.regions])$fileboy->detectVideoFillers($video->id, ['fillers' => true, 'minSilence' => 1]);
$scan = $fileboy->getVideoFillers($video->id);
echo $scan->totals['seconds']; // what removing them all saves
$fileboy->applyVideoFillers($video->id, $scan->scanId, array_map(fn ($r) => $r->id, $scan->regions));curl -X POST https://api.fileboy.io/videos/VIDEO_ID/fillers/detect \
-H "Authorization: token YOUR_SIGNED_TOKEN" \
-H "Content-Type: application/json" \
-d '{"fillers": true, "minSilence": 1, "padding": 0.25}'
# the regions it proposes, and its scanId, once status is "done"
curl https://api.fileboy.io/videos/VIDEO_ID/fillers \
-H "Authorization: token YOUR_SIGNED_TOKEN"
# cut the ones you keep
curl -X POST https://api.fileboy.io/videos/VIDEO_ID/fillers/apply \
-H "Authorization: token YOUR_SIGNED_TOKEN" \
-H "Content-Type: application/json" \
-d '{"scanId": "SCAN_ID", "regions": ["r1", "r3"]}'Find filler words and silences
JSON with any of silences (true by default) and fillers (false by default: true can send the speech to OpenAI), minSilence (0.3 to 10 seconds, default 1), padding (0 to 1, under half of minSilence, default 0.25), language and fillerWords. Needs your private key. Answers 202 with the scan, pending, and its scanId. A scan already queued is left as it is. 409 video_not_ready, 409 replacement_in_progress, 429 rate_limited after 30 scans an hour per app. The processor starts up to 20 scans an hour per app, across all of Fileboy's servers (see GET /usage/ai); the rest wait.
1https://api.fileboy.io/videos/{id}/fillers/detect
URL Params
id string
The video id.
Example
1curl -X POST https://api.fileboy.io/videos/VIDEO_ID/fillers/detect -H "Authorization: token YOUR_SIGNED_TOKEN" -H "Content-Type: application/json" -d '{ "fillers": true, "minSilence": 1, "padding": 0.25 }'
1{ "data": { "videoId": "9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10", "scanId": "5f0c2a8e-1d3b-4c6a-9e7f-2b8d4a6c1e90", "status": "pending", "regions": [], ... } }
Get the scan
Its status (none, pending, processing, done, failed or skipped), and once done the regions it proposes, totals (the seconds removing them all saves), found and capped, wordSource (openai, captions or none) and stale. Needs your private key.
1https://api.fileboy.io/videos/{id}/fillers
URL Params
id string
The video id.
Response
data.scanId string
Names this scan (new each detect). Apply sends it back.
data.regions array
Each { id, kind (silence or filler), start, end, text }, in seconds of the video as it played when it was scanned.
data.totals.seconds number
What removing every region saves.
data.stale boolean
The video changed since the scan: detect again before applying.
Example
1curl https://api.fileboy.io/videos/VIDEO_ID/fillers -H "Authorization: token YOUR_SIGNED_TOKEN"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16{ "data": { "scanId": "5f0c2a8e-1d3b-4c6a-9e7f-2b8d4a6c1e90", "status": "done", "regions": [ { "id": "r1", "kind": "silence", "start": 1, "end": 2.5 }, { "id": "r2", "kind": "filler", "start": 4, "end": 4.3, "text": "um" } ], "totals": { "seconds": 1.8, "silenceSeconds": 1.5, "fillerSeconds": 0.3, "silences": 1, "fillers": 1 }, "found": 2, "capped": false, "wordSource": "openai", "stale": false, ... } }
Apply the regions you keep
JSON with scanId (the scan's, from GET /videos/{id}/fillers) and regions, the ids of 1 to 100 of its regions to remove. Cuts them out as one cut, exactly like POST /videos/{id}/cuts. Needs your private key. Answers 202 with the video, its replacement.status pending and replacement.reason cut. 409 no_filler_scan, 409 fillers_stale (the video changed, or was scanned again, since), 409 replacement_in_progress, 400 for an unknown region, 403 storage_limit_reached.
1https://api.fileboy.io/videos/{id}/fillers/apply
URL Params
id string
The video id.
Body
scanId string
The scanId of the scan reviewed.
regions array
The region ids to remove.
Example
1curl https://api.fileboy.io/videos/VIDEO_ID/fillers/apply -H "Authorization: token YOUR_SIGNED_TOKEN" -H "Content-Type: application/json" -d '{ "scanId": "SCAN_ID", "regions": ["r1", "r3"] }'
1{ "data": { "id": "9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10", "replacement": { "status": "pending", "reason": "cut", "message": "", "replacedAt": null }, ... } }
Blur a region
Hide a password, an email address, a face or a number plate that shows for part of a video, without recording it again. On the Edit tab's Trim, cut and blur card, pause the player on a frame, drag a box over what to hide in the Blur section (move it and drag its corners, or use the arrow keys), set when it shows with Set from playhead, check it with Preview, then Apply from the edit list. From your server, send PUT /videos/:id/blurs with the whole list, { "blurs": [{ "start": 12.5, "end": 18, "x": 0.62, "y": 0.08, "width": 0.3, "height": 0.07, "strength": "strong" }] }. An empty list removes every blur, and GET /videos/:id/blurs lists them.
Times are seconds of the video as it plays now, at least 0.1 s, inside the video. The box is x, y, width and height as fractions 0 to 1 of the picture as it is shown, so it fits every rendition and a phone video recorded upright; it must lie inside the picture and be at least 1% of it each way. strength is light, medium (the default) or strong: each pixelates the region into a few large cells and blurs over them, so what was under it can't be recovered; they differ in how coarse it looks. Up to 50 blurs, each snapped outwards to whole frames.
A change works like a trim: the current version plays until the blurred one is encoded, then it is swapped in under the same id, version goes up (URLs of the old version answer 410) and video.replaced is sent with replacement.reason blur and replacement.blurCount. From then on everything Fileboy serves is made from the blurred version: every rendition and segment, the MP4 and original downloads, the poster, the seek-preview thumbnails, the poster suggestions, the animated preview, and clips and stitches made afterwards. Clips made before keep what they were cut from. If your custom poster was a frame inside a blurred range, it is removed and the automatic poster is shown; an uploaded poster image is kept. Fileboy keeps your upload, as for a trim, read only with a signed URL and counted towards storage, so you can change or remove the blurs. Chapters and captions don't change.
Blurs belong to the upload, not to one edit of it, so trims, cuts and Reset trim keep them in the same place in the picture's timeline. A blur wholly inside a section a trim or cut removed is kept but not active (active false, start and end null): it shows again if the trim is reset. To keep a blur as it is when you send the list, send its untrimmedStart and untrimmedEnd (as listed) in place of start and end. Uploading a new file for the video removes every blur.
Set a video's blurs
JSON with blurs, the whole list (up to 50; empty removes every blur). Needs your private key. Answers 202 with the video, its replacement.status pending and replacement.reason blur, or 200 when the list is what the video already has. 400 invalid_range, 409 video_not_ready, 409 replacement_in_progress while a replacement, trim, cut or blur runs, 403 storage_limit_reached.
1https://api.fileboy.io/videos/{id}/blurs
URL Params
id string
The video id.
Body
blurs array
Each { start, end, x, y, width, height, strength? }; untrimmedStart and untrimmedEnd in place of start and end keep a blur as listed.
Response
data.replacement object
status, reason (blur), message (why it failed, or how many blurs are applied) and replacedAt.
data.blurCount number
How many blurs the video has now.
Example
1curl -X PUT https://api.fileboy.io/videos/VIDEO_ID/blurs -H "Authorization: token YOUR_SIGNED_TOKEN" -H "Content-Type: application/json" -d '{ "blurs": [{ "start": 12.5, "end": 18, "x": 0.62, "y": 0.08, "width": 0.3, "height": 0.07, "strength": "strong" }] }'
1 2 3 4 5 6 7 8 9{ "data": { "id": "9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10", "version": 1, "blurCount": 0, "replacement": { "status": "pending", "reason": "blur", "message": "", "replacedAt": null }, ... } }
Make a clip
Save part of a video as a new video: a teaser, a highlight, one answer from a long interview. On the Edit tab's Trim, cut and blur card, pick the range, give the clip a name if you like, and use Save as new clip: it's made at once, not added to the edit list. From your server, send POST /videos/:id/clips with { "start": 30, "end": 45, "name": "Teaser" }. The video you clip from doesn't change.
The clip is a new video in the same app, with its own id. Fileboy cuts it from the source's original and processes it like an upload, so it sends video.uploaded (with clipOf: the source's id and the range) and then video.ready or video.failed. It counts as a new video towards your file and storage limits. Its chapters and caption tracks are copied from the source and moved to its own timeline, by the same rules as a trim. While the video has a new file, trim, cut or blur waiting or being processed, a clip is refused (409 replacement_in_progress): it would be cut from the version being replaced, so make it once that is done.
PATCH /videos/:id.Make a clip of a video
JSON with start and end, in seconds of the source as it plays now, and an optional name (1 to 200 characters; the source's name with " (clip)" by default). Needs your private key. Answers 201 with the new video, status pending until it is cut and processed. 400 invalid_range, 409 video_not_ready when the source isn't ready, 409 replacement_in_progress while the source has a replacement, trim, cut or blur waiting or running, 403 storage_limit_reached. A clip is a video, so the file limit doesn't apply. If the source is replaced, trimmed or deleted before the clip is cut, the clip fails.
1https://api.fileboy.io/videos/{id}/clips
URL Params
id string
The source video id.
Body
start number
Where the clip starts, in seconds.
end number
Where it ends, in seconds.
name string, optional
The clip's title.
Response
data.id string
The new video's id.
data.clipOf object
videoId, start and end: the source and the range it was cut from.
Example
1curl https://api.fileboy.io/videos/VIDEO_ID/clips -H "Authorization: token YOUR_SIGNED_TOKEN" -H "Content-Type: application/json" -d '{ "start": 30, "end": 45, "name": "Teaser" }'
1 2 3 4 5 6 7 8 9 10{ "data": { "id": "4f6a2c1d-8e3b-4a7f-9c2d-1b5e6f7a8c9d", "name": "Teaser", "status": "pending", "visibility": "private", "clipOf": { "videoId": "9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10", "start": 30, "end": 45 }, ... } }
Stitch videos together
Join whole videos into a new one: an intro, the talk and an outro, or a series of short recordings. On the Videos list, select the videos, choose Stitch, put them in order, and confirm; or, on a video's Edit tab, use Pick videos to join to stitch others after it. From your server, send POST /videos/stitch with { "videos": ["ID_1", "ID_2"], "name": "Full talk" }: 2 to 20 of the app's videos, in the order they play. The videos you stitch don't change.
The stitched video is a new video in the same app. Fileboy joins the sources' originals, re-encoding each to one picture size (the largest one's; smaller or differently shaped videos are fitted inside it with black bars) and one frame rate (the highest, up to 60 fps). A video with no sound gets silence, so the sound stays in step. Then it is processed like an upload: video.uploaded (with stitchedFrom) and then video.ready or video.failed. It counts as a new video towards your file and storage limits.
Chapters are joined, each video's moved later by the length of the videos before it. Captions are joined the same way, one track per language, but only for languages every video has a track in: a language missing from one video is left out rather than going silent part way through. If a video is replaced, trimmed, cut or deleted before it is joined, the stitched video fails and video.failed says so. Every id must be one of the app's own videos (404 otherwise) and ready (409 video_not_ready).
Stitch videos into a new video
JSON with videos, 2 to 20 video ids in the order they play (one can appear more than once), and an optional name (1 to 200 characters; the first names joined with " + " by default). Needs your private key. Answers 201 with the new video, status pending until it is joined and processed. 404 video_not_found when an id isn't one of the app's videos, 409 video_not_ready, 409 replacement_in_progress when a video is being replaced, trimmed or cut, 403 limit_reached, 403 storage_limit_reached.
1https://api.fileboy.io/videos/stitch
Body
videos string[]
The videos to join, in order.
name string, optional
The new video's title.
Response
data.id string
The new video's id.
data.stitchedFrom object
videos: the ids it joins, in order.
Example
1curl https://api.fileboy.io/videos/stitch -H "Authorization: token YOUR_SIGNED_TOKEN" -H "Content-Type: application/json" -d '{ "videos": ["9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10", "4f6a2c1d-8e3b-4a7f-9c2d-1b5e6f7a8c9d"], "name": "Full talk" }'
1 2 3 4 5 6 7 8 9 10{ "data": { "id": "7d2e9a40-3b1c-4c55-8f0e-6a9b2c4d1e3f", "name": "Full talk", "status": "pending", "visibility": "private", "stitchedFrom": { "videos": ["9b1c4d1e-5c1e-4b8e-9d57-3f0a4f1a7c10", "4f6a2c1d-8e3b-4a7f-9c2d-1b5e6f7a8c9d"] }, ... } }
The edit list
In the dashboard, the Edit list at the bottom of the Trim, cut and blur card holds your changes until you apply them, for example “Trim to 0:02–0:58”, “Cut out 0:12–0:15” and “Blur 1: 0:20–0:24 · medium”. Each line has Undo and Remove, and nothing happens to the video until Apply.
Through the API, the edit list is what a video plays. A video that has been trimmed or cut has trim.start, trim.end and trim.untrimmedDuration, in seconds of the upload, and after a cut trim.keep: the ranges of the upload that are kept, in order. Every trim and cut is made afresh from the upload Fileboy keeps, never from an earlier cut, so quality doesn't drop as you edit. POST /videos/:id/trim/reset clears the list and plays the whole upload again. Blurs are listed separately, with GET /videos/:id/blurs, and stay in place when you trim, cut or reset.
Versions
A video starts at version 1. Each trim, cut, trim reset, blur, re-process or replacement file that is swapped in adds one. The current version keeps playing while the next is encoded, then every rendition is swapped in at once under the same id, so the watch page, embeds, links and playlists need no change. The old files are deleted, so you are only charged for one copy. Fileboy doesn't keep older versions to go back to, apart from the upload that trims, cuts and blurs are made from.
From version 2, segment, audio and MP4 URLs carry the version, as v=2. An older version's URL answers 410 version_replaced, so nothing cached of the old version is served for the new one. fileboy-player 1.5.0 or later picks up a new version where it was part way through. When a version is live, video.replaced is sent, with replacement.reason upload (a new file), trim, cut, reset_trim, blur or reprocess. If it can't be made, the old version stays and video.replacement_failed is sent.
Limits and errors
The limits on an edit:
- A trim or cut must leave at least a second of the video, and a range must be inside it.
- One cut removes 1 to 100 sections. A filler scan proposes at most 100 regions.
- A video has up to 50 blurs, each at least 0.1 s long and 1% of the picture each way.
- A stitch joins 2 to 20 of the app's videos.
- A replacement file can be up to 5 GB.
- Only one replacement, trim, cut or blur runs on a video at a time.
The errors the edit calls answer with:
400 invalid_range: a time outside the video, too short, a cut that removes nothing, or a blur box outside the picture.409 video_not_ready: the video (or one being stitched) is still processing.409 replacement_in_progress: another edit or replacement is waiting or running, or you are changing the video's captions during one.409 fillers_staleand409 no_filler_scan: the scan is out of date or missing. Detect again.403 storage_limit_reached: the new version, clip or stitch would pass the app's storage limit. A video's files never count towards the file limit, so it doesn't apply.404 video_not_found: a stitch id isn't one of the app's videos.413 file_too_large: a replacement file over 5 GB.
A video in the trash, or one whose upload the virus scan found infected, can't be edited. In the dashboard these errors are shown in place with what to do. See also the full API reference.