Back to Projects
iot

Raspberry Pi WebRTC Streaming

Offline-capable camera streaming with mobile access

Tech Stack

Raspberry PiWebRTCUV4LRTSPPythonJavaScriptLinux/Debian

1080p

Resolution

<300ms

Latency

50m

Range

Problem Statement

Remote surveillance locations often lack internet connectivity, making cloud-based streaming solutions impractical and expensive.

Overview

A portable streaming solution using Raspberry Pi that creates its own Wi-Fi hotspot and serves WebRTC video streams accessible from mobile devices. Designed for surveillance in areas without internet connectivity.

My Role & Contributions

Systems Developer - Configured UV4L, built the WebRTC server, implemented hotspot networking, created mobile-friendly viewing interface.

Tech Stack

Raspberry PiWebRTCUV4LRTSPPythonJavaScriptLinux/Debian

Challenges & Solutions

1

Challenge

Maintaining stable P2P WebRTC connections through mobile NAT with frequent reconnections and packet loss >5%

Solution

Implemented STUN/TURN server with coturn, ICE candidate gathering with exponential backoff, and WebRTC data channel for heartbeat monitoring

2

Challenge

Balancing H.264 encoding quality vs CPU usage on Pi's limited VideoCore IV GPU while hitting 1080p@25fps target

Solution

Tuned v4l2 H.264 encoder params: bitrate 2-6Mbps adaptive, GOP size 25, profile high, leveraging hardware OMX codec with zero-copy DMA buffers

3

Challenge

Creating production-grade hotspot with DHCP, DNS resolution, and automatic failover between Ethernet/Wi-Fi uplinks

Solution

Built NetworkManager dispatcher scripts for interface priority, dnsmasq for DHCP/DNS, and iptables NAT rules with connection tracking