Ring Motion Recorder

Docker-ready Python recorder for a Ring camera. The script keeps a Ring WebRTC stream warm, runs local OpenCV-based motion detection on incoming frames, and writes MP4 clips when motion is detected.

Features

  • Authenticates with ring-doorbell, including token caching and optional 2FA input.
  • Connects to Ring live view over WebRTC with aiortc.
  • Runs local frame-difference motion detection.
  • Records motion-triggered MP4 clips with FFmpeg.
  • Can run locally or through Docker Compose.
  • Supports environment variables for device name, output paths, recording length, live preview, FPS, motion warmup, and reconnect timing.

Requirements

  • Python 3.11+
  • FFmpeg available on the system path for local runs
  • Python packages from requirements.txt
  • Docker and Docker Compose for containerized runs

Configuration

Copy .env.example to .env and set RING_DEVICE_NAME to the exact camera name from your Ring account.

The app stores Ring auth tokens in RING_CONFIG_DIR and recordings in RING_OUT_DIR. Those folders are intentionally ignored by Git.

Docker Usage

docker compose up --build

For the first login, run interactively so the script can ask for Ring credentials and a 2FA code if needed.

Local Usage

pip install -r requirements.txt
python ring_live_view.py

Privacy Notes

Do not commit token cache files, .env files, recorded clips, or exported Docker image archives. This repository is configured to ignore those files by default.

Built With

Share this project:

Updates