Video processing with Workflows
Stream webcams, camera feeds, and video files through a Workflow with the Inference SDK WebRTC client.
Choose a runtime
Runtime
API URL
Use it when
Install the SDK
pip install "inference-sdk[webrtc]"Stream a Workflow
from inference_sdk import InferenceHTTPClient
from inference_sdk.webrtc import StreamConfig, WebcamSource
client = InferenceHTTPClient(
api_url="http://localhost:9001",
api_key="ROBOFLOW_API_KEY",
)
session = client.webrtc.stream(
source=WebcamSource(),
workflow="workflow-id",
workspace="workspace-name",
config=StreamConfig(data_output=["predictions"]),
)
@session.on_data("predictions")
def handle_predictions(predictions, metadata):
print(f"Frame {metadata.frame_id}: {predictions}")
session.run()Choose a video source
Source
Use it when
Stream one model
Next steps
Last updated
Was this helpful?