> 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/add-cameras-by-url.md).

# Add Cameras by URL

Add an internet-reachable RTSP or RTSPS camera or an HLS stream to Cloud Streaming by its URL, with no connector to install, in the Web App or with the HTTP API.

Add a camera to Cloud Streaming by its RTSP or RTSPS URL, or a stream by its HLS playlist URL. Roboflow connects to the camera itself, so there is no connector to install. Roboflow connects only while a Workflow or preview needs the video.

Use a camera URL when the camera, or a port forwarded to it, accepts connections from the internet. The "Camera URL" tab appears in "Add Video Source" where cameras by URL are enabled for your workspace.

Use the [Video Connector](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/install-a-connector.md) when the camera is only reachable inside your network, or for USB cameras. For Verkada cameras, [connect your Verkada organization](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/verkada.md).

<figure><img src="https://1583372177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoksNmwps1HmYr8TqHDnX%2Fuploads%2Fgit-blob-7bc2cb59f87d1dfce31124710e45b428b43fb444%2Fcloud-streaming-shot10-camera-url.png?alt=media" alt="Add Video Source dialog on the Camera URL tab, with Name, Camera or Stream URL, Username, and Password fields, a permission checkbox, and the Add Camera button."><figcaption><p>Add a camera or stream by its URL in the "Camera URL" tab.</p></figcaption></figure>

## Before you start

You need:

* The camera's stream URL, starting with `rtsp://` or `rtsps://`, or an HLS playlist URL, starting with `http://` or `https://` (ex: `https://stream.example.com/live/index.m3u8`).
* The username and password, if the camera or stream has them.
* A camera address that is reachable from the internet. Private, loopback, and local addresses (ex: `192.168.1.20`, `camera.local`) are refused.
* Ownership of the camera or permission to connect to it.

## Web App

### Add a camera

1. Open "Deployments", then "Cloud Streaming", and click "Add Video Source".
2. Select the "Camera URL" tab.
3. Enter a "Name" and the "Camera or Stream URL" (ex: `rtsps://camera.example.com:322/stream1`).
4. Enter the "Username" and "Password" if the camera needs them.
5. Check "I own this camera or have permission to connect to it."
6. Click "Add Camera".

Roboflow saves the camera and tests the connection. The test can take up to a minute. When it passes, the camera is ready to [run a Workflow](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/run-a-workflow.md).

If the test fails, the form stays open with the reason. Correct the fields and submit again: this edits the same camera and does not add a second one.

Roboflow stores the password encrypted and never shows it again.

### HLS streams

An HLS playlist is added, tested, and used the same way as a camera. These differences apply:

* HLS streams run several seconds behind live.
* The username and password are sent as HTTP Basic authentication.
* An `https://` playlist needs a publicly trusted certificate. Roboflow does not save certificates for HLS.
* The saved URL is shown with every query value hidden.

### Camera statuses

<table data-search="false"><thead><tr><th>Status</th><th>Meaning</th></tr></thead><tbody><tr><td>Testing</td><td>The first connection test is running.</td></tr><tr><td>Connection failed</td><td>The first connection test did not pass. Fix the address or credentials and test again.</td></tr><tr><td>Ready</td><td>The camera passed its test. No Workflow or preview is using it, so Roboflow is not connected.</td></tr><tr><td>Live</td><td>A Workflow or preview is using the camera and video is flowing.</td></tr><tr><td>Offline</td><td>A Workflow or preview needs the camera, but Roboflow cannot read its stream right now.</td></tr><tr><td>Needs attention</td><td>Roboflow stopped connecting to the camera. See <a href="#blocked-cameras">Blocked cameras</a>.</td></tr></tbody></table>

A deployed Workflow on an offline camera waits and starts again when the camera's video returns.

### Connection test results

