Raspberry Pi Camera – Basic Motion Detection

Here’s a very basic method for implementing motion detection using a Raspberry Pi and camera.

This script works by taking an image and comparing it to the last significant image taken – if the images differ by 10% (this can be configured to suit your environment), the new image will be saved.

The idea here is that images are only stored when a significant change has been detected. The image comparison algorithm has been taken from Rosetta Code.

Continue reading “Raspberry Pi Camera – Basic Motion Detection”


Raspberry Pi Camera Live Streaming

I recently bought a Camera Module for the Raspberry Pi. One of the main reasons for getting one was to see if I could set up a live stream from the camera that would be accessible from a web browser or mobile device – partly because it seemed like an interesting project, and partly so I can keep an eye on our dog while I’m away from the house.

It turned out that this was very achievable, but it does require quite a bit of configuration to get things working. I thought I’d document my process here, in the hope that my experiences might help anyone else trying to get a live stream up and running from their Raspberry Pi.

I’m using the following software to enable the live stream:

  • Raspbian
  • FFmpeg
  • libx264
  • nginx with rtmp
  • Safari (OS X or iOS)

Assuming that you have a Raspbian installation up & running, I’ll run through the configuration of the other items below.

Continue reading “Raspberry Pi Camera Live Streaming”