A complete camera streaming system combining Raspberry Pi streaming server with a modern web viewer. Features ultra-low latency WebRTC streaming, mobile-optimized interface, and easy setup scripts. Perfect for home security, business monitoring, pet cams, and more.
webrtc-camera-suite/
├── rpi-config/ # MediaMTX configs, service files, Pi setup scripts
│ ├── mediamtx.yml # MediaMTX server configuration
│ ├── install.sh # Raspberry Pi installation script
│ ├── update.sh # MediaMTX update script
│ └── README.md # Pi setup instructions
├── webapp/ # Next.js viewer/configurator
│ ├── src/
│ │ ├── app/ # Next.js app router pages
│ │ ├── components/ # React components
│ │ ├── lib/ # Utilities and services
│ │ └── types/ # TypeScript definitions
│ ├── package.json
│ └── ...
├── docs/ # Setup guides, architecture notes
│ ├── SETUP.md # Complete setup guide
│ ├── ARCHITECTURE.md # System architecture
│ └── API.md # MediaMTX API reference
└── README.md # This file
Secure login page with dual authentication system (site + camera credentials)
Modern camera grid interface with status indicators and quick access
Easy server configuration with MediaMTX and ICE server setup
Account management with security warnings for default credentials
- 🔐 Secure Authentication: HTTP Basic Auth with configurable credential storage
- 📱 Mobile-First Design: Touch-friendly controls optimized for phones and tablets
- ⚡ Ultra-Low Latency: WebRTC WHEP protocol for real-time video (< 500ms)
- 📊 Stream Statistics: Live bitrate, latency, FPS, and packet loss monitoring
- 🔄 Auto-Reconnection: Intelligent reconnection with exponential backoff
- 🎛️ Advanced Controls: Play/pause, mute, fullscreen, picture-in-picture
- ⌨️ Keyboard Shortcuts: Desktop shortcuts for camera switching and controls
- 🎨 Modern UI: Clean, intuitive interface for any monitoring use case
- 🏠 Self-Hosted: Complete privacy with local-only streaming
- 🔧 Easy Setup: Automated Raspberry Pi installation scripts
- Hardware: Raspberry Pi 3B+ or newer (Pi 4B 4GB+ recommended)
- Storage: 16GB+ microSD card (Class 10 or better)
- Network: Ethernet connection preferred
- Cameras: RTSP-compatible IP cameras
- Browser: Chrome 88+, Firefox 85+, Safari 14+, Edge 88+
- Network: Same LAN as Raspberry Pi (or VPN for remote access)
- Flash Raspberry Pi OS to microSD card
- Copy installation files to your Pi:
scp -r rpi-config/ pi@your-pi-ip:~/camera-suite/ - Run the installation script:
ssh pi@your-pi-ip cd ~/camera-suite/rpi-config ./install.sh
- Update camera IPs in
/etc/mediamtx/mediamtx.yml - Restart the service:
sudo systemctl restart mediamtx
-
Install dependencies:
cd webapp npm install -
Configure environment:
cp .env.example .env.local # Edit .env.local with your Pi's IP address -
Start the application:
npm run dev
-
Access at http://localhost:3000
- Complete Setup Guide - Step-by-step installation and configuration
- System Architecture - Technical details and design decisions
- API Reference - MediaMTX API endpoints and usage examples
- Raspberry Pi Setup - Pi-specific setup and troubleshooting
- Web App Quick Start - First-time setup and authentication guide
- Security Notes - Security implementation details
- Test Suite - E2E testing documentation
After installation, your system will have:
- MediaMTX Server: Running on Pi at port 8889 (WebRTC)
- Default Credentials:
admin/changeme(change immediately!) - Camera Paths:
/camera1,/camera2,/camera3(configurable) - Web Interface: Accessible via Pi's IP or localhost:3000
- HTTP Basic Authentication for all stream access
- Local Network Only - no external dependencies
- Credential Storage Options - session-only or persistent
- DTLS Encryption for WebRTC streams
- Firewall Configuration included in setup
- System User Isolation for MediaMTX service
# Service management
sudo systemctl start|stop|restart mediamtx
sudo systemctl status mediamtx
# View logs
sudo journalctl -u mediamtx -f
# Update MediaMTX
cd ~/camera-suite/rpi-config
./update.sh# Development
cd webapp
npm run dev
# Production build
npm run build
npm start
# Type checking
npm run type-check- Camera not connecting: Verify RTSP URL and credentials
- WebRTC fails: Check firewall and browser support
- High latency: Use wired connections, reduce camera bitrate
- Service won't start: Check logs with
sudo journalctl -u mediamtx
# Test MediaMTX API
curl http://pi-ip:9997/v3/config/get
# Test camera stream
curl -u admin:changeme http://pi-ip:8889/camera1/
# Check system resources
htop- Update
/etc/mediamtx/mediamtx.ymlwith new camera paths - Restart MediaMTX service
- Add camera names to webapp environment config
- Edit
readUser/readPassin MediaMTX config - Update webapp login credentials
- Restart services
Build and deploy the webapp to:
- Vercel/Netlify for cloud hosting
- Local server on the Raspberry Pi
- Docker container for easy deployment
The web interface is fully optimized for mobile:
- Touch Controls: Large, finger-friendly buttons
- Responsive Layout: Adapts to any screen size
- Swipe Navigation: Gesture-based camera switching
- Wake Lock: Keeps screen on during viewing
- Offline Support: Works without internet connection
- Fork the repository
- Create a feature branch
- Test on actual hardware (Pi + cameras)
- Submit a pull request
- Set up a Raspberry Pi with cameras for testing
- Run webapp in development mode
- Test WebRTC streaming end-to-end
- Verify mobile responsiveness
This project is licensed under the MIT License - see the LICENSE file for details.
- MediaMTX - Excellent Go-based streaming server
- Next.js - React framework for the web interface
- Shadcn/ui - Beautiful component library
- Tailwind CSS - Utility-first CSS framework
Ready to set up your camera monitoring system? 📹🔒
Perfect for:
- 🏠 Home security monitoring
- 👶 Baby/nursery monitoring
- 🐕 Pet monitoring
- 🏢 Business/office surveillance
- 🚗 Garage/driveway monitoring
Get started with the Complete Setup Guide or jump to Raspberry Pi Configuration!