<table data-search="false"><thead><tr><th>Message</th><th>What to check</th></tr></thead><tbody><tr><td>The camera refused the username or password.</td><td>The credentials.</td></tr><tr><td>Roboflow couldn't reach the camera.</td><td>The address and port, and that the camera accepts connections from the internet.</td></tr><tr><td>The camera answered, but there is no stream at this path.</td><td>The part of the URL after the host.</td></tr><tr><td>The camera answered, but its stream can't be read.</td><td>That the URL is the stream's own URL with a video track, not a page or a redirect.</td></tr><tr><td>The camera's security certificate is not the one saved for it.</td><td>Whether you expected the certificate to change. See <a href="#rtsps-certificates">RTSPS certificates</a>.</td></tr><tr><td>The connection test didn't finish in time.</td><td>Try again.</td></tr><tr><td>Roboflow can't take another camera right now.</td><td>Try again later.</td></tr></tbody></table>

### Edit or retest a camera

Open the camera's stream page, open its menu, and click "Connection Settings". The panel shows the camera URL, its encryption, the saved username, whether a password is saved, the detected codec, and when the camera was last tested.

* To test the saved address again, click "Test Connection Again".
* To change the name, URL, or credentials, click "Edit", then "Save and Test". Leave the password blank to keep the saved one. When the address or username changes, enter the password again.

A new address or new credentials replace the saved ones only if their test passes. If the test fails, the camera keeps its saved address.

When Workflows are running on the camera, the app asks you to confirm a restart. The Workflows keep running on the current address until the new one passes its test, then restart on it. Tracker and session state resets.

### RTSPS certificates

Roboflow accepts an `rtsps://` camera with a publicly trusted certificate as is. For any other certificate (ex: self-signed), Roboflow saves the certificate the camera presents at its first test and connects only while the camera presents the same one. "Connection Settings" shows its fingerprint as "Saved certificate (SHA-256)".

If the camera later presents a different certificate, Roboflow stops connecting and the camera shows "Needs attention". Compare the saved fingerprint with "Certificate presented now (SHA-256)". If you expected the change (ex: after resetting the camera), click "Trust New Certificate", then "Trust Certificate". Roboflow tests the camera again and saves the certificate it presents now.

### Blocked cameras

Roboflow stops connecting to a camera, and pauses the Workflows on it, when:

* The camera refuses the saved username or password. Click "Edit Credentials" and save the correct ones.
* The camera's certificate changed. [Trust the new certificate](#rtsps-certificates) if you expected it.
* The camera's stream stays above the allowed bitrate. Lower the bitrate in the camera's settings, then click "Test Connection Again".

A passed connection test clears the block. Restart the Workflow afterward.

### Delete a camera

Stop the Workflows running on the camera. Then open the stream page's menu, click "Delete", and confirm with "Delete Stream".

## HTTP API

Use a workspace API key with the `video-inference-job:create` scope for every request on this page, including reads. Folder-scoped and device-bound keys are refused. See [scoped API keys](https://docs.roboflow.com/reference/authentication/authentication/scoped-api-keys).

Deleting a camera is a Web App action. The API has no endpoint for it.

### Add a camera

Send a new `Idempotency-Key` for each camera. The response returns while the connection test is still running, with `status` set to `testing`.

{% openapi src="/files/HZKHykExD3Pp9vVK5PrS" path="/{workspace}/video-sources/v1/pull" 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 %}

### Read the connection test

Read the camera every few seconds until `status` is no longer `testing`. A test ends within 90 seconds. `ready` means it passed and you can [start a job](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/run-a-workflow.md#http-api) with the camera's `id` as the source. `failed` means it did not: `pull.error` holds the reason.

{% openapi src="/files/HZKHykExD3Pp9vVK5PrS" path="/{workspace}/video-sources/v1/{sourceId}/pull" 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 %}

### Edit or retest a camera

Send only the fields you want to change. To clear a block or check a repaired camera, send `{"retest": true}`. To accept a changed certificate, send `{"trustCertificate": true}`.

When Workflows are running on the camera, a change to its address, credentials, or certificate returns 409 until you send `restartWorkflows: true`.

{% openapi src="/files/HZKHykExD3Pp9vVK5PrS" path="/{workspace}/video-sources/v1/{sourceId}/pull" method="patch" %}
[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 %}
