video_matting
Extract a clean alpha foreground from video with temporal smoothing and optional shadow preservation, then export transparent WebM/MOV or composite onto replacement backgrounds, retaining audio.
Instructions
Extract a clean AI-matted alpha foreground from a single video clip with 3-frame temporal edge smoothing and optional contact-shadow preservation, then export transparent alpha video (VP9 WebM / ProRes 4444 MOV) and/or composite onto 1..N replacement background images while preserving original audio.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"src_video": "<src_video>",
"out_dir": "<out_dir>"
},
"name": "video_matting"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | rembg segmentation model (e.g. isnet-general-use, u2net, u2net_human_seg, birefnet-general). | isnet-general-use |
| out_dir | Yes | Output directory for alpha video(s), composited MP4(s), and preview strip. | |
| src_video | Yes | Path to input foreground video file. | |
| blur_sigma | No | Slight Gaussian blur applied to replacement backgrounds for natural depth of field. | |
| keep_audio | No | Preserve original audio track in composited MP4 outputs. | |
| max_frames | No | Optional frame cap for quick preview runs (0 = process full video). | |
| backgrounds | No | Optional list of replacement background image paths. | |
| export_webm | No | Export transparent VP9 WebM (yuva420p). | |
| keep_shadow | No | Preserve subtle natural floor contact shadow on replacement backgrounds. | |
| chroma_boost | No | Optional soft alpha rescue for glowing/translucent props of a dominant color. | none |
| export_prores | No | Export transparent ProRes 4444 MOV (yuva444p10le, large file). | |
| backgrounds_dir | No | Optional directory of background images to batch-composite onto. |