Turn your webcam into an FTP security camera
If you have a webcam sitting around, a great alternative use for it is to turn it into a security camera. Having a security camera in your house, office, or apartment can provide numerous benefits. This guide is for beginners who have no experience in setting up webcam security cameras. I will show you how to turn your webcam into a security camera using GNOME.
The first step is to make sure your camera is detected. Go to System >> Administration >> System Log. In System Log go to Open and choose “messages.” At the bottom of the log make sure you see an entry related to your webcam.
The second step is to install motion. You can download the package appropriate for your distribution from the motion web site. Alternatively, Motion is in most repositories so you can install it using apt-get install motion.
The third step is to actually fire up Motion. Motion runs from the terminal. Open a terminal and type motion to get started. What’s nice about Motion is that it only records movement. Run your hand in front of your webcam so that motion will record some images. Press CTRL+C in the terminal to stop motion.
Now, navigate to /tmp directory and you will see the timestamped images captured by Motion.
However, saving files to the /tmp directory is not very helpful. You can change this directory by going into the /etc/motion/motion.conf and changing the line that says target_dir /tmp to a directory of your choice.
Also, it is not very helpful to have these images saved to your local hard drive because if someone broke into your home they would probably steal the computer that has the images on it. Therefore, we will set Motion to save the images to an external server via FTP.
In order to do this you need to install wput. Wput is widely available in the repositories and can be installed using apt-get install wput. After you install wput, add the following line at the end of the /etc/motion/motion.conf file:
on_picture_save wput ftp://username:password@yourserver %f
The %f is added at the end of the file to upload each picture as it is taken. Motion is a very handy tool and can also record full movies instead of pictures (which I demonstrated). Please see the configuration options at the Motion homepage to learn about the many other things you can do with Motion.
Does anyone know a better way to do this in Linux? Please tell us your way in the comments.
Related Stories
POSTED IN: How To
5 opinions for Turn your webcam into an FTP security camera
Audrey
May 1, 2007 at 3:12 am
Thanks. This is a lot simpler than other How-Tos in the net. Now I can set up my own surveillance camera without having to call them up for another how-do-you-do-that-again?
Jim McDonald
Jun 8, 2007 at 8:41 am
Does anyone have or know of an online management tool (to view multiple cameras over the internet) for Linux?
Peter Hoeg
Jun 20, 2007 at 1:49 am
I suggest emailing the images instead of ftp’ing them. Somebody breaks in and they could retrieve id and password from the machine to log on to the remote machine in order to delete the images. It admittedly would be a little more complicated than what most burglers could do, but this way you ensure that once the images are sent, the person breaking in cannot remove them. Alternatively if using the ftp option (or ssh/scp), the permissions need to be set on the receiving ftp server in a way that prohibits removing files once written.
cbsketchpad
Jan 2, 2008 at 1:08 pm
Cool I’ll give it a try :)
Luis
Feb 18, 2008 at 9:10 pm
Thanks a lot for this nice an easy howto…. Check this link…
http://lifehacker.com/software/how-to/create-a-motion-detecting-security-camera-in-linux-273034.php
for mor information on other cameras
Kind regards
Luis
Have an opinion? Leave a comment: