The Video Matting API allows you to extract high-quality portrait subjects from video content with precise matting effects. This service provides an efficient way to isolate subjects, featuring customizable video bitrates and an optional green screen spill removal for professional background replacement workflows.
taskId.Enum: application/json
Bearer authentication token. Example: Bearer {{APIKey}}.
The URL of the source video file. Note: Only .mp4 format is supported.
Specifies the target video bitrate. Default: 16m. Supported units: k (kbps) or m (mbps).
Enables removal of color fringes (spill) typically caused by green screen backgrounds. Default: false.
Returns 0 for success, or a specific error code.
Returns "success" or a descriptive error message.
The unique identifier for the task. Use this ID with the Polling API to retrieve the generated output.
Use the Polling API to retrieve the processing results.
Alternatively, you can enable Callback to receive task results automatically upon completion.
{
"code": 0,
"message": "success",
"data": {
"task": {
"taskId": "2e25206a92fb497e9fc546cc6b099789",
"status": 3,
"taskType": "image_matting_process_image",
"reason": ""
},
"mattingResult": {
"mattingFileUrl": "https://dreamface-resource-aigc.oss-us-east-1.aliyuncs.com/apiDocsAdmin/2025-4-1744805123831-videoMatting_mattingFileUrl.mp4",
"mattingAlphaFileUrl": "https://dreamface-resource-aigc.oss-us-east-1.aliyuncs.com/apiDocsAdmin/2025-4-1744805292668-videoMatting_mattingAlphaFileUrl.mp4"
}
}
}curl -X POST 'https://api.newportai.com/api/async/image_matting_process_video' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {{APIKey}}' \
-d '{
"srcFileUrl": "https://d2t5pyzt5qvy2d.cloudfront.net/api/static_resource/prod/default/mq0MSmKgPGQQsxS9UovqH.mp4",
"bitRate": "16m",
"removeColorSpill": false
}'{
"code": 0,
"message": "success",
"data": {
"taskId": "2e25206a92fb497e9fc546cc6b099789"
}
}