For the complete documentation index, see llms.txt. This page is also available as Markdown.

Upload a Vision Event Video

Upload a video clip to your workspace and attach it to a Vision Event so reviewers can play it in the dashboard.

About

A video clip shows what happened around the moment a Vision Event was recorded, which a still image can miss. You can attach up to four clips to each event. Clips play in the event detail view of the dashboard (see View Event Details).

Videos must be MP4 or MOV files up to 3 GB. They are uploaded to your Workspace, not to a Project. MP4 files that browsers can play are stored as they are. Other videos are converted to H.264 MP4, and a very long video can fail conversion.

Edge Device Backup uploads clips recorded on the device for you. Use the steps on this page when you send events through the REST API.

HTTP API

Attaching a video takes three steps:

  1. Prepare the upload. You get a videoId, a signedUrl, and requiredHeaders.

  2. Send the video file with a PUT request to signedUrl, with every header in requiredHeaders. The URL expires after 60 minutes.

  3. Create the event with the videoId in videos[].sourceId.

You do not need to wait for Roboflow to process the video before you create the event. The clip plays in the dashboard as soon as processing finishes. If processing fails, the event is kept and the dashboard shows the video as failed. If the file is never sent, the video stays pending and the dashboard keeps showing it as processing.

Required scope: vision-events:write or device:update to prepare an upload, and vision-events:read or device:read to read status or get a playback URL.

Prepare the Upload

Prepare a Vision Event Video Upload

post

Create a pending video in the workspace and return a signed URL to PUT the file to. Videos can be up to 3 GB. Reference the returned videoId in an event's videos array. Requires the vision-events:write or device:update scope.

Authorizations
AuthorizationstringRequired

Roboflow API key passed as a Bearer token.

Body
namestring · min: 1 · max: 1024Required

File name of the video.

Example: line-3-clip.mp4
contentTypestring · enumRequired

MIME type of the video file.

Example: video/mp4Possible values:
Responses
201

Upload prepared.

application/json
successbooleanOptionalExample: true
videoIdstringOptional

Put this in videos[].sourceId when you create the event.

Example: Kq4vX8mNp2RtY6wZ1bCd
signedUrlstringOptional

URL to PUT the video file to. It expires after 60 minutes.

Example: https://storage.googleapis.com/...
post/vision-events/videos/prepare-upload
POST /vision-events/videos/prepare-upload HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 52

{
  "name": "line-3-clip.mp4",
  "contentType": "video/mp4"
}
{
  "success": true,
  "videoId": "Kq4vX8mNp2RtY6wZ1bCd",
  "signedUrl": "https://storage.googleapis.com/...",
  "requiredHeaders": {
    "x-goog-content-length-range": "1,3221225472",
    "x-goog-if-generation-match": "0"
  }
}

Then send the file to signedUrl. Copy each header from requiredHeaders into the request:

Nothing else is needed after the PUT. Roboflow starts processing the video when the file arrives.

Attach the Video to an Event

Put the videoId in the event's videos array when you create a Vision Event or batch create events.

Only videos prepared with this endpoint can be attached. A videoId from a dataset video upload, or from another workspace, is kept on the event but returns a warning and does not play.

Check the Upload Status

status is pending from the moment you prepare the upload until Roboflow finishes processing the file, then uploaded or failed. A video whose file never arrives stays pending.

Get Vision Event Video Status

get

Read the processing status and details of a video prepared for Vision Events. Requires the vision-events:read or device:read scope.

Authorizations
AuthorizationstringRequired

Roboflow API key passed as a Bearer token.

Path parameters
videoIdstring · max: 256Required

The videoId returned by Prepare a Vision Event Video Upload.

Responses
200

Video status.

application/json
videoIdstringOptionalExample: Kq4vX8mNp2RtY6wZ1bCd
statusstring · enumOptional

pending from the moment the upload is prepared until Roboflow finishes processing the file, then uploaded or failed. A video whose file is never sent stays pending.

Possible values:
posterUrlstringOptional

Public URL of a still frame from the video. It returns 404 until status is uploaded.

durationSecondsnumber · nullableOptionalExample: 12.4
contentTypestring · nullableOptionalExample: video/mp4
sizeBytesinteger · nullableOptionalExample: 18350080
filenamestring · nullableOptionalExample: line-3-clip.mp4
get/vision-events/videos/{videoId}
GET /vision-events/videos/{videoId} HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "videoId": "Kq4vX8mNp2RtY6wZ1bCd",
  "status": "pending",
  "posterUrl": "text",
  "durationSeconds": 12.4,
  "contentType": "video/mp4",
  "sizeBytes": 18350080,
  "filename": "line-3-clip.mp4"
}

Get a Playback URL

Query results list each video's sourceId and label only. Call this endpoint to get a URL that plays or downloads one video. The URL works for 60 minutes and is null until status is uploaded. Anyone holding the URL can play the clip, so do not cache or share it.

Get a Vision Event Video Playback URL

get

Return the video's status and details plus a signed URL that plays it. The response is sent with Cache-Control private, no-store. Requires the vision-events:read or device:read scope.

Authorizations
AuthorizationstringRequired

Roboflow API key passed as a Bearer token.

Path parameters
videoIdstring · max: 256Required

The videoId returned by Prepare a Vision Event Video Upload.

Responses
200

Video status and playback URL.

application/json
videoIdstringOptionalExample: Kq4vX8mNp2RtY6wZ1bCd
statusstring · enumOptional

pending from the moment the upload is prepared until Roboflow finishes processing the file, then uploaded or failed. A video whose file is never sent stays pending.

Possible values:
posterUrlstringOptional

Public URL of a still frame from the video. It returns 404 until status is uploaded.

durationSecondsnumber · nullableOptionalExample: 12.4
contentTypestring · nullableOptionalExample: video/mp4
sizeBytesinteger · nullableOptionalExample: 18350080
filenamestring · nullableOptionalExample: line-3-clip.mp4
urlstring · nullableOptional

Signed URL that plays the video. It expires after 60 minutes. null until status is uploaded.

get/vision-events/videos/{videoId}/url
GET /vision-events/videos/{videoId}/url HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "videoId": "Kq4vX8mNp2RtY6wZ1bCd",
  "status": "pending",
  "posterUrl": "text",
  "durationSeconds": 12.4,
  "contentType": "video/mp4",
  "sizeBytes": 18350080,
  "filename": "line-3-clip.mp4",
  "url": "text"
}

Last updated

Was this helpful?