On this section
Guide
Removing a video background
Choose between Standard, Fast and Green screen, pick an output codec, and get clean edges.
Video Background Removal cuts the subject out of a video and returns it on a transparent background. It takes video only, and it returns the cutout: placing it over a new background is up to you.
Which model
There are three, priced per block of frames:
| Model | Best for | Price |
|---|---|---|
Standard, /v1/video-background-removal | Any backdrop, the best quality | $0.015–$0.0225 per 30 frames of the output video |
Fast, /v1/video-background-removal-fast | A quicker turnaround | $0.008–$0.012 per 30 frames of the output video |
Green screen, /v1/video-background-removal-green-screen | Footage shot on a green screen | $0.025 per 30 frames of the output video |
Shot on a green screen? Use that model: keying out the backdrop is faster and cleaner than segmenting it. Otherwise start with Standard, and move to Fast when turnaround matters more than edge quality. Each reference page states the largest source it accepts.
Standard and Fast
output_codecenumoptionalOutput encoding. vp9 (the default) yields a single webm video with an alpha channel; h264 yields two files (the RGB video and an alpha matte) and is recommended for better RGB quality.
vp9h264Defaults to "vp9".refine_foreground_edgesbooleanoptionalImproves the quality of the extracted subject's edges.
true.subject_is_personbooleanoptionalSet to false when the subject is not a person.
true.video_urlurlrequiredURL of the source video to remove the background from.
# Submit a job
curl -X POST "https://api.veed.io/v1/video-background-removal" \
-H "Authorization: Bearer $VEED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video_url": "https://static-assets.veed.io/api-examples/bg-v2v-input.mp4"
}'
# Poll until COMPLETED (response includes data.job_id)
curl "https://api.veed.io/v1/video-background-removal/{job_id}" \
-H "Authorization: Bearer $VEED_API_KEY"refine_foreground_edges defaults to true
and costs more. Keep it on for hair, fur and fine detail; turn it off to save on
simple shots. The subject does not have to be a person: set subject_is_person
to false for objects.
Green screen
output_codecenumoptionalOutput encoding. vp9 (the default) yields a single webm video with an alpha channel; h264 yields two files (the RGB video and an alpha matte) and is recommended for better RGB quality.
vp9h264Defaults to "vp9".spill_suppression_strengthnumberoptionalHow strongly green cast is removed from the kept subject. Raise it when green spots remain, lower it when colours shift on the subject.
0.8.video_urlurlrequiredURL of the source video, shot against a green screen.
spill_suppression_strength defaults to 0.8.
Raise it when green spots remain on the subject; lower it when the subject's
colours look off.
What you get back
output_codec is one of vp9, h264,
and decides the shape of result.files:
vp9renders one WebM with a transparent background.h264renders two files: the colour video and a black-and-white alpha matte. Colour quality is better, and it is the one to use when your editor or player does not handle transparent WebM.
Getting good results
- Give the subject contrast with the background.
- Avoid heavy motion blur and very low light.
- Try a short clip first, before you send a long job.