streamlit-webrtc
Real-time video and audio processing on Streamlit
What it is and what it does
streamlit-webrtc bridges Streamlit and WebRTC to let you capture and process live video and audio streams directly in the browser. It exposes a single main component, `webrtc_streamer()`, which handles the peer connection setup, media negotiation, and frame delivery. You pass optional callbacks to intercept and transform video or audio frames using the PyAV library (av.VideoFrame, av.AudioFrame), then return the modified frames to the stream.
The package handles the complexity of WebRTC signaling and media transport so you can focus on the processing logic. Common patterns include object detection, audio filtering, style transfer, and speech-to-text. Callbacks execute in background threads independent of the main Streamlit script, so you must manage thread-safety and use locks when sharing state. The component includes built-in media toggle controls to let users mute camera or microphone without stopping the session.
Use it for:
- Build a real-time video chat or conferencing app with minimal boilerplate.
- Apply live computer vision (object detection, pose estimation) to camera input.
- Process audio in real time for speech-to-text or audio filtering applications.
- Create interactive video effects or style transfer demos that run in the browser.
- Stream video from one peer to another with frame-level processing in between.
- Prototype media-heavy Streamlit apps without managing WebRTC infrastructure yourself.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds real-time video and audio streaming over WebRTC to Streamlit apps, with support for frame-by-frame processing callbacks.
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a specific problem (real-time media in Streamlit) that is otherwise difficult to implement. MIT licensing removes legal barriers. Suitable if you need browser-based video/audio capture and processing in a Streamlit app; not necessary if you only need static media or pre-recorded files.
Install
streamlit-webrtc on PyPI
pip
pip install streamlit-webrtcuv
uv add streamlit-webrtcpoetry
poetry add streamlit-webrtcInstalling streamlit-webrtc
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a recent release (7 days old) and steady repository activity. Requires Python 3.10 or later.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install streamlit-webrtc
from streamlit_webrtc import webrtc_streamer
import av
def video_frame_callback(frame):
img = frame.to_ndarray(format="bgr24")
flipped = img[::-1,:,:]
return av.VideoFrame.from_ndarray(flipped, format="bgr24")
webrtc_streamer(key="example", video_frame_callback=video_frame_callback)
Requires Python 3.10 or later. Browser must support WebRTC and grant camera/microphone permissions. Callbacks run in forked threads and cannot call Streamlit methods directly.
Verify before relying
- Whether frame processing latency is acceptable for interactive real-time applications.
- Browser compatibility matrix and any known platform-specific WebRTC limitations.
- Performance characteristics with multiple concurrent streams or high-resolution video.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — aioice, aiortc, av, packaging, streamlit |
| Maintenance | actively maintained — 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 97,508/month — #13,148 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: streamlit_webrtc-0.77.0-py3-none-any.whl
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
streamlit-camera-input-liveProvides a Streamlit component that captures…
unclear · top 15,000 on PyPI
aiortcaiortc is a Python library implementing WebRTC…
permissive · top 5,000 on PyPI
livekitPython SDK for building real-time video, audio,…
permissive · top 5,000 on PyPI
livekit-protocolProvides Python protocol stubs and type…
permissive · top 5,000 on PyPI
pyrealsense2Python wrapper for Intel RealSense SDK 2.0 that…
permissive · top 15,000 on PyPI
streamlit-keyupAdds real-time text input to Streamlit apps…
unclear · top 15,000 on PyPI
webrtcvadProvides a Python interface to Google's WebRTC…
permissive · top 15,000 on PyPI
livekit-apiGenerate access tokens and call LiveKit server…
permissive · top 5,000 on PyPI
pipecat-ai-small-webrtc-prebuiltProvides a ready-to-use WebRTC client UI for…
permissive · top 15,000 on PyPI
ntgcallsNTgCalls provides Python bindings to a C++…
unclear · top 15,000 on PyPI