Motion: Your Eye in the Sky for Computer Room Surveillance
Let's say you have a room full of thousands of dollars' worth of computer equipment. That's probably something you want to keep an eye on, right? With that in mind, you install a network-connected camera. Now, you can surf over to the camera's Web page and see what's going on in the server room at any time of day or night. That's an improvement, but you quickly realize some sort of recording facility is needed, in case you need to figure out who was in the room last Tuesday. So, you start saving the video to another system on the network for possible viewing at a later time. Maybe you write a few scripts to rotate the video after a week or so to keep from filling up your hard drive.
After wading through hours of video to find out who “borrowed” your favorite screwdriver, you realize further refinements are necessary. Wouldn't it be great if the computer could keep only the interesting video and throw out everything else? Enter Motion, a free motion-detection program. Process your video through it, and 24 hours of daily video becomes 15 minutes of video clips documenting every time something moved in that room—technology to the rescue.
Motion works with either standalone netcams, such as those offered by Axis (see the on-line Resources), or any camera connected to a video4linux-compatible video capture card. I concentrate here on using a standalone camera, the Axis 2100, because it's simpler to set up. In any case, you need a Linux system to save the video and to run Motion as well. Motion can require quite a bit of processing power, but a system with a Pentium III CPU or higher should work okay if the machine is dedicated to running only Motion.
Installation and configuration of the Axis camera is straightforward. Pick a location for it in the room you want to monitor, and run power and Ethernet cables. In my experience, a camera mounted slightly above eye level, seven feet up or so, in a corner of the room provides the best coverage. Follow the camera install instructions to assign it an IP address on your network. Then, verify that the camera works by pointing your Web browser at the camera's Web page.
The computer system that is going to save the video and run Motion can be situated anywhere you like. It's probably best to keep it on the same logical and physical network as the camera, for simplicity's sake.
Any modern Linux distribution should work fine. I use Fedora Core 1 in my setup.
Obtain Motion from the Motion Web site (see Resources). The current version at the time of this writing is 3.1.16. You can use either the RPM supplied on the Motion Web site or build from source. I don't recommend using RPMs or Debian packages from elsewhere as they tend to be out of date and lacking features. Numerous important changes have occurred in Motion development in a few months' time.
The only other software dependency is the ffmpeg library, which Motion uses to generate MPEG videos. You must use the released version 0.4.8 of ffmpeg, as newer development versions do not work well with Motion. Download ffmpeg source (see Resources); you must have ffmpeg built and installed before building Motion. Otherwise, Motion attempts to use an older tool called mpegplayer to create videos. You probably don't have that installed either, so Motion won't work very well.
After you have downloaded both Motion and ffmpeg, untar them in a directory such as /tmp. Then, cd to the ffmpeg source directory and run:
$ ./configure $ make # make install
The last command must be run as root.
These commands install the ffmpeg libraries under /usr/local/lib. Then, cd to the Motion source directory and again run ./configure. This time, make sure to check the results. In particular, under Configure Status, FFmpeg Support must say Yes. If not, Motion didn't find the ffmpeg library on your system. This is the number one cause of problems and confusion when installing Motion. Don't continue until you resolve this problem. Figure out where on your system the file libavcodec-0.4.8.so is located, and rerun configure in the Motion directory as follows:
$ ./configure --with-ffmpeg=/some/random/path
Once you are able to run configure and see it report FFmpeg Support: Yes, you can build and install motion:
$ make # make install
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
|CentOS 6.8 Released||May 27, 2016|
|Secure Desktops with Qubes: Introduction||May 27, 2016|
|Chris Birchall's Re-Engineering Legacy Software (Manning Publications)||May 26, 2016|
|ServersCheck's Thermal Imaging Camera Sensor||May 25, 2016|
|Petros Koutoupis' RapidDisk||May 24, 2016|
|The Italian Army Switches to LibreOffice||May 23, 2016|
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Secure Desktops with Qubes: Introduction
- Chris Birchall's Re-Engineering Legacy Software (Manning Publications)
- The Italian Army Switches to LibreOffice
- Linux Mint 18
- Petros Koutoupis' RapidDisk
- ServersCheck's Thermal Imaging Camera Sensor
- Oracle vs. Google: Round 2
- The FBI and the Mozilla Foundation Lock Horns over Known Security Hole
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide