Blog

AI Video Background Remover: Tools, API and Cost (2026)

Unicorn API Team · · 11 min read

AI video background remover turning video frames with an office background into frames with a transparent background

An AI video background remover separates the person or object in a clip from everything behind it, frame by frame, so you can make the background transparent or swap in a new one without a green screen. Most people meet these tools as one-click web apps: upload a clip, wait, download. That works for a quick social post. It stops working when you have fifty product clips, need a transparent master for an editor, or want the step inside your own app.

This article covers both paths. First, how the technology works and which kind of tool fits which job. Then a complete, working pipeline you can run yourself, built from ffmpeg and an image background remover called over an API, with real per-second costs and the mistakes that make cut-outs look cheap.

What does an AI video background remover actually do?

Under the hood, an AI video background remover runs two related tasks on every frame.

  • Segmentation: a neural network labels each pixel as subject or background. This gives a rough mask, good enough for the body but blocky around fine detail.
  • Matting: a second pass estimates partial transparency at the edges. Hair, motion blur and semi-transparent fabric are neither fully subject nor fully background, so a good matte assigns them in-between values.

The result is an alpha channel: an extra greyscale layer stored alongside the colour data, where white means fully visible, black means fully transparent and grey means partly see-through. Every transparent video or PNG you have ever used carries one.

Video adds a problem that still images do not have: temporal consistency, meaning the mask should stay stable from one frame to the next. If the model decides a strand of hair is subject in frame 40 and background in frame 41, the edge shimmers during playback. Dedicated video tools often pass information between frames to reduce this. Image tools treat each frame independently, which is simpler and cheaper but needs a little cleanup, covered later.

Remove, replace or blur?

Most tools offer three outcomes, and it helps to decide which you need before you pick one:

  • Remove: export the subject on a transparent background, to layer in an editor or a web page.
  • Replace: composite the subject onto a colour, image or other video.
  • Blur: keep the original background but soften it, like portrait mode on a phone.

Replace and blur hide edge errors better than remove does, because the new background sits close in colour and the eye forgives soft edges. Fully transparent output exposes every flaw, so it demands the best matte.

App, editor plugin or API: which kind of tool fits?

The products ranking for this search fall into four groups. Some are browser apps such as Unscreen, Fotor and BIGVU; some are mobile apps on Google Play and the App Store; some are plugins that add masking to Adobe Premiere Pro; and some developers skip all of these and build a pipeline on an API. Each makes sense for a different job.

OptionBest forStrengthsLimits
Online appOne-off clips for social mediaNo install, paste a link or upload, results in minutesFree tiers often add watermarks or cap length and resolution; manual, one clip at a time
Mobile appCreators who shoot and edit on a phoneFast, simple, built-in backgroundsLimited export formats; transparent output is often unavailable or paywalled
Editor pluginEditors working in Premiere Pro or similarMask stays editable on the timeline; you can fix frames by handTied to one editor; renders on your machine
API pipelineBatches, product catalogues, features inside your own appScriptable, repeatable, pay per frame, any output format ffmpeg supportsYou handle frame extraction, flicker smoothing and reassembly

A rule of thumb: if a human will touch each clip anyway, use an app or plugin. If the same treatment needs to run on many clips, or on clips your users upload, an API pipeline pays for itself in saved clicks. The searches for “ai video background remover free” and “online” are mostly the first group; the rest of this article is mostly for the second.

Diagram comparing online apps, mobile apps, editor plugins and API pipelines for removing video backgrounds
Four ways to remove a video background, from one-click apps to a scripted pipeline.

How to build an AI video background remover with an API

The idea is simple: a video is a stack of images. Split it into frames, run each frame through an AI image background remover, then stitch the results back together. On Unicorn API the cutting step uses Recraft Remove Background, an image model that takes a single image input and costs 1 credit per image. You need ffmpeg installed, Python 3 with the requests library, and an API key from your keys page.

Step 1: Extract the frames

Pull frames out as lossless PNGs. JPEG frames add compression blocks that the model may mistake for edges.

mkdir -p frames
# Keep the original frame rate (best quality):
ffmpeg -i input.mp4 frames/%05d.png

# Or sample fewer frames to cut cost, e.g. 12 per second:
ffmpeg -i input.mp4 -vf fps=12 frames/%05d.png

Dropping the frame rate halves or thirds the cost, but motion looks choppier. For talking heads and slow product spins, 12 to 15 fps is often acceptable for web use. For anything with fast gestures, keep the source rate.

Step 2: Test one frame first

Before you spend credits on a whole clip, run a single tricky frame, ideally one with hair, hands or motion blur. The quickest way is the browser playground; or call the API directly:

curl -X POST https://api.unicornapi.net/v1/jobs \
  -H "Authorization: Bearer $UNICORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"recraft-remove-background","input":{"image":"https://your-bucket.example/frames/00042.png"}}'

The response contains a job id. Poll GET /v1/jobs/{id} until status is "succeeded", then download outputs[0].url. Open the result in an image editor and confirm the background is actually transparent and the edges look right. This one check tells you whether the whole clip is worth running.

Step 3: Run the whole clip

The model needs to reach each frame, so upload the frames folder somewhere it can be fetched (a storage bucket with public or signed URLs works) and set FRAME_BASE_URL to that location. The API documentation lists the input formats each model accepts. This script submits frames in parallel, polls each job, saves the cut-outs and skips frames already done, so you can rerun it after a network hiccup without paying twice.

import os
import time
import pathlib
import requests
from concurrent.futures import ThreadPoolExecutor, as_completed

API = "https://api.unicornapi.net"
HEADERS = {"Authorization": f"Bearer {os.environ['UNICORN_API_KEY']}"}
FRAME_BASE_URL = os.environ["FRAME_BASE_URL"].rstrip("/")

SRC = pathlib.Path("frames")
OUT = pathlib.Path("cut")
OUT.mkdir(exist_ok=True)


def remove_background(frame: pathlib.Path) -> str:
    target = OUT / frame.name
    if target.exists():
        return f"skipped {frame.name}"

    resp = requests.post(
        f"{API}/v1/jobs",
        headers=HEADERS,
        json={
            "model": "recraft-remove-background",
            "input": {"image": f"{FRAME_BASE_URL}/{frame.name}"},
        },
        timeout=60,
    )
    resp.raise_for_status()
    job_id = resp.json()["id"]

    deadline = time.time() + 600
    while True:
        r = requests.get(f"{API}/v1/jobs/{job_id}", headers=HEADERS, timeout=60)
        r.raise_for_status()
        job = r.json()
        if job["status"] == "succeeded":
            break
        if job["status"] == "failed":
            raise RuntimeError(f"{frame.name} failed: {job}")
        if time.time() > deadline:
            raise TimeoutError(f"{frame.name} timed out")
        time.sleep(2)

    image = requests.get(job["outputs"][0]["url"], timeout=120)
    image.raise_for_status()
    target.write_bytes(image.content)
    return f"done {frame.name}"


if __name__ == "__main__":
    frames = sorted(SRC.glob("*.png"))
    with ThreadPoolExecutor(max_workers=8) as pool:
        futures = [pool.submit(remove_background, f) for f in frames]
        for future in as_completed(futures):
            try:
                print(future.result())
            except Exception as err:
                print("error:", err)

Eight workers is a sensible start; check the docs for your rate limits before raising it. Because file names are preserved, the output sequence stays in order for reassembly.

Step 4: Reassemble with transparency

Pick the output format by where the clip is going. Use the same frame rate you extracted at.

# ProRes 4444 with alpha, for Premiere Pro, Final Cut or DaVinci Resolve
ffmpeg -framerate 24 -i cut/%05d.png \
  -c:v prores_ks -profile:v 4444 -pix_fmt yuva444p10le output.mov

# WebM VP9 with alpha, for browsers
ffmpeg -framerate 24 -i cut/%05d.png \
  -c:v libvpx-vp9 -pix_fmt yuva420p -b:v 2M output.webm

Do not export transparent footage to a standard H.264 MP4. That codec has no alpha channel, so the transparent areas turn black and all the work disappears.

Replacing the background with a generated scene

Often you do not want transparency at all; you want the subject somewhere nicer. A video background remover gives you the cut-out, and an image model can give you the new scene. A static background plate works well for talking heads, interviews and product demos where the camera does not move.

Generate the plate in the clip’s aspect ratio. Flux 3 Klein Text to Image takes a resolution field and costs 1.6 credits at 1K, 2.5 at 2K and 6.5 at 4K per image, rounded up to whole credits per output, so a 2K plate is 3 credits. Nano Banana 2 Lite costs 4 credits per image, supports 16:9 and 9:16 aspect ratios for landscape and vertical video, and accepts up to 10 reference images if you want the scene to match a brand set.

curl -X POST https://api.unicornapi.net/v1/jobs \
  -H "Authorization: Bearer $UNICORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"nano-banana-2-lite","input":{"prompt":"A bright, minimal home office with a bookshelf and plants, soft window light from the left, shallow depth of field, no people","aspect_ratio":"16:9"}}'

Two prompt details matter. Ask for “no people” so the plate does not include a second subject. And describe the light direction so it matches your footage: if the presenter is lit from the left, a plate lit from the right looks pasted on no matter how clean the matte is.

Then composite the cut-out frames over the plate and carry the original audio across:

ffmpeg -loop 1 -i background.png -framerate 24 -i cut/%05d.png -i input.mp4 \
  -filter_complex "[0:v]scale=1920:1080[bg];[1:v]scale=1920:1080[fg];[bg][fg]overlay=shortest=1,format=yuv420p[out]" \
  -map "[out]" -map 2:a? -c:v libx264 -crf 18 -c:a copy -shortest final.mp4

Here H.264 is fine, because the output is no longer transparent. Two related jobs fit the same workflow. For lower-thirds, logos or stickers that sit on top of the video, GPT Image 1.5 has an optional transparent background setting and renders legible text. And for a thumbnail, take one cut-out frame and restyle it with Flux 3 Klein Edit Image, which takes a prompt plus image URLs.

What does it cost per second of video?

With a per-frame approach the maths is predictable: one frame is one Recraft Remove Background call, and one call is 1 credit. Monthly plans give credits at $0.01 each (Starter $25, Creator $50, Studio $100, Pro $200); top-up credits cost $0.015 each and never expire. Details are on the pricing page.

ClipFrames sentCreditsCost on a planCost with top-ups
10 s at 12 fps120120$1.20$1.80
10 s at 24 fps240240$2.40$3.60
10 s at 30 fps300300$3.00$4.50
60 s at 12 fps720720$7.20$10.80
60 s at 24 fps1,4401,440$14.40$21.60
60 s at 30 fps1,8001,800$18.00$27.00

Add a few credits if you generate a background plate: 3 for a 2K Flux 3 Klein plate, 4 for Nano Banana 2 Lite. For scale, the Starter plan’s 2,500 credits cover a bit over 100 seconds of 24 fps footage.

Three levers bring the bill down. Lower the sampled frame rate where motion allows. Trim the clip before extraction rather than after, since every frame you cut out of the timeline first is a credit saved. And run your single test frame before the batch, so a bad shot costs you 1 credit instead of 1,440. If you want the exact price of a request before running it, Unicorn API exposes POST /v1/models/price; the request format is in the docs.

This per-frame model suits short, high-value clips: product videos, ads, talking-head intros, app features where users upload a few seconds. For a 40-minute webinar it adds up quickly, and a desktop tool or plugin running locally is the more sensible choice.

Pipeline diagram showing video split into frames, cut out, composited on a new background and exported
The frame-by-frame pipeline: cost scales with the number of frames you send through panel 3.

Common mistakes and how to fix them

Most bad cut-outs come from a handful of avoidable problems, whichever AI video background remover you use.

Edges that flicker

Because an image model sees each frame alone, the mask boundary wobbles slightly between frames. A light temporal blur on the alpha channel only, averaged over three frames, calms it without softening the subject’s colours:

ffmpeg -framerate 24 -i cut/%05d.png -filter_complex \
  "[0:v]split[c][a];[a]alphaextract,tmix=frames=3[m];[c][m]alphamerge" \
  -c:v prores_ks -profile:v 4444 -pix_fmt yuva444p10le smoothed.mov

The trade-off: on fast movement, averaged masks can leave a faint ghost trail. Use frames=2 for energetic footage, or skip smoothing and composite onto a background that sits close in colour to the original.

Feeding compressed frames

Phone footage and social downloads are heavily compressed. Blocky artefacts around the subject confuse segmentation. Start from the highest-quality source you have and extract to PNG, not JPEG.

Weak contrast in the shot

