Taking automated screenshots from a live video camera

Following my previous post, I attached a video camera to the composite input of my tv tuner. One good thing I didn’t noticed yesterday is that mplayer can be told to directly use pvr:// as a source instead of the generic tv:// (with many options). So you just have to enter mplayer pvr:// -tv device=/dev/video1:input=0 in order to watch tv. Noticed the input=0 above? This tells the tuner to take the video signal from the tv (read the mplayer man page to see how to change the channel). Now, since I connected my video camera to the composite video in, I need to tell mplayer to use it with input=1. One last thing: taking a screenshot in mplayer is done by pressing the ’s’ key (with option -vf screenshot. In summary, the image below was taken with mplayer pvr:// -tv device=/dev/video1:input=1:noaudio -vo x11 -vf screenshot (camera facing the screen). ...

November 23, 2008 · 2 min · jepoirrier

Watch your webcam with mplayer

A small post just to keep this command at hand: mplayer -fps 30 -tv driver=v4l:width=640:height=480:device=/dev/video1 tv:// This allows you to watch what your webcam “sees” (provided it uses a video4linux webcam). Btw, Cheese is funny to use too! I was also trying to find a decent Python library for video4linux but I only found outdated ones ( libfg, 2003, and pyv4l, 2002). I guess I’ll have to use some C library for a small project I’ll tell you about later ;-)

September 19, 2008 · 1 min · jepoirrier