Video Editing
/- Generate Mask by Key Points
Generate Mask by Prompt
Foreground Mask
Generate Mask by Key Poin...
Generates a segmentation mask video based on coordinate key points.
Response behavior:
- Returns HTTP 202 with
request_idandstatus_url - The final result (via status endpoint) will contain a
mask_url.
Constraints:
- Max Duration: 5 seconds (Truncated if
auto_trim=true). - Max Resolution: 750p.
Security
api_token
An array of coordinate objects defining the mask hints.
- positive: Inclusion points. These coordinates identify areas that SHOULD be part of the mask.
- negative: Exclusion points. These coordinates identify areas that SHOULD NOT be part of the mask.
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/segment/mask_by_key_points",
payload={
"video": "example",
"frame_index": 88,
"key_points": [
{
"x": 650,
"y": 400,
"type": "positive",
},
{
"x": 655,
"y": 405,
"type": "positive",
},
{
"x": 50,
"y": 100,
"type": "negative",
},
],
},
)
result = client.poll(job, interval=5, timeout=600)
print(result.result.video_url)Response
{ "request_id": "string", "status_url": "string" }