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

Connect a Source

Connect USB, RTSP, ONVIF, webcam, phone, or direct RTMP video to Cloud Streaming and understand each source's lifetime.

A source supplies video to Cloud Streaming. Connecting it does not start a Workflow. After confirming live video, run a Workflow on the source.

Source
Connection
Lifetime

USB, RTSP, or ONVIF camera

Video Connector on the camera's computer or network

Reusable source while the connector and camera are available

Connector-local file

Video Connector with a files directory

Looping live test source, not a finite batch upload

Browser webcam or phone QR session

Browser camera publisher

Temporary session, previews only

RTMP or RTMPS publisher

Direct publishing URL from the app

Reusable direct source

Web App

USB cameras

Install and start a connector and allow camera access on its computer. Supported USB cameras appear in "Cloud Streaming" after discovery. Confirm the source's live preview, not just its cached thumbnail. To change resolution, frame rate, or bitrate, use "Capture Settings" on the source page (see Capture and codec settings).

RTSP and ONVIF cameras

Open the connector in "Cloud Streaming" and find "RTSP Cameras" (update the connector if it is missing).

To add a known stream, click "Add by RTSP URL", enter a name and the camera's complete RTSP URL, put the username and password in their own fields, and click "Add camera".

For ONVIF discovery, choose a camera from "Cameras found on the network", enter its credentials, and select a compatible profile. The connector must reach the camera from its own network, and no source exists until the camera's stream resolves.

Wait for "Applied" and a live source before starting processing. If the panel shows "Rejected by the connector", read the reason, fix the configuration, and save again.

Editing a camera can interrupt its stream. Removing it stops the stream, and adding it again creates a new source: Workflow bindings and history stay with the old one. Roboflow stores camera credentials and delivers them to the connector, so keep them out of screenshots and logs.

Temporary webcam and phone sessions

In the Agent or the Workflow editor's stream setup, choose "Webcam" or "Phone" and allow camera access. For a phone, scan the QR code. Keep pairing codes and QR codes private.

While the phone streams, use the camera menu under the preview to switch lenses (ex: Back Ultra Wide Camera, Back Telephoto Camera, Front Camera). The stream keeps running. The menu shows only when the phone lists more than one camera and its browser supports switching.

Agent test-source picker with File, Webcam and Stream options.
Choose Webcam to begin a temporary browser-camera preview.
Connect your phone panel with QR pairing instructions and an expiry timer.
Scan the phone pairing code and keep the publishing page open for the session.

A publisher disconnect or a session stop ends the session and its jobs. A preview also ends if its controlling browser closes, even while a phone still publishes. Temporary sources run previews only and cannot be promoted; for continuous processing, use a connector or direct source.

Direct RTMP and RTMPS

Direct ingest is shown as "RTMP Stream" with a "Pilot" label. Do not infer support for a specific camera, encoder, or firmware from the protocol name alone.

  1. Open "Add Video Source", select "RTMP Stream", enter "Source Name", and click "Create stream source".

  2. Select a protocol. Prefer RTMPS when your publisher supports it: RTMP sends video and the stream key unencrypted.

  3. Copy "Server URL" and "Stream Key" into your camera or encoder. If it accepts one address, use "Copy full URL" and leave its key field empty.

  4. Start broadcasting and wait for live video, then choose "Run a Workflow".

RTMP Stream Pilot setup with RTMPS selected and a masked stream key.
Copy the offered publishing details into your encoder. Keep the stream key private.

Use the URLs the app returns rather than building a hostname or changing the URL scheme yourself.

Reopen "Connection Settings" to get the details or rotate the key. "Rotate key" invalidates the old key for both protocols, so update the publisher and broadcast again. Changing the protocol in the app does not rotate the key or change a running publisher.

After a disconnect or key rotation, check both incoming video and the Workflow's state: a connected publisher does not prove frames arrive, and a live source does not prove the Workflow resumed. See restart behavior.

Capture and codec settings

Use "Capture Settings" in Roboflow to adjust supported USB camera settings when the connector supports app-managed settings. Choose a mode the camera reports. An older connector can show current settings without allowing edits; update it to change them. Configured FPS is a capture setting, not a guarantee of processing throughput.

A saved change is the desired configuration, not proof it has taken effect: wait for the applied state. If the connector is offline, the change waits; a rejected setting leaves the last applied setting in place. Applying a change can restart that camera's stream and interrupt video.

RTSP cameras normally use the camera's own encoded stream without re-encoding. Connector USB settings do not lower an RTSP camera's resolution, FPS, or bandwidth. Change the camera's profile or encoder settings instead.

For broad browser playback compatibility, use H.264 without B frames, preferably a baseline profile. H.265 or H.264 with B frames can reach the relay but fail browser playback. Changing transport alone does not fix an incompatible codec; use a compatible camera profile or deliberate transcoding on a capable host.

Connector CLI

Loop a local file

To register videos from a local directory:

The connector replays these files as looping live sources. Live processing can skip frames to keep up. For a finite job that processes a stored file to completion, upload the file instead or use Batch Processing. The file's location on the connector does not make it a cloud batch upload.

Control thumbnails

The connector can take small still images for the source list, including shortly after discovery and on later refreshes. This can briefly turn on a camera's indicator light even when no Workflow is running. RTSP thumbnail capture may open a separate short camera session.

Turn off "Camera thumbnails" on the connector's page to stop future captures, or launch with --no-thumbnails as a local override. Disabling capture does not erase an existing thumbnail. A thumbnail is not live video, a recording, or proof that processing is running.

HTTP API

Use API authentication with a credential for the workspace in the path. Use the Roboflow app to add RTSP cameras, configure connectors, create direct RTMP sources, and rotate publishing keys. The API has no endpoints for these.

List registered sources

List sources, choose the intended source ID, and check its availability before creating a job. Include temporary sources only when needed. A source record does not contain its camera's publishing credentials.

List Cloud Streaming sources

get

Lists registered sources without stream credentials. Temporary sessions are excluded unless requested. The response contains sources only, not jobs or a webcam-availability flag. Requires video-inference-job:read. Use a workspace API key or OAuth access token for the workspace in the path. Device-bound keys are not accepted.

Authorizations
AuthorizationstringRequired

Roboflow API key or OAuth access token.

Path parameters
workspacestringRequired

Workspace URL slug.

Query parameters
includeTemporarybooleanOptional

Include workspace temporary sessions.

Default: false
Responses
200

Successful response.

application/json
get/{workspace}/video-sources/v1
GET /{workspace}/video-sources/v1 HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "sources": [
    {
      "id": "SOURCE_ID",
      "workspace": "WORKSPACE_ID",
      "kind": "usb",
      "name": "Warehouse camera",
      "status": "connected",
      "availableProcessorSizes": [
        "gpu-s-v1",
        "gpu-m-v1",
        "gpu-l-v1"
      ],
      "persistentWorkflowsAvailable": true
    }
  ]
}

Preview source video

Request input playback before assigning a Workflow. A source preview creates video demand; it does not perform model inference. Treat any returned playback URL as a credential, use it only for the intended viewer, and keep it out of logs, persistent storage, and screenshots.

Preview raw source video

post

Requests source demand and placement, not Workflow inference. For connector sources, renew the five-minute demand lease while viewing. Direct-source grants include expiresAt; reacquire before it expires. Returns raw-source playback credentials or an uploaded-file playback URL. These grants are sensitive and can include a long-lived connector source credential. Requires video-inference-job:create. Use a workspace API key or OAuth access token for the workspace in the path. Device-bound and folder-scoped credentials are not accepted.

Authorizations
AuthorizationstringRequired

Roboflow API key or OAuth access token.

Path parameters
workspacestringRequired

Workspace URL slug.

sourceIdstring · min: 1 · max: 256Required

Cloud Streaming source ID from the source list.

Pattern: ^[^/\\]+$
Body
cellstring · nullableOptional

Optional source placement cell. Omit for server selection.

Responses
200

Successful response.

application/json
or
post/{workspace}/video-sources/v1/{sourceId}/preview
POST /{workspace}/video-sources/v1/{sourceId}/preview HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 2

