whitphx/streamlit-webrtc

Real-time video and audio processing on Streamlit

What it solves

streamlit-webrtc is a component for Streamlit that enables the handling and transmission of real-time video and audio streams over a network. It allows developers to integrate live media streams into their web applications without needing to build a complex WebRTC infrastructure from scratch.

How it works

The library provides a webrtc_streamer widget that manages the WebRTC session. Developers can define callback functions—video_frame_callback and audio_frame_callback—to process media frames in real-time. These callbacks receive and return frames as PyAV objects (av.VideoFrame or av.AudioFrame), allowing for the injection of image or audio processing logic (such as OpenCV filters or AI models) directly into the stream.

Who it’s for

It is designed for Python developers using Streamlit who want to build real-time media applications, such as video chat apps, real-time speech-to-text tools, or computer vision applications.

Highlights

  • Real-time Processing: Supports both video and audio frame callbacks for live manipulation.
  • AI Integration: Easily integrates with libraries like OpenCV and MediaPipe for tasks like object detection and pose estimation.
  • Flexible Controls: Includes built-in media toggle buttons for camera and microphone access.
  • Deployment Ready: Provides guidance and configuration options for HTTPS, STUN, and TURN servers to ensure connectivity across different network environments.

Related

  • Project
  • Project
  • Dispatch
  • Project
  • Dispatch