Skip to content
Last updated

Video Upload Service

Most Bria video endpoints take a video parameter that points to a publicly accessible URL. When your video lives on your own machine rather than at a public URL, use the upload service to get a temporary hosted URL you can pass straight into those endpoints.

The flow is three steps:

  1. Request a presigned upload URL. Call POST /v2/video/upload to get an upload_url, the upload_fields needed to authenticate the upload, and the file_url your video will live at.
  2. Upload the file. POST the video directly to upload_url as multipart form data.
  3. Process the video. Pass file_url as the video input to any video editing endpoint.

Upload and process a local video

client.upload() wraps all three steps and returns the hosted URL:

from bria_client import BriaSyncClient

client = BriaSyncClient()  # reads BRIA_API_TOKEN

file_url = client.upload("path/to/video.mp4", media_type="video/mp4")

job = client.submit(endpoint="video/edit/remove_background", payload={"video": file_url})
result = client.poll(job, interval=5, timeout=600)
print(result.result.video_url)

The HTTP API

Step 1: Request a presigned upload URL

POST /v2/video/upload

Body (JSON)

FieldTypeRequiredDescription
media_typestringNoMIME type of the video you intend to upload, e.g. "video/mp4". When omitted, the server falls back to a "video/" content-type prefix.

An empty body ({}) is also valid.

Response (result)

FieldTypeDescription
upload_urlstringPresigned URL to upload your video to. Valid for 1 hour.
upload_fieldsobjectPresigned form fields (key, policy, signature, etc.) that must be included in the upload POST to authenticate it.
file_urlstringThe URL your video will be available at after upload. Pass this as the video input to any video endpoint. Valid for 1 day.

Step 2: Upload the file

POST the video to upload_url as multipart/form-data. The upload_fields must be sent as form fields before the file field: they are validated in order, so the file must come last. A successful upload returns HTTP 204 No Content.

Step 3: Process the video

Pass file_url as the video input to any video editing endpoint, for example POST /v2/video/edit/remove_background with { "video": "<file_url>" }. Video endpoints are asynchronous: a successful call returns HTTP 202 with a request_id and a status_url. Poll it until status is COMPLETED (or ERROR); the finished video is then available at result.video_url. See Async requests and polling.

Limits and expiry

ConstraintValue
Content typeVideo files only
Max file size1 GB
upload_url validity1 hour
file_url validity1 day

Security note: Both upload_url and file_url are unauthenticated. Anyone holding either can upload to or download from your file. Treat them as secrets and do not share them beyond your processing pipeline.