Transform your Raspberry Pi into a powerful home security camera with the Pi Camera app. Using peer-to-peer (P2P) communication over WebRTC to make a decentralized monitor system, this app connects directly to your Raspberry Pi, allowing you to monitor live video with minimal delay and access historical footage. [demo video]
👉 Low-Latency Live Monitoring: Achieve extremely low-latency video streaming through WebRTC technology, ensuring you don’t miss any important moments.
👉 Playback of Historical Footage: Easily view and manage recorded videos to meet your security needs.
👉 Simple Setup: Quickly configure your Raspberry Pi camera through a user-friendly interface.
👉 Privacy Protection: Direct P2P connection without relying on third-party servers ensures that your data is fully under your control.
👉 Open-Source Support: The camera source code is fully open-source, allowing you to customize and extend it as needed.
Important Notice
- MQTT Server (necessary): It must be over SSL/TLS! This server exchanges initialized signals (ICE, SDP) to help p2p hole-punching. Please use the same setting on your raspberry pi camera program. You can setup own MQTT server, or choose some free plans including but not limited to HiveMQ, EXMQ.
- STUN Server (optional): If it's empty, the Google STUN server
stun:stun.l.google.com:19302
will be used by default. - TURN Server (optional): This is used for a few mobile networks or specific scenarios. If your NAT setup doesn't allow for p2p hole-punching, the TURN Server will help relay data transfers.
- Go to Setting Page.
- Click 🌐 icon and paste your servers setting. Here is an example mqtt setting shown on HiveMQ.
-
Click ➕ icon
-
The app will generate a
UUID
, which will be used on your Raspberry Pi later.
If you'd like to assign a specific ID to the device, you can edit theUUID
at the beginning. Once confirmed, theUUID
cannot be edited; you will need to delete the device and add a new one if changes are needed. -
Enter a name in the "Alias", which can be edited at any time in the future.
-
The new device will appear on the list after clicking the confirm button. You can change the order of devices on the selectors and home page by dragging the ☰ icon.
-
Download the
pi_webrtc
software from the release page. -
Run the
pi_webrtc
on your Raspberry Pi. Here’s an example where the deviceuid
is set toabcdefg-123-1qaz2wsx
in the app.Important: The MQTT port specified in the command is NOT the WebSocket port (8884), but the standard MQTT protocol port (8883).
/path/to/pi_webrtc --device=/dev/video0 --fps=30 --width=1280 --height=960 --v4l2_format=h264 --hw_accel --mqtt_host=example.s1.eu.hivemq.cloud --mqtt_port=8883 --mqtt_username=hakunamatata --mqtt_password=WonderfulPhrase --uid=abcdefg-123-1qaz2wsx --record_path=/mnt/ext_disk/video/
For detailed setup instructions, please refer to the guide on the RaspberryPi_WebRTC page.
-
Please switch to the home page, the app will try to connect to Raspberry Pi.
-
If everything is correct, the status light will turn green.
-
The preview image is refreshed every 90 seconds, and it can be refreshed immediately by scrolling down the page.
-
Click the share button on the phone that can connect to Raspberry Pi already. It'll show the QR code.
-
Pick up the second phone click the QR code button in the add device section, and scan the QR code will copy the device, including the network setting, to the second phone. Notice! The network setting will be replaced in the second phone if set before.
If you have any questions, need support, or just want to provide feedback, you can reach out via
Thank you for using Pi Camera!