1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/veed-video-background-removal";
const data = {
"video_url": "https://segmind-resources.s3.amazonaws.com/input/veed-video-background-removal-input.mp4",
"mode": "standard"
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();The source video to remove the background from. Provide a clear, well-lit HD clip (mp4, mov, webm, m4v, gif) for the cleanest matte.
Chooses the matting engine. Use standard for best quality, fast for cheap high-volume jobs, green-screen for chromakey footage.
Allowed values:
Sharpens hair and fine edges at a higher per-frame rate. Keep on for hero content, off in fast mode to save cost. Standard/fast only.
Optimizes matting for the subject type. Leave true for people; set false for products and other objects. Standard/fast only.
Sets the output container. vp9 gives one WebM with alpha; h264 returns separate RGB + alpha URLs for higher RGB quality.
Allowed values:
Controls green-spill cleanup in green-screen mode only. Raise toward 1 if green remains; lower if subject colors shift.
min : 0,
max : 1
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
VEED Video Background Removal is an AI video matting API that separates subjects from their backgrounds in any video — no green screen required. Instead of frame-by-frame rotoscoping, the model analyzes pixel data, edges, and motion directly to produce a clean per-frame alpha matte for people and objects. Delivered through Segmind on fal.ai infrastructure, it turns ordinary talking-head clips, product shots, and webcam recordings into transparent, composite-ready footage in a single API call. You send a video URL, choose a mode, and receive an alpha-enabled result you can drop onto brand colors, custom images, or AI-generated scenes.
standard for best quality, fast for cheaper high-volume jobs, and green-screen for chromakey footage with green-spill suppression.refine_foreground_edges sharpens hair and fine details at a higher per-frame rate.subject_is_person tunes matting for human subjects versus objects.Use it to produce polished talking-head videos for social, YouTube, and course content without a studio. It shines for product demos and e-commerce clips where subjects need to sit cleanly on brand backgrounds, for webcam and screen-recording overlays, and for compositing pipelines that would otherwise require manual masking. Green-screen mode is ideal when you already shot on a chroma backdrop and want automatic keying with spill cleanup. Fast mode is built for high-volume, cost-sensitive batch workflows where slight edge artifacts are acceptable.
This is a parameter-driven model, not a prompt-driven one — quality comes from picking the right mode and toggles. Feed HD video where the subject is well-lit and clearly separated from the background for the cleanest mattes. Keep refine_foreground_edges on for hero content with visible hair or fine edges; turn it off in fast mode to cut cost on bulk jobs. Set subject_is_person true for people and false for objects. Choose VP9 for a simple single-file alpha workflow, or H264 when you need maximum RGB fidelity. In green-screen mode, raise spill_suppression_strength toward 1 if green fringing remains, or lower it if the subject's colors start to shift.
Do I need a green screen? No. Standard and fast modes remove backgrounds from any footage. Green-screen mode is a separate option for people who already shot on chroma.
What output formats does it return? VP9 (default) is a single WebM with an alpha channel; H264 returns JSON with separate RGB and alpha video URLs.
What video formats can I upload? MP4, MOV, WebM, M4V, and GIF, provided as a URL.
What's the difference between standard and fast? Standard prioritizes matte quality; fast trades a little edge precision for lower cost and quicker turnaround on large batches.
When should I turn on edge refinement? For close-ups and subjects with hair or intricate outlines where clean edges matter most — it improves quality at a higher per-frame rate.
Does it work for objects, not just people? Yes. Set subject_is_person to false to optimize matting for non-human subjects.