PiKrellCam is an audio/video recording motion detect program with an OSD web interface that detects motion using the Raspberry Pi camera MMAL motion vectors.
Read about it and install instructions at: PiKrellCam webpage
sudo apt-get install git
Git download with: $ git clone https://github.com/zweistein22/pikrellcam
sudo apt-get install libasound2-dev alsa-base alsa-utils sudo apt-get install libmp3lame-dev
cd ~/pikrellcam/src
make -j4
cd ~/pikrellcam
./install-pikrellcam.sh
in case of errors you can try to delete ~/.pikrellcam/pikrellcam.conf