Video Background Removal

Submit a video background removal (fast) job

Changed on

Start an asynchronous job that removes the background from a source video, keeping only the foreground subject. Faster generation; accepts source videos up to full HD (1080p).

It takes video only, and returns the cutout: placing it over a new background is up to you.

Inputs

  • video_url — public URL of the source video
  • output_codec — optional; vp9 (the default) renders one WebM with an alpha channel, h264 renders two files (the RGB video and an alpha matte) and is recommended for better RGB quality
  • refine_foreground_edges — optional; improves the quality of the extracted subject's edges (defaults to true)
  • subject_is_person — optional; set to false when the subject is not a person (defaults to true)

What happens next

The job is accepted immediately — you get 202 Accepted with a job_id and status PROCESSING. Rendering runs in the background; poll GET /v1/video-background-removal-fast/{job_id} until the job is COMPLETED or FAILED.

post/v1/video-background-removal-fast

Request

Headers

X-Veed-Store-IO'0' | '1'

Set to 0 to not store this request's and response's bodies. They are then not available in your request logs for debugging.

X-Veed-Media-Expiration-Secondsinteger

Number of seconds before the media URLs returned for this request expire. A value above the maximum is capped rather than rejected.

Request body

$schemastring uri

A URL to the JSON Schema for this object.

output_codec'vp9' | 'h264'

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.

refine_foreground_edgesboolean

Improves the quality of the extracted subject's edges.

subject_is_personboolean

Set to false when the subject is not a person.

video_urlstring uri required

URL of the source video to remove the background from.

Example request

{
  "$schema": "https://api.veed.io/schemas/VideoBackgroundRemovalFastInput.json",
  "output_codec": "vp9",
  "video_url": "https://static-assets.veed.io/api-examples/bg-fast-input.mp4"
}

Response

Accepted

$schemastring uri

A URL to the JSON Schema for this object.

Example response

{
  "$schema": "https://api.veed.io/schemas/ResourceVideoBackgroundRemovalJob.json",
  "data": {
    "result": {
      "files": [
        {
          "content_type": "video/mp4"
        }
      ]
    }
  }
}

Changes

    • warning

      added the new model_access_required enum value to the /// response property for the response status

    • warning

      added the new model_access_required enum value to the /// response property for the response status

    • warning

      added the new model_access_required enum value to the /// response property for the response status

    • warning

      added the new model_access_required enum value to the /// response property for the response status

    • warning

      added the new model_access_required enum value to the /// response property for the response status

    • warning

      added the new insufficient_credits enum value to the // response property for the response status