Firefox 16, a treat for developers http://t.co/cnd27CzT
Howto Turn your old webcam into a motion-detecting security camera in Linux
If you have an old cam that you are not using, you can use it as a security cam. Control 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.
What motion can do?
- Taking snapshots of movement
- Watch multiple video devices at the same time
- Watch multiple inputs on one capture card at the same time
- Live streaming webcam (using multipart/x-mixed-replace)
- Real time creation of mpeg movies using libraries from ffmpeg
- Take automated snapshots on regular intervals
- Take automated snapshots at irregular intervals using cron
- Execute external commands when detecting movement (and e.g. send SMS or email)
- Motion tracking (camera follow motion – special hardware required)
- Feed events to a MySQL or PostgreSQL database.
- Feed video back to a video4linux loopback for real time viewing
- Lots of user contributed related projects with web interfaces etc.
- User configurable and user defined on screen display.
- Control via browser (older versions used xml-rpc)
- Automatic noise and threshold control
- Motion is a daemon with low CPU consumption and small memory footprint.
Watch some examples here
- For ubuntu / LinuxMint and other debian based systems, you can install motion from terminal using the command:
sudo apt-get install motion
- For Fedora :
RPM for Fedora 12/13/rawhide on x86/x86-64 – Available on RPM Fusion, build without DB support.
Motion and all its dependencies (ffmpeg…) are available on the RPM Fusion repository. Configure the repository and Install motion with
yum install motion
-For other linux distributions download and install the tar package.
- ntar and uncompress the file to the place you want the program installed. Editor recommends placing the motion source file directory in /usr/local.
cd /usr/localtar -xvzf /path/to/motion-3.2.X.tar.gz
- Before to start compiling be sure to have build essential installed:
sudo apt-get install build-essential
- You will now have created a directory called motion-3.2.X. You can rename it to motion (mv motion-3.1.X motion). I recommend creating a symbolic link to the current version. This way you can more easily experiment with different version simply by changing the link.
ln -s motion-3.2.X motion
- Now change to the new directory
- Run configure. You can start with the defaults. If you need to modify the installation parameters you can read the next section.
- Build the code
- Install the code, manual page, etc
- In /etc/motion/ you will find a file called motion-dist.conf. If it is the first time you install Motion – rename this file to motion.conf and edit as a minimum the settings: videodevice, input, norm, frequency, width, height and target_dir. That should get you going.
- Run the program. To enable more features you must modify the config file.
To start motion open terminal and type :
After motion is installed, we have to configure Motion to save captured images in a remote server, to do that we need to install wput a command line FTP client that upload the captured photos by motion , to an remote FTP server. You can install wput by entering the following command into a terminal :
sudo apt-get install wput
- Now you can configure Motion to use wput to upload captured photos by adding the lines bellow to motion.conf file :
And add these lines at the end of the file:
# Command to be executed when a picture (.ppm|.jpg) is saved (default: none)# The filename of the picture is appended as an argument for the command.on_picture_save wput ftp://USERNAME:PASSWORD@REMOTE SERVER %f
Now save and close.
- Finally, we will add Motion to startup automatically start with the server, to do that go to top menu System–>Preferences–>Startup applications then add a new startup program, type in a name for it and then type:
You should now be able to open a web interface for Motion now by typing in localhost:8000 from the server itself or XXX.XXX.X.XXX:8000 from another computers web browser. To view a live stream of your webcam type localhost:8001 from the server itself or XXX.XXX.X.XXX:8001 from another computers web browser. You can change settings from this interface here too, you can even make Motion generate it’s own config files to fit your setup exactly.
Result after installing motion:
Like us on Facebook
This week Top Posts
- Top Things to do After Installing Ubuntu 13.04 ‘Raring Ringtail’ : Ubuntu 13.04 Raring Ringtail final is almost out. The final release it scheduled for release on Apri...0 comment(s) |
- Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...0 comment(s) |
- Howto: Upgrade to Ubuntu 13.04 Raring Ringtail from 12.04, 12,10 | Desktop & Server : Updated 05-04-2013: Ubuntu 13.04 Raring Ringtail will be released Soon, If you have ubuntu 12,10, 12...0 comment(s) |
- How to use Remote Desktop in Ubuntu : Sometimes, we need to access our computer from other locations when we’re not at home and such. This...0 comment(s) |
- Configure conky-Lua in Ubuntu (12.10 & 13.04 Raring Ringtail), Fedora, debian and LinuxMint | Howto Conky : Updated 05-04-2013: Conky is a free, light-weight system monitor for X, that displays any informatio...0 comment(s) |
- Unix/Linux File Recognition. Did You Know? : Did you know that Unix and Linux has no concept of a file extension? What is a file name extension? ...1 comment(s) |
- Steganography- Hide Your Files Inside An Image in Linux
- Unix/Linux File Recognition. Did You Know?
- Migrate from MySQL to MariaDB in FreeBSD
- Connect Your Android Galaxy Tablet to Ubuntu via USB
- ElementaryOS Beta 1 and 2 Comparison and Review
- Introduction to the Linux Command Line
- A Secure Password
- Linux Kernel 3.10. It’s BIG!
- Monitoring Users Activity Using psacct or acct Tools in Linux
- Run Your Own Social Network Using elgg on RHEL / CentOS and Scientific Linux
Copyright © 2008-2013 Unixmen.com .