Baby and Pet Monitor with a Low-Latency Live Stream
Watch a room from any phone or browser on your home network with MediaMTX — private, no cloud.
MediaMTX is a lightweight streaming server that can read the Raspberry Pi camera directly and serve it over WebRTC with very low delay. Use the NoIR camera and an IR light for night view.
A camera in a child's room must never be reachable from the internet without strong authentication. Keep it on your local network or VPN.
Mission steps
Install MediaMTX
Download the ARM64 release from its GitHub page and unpack it on the Pi.
Enable the camera source
In mediamtx.yml, add a path with source: rpiCamera and set resolution and frame rate.
Start it
Run ./mediamtx and open http://<pi-ip>:8889/cam in a browser for the WebRTC stream.
Run at boot
Create a systemd service so the monitor comes back after a power cut.
Keep it private
Do not port-forward. Use Tailscale for remote viewing and set a username and password in the config.
Code
# mediamtx.yml (excerpt)
paths:
cam:
source: rpiCamera
rpiCameraWidth: 1280
rpiCameraHeight: 720
rpiCameraFPS: 30Tip: test every script on the bench before installing it in a moving machine.
Questions
Can it alert on crying?
Yes — a small audio-level script can send a notification when sound stays loud for a few seconds. It is a convenience, not a medical device.