Registry / web-framework / streamlit-webrtc

streamlit-webrtc

JSON →
library0.72.2pypypi✓ verified 88d ago

Real-time video and audio processing for Streamlit apps via WebRTC. Current version 0.64.6, requires Python >=3.10. Active development with frequent releases.

pip install streamlit-webrtc
INSTALL
IMPORT
SIG · STREAMLIT-WEBRTC
S
streamlit-webrtc
web-frameworkpythonv0.72.2
Install
18.4s avg
Import
2516ms
Disk
580MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.72.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 20.6s
py 3.11
✓ —
✓ 18.5s
py 3.12
✓ —
✓ 17.5s
py 3.13
✓ —
✓ 17.2s
py 3.9
✕ build_error
✕ build_error
580MB installed
● package 580MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

webrtc_streamer
✓ from streamlit_webrtc import webrtc_streamer
✗ from streamlit_webrtc import WebRtcStreamer
The class is a function, not a class; wrong casing leads to ImportError
WebRtcStreamerContext
✓ from streamlit_webrtc import WebRtcStreamerContext
Used for accessing state and video/audio receivers
VideoTransformerBase
✓ from streamlit_webrtc import VideoTransformerBase
Base class for video transformations; use with webrtc_streamer

Minimal app that displays a webcam feed with a no-op video transformer.

import streamlit as st from streamlit_webrtc import webrtc_streamer, VideoTransformerBase class MyTransformer(VideoTransformerBase): def transform(self, frame): return frame webrtc_streamer(key="example", video_transformer_factory=MyTransformer)
Debug
Known issues
breakingIn v0.50.0, the async-to-sync transformation changed; `video_transformer_factory` must return a transformer instance, not a coroutine. Older patterns using async functions break.
fix
Ensure `video_transformer_factory` returns a synchronous transformer object; do not use async/await in the factory.
affects: >=0.50.0
gotchaThe `webrtc_streamer` function is not a class; calling `WebRtcStreamer(...)` (capital W) raises ImportError.
fix
Use `from streamlit_webrtc import webrtc_streamer` (lowercase).
affects: all
gotchaStreamlit WebRTC only works over HTTPS (or localhost). Deploying over HTTP results in `Failed to access media` errors.
fix
Use HTTPS in production or run locally via `streamlit run` (which uses localhost).
affects: all
deprecatedThe `audio_frame_callback` parameter is deprecated since v0.50.0 in favor of `audio_transformer_factory`.
fix
Replace `audio_frame_callback` with `audio_transformer_factory` that returns an audio transformer.
affects: >=0.50.0
Errors
Common errors & fixes
ImportError: cannot import name 'WebRtcStreamer' from 'streamlit_webrtc'
Using wrong case (WebRtcStreamer instead of webrtc_streamer) or wrong import path.
fix
Use `from streamlit_webrtc import webrtc_streamer` (all lowercase).
TypeError: 'NoneType' object is not callable
`video_transformer_factory` returned None, or no factory was provided.
fix
Ensure `video_transformer_factory` returns a valid transformer instance (e.g., MyTransformer()).
RuntimeError: Could not obtain user media
Browser requires HTTPS (or localhost) for getUserMedia.
fix
Run on localhost (default with streamlit run) or deploy with HTTPS.
Upgrade
Version history
0.72.2latest on PyPI · released Jun 19, 2026
Audit
Dependencies
streamlitrequiredCore dependency; the component is designed to run inside a Streamlit app
avoptionalAudio/video processing (required for media transformations)
Agent activity
37 hits · last 30 days
node
32
OpenAI (training)
1
Resources
streamlit-webrtc — pip install streamlit-webrtc · libregistry