I have rewritten my timelapse script to include webcam support.
The script is designed to create time lapse videos to document my progress in Ludum Dare competitions.
The script uses scrot for taking screenshots and mencoder to compile the created images into a video. I have also written a python script to capture images from a webcam along with the desktop screenshot that the timelapse script uses.

The script can also scale each screenshot image for you to keep file size down.

I originally had a bash script for webcam capture, it used the video4linux driver with mplayer, but that ran into a problem of the webcam shutting down after around 80 images. The new version is a short python script that uses openCV.

The webcam script is an optional addition to the timelapse script and can be replaced with an alternative script if you have a better one.

Download the timelapse script here
Download the webcam script here

to capture just the desktop every minute:
timelapse capture -t 60
or screenshot size at 50% and also using wcapture (the webcam script).
timelapse capture -t 60 -size 50% -cam wcapture
The script can then convert images into a video
timelapse compile timelapse.avi