> 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/serverless-api/serverless-video-streaming-api.md).

# (Deprecated) Serverless Video Streaming

Deprecated Serverless Video Streaming API reference and migration to Cloud Streaming for managed live cameras.

{% hint style="info" %}
Deprecated: use [Cloud Streaming](/deployment/roboflow-cloud/cloud-streaming.md) for new managed live-camera deployments. This page remains available for existing Serverless Video Streaming API integrations. This deprecation does not announce a shutdown date, remove an endpoint, or change existing support terms.
{% endhint %}

## Move to Cloud Streaming

Cloud Streaming uses registered sources and Workflow jobs, not the client-managed WebRTC session described below. Migration is not an `api_url` substitution, and the two interfaces do not promise feature parity.

1. [Connect a source](/deployment/roboflow-cloud/cloud-streaming/connect-a-source.md), using a Connector for cameras on your network or a temporary camera session for a preview.
2. [Run a Workflow](/deployment/roboflow-cloud/cloud-streaming/run-a-workflow.md). Choose a bounded preview or a persistent deployment, and stop processing explicitly when finished; closing a viewer is not a deployment stop.
3. [Update result consumers](/deployment/roboflow-cloud/cloud-streaming/consume-results.md). Review live-video playback, JSON inspection in "Latest Result", and Workflow sinks instead of assuming WebRTC data-channel callbacks transfer unchanged.
4. [Review billing and limits](/deployment/roboflow-cloud/cloud-streaming/pricing-and-limits.md). Cloud Streaming has its own GPU processing rates and lifecycle; do not reuse the legacy plan names, regions, concurrency limit, or billing-start rule below.

For stored files that should finish and produce results, use [Batch Processing](/deployment/roboflow-cloud/batch-processing.md), not a looping live source. To keep inference on your own hardware, continue with [self-hosted WebRTC](https://docs.roboflow.com/reference/inference/inference-sdk/webrtc).

## About

The deprecated Serverless Video Streaming API uses WebRTC to stream video from webcams, RTSP cameras, or video files to Roboflow Cloud. You can run one model or a [Workflow](https://docs.roboflow.com/workflows) and receive processed frames plus prediction data in your application.

Use the Inference SDK WebRTC client for both models and Workflows. Set `api_url` to `https://serverless.roboflow.com`. The same client works with a [self-hosted Inference Server](/deployment/self-hosted/inference-server.md) when you change the URL.

Supported input sources:

* Webcam: a browser or device camera
* RTSP: an IP camera or other RTSP-compatible source
* Video file: a stored video uploaded through the data channel

When Serverless connects directly to an RTSP source, its URL must be publicly accessible. If the camera is available only on your local network, use `LocalStreamSource` to capture it on the client and forward the frames.

## How it works

When you start a streaming session, the SDK calls Roboflow's API to initialize a WebRTC connection. The API spawns a serverless function that runs your Workflow. Once connected, data flows through two WebRTC channels:

### Video track

Streams video frames bidirectionally. You send frames from your webcam or video file, and receive annotated/processed frames back. The Video Track is optimized for real-time display: it adjusts resolution and may drop frames based on available bandwidth. Quality ramps up as the connection stabilizes.

Due to WebRTC congestion control, it can take up to a minute for quality and FPS to ramp up to full capacity, especially at higher resolutions like 1920×1080 at 30 FPS.

### Data channel

Sends structured inference results as JSON messages. This includes all Workflow output data like predictions, coordinates, and classifications. Unlike the Video Track, the Data Channel provides reliable, ordered delivery without any optimizations to keep up with the live camera feed. To process video files, you can upload the file via the Data Channel and consume results the same way to fully process the video.

You can use both channels simultaneously, for example displaying annotated video while also processing the structured prediction data in your application.

## Regions and GPU plans

These settings apply to the deprecated API only, not Cloud Streaming. Specify `requested_region` and `requested_plan` in your legacy configuration to control where and how your stream is processed.

Regions: `us` (United States), `eu` (Europe), `ap` (Asia Pacific)

Choose the region closest to your users or video source to minimize latency.

GPU plans:

* `webrtc-gpu-medium`: Default and recommended for most workflows
* `webrtc-gpu-small`: Lower cost. Try this after confirming Medium works well for your use case.
* `webrtc-gpu-large`: Required for SAM3 and Rapid Models that use SAM3 (expect \~5 FPS)

## Concurrency limits

The deprecated API has a default limit of 10 concurrent streams per Workspace. This is not the Cloud Streaming limit. Contact your support or sales contact about an existing legacy integration.

## Pricing

The deprecated API bills per hour based on its selected GPU plan. Its billing starts once the serverless function spawns and the WebRTC connection is established. These legacy rules do not describe Cloud Streaming pricing. For new deployments, see [Cloud Streaming pricing and limits](/deployment/roboflow-cloud/cloud-streaming/pricing-and-limits.md) and the [current Cloud Streaming rate table](https://roboflow.com/credits).

## SDKs

### JavaScript

For web browsers and React Native applications.

```bash
npm install @roboflow/inference-sdk
```

Do not expose your API key in frontend code. Use a backend proxy endpoint to keep it secure.

* [NPM package](https://www.npmjs.com/package/@roboflow/inference-sdk)
* [Sample application](https://github.com/roboflow/inferenceSampleApp)
* [Documentation](/deployment/self-hosted/sdks/web-browser/web-inference-sdk.md)

### Python

For models and Workflows in Python applications:

```bash
pip install inference-sdk[webrtc]
```

* [PyPI package](https://pypi.org/project/inference-sdk/)
* [WebRTC Streaming reference](https://docs.roboflow.com/reference/inference/inference-sdk/webrtc)
* [Example scripts](https://github.com/roboflow/inference/tree/main/examples/webrtc_sdk) (webcam, RTSP, video file)

## Configuration

When creating a streaming session, pass a `StreamConfig` object to control behavior:

* `stream_output`: List of Workflow output names to stream via Video Track
* `data_output`: List of Workflow output names to send via Data Channel
* `requested_plan`: GPU plan (see above)
* `requested_region`: Region code (`us`, `eu`, or `ap`)
* `realtime_processing`: If `True` (default), drop frames when processing can't keep up
* `workflow_parameters`: Dictionary of parameters to pass to the Workflow

## Test without code

For the current web app flow, follow the [Cloud Streaming quickstart](/deployment/roboflow-cloud/cloud-streaming/quickstart.md). The legacy SDK configuration above does not describe the current app controls.
