Acquiring videos from webcam and converting to PGM

ReacTIVision can process image data recorded as PGM files.

First acquire some video from the webcam with mencoder.

mencoder tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -nosound -ovc lavc -o myvideo.avi

This was taken from an article on linux.com. I’ve found that v4l2 works but v4l doesn’t. Replace video0 with your video device.

To convert the avi to a series of PGM files use mplayer.

mplayer -vo pnm:pgm myvideo.avi

This entry was posted on Tuesday, November 11th, 2008 at 07:01:46 Europe/London and is filed under Linux. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply