Move Action by Wuul

Move Action is an open source application that monitors your webcam and can take some action when movement is detected. The action could be to lock your PC (requiring a password to reactive it), save a JPG image to disk, play a WAV sound file or run an external application. It checks the webcam at particular intervals and compares the current image with the previous one, or against a "base image" that you capture by clicking a button. If there is a significant change detected between images the program will take the configured action(s).

Here's how you might use the program to monitor your car by configuring the program to save an image when movement is detected inside a specific zone...

The actions are documented below:

Download Move Action 2.61 and source code

note - to configure the various options you need to edit the configuration file "moveaction.conf" with a text editor such as Notepad - I've put comments/examples against all the entries to make it easier to configure the settings. I occasionally think about making a proper configuration screen but so far I haven't got around to it...

1. Locking your PC

I got the inspiration for this functionality from Cryptonomicon where Randy Waterhouse is on an aeroplane using a "marvelously paranoid piece of software invented by John Cantrell" called OrdoEmacs, which is "coupled to a screensaver that uses the little built-in CCD camera in the laptop to check to see if you are actually there. It can’t recognize your face, but it can tell whether or not a vaguely human-shaped form is sitting in front of it, and if that vaguely human-shaped form goes away, even for a fraction of a second, it will drop into a screen-saver that will blank the display and freeze the machine until such time as you type in a password..."

To enable system locking, edit "moveaction.conf" and set "lockOnMovement=true". The program will now monitor the frames from the webcam and will lock the system if movement is detected. However, to give you a chance to cancel the lock, the program will start a countdown which you can stop by clicking the cancel button. The countdown time is configured by setting "cancelPeriod=N" (where N is the number of seconds the program will countdown before locking). When the countdown reaches zero your PC will be locked and you will need to re-enter your Windows password to activate it. By default, when the application locks your system it uses a standard Windows function which is exactly the same as if you pressed CTRL-ALT-DEL and selected "Lock Computer". However, this requires you to enter your Windows password in order to unlock the system. A couple of users asked me if it would be possible to automatically unlock the system when movement is no longer detected, but unfortunately it isn't possible to unlock the system as Windows requires you to enter your password. However, I have provided an alternative locking mechanism which works by disabling all the system keys, the Task Manager and completely takes over the screen - and this will automatically be unlocked when movement is no longer detected (this is probably only useful when comparing against a base image to be honest). However, I am not 100% convinced yet that this is totally secure so I have provided the option to configure the program to define the locking mechanism used - you need to set the property useWindowsLock in moveaction.conf to either true or false. Please note that if you use the alternative locking mechanism under Vista you need to run Move Action as an administrator otherwise it cannot disable Task Manager.

I need to point out that if your PC gets locked by the custom lock but you cannot unlock it and are forced to power-down, the next time you start it you may find that Task Manager is still disabled. If this happens, all you need to do is to perform a (custom) lock, followed by an unlock and it will be back to normal again. If you still get stuck please drop me an email and I will try to help - I might even release a "reset" utility if this happens a lot.


2. Capturing images

You can use the program as a simple CCTV system - whenever the program detects any movement it will save a JPG image to disk. To enable image capture, edit "moveaction.conf" and set "saveJpegOnMovement=true". The program saves jpg images into the current directory, using a numbered sequence for the file names. You have a couple of options for transmitting the images, this is in case somebody realises they are being caught on camera and decides to steal/destroy your PC. If you configure these options correctly, there should be a couple of shots of the guilty person on their way to your online account by the time they have figured out they are being filmed.

This was another idea from Cryptonomicon: Hacker Randy Waterhouse is in a meeting with a bunch of sinister business people who are about to view a demo on his laptop but he has no idea who they are....and has an idea how to find out...

What can Randy do right now to enhance shareholder value? Intrigue is not his specialty; he’ll leave that to Avi. Instead, he tunes out the meeting, opens up his laptop, and begins to hack.

Hacking is an overly glorious word for this. Everyone in Epiphyte Corp. has a laptop with a tiny built-in video camera, so that they can do long-distance videoconferencing. Avi insisted on it. The camera is almost invisible: just an orifice a couple of millimeters across, mounted in the top center of the frame that surrounds the screen. It doesn’t have a lens as such—it’s a camera in the oldest sense, a camera obscura. One wall contains the pinhole and the opposite wall is a silicon retina.

Randy has the source code — the original program — for the videoconferencing software. It is reasonably clever in its use of bandwidth. It looks at the stream of frames (individual still images) coming from the pinhole camera and notices that, although the total amount of data in those frames is rather large, the difference from one frame to the next is tiny. It would be altogether different if Frame 1 were a talking head and Frame 2, a fraction of a second later, were a postcard shot of a Hawaiian beach and Frame 3 a diagram of a printed circuit and Frame 4 a closeup of a dragonfly’s head. But in fact, each frame is a talking head—the same person’s head, with minor changes in position and expression. The software can save on precious bandwidth by mathematically subtracting each new frame from the previous one (since, to the computer, each image is just a long number) and then transmitting only the difference.

What it all means is that this software has a lot of built-in capabilities for comparing one image with another, and gauging the magnitude of the difference from one frame to the next. Randy doesn’t have to write that stuff. He just has to familiarize himself with these already-existing routines, learn their names and how to use them, which takes about fifteen minutes of clicking around.

Then he writes a little program called Mugshot that will take a snap shot from the pinhole camera every five seconds or so, and compare it to the previous snapshot, and, if the difference is large enough, save it to a file.

Randy slides the computer over to John, who runs through the demo (there should be a mug shot of John Cantrell stored on the hard disk now). One by one, members of the other delegations run the demo.....


3. Running an external application

The program can be configured to launch any other application when movement is detected. To enable this setting, just enter the full path of the program you want to run in the setting "launchOnMovement" in the file moveaction.conf, e.g. launchOnMovement=c:\apps\someprogram.exe You can also configure the working directory that your application starts in by setting "workingDirectory" to the directory you require.


4. Playing a sound

The program can play a sound file when movement is detected. The sound file must be a WAV file (e.g. mysound.wav), and you enter the name of the file in the setting "playSoundOnMovement", e.g. "playSoundOnMovement=c:\sounds\alarm.wav".


5. Shutting down your PC

The program can shut down your PC when movement is detected. Just set "shutdownOnMovement=true" in moveaction.conf. I can't think of many reasons why you would want to do this, but you never know...


Setting the source of images

By default the program captures images from your webcam. However, it can be configured to retrieve the images from an external URL by setting the "source" property in "moveaction.conf" to the URL of a jpg file, e.g. source=http://mywebsite.com/images/webcam.jpg. This makes it possible to link two instances of Move Action together, e.g. you could set up your webcam at home to upload images to a web site (using the FTP upload feature), then use a second instance of Move Action to grab the images and alert you wherever you happen to be if any movement is detected.

If you are using the webcam option, there is a button on the toolbar that allows you to configure the webcam (this brings up the manufacturer's dialog).


Defining a movement capture zone

You can configure Move Action to only detect movement within a particular area of the image. To do this, click the button on the top panel, and a blue rectangle will appear within the image. The program will now only detect movement within this zone. To position the detection zone, drag it around using the blue border. To resize the zone, hold the shift key down and drag the bottom-right corner border of the zone. Note that you cannot move or resize the detection zone outside of the main image. If you click the zone button again the blue zone will disappear, and the entire screen is monitored instead.


Other notes

The movement sensitivity is controlled using the slider where you can adjust the value that will cause movement detection to trigger. This is basically a percentage of the image that must have changed for movement detection to be triggered. For example, setting this to 1 means that only 1% of pixels needs to change in order to trigger movement detection (this will trigger constantly), whereas setting this to 100 means that every pixel needs to change and therefore movement detection is very unlikely.


Bugs/Gotchas:

For some reason, the button that allows you to cancel the system lock is not displayed when the program restores from the system tray. I have no idea why this is, as you can still press ESC to cancel the lock. The button is displayed if you set "minimizeToTray=false" (the program minimizes to the taskbar). Just a quick note - I do try to test the program thoroughly before releasing a new version, but it is quite possible that a bug will creep in occasionally; if you do experience problems running the latest version, all the previous versions of the program can be downloaded using the links at the end of this page so it may be worth trying an older version. Please let me know if you have any problems running the program, my email address is

Sorry, but a Javascript-enabled browser is required to email me.


As I don't get a lot of time to respond to emails, I have created a forum where you can discuss this software with other users. Feel free to post bug fixes, suggestions for improvements, questions or anything else related to this software. The forum link is http://wuulsoftware.freeforums.org/

To build the software you will need these additional components


Previous versions of Move Action:

Move Action 2.6
Move Action 2.5
Move Action 2.4
Move Action 2.3
Move Action 2.2
Move Action 2.1
Move Action 2.0
Move Action 1.9
Move Action 1.8
Move Action 1.7
Move Action 1.6
Move Action 1.5

Home