Green-screen-free human video matting: auto-detect the subject in the first frame (or specify it), then cut it out frame by frame, producing a temporally stable WebM/VP9 transparent video with an alpha channel and hair-level soft edges.
The checkerboard indicates transparent areas (for visualization only). Foreground and background are complementary and reconstruct the original when stacked. The API actually returns a transparent WebM (VP9 / yuva420p) — overlay it with an alpha-aware tool (CapCut / Premiere / After Effects, or ffmpeg overlay). ⚠️ When re-encoding, keep the alpha (VP9 / yuva420p); converting to AV1 or yuv420p drops the alpha channel.
Usage Limits
Input video duration must be within 10 minutes (10 minutes inclusive). Longer videos are rejected by the server with error code 6019 and no task is created. Trim or compress to within 10 minutes before submitting.
Create Task
Basic Information
Item
Value
Request Method
POST
Request Path
/task/video_matting
Content-Type
application/json
Authentication
Raw API key in the Authorization header
Request Body
Parameter
Type
Required
Default
Description
file_id
string
Yes
-
Uploaded video file ID
target_mode
string
No
auto
First-frame subject selection: auto detects the subject; mask uses mask_file_id
mask_file_id
string
Conditional
-
First-frame binary mask image file ID (required when target_mode=mask)
output_format
string
No
webm
Transparent output container; currently webm (VP9 alpha)
max_size
integer
No
-
Long-edge downscale cap (VRAM/speed); original resolution if omitted
output_background
boolean
No
false
Also output the background video after matting (subject transparent, complementary to the foreground)