Skip to content
Collection of two pure Python image capture scripts from the Raspberry Pi forums
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Modifications of brainflakes' sterling work implementing motion in Python original script by brainflakes, improved by pageauc, peewee2 and Kesthal

Use raspi-config to enable camera support if necessary:

 sudo raspi-config

Install the prerequisites:

sudo apt-get install python-imaging-tk

Copy the init script into place

git clone  ""
cd RPIPythonMotion
sudo cp pymotion /etc/init.d/pymotion
sudo cp default_pymotion /etc/default/pymotion

Make the Output directory:

mkdir /home/pi/MOTION/

Copy the picam binary into place:

sudo cp /usr/local/bin/

Enable the init script:

sudo insserv pymotion
sudo /etc/init.d/pymotion start

Alternate (better) script

JBeale and waveform80 have written a very fast implementation which produces B&W images very quickly. Assuming you have done the above steps (namely putting the init script in place, and running insserv).: Stop pymotion and install the prereqs:

sudo /etc/init.d/pymotion stop
sudo apt-get install python-opencv python-numpy python-picamera

Copy the new Python script in place over /usr/local/bin/

cd /home/pi/RPiPythonMotion
sudo cp /usr/local/bin/

Restart pymotion:

sudo /etc/init.d/pymotion start
You can’t perform that action at this time.