API
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:

ModelBest forPrice
Standard, /v1/video-background-removalAny backdrop, the best quality$0.015–$0.0225 per 30 frames of the output video
Fast, /v1/video-background-removal-fastA quicker turnaround$0.008–$0.012 per 30 frames of the output video
Green screen, /v1/video-background-removal-green-screenFootage 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_codecenumoptional

Output 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.

Acceptsvp9h264Defaults to "vp9".
refine_foreground_edgesbooleanoptional

Improves the quality of the extracted subject's edges.

Defaults to true.
subject_is_personbooleanoptional

Set to false when the subject is not a person.

Defaults to true.
video_urlurlrequired

URL of the source video to remove the background from.

Must be an http(s) URL.
terminal
# 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_codecenumoptional

Output 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.

Acceptsvp9h264Defaults to "vp9".
spill_suppression_strengthnumberoptional

How strongly green cast is removed from the kept subject. Raise it when green spots remain, lower it when colours shift on the subject.

Between 0 and 1.Defaults to 0.8.
video_urlurlrequired

URL of the source video, shot against a green screen.

Must be an http(s) URL.

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:

  • vp9 renders one WebM with a transparent background.
  • h264 renders 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.