Roboflow Docs
DashboardResourcesProducts
  • Product Documentation
  • Developer Reference
  • Changelog
  • Roboflow Documentation
  • Quickstart
  • Workspaces
    • Workspaces, Projects, and Models
    • Create a Workspace
    • Rename a Workspace
    • Delete a Workspace
  • Team Members
    • Invite a Team Member
    • Role-Based Access Control (RBAC)
    • Change a Team Member Role
    • Remove a Team Member
  • Single Sign On (SSO)
  • Workflows
    • What is Workflows?
    • Create a Workflow
    • Build a Workflow
    • Test a Workflow
    • Deploy a Workflow
    • Workflow Examples
      • Multimodal Model Workflow
    • Share a Workflow
    • Workflows AI Assistant
  • Enterprise Integrations
  • Workflow Blocks
    • Run a Model
      • Object Detection Model
      • Single-Label Classification Model
    • Visualize Predictions
      • Bounding Box Visualization
      • Label Visualization
      • Circle Visualization
      • Background Color Visualization
      • Classification Label Visualization
      • Crop Visualization
  • Dataset Management
    • Create a Project
    • Upload Images, Videos, and Annotations
      • Import Data from Cloud Providers
        • AWS S3 Bucket
        • Azure Blob Storage
        • Google Cloud Storage
      • Import from Roboflow Universe
    • Manage Datasets
      • Dataset Batches
      • Search a Dataset
      • Set Dataset Classes
      • Add Tags to Images
      • Create an Annotation Attribute
      • Download an Image
      • Delete an Image
    • Dataset Versions
      • Create a Dataset Version
      • Preprocess Images
      • Augment Images
      • Delete a Version
      • Export a Dataset Version
    • Dataset Analytics
    • Merge Projects
    • Rename a Project
    • Delete a Project
    • Project Folders
    • Make a Project Public
  • Annotate
    • Introduction to Roboflow Annotate
    • Annotate an Image
      • Keyboard Shortcuts
      • Comment on an Image
      • Annotation History
      • Similarity Search
    • AI Labeling
      • Label Assist
      • Enhanced Smart Polygon with SAM
        • Smart Polygon (Legacy)
      • Box Prompting
      • Auto Label
    • Set Keypoint Skeletons
    • Annotate Keypoints
    • Annotate Multimodal Data
    • Collaborate on Labeling
    • Annotation Insights
  • Managed Labeling
  • Train
    • Train a Model
      • Train from a Universe Checkpoint
      • Train from Azure Vision
      • Train from Google Cloud
    • Roboflow Instant
    • Cancel a Training Job
    • Stop Training Early
    • View Training Results
    • View Trained Models
    • Evaluate Trained Models
  • Download a Dataset Version
  • Deploy
    • Deploy a Model or Workflow
    • Managed Deployments
    • Serverless Hosted API V2
      • Use in a Workflow
      • Use with the REST API
      • Run an Instant Model
    • Serverless Hosted API
      • Object Detection
      • Classification
      • Instance Segmentation
        • Semantic Segmentation
      • Keypoint Detection
      • Foundation Models
        • CLIP
        • OCR
        • YOLO-World
      • Video Inference
        • Use a Fine-Tuned Model
        • Use CLIP
        • Use Gaze Detection
        • API Reference
        • Video Inference JSON Output Format
      • Pre-Trained Model APIs
        • Blur People API
        • OCR API
        • Logistics API
        • Image Tagging API
        • People Detection API
        • Fish Detection API
        • Bird Detection API
        • PPE Detection API
        • Barcode Detection API
        • License Plate Detection API
        • Ceramic Defect Detection API
        • Metal Defect Detection API
    • Dedicated Deployments
      • Create a Dedicated Deployment
      • Make Requests to a Dedicated Deployment
      • Manage Dedicated Deployments with an API
    • Batch Processing
    • SDKs
      • Python inference-sdk
      • Web Browser
        • inferencejs Reference
        • inferencejs Requirements
      • Lens Studio
        • Changelog - Lens Studio
      • Luxonis OAK
    • Upload Custom Model Weights
    • Download Model Weights
    • Enterprise Deployment
      • License Server
      • Offline Mode
      • Kubernetes
      • Docker Compose
    • Monitor Deployed Models
      • Alerting
  • Universe
    • What is Roboflow Universe?
    • Find a Dataset on Universe
    • Explore Images in a Universe Dataset
    • Fork a Universe Dataset
    • Find a Model on Universe
    • Download a Universe Dataset
  • Set a Project Description
  • View Project Analytics
  • Support
    • Share a Workspace with Support
    • Delete Your Roboflow Account
    • Apply for Academic Credits
  • Billing
    • Premium Trial
    • Credits
      • View Credit Usage
      • Enable or Disable Flex Billing
      • Purchase Prepaid Credits
    • Plans
      • Purchase a Plan
      • Cancel a Plan
      • Update Billing Details
      • Update Payment Method
      • View Invoices
Powered by GitBook
On this page
  • Base URL
  • API Methods

Was this helpful?

  1. Deploy
  2. Serverless Hosted API
  3. Video Inference

API Reference

PreviousUse Gaze DetectionNextVideo Inference JSON Output Format

Last updated 9 days ago

Was this helpful?

The Video Inference API can be used through the Roboflow Python SDK and through a REST API.

Base URL

The API uses the following URL:

https://api.roboflow.com

API Methods

We highly recommend accessing video inference via the roboflow Pip package. The raw Video Inference API at https://api.roboflow.com has three methods:

METHOD
DESCRIPTION

POST /video_upload_signed_url/?api_key={{WORKSPACE_API_KEY}}

This endpoint returns a signed URL where a user can upload video. The endpoint accepts a JSON input with the filename, like so

A signed URL is returned

You can then use your favorite upload program (like cURL) to PUT your video file to the signed URL.

POST /videoinfer/?api_key={{WORKSPACE_API_KEY}}

The endpoint accepts a json input to schedule a video inference job for processing. Note that the INPUT_URL can be any publicly available URL, you don't need to first create a signed URL and then upload a video to Roboflow.

An example showing the body of the request is shown below:

Please be noted that models[*].inference_params is optional.

The response is a JSON string, like so

You can specify multiple models in the models array. The infer_fps field should be at least set to 1 and its value should not exceed the video frame-rate. For most use-cases, the video frame rate is an exact multiple of the infer_fps .

/videoinfer/?api_key={{WORKSPACE_API_KEY}}&job_id={{JOB_ID}}

This endpoint returns the current status of the job. This endpoint is rate-limited, please don't poll this endpoint more than once per minute. When the job is successful, the returned JSON's status key is set to 0, and the output_signed_url key contains the download link for the video inference results. If the status is set to 1, it indicates that the job processing is not complete. Any higher values indicates job failure.

Once you have downloaded the JSON file stored from the output_signed_url location, you can parse it to obtain inference information. The format of the json file is .

{
    "file_name": "my_video_file.mp4"
}
{
    "signed_url": "https://storage.googleapis.com/roboflow_video_inference_input/GNPwawe7dxWthlZZ24r72VRTV852/oct27_video_file.mp4?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=roboflow-staging%40appspot.gserviceaccount.com%2F2023110......."
}
curl -X PUT "my_signed_url" \
-H "Content-Type: application/octet-stream" \
--data-binary "@your_video.mp4"
{
    "input_url": "{{INPUT_URL}}",
    "infer_fps": 5,
    "models": [
        {
            "model_id": "rock-paper-scissors-presentation",
            "model_version": "4",
            "inference_type": "object-detection",
            "inference_params": {"confidence": 0.4}
        }
    ]
}
{
    "job_id": "fec28362-f7d9-4cc0-a805-5e94495d063d",
    "message": "This endpoint will create videojob"
}
described here
GET