Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Native WebRTC low-latency P2P video streaming on Raspberry Pi with V4L2 hardware H.264 and OpenH264 software encoding support.

License

Notifications You must be signed in to change notification settings

program-cn/RaspberryPi-WebRTC

Open more actions menu
 
 

Repository files navigation

Pi 4b latency demo

Raspberry Pi WebRTC

Turn your Raspberry Pi into a real-time, ~200ms low-latency WebRTC camera.

WebRTC Version Download Release License Apache


Quick Start

Check out the tutorial video or follow these steps.

Requirements

  • Raspberry Pi Zero 2W, 3B, 4B, or 5
  • CSI or USB camera (supports libcamera or V4L2)

Setup

1. Flash Raspberry Pi OS

Use Raspberry Pi Imager to flash Lite OS (or full OS) to SD card.

2. Install Dependencies

sudo apt update
sudo apt install libcamera0.5 libmosquitto1 pulseaudio libavformat59 libswscale6 libprotobuf32

3. Download App

Get the latest release binary .

wget https://github.com/TzuHuanTai/RaspberryPi-WebRTC/releases/latest/download/pi-webrtc-v1.1.2_raspios-bookworm-arm64.tar.gz
tar -xzf pi-webrtc-v1.1.2_raspios-bookworm-arm64.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.

Run the App

preview_demo

  • Open picamera-web, 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 # Only Pi Zero 2W, 3B, 4B support hw encoding

Important

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

About

Native WebRTC low-latency P2P video streaming on Raspberry Pi with V4L2 hardware H.264 and OpenH264 software encoding support.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 97.0%
  • CMake 2.9%
  • Shell 0.1%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.