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

Vision Event ビデオをアップロード

動画クリップをワークスペースにアップロードし、Vision Event に添付すると、レビュー担当者がダッシュボードで再生できます。

概要

動画クリップには、次のような瞬間の前後で何が起きたかが映っています。 Vision Event 静止画像では捉えられないこともあります。各イベントには最大4本のクリップを添付できます。クリップはダッシュボードのイベント詳細ビューで再生されます( イベントの詳細を表示).

動画はMP4またはMOV形式で、最大3 GBまでです。動画はプロジェクトではなくワークスペースにアップロードされます。ブラウザーで再生できるMP4ファイルはそのまま保存されます。それ以外の動画はH.264 MP4に変換されます。非常に長い動画は変換に失敗する場合があります。

エッジデバイスのバックアップ では、デバイス上で録画されたクリップが自動的にアップロードされます。REST API経由でイベントを送信する場合は、このページの手順に従ってください。

HTTP API

動画の添付は、次の3つの手順で行います。

  1. アップロードを準備します。 videoId、 signedUrl、および requiredHeaders.

  2. 動画ファイルを、次の宛先に PUT リクエストで送信します。 signedUrlその際、 requiredHeadersに含まれるすべてのヘッダーを指定します。URLの有効期限は60分です。

  3. イベントを作成します。 その際、 videoId を videos[].sourceId.

イベントを作成する前に、Roboflowによる動画の処理が完了するのを待つ必要はありません。処理が完了すると、ダッシュボードでクリップを再生できるようになります。処理に失敗してもイベントは保持され、ダッシュボードには動画の処理失敗が表示されます。ファイルが送信されない場合、動画は pending のままとなり、ダッシュボードには処理中と表示され続けます。

必須スコープ: vision-events:write または device:update (アップロードの準備に必要)、および vision-events:read または device:read (ステータスの読み取りまたは再生URLの取得に必要)。

アップロードを準備する

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.

認可
Authorizationstring必須

Roboflow API key passed as a Bearer token.

本文
namestring · 最小: 1 · 最大: 1024必須

File name of the video.

Example: line-3-clip.mp4
contentTypestring · enum必須

MIME type of the video file.

Example: video/mp4可能な値:
レスポンス
201

Upload prepared.

application/json
successbooleanオプションExample: true
videoIdstringオプション

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

Example: Kq4vX8mNp2RtY6wZ1bCd
signedUrlstringオプション

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"
  }
}

次に、ファイルを signedUrlに送信します。 requiredHeaders の各ヘッダーをリクエストにコピーします。

PUT の後に必要な操作はありません。ファイルが届くと、Roboflowは動画の処理を開始します。

動画をイベントに添付する

イベントの videoId を videos 配列に指定して、 Vision Eventを作成する か、 イベントを一括作成します.

このエンドポイントで準備した動画のみ添付できます。データセットへの動画アップロード、または別のワークスペースから取得した videoId はイベントに保持されますが、警告が返され、再生できません。

アップロード状況を確認する

status は、 pending アップロードを準備した時点から、Roboflowによるファイルの処理が完了するまでの間は、 uploaded または failedになります。ファイルが届かなかった動画は、そのまま 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.

認可
Authorizationstring必須

Roboflow API key passed as a Bearer token.

パスパラメータ
videoIdstring · 最大: 256必須

The videoId returned by Prepare a Vision Event Video Upload.

レスポンス
200

Video status.

application/json
videoIdstringオプションExample: Kq4vX8mNp2RtY6wZ1bCd
statusstring · enumオプション

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.

可能な値:
posterUrlstringオプション

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

durationSecondsnumber · ヌル許容オプションExample: 12.4
contentTypestring · ヌル許容オプションExample: video/mp4
sizeBytesinteger · ヌル許容オプションExample: 18350080
filenamestring · ヌル許容オプションExample: 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"
}

再生URLを取得する

クエリ結果には 各動画の sourceId と label のみが含まれます。動画を再生またはダウンロードするURLを取得するには、このエンドポイントを呼び出してください。URLの有効期間は60分で、 null から status が uploadedになるとURLが設定されます。このURLを持つ人は誰でも動画を再生できるため、キャッシュしたり共有したりしないでください。

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.

認可
Authorizationstring必須

Roboflow API key passed as a Bearer token.

パスパラメータ
videoIdstring · 最大: 256必須

The videoId returned by Prepare a Vision Event Video Upload.

レスポンス
200

Video status and playback URL.

application/json
videoIdstringオプションExample: Kq4vX8mNp2RtY6wZ1bCd
statusstring · enumオプション

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.

可能な値:
posterUrlstringオプション

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

durationSecondsnumber · ヌル許容オプションExample: 12.4
contentTypestring · ヌル許容オプションExample: video/mp4
sizeBytesinteger · ヌル許容オプションExample: 18350080
filenamestring · ヌル許容オプションExample: line-3-clip.mp4
urlstring · ヌル許容オプション

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"
}

最終更新

役に立ちましたか?