Skip to content

Web streaming & still image motion detection capture on the Raspberry Pi.

Notifications You must be signed in to change notification settings

ashrielbrian/raspi-motion-streaming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro

Web streaming & still image motion detection capture on the Raspberry Pi.

This project:

  • streams the output of the picamera through a HTTP server
  • detects motion using a simple rules-based algorithm (see below)
  • captures still images and saves to a data/ directory in the project directory

Motion detection algorithm taken from pyimagesearch, with the streaming component adapted from picamera's advanced recipes.

Usage

    python3 -m venv .venv
    source .venv/bin/activate

    pip install -r requirements.txt -i https://www.piwheels.org/simple
    python main.py

where the -i flag is used to find pre-compiled wheels at the piwheels index (way faster installation on raspberry pi).

Then, open your favourite browser, and provided your Pi is on the same local network, go to http://<raspberry-pi-local-ip>:8000/. Say hi to the camera!

If you want your stream accessible on the public internet (hello justin.tv), download ngrok:

    ngrok http -region=ap -auth="<user>:<pw>" 8000

Notes

Tested on a raspberry pi 4B, with 4GB RAM, and a v2.1 camera module.

Future work

  • Instead of capturing and saving still images, capture the past x seconds of video.

About

Web streaming & still image motion detection capture on the Raspberry Pi.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages