ContaCam is a freeware application for capturing, recording and reviewing camera footage.
The program supports multiple hardware types, including webcams, WDM and DV devices and IP cameras. In many cases it can record audio along with the video footage.
ContaCam has a very configurable motion detection algorithm. You're able to set its sensitivity, define the size of zones to use, to ignore detections shorter than a defined period, even to schedule when detection is enabled or disabled (9:00 am to 5:00 pm on weekdays, say).
What happens next? At a minimum, you could just save the video. ContaCam allows you to define a "before" and "after" period to ensure you capture the full event (the five seconds of footage before and after the detection, maybe).
In addition, the program can send you an email, upload the footage to an FTP server, or run some custom command to trigger whatever action you like.
There is an array of other settings to cover basic camera operations (resolution, frame rate), when and how footage is recorded, and how it's kept on your hard drive (a day, a month, a year, what's the maximum camera folder size, more).
ContaCam has almost as much control over viewing. You can check out live footage from within the program, easily browse to historical recordings, or access the system from anywhere by using the integrated server, enabling port forwarding or using Dropbox.
A well-designed, powerful and highly configurable video surveillance tool.