Tuesday, January 31, 2012

Using Motion to set up a web-cam for security (Ubuntu 10.04)

So you want to setup a web-cam to capture what a web-cam see's when there is movement?


You will need a program called 'motion'. 


Open a terminal window and type in:


sudo apt-get install motion


and key in your password when prompted. It's a quick install. Once installed you can start the program with:


sudo motion


To stop the monitoring press ctrl+c


The default configuration will record only when there is movement at the web-cam and it will record a video and jpg files whilst the movement continues. To configure motion edit the /etc/motion/motion.conf file. It's well commented. This file is locked to the root user. To overcome this use: sudo gedit /etc/motion/motion.conf.


Motion records the images in a folder called /tmp/motion. These files are locked and can't be deleted except by the 'root' user. To remove them, open a terminal window and type in cd /tmp/motion and then sudo rm *.jpg and give it your password if prompted.


To view the live monitoring of your web-cam, open your browser to http://localhost:8081. From another machine on the network use http://xxx.xxx.xxx.xxx:8081 and use the IP address of the monitoring computer.


Personally, I have set the capture directory to /home/your-user-name/motion so it's easier for me to view and delete the files as necessary. The files are named very cleverly with a reverse date and time so you can go straight to necessary incident.


Enjoy.

No comments:

Post a Comment