Turn your webcam into an FTP security camera

Posted in Technology
Mon, Jan 29 - 4:14 pm EDT | 8 years ago by
Comments: 7
Share This Post:
  • Facebook
  • StumbleUpon
  • Tumblr
  • Reddit
  • Twitter

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 Posts

Share This Post:
  • Facebook
  • StumbleUpon
  • Tumblr
  • Reddit
  • Twitter
  • http://www.video-surveillance-guide.com/ Audrey

    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?

  • http://www.bestsecurityzone.com Jim McDonald

    Does anyone have or know of an online management tool (to view multiple cameras over the internet) for Linux?

  • http://www.hoeg.com Peter Hoeg

    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.

  • http://cbsketchpad.homelinux.net cbsketchpad

    Cool I’ll give it a try :)

  • Luis

    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

  • anon

    ok how about i have 25 fps in order to avoid blurry motion, but then i want to upload but i don’t want to have 1000 emails or ftp connections (firewall will block attempts)?

  • Michael

    Thanks for the description. Is it possible to upload the files to an SFTP via wput?