Background Removal (Video) 1.0
zilapi/bgr-video-1.0 · by InverseAI
Removes the background from a video, keeping the subject: a greyscale matte video at the input's size and frame rate.
Video background removal API
POST /v1/video/remove-background takes a short video and returns a matte video: the subject in white on black, at the input's size and frame rate, one matte frame per input frame. Use it as the alpha channel in your editor or pipeline, or turn it into a transparent WebM or a green-screen MP4 with one ffmpeg command.
What developers use it for
- Cut out presenters and talking heads for social and marketing videos
- Replace or blur the background of recorded calls and webinars
- Put product and e-commerce clips on a clean background
- Masks for compositing, colour grading and effects in your video pipeline
What it does
Separate the subject from the background in short clips: social videos, product videos, talking heads and recorded calls. You get a greyscale matte video, one matte frame per input frame, to composite in your editor or with ffmpeg.
Create a job
POST /v1/video/remove-background accepts an input_url, a ready file id, or a multipart file. A video in the request itself can be up to 50 MB; a file id or input_url takes up to 250 MB. Send the optional webhook_url to receive a signed completion event, or poll GET /v1/jobs/{id}.
curl -s https://api.zilapi.com/v1/video/remove-background \
-H "Authorization: Bearer $ZILAPI_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"input_url": "https://example.com/clip.mp4",
"model": "zilapi/bgr-video-1.0",
"webhook_url": "https://your-app.example.com/hooks/zilapi"}' \
> job.json
JOB_ID=$(jq -r .id job.json)Output
| Name | Contains |
|---|---|
mask | The matte video: MP4 (H.264), full-range greyscale with white for the subject, at the input's displayed size and frame rate, one matte frame per input frame. |
The output is a mask, not a finished video: white where the subject is, black for the background. Transparent WebM and green-screen MP4 outputs are coming soon. Until then, one ffmpeg command combines the matte with your video, for example into a transparent WebM (the guide also has a green-screen MP4):
# The matte becomes the alpha channel: a VP9 WebM with transparency (audio re-encoded to Opus).
ffmpeg -i clip.mp4 -i clip-matte.mp4 -filter_complex \
"[1:v]format=gray[m];[0:v][m]alphamerge,format=yuva420p[v]" \
-map "[v]" -map "0:a?" -c:v libvpx-vp9 -auto-alt-ref 0 -c:a libopus clip-transparent.webmAfter the job succeeds, call GET /v1/jobs/{id}/output?name=mask for a signed download URL. Outputs are kept for 7 days.
Inputs, limits and formats
| Provider | InverseAI |
|---|---|
| Input formats | MP4, MOV or WebM (H.264, HEVC, VP8, VP9 or AV1) |
| Max duration | Up to 60 seconds per video |
| Max file size | 250 MB by URL or file id; 50 MB directly in the job request |
| Max resolution | 1920×1080, landscape or portrait (1080×1920); at least 64 px and an even number of pixels per side |
| Max frame rate | 60 fps |
| Typical time | A 10-second clip usually finishes in seconds |
| Output | Video → MP4: the matte video (mask) |
Video background removal API: questions
How much does the video background removal API cost?
$0.10 per video minute, billed by the millisecond with a 1-second minimum. A 10-second clip costs $0.0167 and a 60-second clip $0.10. Failed jobs are free.
Which videos can I send?
MP4, MOV or WebM (H.264, HEVC, VP8, VP9 or AV1) up to 60 seconds, 250 MB, 1920×1080 in either orientation and 60 fps, at least 64 px and an even number of pixels per side. The container's rotation is applied.
How fast is it?
A 10-second clip usually finishes in seconds. One video runs at a time per account; more wait in the queue and start as soon as the previous one finishes, within the 24-hour job lifetime, so accepted jobs wait instead of failing. Your account's limit on live jobs at once (10 before your first top-up, 50 after) still applies.
What do I get back?
The matte video: MP4 (H.264), full-range greyscale with white for the subject, at the input's displayed size and frame rate, one matte frame per input frame. Combine it with your video in your editor or with ffmpeg for a transparent or green-screen result.
More APIs on the same key
Compare every model on the pricing page, read the step-by-step guide, or start with the quickstart.