No green screen is needed, but contrast still helps. A dark jacket against a dark wall, or blonde hair against a beige background, is hard for any model. If you control the shoot, put clear separation between subject and background and add a little rim light behind the subject.

Exporting to a format without alpha

The most common support question for every AI video background remover: “my transparent video has a black background.” The file was saved as H.264 MP4. Use ProRes 4444, WebM VP9 with yuva420p, or keep a PNG sequence.

Mismatched frame rates

If you extract at 12 fps and reassemble at 24, the video plays at double speed and drifts from the audio. Use the same number in -vf fps= and -framerate.

Ignoring lighting on replacements

A perfect matte on a mismatched background still looks fake. Match the light direction, colour temperature and depth of field of the plate to the footage. A slightly blurred background plate hides small edge errors and looks more like a real lens.

When is a dedicated video tool the better choice?

The frame-by-frame pipeline is flexible and transparent about cost, but it is not always the right answer. Reach for a dedicated AI video background remover, app or plugin, when:

  • The clip is long. Per-frame pricing scales linearly with duration; long recordings are cheaper to process locally.
  • There is a lot of fast motion. Dancing, sports and handheld camera work benefit from tools that track the mask across frames.
  • You need hand fixes. A Premiere Pro plugin lets you correct individual frames on the timeline; a script cannot.
  • It is a one-off. If you will never do this again, writing a pipeline is more work than uploading a file.

The API pipeline wins when the job repeats: an e-commerce team cutting out the same kind of product spin every week, a SaaS product letting users drop their webcam background, a marketing team producing the same intro format in ten variations. It also wins when you want one account for the whole job. The background removal, the generated plate, the overlay graphics and the thumbnail edit above all run on the same key and the same credit balance, and you can browse the rest of the model catalog when a step needs something different.

If you work inside an AI coding assistant, you can also hand it this pipeline: Unicorn API can be used from Cursor, Claude Code and other agents through MCP, as described on the agents page. Ask the agent to extract frames, run the cut-outs and reassemble, and review the single test frame before letting it run the batch.

Whichever route you choose, the same checklist applies: test one hard frame, keep the source quality high, export to a format that carries alpha, and match the light when you replace the background. Get those four right and an AI video background remover produces footage that looks shot on set, not pasted on.

Frequently asked questions

Is there a free AI video background remover?

Yes. Several online tools and mobile apps offer a free tier, usually with a watermark, a short clip limit or reduced resolution. Free tiers are fine for testing a shot or making a quick social post. If you need full resolution, no watermark, transparent output or batch processing, expect to pay, either for an app subscription or per frame through an API pipeline like the one in this article.

Can you remove a video background without a green screen?

Yes. An AI video background remover uses segmentation models trained to recognise people and objects, so it does not need a solid colour behind the subject. A green screen still gives cleaner edges, especially around hair and fast motion. Without one, shoot with good light, a clear contrast between subject and background, and a steady camera to get the best automatic cut-out.

Which video formats keep a transparent background?

Standard MP4 with H.264 has no alpha channel, so transparency is lost on export. Use ProRes 4444 in a .mov container for editing in Premiere Pro, Final Cut or DaVinci Resolve, or WebM with VP9 and a yuva420p pixel format for browsers. A PNG image sequence also keeps full transparency and is the safest intermediate format between tools.

How much does it cost to remove a video background with an API?

With a per-image background remover such as Recraft Remove Background on Unicorn API, you pay 1 credit per frame. A 10-second clip at 24 frames per second is 240 frames, so 240 credits: $2.40 on a monthly plan at $0.01 per credit, or $3.60 with top-up credits at $0.015. Lower frame rates cost proportionally less.

Why does my video cut-out flicker between frames?

Image background removers judge each frame on its own, so the edge of the mask shifts slightly from frame to frame, which shows up as shimmer around hair and shoulders. Fix it by averaging the alpha channel over two or three neighbouring frames, feeding the model high-quality frames instead of compressed ones, and shooting with stronger contrast between subject and background.

Can I use an AI image background remover on video?

Yes, by treating the video as a sequence of images. Extract the frames with ffmpeg, run each frame through the image background remover, then reassemble the cut-out frames into a video with an alpha channel or composite them onto a new background. It works well for short clips, talking heads and product shots, and gives you full control over format and cost.