> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/connect-a-source.md).

# 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](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/run-a-workflow.md) on the source.

<table data-search="false"><thead><tr><th>Source</th><th>Connection</th><th>Lifetime</th></tr></thead><tbody><tr><td>USB, RTSP, or ONVIF camera</td><td>Video Connector on the camera's computer or network</td><td>Reusable source while the connector and camera are available</td></tr><tr><td>Phone with the Roboflow Outpost app</td><td>App on the phone</td><td>Reusable source while the app streams</td></tr><tr><td>Connector-local file</td><td>Video Connector with a files directory</td><td>Looping live test source, not a finite batch upload</td></tr><tr><td>Browser webcam or phone QR session</td><td>Browser camera publisher</td><td>Temporary session, previews only</td></tr><tr><td>RTMP or RTMPS publisher</td><td>Direct publishing URL from the app</td><td>Reusable direct source</td></tr></tbody></table>

## Web App

### USB cameras

[Install and start a connector](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/install-a-connector.md) 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](#capture-and-codec-settings)).

### RTSP and ONVIF cameras

Open the connector in "Cloud Streaming" and find "RTSP Cameras". You can also click "Add Video Source", then "Connect a Camera", and pick a connector on the camera's network under "Add to an existing connector". [Update the connector](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/install-a-connector.md#preserve-state-when-updating) if the app asks. A connector holds up to 50 cameras added this way.

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

Click "Add" next to a camera under "Cameras found on the network", enter its "Username" and "Password", then click "Add camera". Once it resolves, choose a profile from its dropdown.

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 and adding it again creates a new source. You cannot read a saved password back.

### Phone app

To use a phone as a permanent camera, click "Add Video Source", then "Phone". Scan the code for your phone's store (App Store or Google Play) and install the Roboflow Outpost app. Sign in, pick your workspace, and start streaming. The phone appears as a source. The app keeps streaming in the background and reconnects on its own.

* [iOS Roboflow Outpost](https://apps.apple.com/us/app/roboflow-outpost/id6813159424)
* [Android Roboflow Outpost](https://play.google.com/store/apps/details?id=com.roboflow.connector)

### Cameras by URL

A camera that accepts connections from the internet needs no connector. Select the "Camera URL" tab in "Add Video Source" and enter its RTSP or RTSPS URL, or an HLS playlist URL. See [Add Cameras by URL](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/add-cameras-by-url.md).

### Verkada cameras

Select the "Verkada" tab in "Add Video Source" to connect a Verkada organization with an API key and add its cameras. See [Verkada Cameras](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/verkada.md).

### Temporary webcam and phone sessions

Stream your webcam from the Workflow editor's run panel, or choose "Use Webcam" or "Use Your Phone" in the Agent. For a phone, scan the QR code, then tap "Start Camera". The code works once and expires after 5 minutes. Tap "Stop Streaming" to end the session.

Use the camera menu on the phone's page to switch lenses without stopping the stream.

<figure><img src="https://1583372177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoksNmwps1HmYr8TqHDnX%2Fuploads%2Fgit-blob-ba4bedba2138e02567e1476891df3c69ce2c548f%2Fcloud-streaming-shot08-webcam.png?alt=media" alt="Agent test-source picker with File, Webcam and Stream options."><figcaption><p>Choose Webcam to begin a temporary browser-camera preview.</p></figcaption></figure>

<figure><img src="https://1583372177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoksNmwps1HmYr8TqHDnX%2Fuploads%2Fgit-blob-560ab41d13a8aa8d52bf271ee8ec30dd87418903%2Fcloud-streaming-shot08-phone.png?alt=media" alt="Connect your phone panel with QR pairing instructions and an expiry timer."><figcaption><p>Scan the phone pairing code and keep the publishing page open for the session.</p></figcaption></figure>

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

{% hint style="info" %}
Direct ingest shows as "RTMP Stream" with a "Pilot" label. It needs the "Manage Source Video" permission and is not available in the EU region yet.
{% endhint %}

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

Roboflow deletes a direct source that has not received video 24 hours after you create it, unless a Workflow job is queued or running on it. Create the source when your publisher is ready.

<figure><img src="https://1583372177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoksNmwps1HmYr8TqHDnX%2Fuploads%2Fgit-blob-648c95ce19005239e05a99053e061050d3322773%2Fcloud-streaming-shot09-rtmp-pilot.png?alt=media" alt="RTMP Stream Pilot setup with RTMPS selected and a masked stream key."><figcaption><p>Copy the offered publishing details into your encoder. Keep the stream key private.</p></figcaption></figure>

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

To see the details again, choose "Connection Settings" in the source's menu. "Rotate key" disconnects the broadcast: update the publisher and broadcast again. "Set custom key" takes 8 to 128 letters, numbers, hyphens, or underscores.

After a disconnect, [restart the Workflow](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/run-a-workflow.md#restarts) if it does not resume.

## Capture and codec settings

For a USB camera, choose "Capture Settings" in the source's menu and pick a mode the camera reports. Wait for "Applied". "Settings rejected" means the camera keeps its last settings. Applying can restart the stream.

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:

```sh
~/.rfv-connector/rfv-connector \
  --api-key "$ROBOFLOW_API_KEY" \
  --files-dir ./videos
```

The connector loops each video file in the folder (not subfolders) as a live source. Live processing can skip frames. To process a file to the end, use [Batch Processing](https://docs.roboflow.com/deployment/roboflow-cloud/batch-processing.md).

### Control thumbnails

The connector takes a still of each camera when it finds it, then once a day. This can briefly turn on a camera's light.

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](https://docs.roboflow.com/reference/platform/rest-api/authenticate-with-the-rest-api) with a credential for the workspace in the path. To add an internet-reachable camera, see the [cameras by URL API](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/add-cameras-by-url.md#http-api). Use the Roboflow app to add RTSP cameras to a connector, configure connectors, create direct RTMP sources, and rotate publishing keys. The API has no endpoints for these.

### List registered sources

Copy the ID of a connected source before you start a job.

{% openapi src="/files/HZKHykExD3Pp9vVK5PrS" path="/{workspace}/video-sources/v1" method="get" %}
[cloud-streaming.yaml](https://1583372177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoksNmwps1HmYr8TqHDnX%2Fuploads%2Fgit-blob-2927c06848d4341631bbd3bafea073b855e32b47%2Fcloud-streaming.yaml?alt=media)
{% endopenapi %}

### Preview source video

Watch the camera without running a model. Call it again while the player is open. Keep the URL private.

{% openapi src="/files/HZKHykExD3Pp9vVK5PrS" path="/{workspace}/video-sources/v1/{sourceId}/preview" method="post" %}
[cloud-streaming.yaml](https://1583372177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoksNmwps1HmYr8TqHDnX%2Fuploads%2Fgit-blob-2927c06848d4341631bbd3bafea073b855e32b47%2Fcloud-streaming.yaml?alt=media)
{% endopenapi %}

### Allocate a temporary session

Publish video to the returned WHIP URL within two minutes. Reuse the `Idempotency-Key` only to retry the same request.

{% openapi src="/files/HZKHykExD3Pp9vVK5PrS" path="/{workspace}/video-sources/v1/temporary" method="post" %}
[cloud-streaming.yaml](https://1583372177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoksNmwps1HmYr8TqHDnX%2Fuploads%2Fgit-blob-2927c06848d4341631bbd3bafea073b855e32b47%2Fcloud-streaming.yaml?alt=media)
{% endopenapi %}

Temporary session jobs are previews only. The publishing session and its job owner have separate lifetimes; see [temporary preview ownership](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/run-a-workflow.md#hold-a-temporary-preview).

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

{% openapi src="/files/HZKHykExD3Pp9vVK5PrS" path="/{workspace}/video-sources/v1/{sourceId}/stop-session" method="post" %}
[cloud-streaming.yaml](https://1583372177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoksNmwps1HmYr8TqHDnX%2Fuploads%2Fgit-blob-2927c06848d4341631bbd3bafea073b855e32b47%2Fcloud-streaming.yaml?alt=media)
{% endopenapi %}
