(Deprecated) Serverless Video Streaming
Deprecated Serverless Video Streaming API reference and migration to Cloud Streaming for managed live cameras.
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.
Connect a source, using a Connector for cameras on your network or a temporary camera session for a preview.
Run a Workflow. Choose a bounded preview or a persistent deployment, and stop processing explicitly when finished; closing a viewer is not a deployment stop.
Update result consumers. Review live-video playback, JSON inspection in "Latest Result", and Workflow sinks instead of assuming WebRTC data-channel callbacks transfer unchanged.
Review billing and limits. 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, not a looping live source. To keep inference on your own hardware, continue with self-hosted 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 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 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 workflowswebrtc-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 and the current Cloud Streaming rate table.
SDKs
JavaScript
For web browsers and React Native applications.
Do not expose your API key in frontend code. Use a backend proxy endpoint to keep it secure.
Python
For models and Workflows in Python applications:
Example scripts (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 Trackdata_output: List of Workflow output names to send via Data Channelrequested_plan: GPU plan (see above)requested_region: Region code (us,eu, orap)realtime_processing: IfTrue(default), drop frames when processing can't keep upworkflow_parameters: Dictionary of parameters to pass to the Workflow
Test without code
For the current web app flow, follow the Cloud Streaming quickstart. The legacy SDK configuration above does not describe the current app controls.
Last updated
Was this helpful?