By Forrest Cook
June 10, 2008
Motion
is a video application that monitors a video4linux device such as a
USB camera and records movement within the image:
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. Motion is a command line based tool whose output can be either jpeg, ppm fies or mpeg video sequences.
An installation of Motion was performed on a machine with a 3Ghz
Athlon 64 processor running Ubuntu 7.04 (Feisty Fawn).
The most recent version of Motion (v 3.2.10.1) was
downloaded, the file was uncompressed and untared.
The normal configure, make and make install steps were performed.
If one wishes to record mpeg movies, the libavcodec and libavformat
libraries must be installed prior to running configure.
The make install step needed a bit of manual intervention,
it was necessary to create the /var/run/motion directory and
copy the motion-dist.conf configuration file to
/usr/local/etc/motion.conf. The config file was modified to
define a USB camera, the camera's default resolution was defined
and the destination directory for images was set.
The framerate parameter was changed to 2 seconds to slow down the
rate of accumulation of image files.
A Kensington Model 67015 VideoCAM VGA USB camera was plugged into
the computer.
It is a good idea to run a real-time video monitoring application such as
xawtv or
EffecTV (in DumbTV
mode) to adjust the camera's focus, brightness and contrast settings.
Running Motion was simply a matter of typing "motion"
on the command line. The program takes about 25 seconds to start
recording movement, presumably most of this time is spent learning
the contents of the video. After this delay, the software would
output a line of text and create one .jpg file for each movement
it detected. The images were inspected with the
Mirage image viewer and a changing sequence of static images was
observed.
Motion has a wide variety of capabilities and configurable
parameters. The
Motion Guide and
Config File Options are a good place to read about the
various capabilities and the
FAQ gives answers to common questions.
One can imagine a number of uses for Motion, cube farm denizens could
find out what is causing their pens to disappear at night, people in high
crime areas could use it to catch vandals and thieves in the act.
The on_picture_save configuration directive can execute a script
on motion detection, this could be used to copy captured images to
a distant web server for remote monitoring.
This feature was tested by adding a line like this:
on_picture_save scp %f remote-host:/directory-path
to the config file, the operation worked as expected.
It should be noted that inexpensive USB cameras may only work in a
very limited set of lighting conditions. Serious surveillance
would require an NTSC or PAL video input adapter and a better
camera, or a high resolution webcam.
Apparently, no major releases of Motion have been released in a long
time, but the developers'
mail archive shows that recent work has been done on the project.
A new point release just showed up this week, it added a fix
for a security bug.
If you are looking for a way to do automated video surveillance,
Motion is an excellent tool for the job.
(
Log in to post comments)