Skip to content
Video

Background Removal (Video) 1.0

zilapi/bgr-video-1.0 · by InverseAI

Available

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

Outputs of zilapi/bgr-video-1.0
NameContains
maskThe 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):

Shell
# 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.webm

After the job succeeds, call GET /v1/jobs/{id}/output?name=mask for a signed download URL. Outputs are kept for 7 days.

Read the step-by-step guide

Inputs, limits and formats

ProviderInverseAI
Input formatsMP4, MOV or WebM (H.264, HEVC, VP8, VP9 or AV1)
Max durationUp to 60 seconds per video
Max file size250 MB by URL or file id; 50 MB directly in the job request
Max resolution1920×1080, landscape or portrait (1080×1920); at least 64 px and an even number of pixels per side
Max frame rate60 fps
Typical timeA 10-second clip usually finishes in seconds
OutputVideo → 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.

Compare every model on the pricing page, read the step-by-step guide, or start with the quickstart.