Initiates an asynchronous foreground mask generation job for a video.
Response behavior:
- Returns HTTP 202 with
request_idandstatus_url - Check job status by polling
status_urlor by calling the status endpoint with therequest_iduntil a terminal status is returned
Supported input containers:
- .mp4, .mov, .webm, .avi, .gif
Supported input codecs:
- H.264, H.265 (HEVC), VP9, AV1, PhotoJPEG
Input attributes preserved in output:
- Aspect Ratio and resolution
- Frame Rate
- Audio if present
Limits:
- Max input duration: 60 seconds
- Resolutions: Input resolution up to 16000x16000 (16K). Inputs larger than this return 413 Payload Too Large. Output resolution matches the input resolution.
Security
api_token
Publicly accessible URL of the input video. Input resolution supported up to 16000x16000 (16K)
Output container and codec preset
Default:"mp4_h264"
Enum:"mp4_h264""mp4_h265""webm_vp9""mov_h265""mov_proresks""mkv_h264""mkv_h265""mkv_vp9""gif"
Optional URL for receiving the result via webhook when the async job completes. See webhooks.
POST
from bria_client import BriaSyncClient
client = BriaSyncClient() # reads BRIA_API_TOKEN
job = client.submit(
endpoint="video/generate/foreground_mask",
payload={
"video": "example",
},
)
result = client.poll(job, interval=5, timeout=600)
print(result.result.video_url)Response
{ "request_id": "string", "status_url": "string" }