Skip to content

Latest commit

 

History

575 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-webrtc

Ultra-low latency WebRTC streaming for Raspberry Pi and NVIDIA Jetson over WiFi, LTE, or 5G.

WebRTC Version Download Release License Apache

Raspberry Pi 5 latency demo

Features

  • Hardware encoding on-device — V4L2 M2M on Raspberry Pi, NVENC on Jetson.
  • ~200 ms glass-to-glass, ~100 ms on Jetson.
  • Control travels back — DataChannels carry messages the other way, and the IPC bridge relays them to any process on the device.
  • Runs on cellular — NAT traversal, congestion control and packet-loss recovery come with WebRTC, so the same build works over LTE or 5G.
  • Two platforms, three camera backends — libcamera, libargus, V4L2.
  • Pluggable signaling — MQTT, WHEP, LiveKit and Cloudflare Realtime share one interface.

Hardware Support

Board CSI backend Hardware encode Status
Pi Zero 2 W / 3B / 4 libcamera V4L2 M2M — H.264 (zero-copy DMABUF) ✅ Tested
Pi 5 libcamera — (software OpenH264) ✅ Tested
Jetson Orin NX libargus NVENC — H.264 + AV1 ✅ Tested
Jetson Nano / NX / Orin libargus NVENC — H.264 Supported

USB cameras are supported through V4L2 on both platforms.

Quick Start

Check out the tutorial video or follow these steps.

1. Flash Raspberry Pi OS

Use Raspberry Pi Imager to flash Lite OS to SD card.

2. Install Dependencies

sudo apt update
sudo apt install libmosquitto1 pulseaudio libavformat61 libswscale8 libyaml-cpp0.8

3. Download Binary

Get the latest release binary .

wget https://github.com/TzuHuanTai/RaspberryPi-WebRTC/releases/latest/download/pi-webrtc_raspios-trixie-arm64.tar.gz
tar -xzf pi-webrtc_raspios-trixie-arm64.tar.gz

Jetson builds are published on the same page as pi-webrtc_jetson-l4t-<version>.tar.gz.

4. MQTT Signaling

Use HiveMQ, EMQX, or a self-hosted broker.

Tip

MQTT lets your Pi camera and client exchange WebRTC connection info. WHEP doesn’t need a broker but requires a public hostname. LiveKit needs an SFU server, and serves many viewers from one uplink. Cloudflare Realtime serves just as many with no server of your own — the fan-out runs on Cloudflare's edge.

Run the App

preview_demo

  • Open picamera-web demo UI — add MQTT settings, and create a UID.
  • Run the command on your Pi:
    ./pi-webrtc \
        --camera=libcamera:0 \
        --fps=30 \
        --width=1280 \
        --height=960 \
        --use-mqtt \
        --mqtt-host=your.mqtt.cloud \
        --mqtt-port=8883 \
        --mqtt-username=hakunamatata \
        --mqtt-password=Wonderful \
        --uid=your-custom-uid \
        --no-audio \
        --hw-accel

Important

Remove --hw-accel for Pi 5 or others without hardware encoder.

Signaling & Integrations

Transport Best for Clients
MQTT Peer-to-peer, no public hostname needed picamera.js (Web + React Native) · picamera-app (Android)
WHEP Playing a URL in any standard WebRTC player Home Assistant WebRTC Camera · eyevinn/webrtc-player
LiveKit Many simultaneous viewers from one uplink picamera.js
Cloudflare Realtime Many simultaneous viewers with nothing to host picamera.js

Signaling is pluggable — each transport implements the same interface in src/signaling/, and more than one can be enabled at a time.

Documentation

📚 Full documentation → picamera.live/docs

Configuration · Camera and Encoding · Signaling · Recording · Architecture · Building · Advanced usage

Commercial

Object detection and tracking on Jetson, multi-camera capture from a single process, and on-device LiveKit token issuing are available under a commercial license — see Commercial Version or contact tzu.huan.tai@gmail.com.

License

Apache-2.0 — see LICENSE.

About

Real-time WebRTC streaming for Raspberry Pi and NVIDIA Jetson with 100–200 ms glass-to-glass latency.

Topics

Resources

Stars

983 stars

Watchers

8 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages