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.
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.


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
Open "Add Video Source", select "RTMP Stream", enter "Source Name", and click "Create stream source".
Select a protocol. Prefer RTMPS when your publisher supports it: RTMP sends video and the stream key unencrypted.
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.
Start broadcasting and wait for live video, then choose "Run a Workflow".

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.
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.
Roboflow API key or OAuth access token.
Workspace URL slug.
Include workspace temporary sessions.
falseSuccessful response.
The request is invalid.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
The request rate is too high.
A required upstream service is temporarily unavailable.
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.
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.
Roboflow API key or OAuth access token.
Workspace URL slug.
Cloud Streaming source ID from the source list.
^[^/\\]+$Optional source placement cell. Omit for server selection.
Successful response.
The request is invalid.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
Source placement is unavailable, conflicts with active/fixed placement, or the temporary session has ended.
The request rate is too high.
A required upstream service is temporarily unavailable.
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.
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.
Roboflow API key or OAuth access token.
Workspace URL slug.
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.
run-warehouse-camera-001Pattern: ^[A-Za-z0-9._:-]+$Session display name.
Browser previewOptional enabled temporary-source cell allowed for this workspace. Omit for server placement.
^[a-z0-9-]{1,63}$Successful response.
Allocated temporary source ID.
^tmp-[a-f0-9]{40}$Deadline to admit the publisher. Unix time in milliseconds.
Credentialed single-publisher WHIP URL. Use unchanged and never log, persist or share it.
The request is invalid.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
The idempotency key conflicts, the prior session ended, temporary sessions are unavailable, placement failed, or the publishing-grant limit was reached.
The request rate is too high.
A required upstream service is temporarily unavailable.
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.
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.
Roboflow API key or OAuth access token.
Workspace URL slug.
Cloud Streaming source ID from the source list.
^tmp-[a-f0-9]{40}$Successful response.
The request is invalid.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
The request rate is too high.
A required upstream service is temporarily unavailable.
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?