Loading API documentation
Reframes landscape video to vertical 9:16 by its content, shot by shot. Every shot is planned by a vision-language model that sees its frames, the faces in it (with the active speaker) and the transcript: follow the speaker, track a moving subject (a ball, a car, a product), fit a wide view, or split the frame into two stacked panels (two people talking, a speaker and their slides).
#rrggbb for the spoken word in the highlight and pill captions.1 unit = 1 minute of input video. The duration is rounded to whole seconds, then up to the next full minute; minimum 1 unit. A 5:00.011 video is 5 units, a 5:01 video is 6. Captions cost nothing extra. Failed requests are not billed.
The output video follows the request's X-Fal-Object-Lifecycle-Preference, as in fal's other apps.
Invalid input returns HTTP 422 with the offending field, and for video_url a type:
download_error (not public, does not resolve, redirects, answers with an error, breaks off, a download
over 10 minutes), size_exceeded (over 4 GB), invalid_file_type (not a video, no video stream: the cover
picture of an audio file is none), invalid_aspect_ratio (not wider than 9:16 as shown),
no_audio_track, duration_exceeded (more than 10 minutes, too many frames to hold in memory). A
captions style that does not exist or an accent_color that is not #rrggbb is a validation error. A video
without speech gets no captions, without an error.
The client provides a convenient way to interact with the model API.
npm install --save @fal-ai/clientSet FAL_KEY as an environment variable in your runtime.
export FAL_KEY="YOUR_API_KEY"The client API handles the API submit protocol. It will handle the request status updates and return the result when the request is completed.
import { fal } from "@fal-ai/client";
const result = await fal.subscribe("veed/reframe", {
input: {
video_url: ""
},
logs: true,
onQueueUpdate: (update) => {
if (update.status === "IN_PROGRESS") {
update.logs.map((log) => log.message).forEach(console.log);
}
},
});
console.log(result.data);
console.log(result.requestId);The API uses an API Key for authentication. It is recommended you set the FAL_KEY environment variable in your runtime when possible.
import { fal } from "@fal-ai/client";
fal.config({
credentials: "YOUR_FAL_KEY"
});The client API provides a convenient way to submit requests to the model.
import { fal } from "@fal-ai/client";
const { request_id } = await fal.queue.submit("veed/reframe", {
input: {
video_url: ""
},
webhookUrl: "https://optional.webhook.url/for/results",
});You can fetch the status of a request to check if it is completed or still in progress.
import { fal } from "@fal-ai/client";
const status = await fal.queue.status("veed/reframe", {
requestId: "764cabcf-b745-4b3e-ae38-1200304cf45b",
logs: true,
});Once the request is completed, you can fetch the result. See the Output Schema for the expected result format.
import { fal } from "@fal-ai/client";
const result = await fal.queue.result("veed/reframe", {
requestId: "764cabcf-b745-4b3e-ae38-1200304cf45b"
});
console.log(result.data);
console.log(result.requestId);Some attributes in the API accept file URLs as input. Whenever that's the case you can pass your own URL or a Base64 data URI.
You can pass a Base64 data URI as a file input. The API will handle the file decoding for you. Keep in mind that for large files, this alternative although convenient can impact the request performance.
You can also pass your own URLs as long as they are publicly accessible. Be aware that some hosts might block cross-site requests, rate-limit, or consider the request as a bot.
We provide a convenient file storage that allows you to upload files and use them in your requests. You can upload files using the client API and use the returned URL in your requests.
import { fal } from "@fal-ai/client";
const file = new File(["Hello, World!"], "hello.txt", { type: "text/plain" });
const url = await fal.storage.upload(file);Read more about file handling in our file upload guide.
video_url string* requiredThe video to reframe to 9:16 (mp4, mov, mkv, webm, ...): wider than 9:16 (landscape, square, 4:5). It needs an audio track: the active speaker is found by the voice. Up to 10 minutes and 4 GB. A public URL.
captions CaptionsEnumBurn word-timed captions into the output, placed where the layout leaves room for them: clean (white text with an outline), boxed (black text on a white box), highlight (the spoken word in colour), pill (the spoken word on a coloured pill). none: no captions. Default value: "none"
Possible enum values: none, clean, boxed, highlight, pill
accent_color string#rrggbb for the spoken word: its text in the highlight captions (yellow #ffd43b by default), its pill in the pill captions (violet #7b61ff by default). The other styles do not mark the spoken word and ignore it.
{
"video_url": "",
"captions": "none"
}9:16 H.264 MP4 at the source height (at most 1080x1920), with the source audio.
{
"video": {
"url": "",
"content_type": "image/png",
"file_name": "z9RV14K95DvU.png",
"file_size": 4404019
}
}url string* requiredThe URL where the file can be downloaded from.
content_type stringThe mime type of the file.
file_name stringThe name of the file. It will be auto-generated if not provided.
file_size integerThe size of the file in bytes.