{}
{
  "kind": "live",
  "cell": "CELL_ID",
  "placementGeneration": 1,
  "whepUrl": "https://relay.example.invalid/src-SOURCE_ID/whep?key=READ_GRANT"
}

Allocate a temporary session

Allocate a separate session for each browser publishing attempt and use a stable idempotency key when retrying that same attempt. Use the returned WHIP URL unchanged to publish video before its grant expires. Allocation alone does not publish camera frames.

Allocate a temporary source

post

Allocates one WHIP publishing session. The publishing grant admits one publisher within two minutes. At most four unexpired publishing grants may be outstanding per workspace. Repeating the same request and Idempotency-Key returns the same live session, not a renewed grant. A stopped session cannot be revived by replay. Its jobs end when the publisher is lost or the session is stopped. This is source allocation, not a browser capture, recording or reconnect API. Requires video-inference-job:create. Use a workspace API key or OAuth access token for the workspace in the path. Device-bound and folder-scoped credentials are not accepted.

Authorizations
AuthorizationstringRequired

Roboflow API key or OAuth access token.

Path parameters
workspacestringRequired

Workspace URL slug.

Header parameters
Idempotency-Keystring · min: 8 · max: 128Required

A unique key for one start attempt. Reuse the same key, request and credential after a lost response. Use a new key only for a new attempt.

Example: run-warehouse-camera-001Pattern: ^[A-Za-z0-9._:-]+$
Body
namestring · min: 1 · max: 100Optional

Session display name.

Default: Browser preview
cellstringOptional

Optional enabled temporary-source cell allowed for this workspace. Omit for server placement.

Pattern: ^[a-z0-9-]{1,63}$
Responses
200

Successful response.

application/json
sourceIdstringRequired

Allocated temporary source ID.

Pattern: ^tmp-[a-f0-9]{40}$
grantExpiresAtinteger · int64Required

Deadline to admit the publisher. Unix time in milliseconds.

whipUrlstring · uriRequired

Credentialed single-publisher WHIP URL. Use unchanged and never log, persist or share it.

post/{workspace}/video-sources/v1/temporary
POST /{workspace}/video-sources/v1/temporary HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 26

{
  "name": "Browser preview"
}
{
  "source": {
    "id": "tmp-0000000000000000000000000000000000000000",
    "kind": "temporary",
    "name": "Browser preview",
    "status": "awaiting_video",
    "persistentWorkflowsAvailable": false
  },
  "sourceId": "tmp-0000000000000000000000000000000000000000",
  "grantExpiresAt": 1800000120000,
  "whipUrl": "https://relay.example.invalid/src-SESSION_ID/whip?key=PUBLISH_GRANT"
}

Temporary session jobs are previews only. The publishing session and its job owner have separate lifetimes; see temporary preview ownership.

Stop a temporary session

Stop the session when capture is finished. This revokes publishing access and cancels its jobs. Stopping a Workflow job alone is different from ending its source session.

End a temporary source session

post

Invalidates the session's publisher credential, requests publisher disconnection and cancels its jobs. Use this only for a temporary source. Requires video-inference-job:create. Use a workspace API key or OAuth access token for the workspace in the path. Device-bound and folder-scoped credentials are not accepted.

Authorizations
AuthorizationstringRequired

Roboflow API key or OAuth access token.

Path parameters
workspacestringRequired

Workspace URL slug.

sourceIdstringRequired

Cloud Streaming source ID from the source list.

Pattern: ^tmp-[a-f0-9]{40}$
Responses
200

Successful response.

application/json
stopRequestedconst: Required
post/{workspace}/video-sources/v1/{sourceId}/stop-session
POST /{workspace}/video-sources/v1/{sourceId}/stop-session HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "source": {
    "id": "SOURCE_ID",
    "workspace": "WORKSPACE_ID",
    "kind": "usb",
    "name": "Warehouse camera",
    "status": "connected",
    "availableProcessorSizes": [
      "gpu-s-v1",
      "gpu-m-v1",
      "gpu-l-v1"
    ],
    "persistentWorkflowsAvailable": true
  },
  "stopRequested": true
}

Last updated

Was this helpful?