Webcam
Raspberry Pi with its very low power consumption and huge possibilities is a good candidate to become guardian of our property. Now with RPi you will be able to monitor on-goingly what’s going on in your appartment or office. You can record it in a movie format or store snapshots only – and you can do it only if anything changes in your camera’s sight. Cool, right? So let’s do it!
Note: instalation of Motion software did not succeed on Raspbmc so use Weezy instead.
If you don’t have a webcam yet, check webcams compatible with Motion. List of compatible devices can be found here
Connect your webcam to powered USB hub.
If you have a web cam already (I have tested Playstation EYE and A4 tech web camera) what you need to do is to update packages list and install Motion:
sudo apt-get update sudo apt-get -y install Motion -y Assume Yes to all queries and do not prompt |
What is Motion?
Motion is a program that monitors the video signal from one or more cameras and is able to detect if a significant part of the picture has changed; in other words, it can detect motion.
The program is written in C and is made for the Linux operating system, (using the video4linux interface). Motion is a command line based tool whose output can be either jpeg, ppm fies or mpeg video sequences. Motion is strictly command line driven and can run as a daemon with a rather small footprint and do.
Motion is the perfect tool for keeping an eye on your property, keeping only those images that are interesting.
source: http://www.lavrsen.dk/foswiki/bin/view/Motion
Imagine, that you’re almost done :) The only thing that is left to change Motion configuration.
There are 2 configuration files:
pi@raspberrypi /etc $ cat /etc/default/motion # set to 'yes' to enable the motion daemon start_motion_daemon=yes |
The other config file, ‘the real one’ is located at /etc/motion/motion.conf and there are several parameters that I had changed or that I find important for Webcam for monitoring purposes to confirm their values:
(There is a lot of possible usage of Motion but I will focus here on Webcam image broadcast over the Internet.)
sudo nano /etc/motion/motion.conf |
daemon on setup_mode off videodevice /dev/video0 input 8 width 640 height 480 framerate 2 auto_brightness off brightness 50 contrast 40 saturation 100 hue 0 webcam_port 8081 webcam_quality 90 webcam_motion off webcam_maxrate 2 webcam_localhost off control_port 8080 control_localhost off control_html_output on |
Description of options is quite well presented in the config file itself, but if you prefer, you can read about it at http://www.lavrsen.dk/foswiki/bin/view/Motion/CaptureDeviceOptions
Now let’s turn Motion on:
pi@raspberrypi /etc/motion $ sudo service motion start [ ok ] Starting motion detection daemon: motion. |
Now you can use your web browser to see the outcome. Assuming that your RPi has ip 192.168.1.106 open the following address in the browser:
192.168.1.106:8081
To stop it:
pi@raspberrypi /etc/motion $ sudo service motion stop [ ok ] Stopping motion detection daemon: motion. |
Continue reading here: Media Center - Xbmc Polish VOD And Subs
Was this article helpful?