I am using the Genius WideCam 320. Although it doesn't support MPEG or H264 compression, it does work with OpenCV and costs less than $25.
To get started, watch Beaglebone Video Capture and Image Processing on Embedded Linux using OpenCV by Derek Molloy. It is an excellent tutorial. Listed below are some of the commands he uses in the video.
Instead of using Derek's captuer and grabber programs, I just used the following to make sure Video for Linux 2 could actually take a picture programmatically:
If you are using a cheap webcam, you will need to reduce the resolution in Derek's boneCV and boneCVtiming programs prior to compiling them. I believe I had to change the permission on the boneCV.cpp file prior to being able to edit it.
Here are the results of Derek Molloy's boneCV program at a resolution of 320x240.
Using Derek's boneCVtiming program at a resolution of 160x120, I can capture and process about 11 frames per second! This should be fast enough to make computer vision on a BeagleBot useful.
To output video via OpenCV: http://opencv-srf.blogspot.com/2011/09/capturing-images-videos.html (scroll down to the second program)