[mdlug] Best Linux rig for capturing frames from analog video?
David F
mdlug at meta-dynamic.com
Sun May 26 09:25:46 EDT 2013
On 05/25/2013 02:50 AM, Michael Mikowski wrote:
> Thanks Aaron, that was my guess too (see my earlier post). A digital cam would also reduce complexity and improve reliability.
In some cases I would agree, but be careful -- it depends on the application
(which the OP didn't really specify). Cheap USB web-cams sometimes don't
have good temporal resolution (i.e. low exposure time, avoiding
motion-blur): they're typically intended for video web-chat where the
subject doesn't move much or fast. In some cases, a decent NTSC analog
might do better (and capture cards can be had for cheap [1]); or the hacked
point-and-shoot will deliver much higher-quality images. Also, if the
camera cannot be physically close to the host system, you will have some
problem-solving to do regarding the maximum length of the USB spec.
I think the typical "IP camera" is a camera (lens+sensor) attached to a
small SoC (possibly running Linux); the quality of the camera will determine
the quality of the images, and obviously IP can travel arbitrary distances.
If you don't want to deploy a PC-style system at the location of the
camera, something similar (possibly better) could be created by the hobbiest
using a USB-cam and a Rasberry Pi, home router with USB port and OpenWRT
burned, etc., which could then communicate over IP, overcoming the distance
issue and placing much (or all) of the intelligence and/or storage on-board
the embedded system; but the cost and hassle might add up quickly to make a
manufactured IP camera an easier solution, if less customizable.
For image capture on a Linux system, most software (e.g. motion, mentioned
by the OP), whether for USB cams or analog-to-digital cards, is built on top
of video4linux (V4L2) [2]. Depending on the application, for a more elegant
solution than a script that runs a CLI like motion and then mucks with
dumped image files, choose any scripting language with bindings to V4L2 (or
just use C/C++) and make the captures yourself, then process as desired.
Furthermore, mencoder (mentioned by the OP who called it "crude," though I'd
like to see that defined, don't understand what he meant) can capture
directly from V4L2, or can be used to encode video from multiple still image
files.
-- David
[1]: E.g. newegg has this one for $17.99 including shipping, which works
with Linux:
http://www.newegg.com/Product/Product.aspx?Item=N82E16812156023
NB: it's just the first one I found, not an endorsement, search for others
if serious about purchasing and check for compatibility with V4L2 at:
http://linuxtv.org/wiki/index.php/Hardware_Device_Information
[2]: http://linuxtv.org/
More information about the mdlug
mailing list