uvccapture FTW
A commandline solution
The Logitech gang provide/link to uvccapture. It's kind of old, so I'm attaching the source files.
- tar xv --bzip2 -f uvccapture-0.5.tar.bz2
- cd uvccapture-0.5
- make
- sudo make install
...should be sufficient.
Comments
Aaaand, if yer using the Mac, iSightCapture seems prepared to offer similar capabilities. (see the Files section)
Requires libjpeg-dev, apparently.
matt@carlton:~/Downloads/uvccapture-0.5$ sudo make install
install uvccapture /usr/local/bin
http://grumbel.blogspot.com/2010/04/some-notes-on-ubuntu-1004.html
uvccapture fails to capture at 1280x1024, lower resolutions still work:
Unable to query buffer (22).
Init v4L2 failed !! exit fatal
In dmesg it gives:
vmap allocation for size 36704256 failed: use vmalloc= to increase size
Adding vmalloc=268435456 to the Kernel Boot Parameter works as a workaround
Using Grub2, here's how to add that Kernel Boot Parameter
http://ubuntuforums.org/showthread.php?t=1366354
usage
uvccapture -o#{cheese_path} -x1600 -y904
The program '
v4l-info' is currently not installed. You can install it by typing:sudo apt-get install v4l-conf...v4l-info produces the following
### v4l2 device info [/dev/video0] ### general info VIDIOC_QUERYCAP driver : "uvcvideo" card : "UVC Camera (046d:0809)" bus_info : "usb-0000:00:1d.7-3" version : 0.1.0 capabilities : 0x4000001 [VIDEO_CAPTURE,STREAMING] ... maxwidth : 1600 maxheight : 1200 minwidth : 48 minheight : 32 ...The values I have from using this same Logitech webcam on BlackPearl indicate a command line like this
uvccapture -o#{cheese_path} -x1600 -y904...which doesn't work here on Carlton. Hmmm. Still digging...
### v4l2 device info [/dev/video0] ### general info VIDIOC_QUERYCAP driver : "uvcvideo" card : "UVC Camera (046d:0809)" bus_info : "usb-0000:00:1d.7-3" version : 0.1.0 capabilities : 0x4000001 [VIDEO_CAPTURE,STREAMING] standards inputs VIDIOC_ENUMINPUT(0) index : 0 name : "Camera 1" type : CAMERA audioset : 0 tuner : 0 std : 0x0 [] status : 0x0 [] video capture VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE) index : 0 type : VIDEO_CAPTURE flags : 0 description : "YUV 4:2:2 (YUYV)" pixelformat : 0x56595559 [YUYV] VIDIOC_ENUM_FMT(1,VIDEO_CAPTURE) index : 1 type : VIDEO_CAPTURE flags : 1 description : "MJPEG" pixelformat : 0x47504a4d [MJPG] VIDIOC_G_FMT(VIDEO_CAPTURE) type : VIDEO_CAPTURE fmt.pix.width : 800 fmt.pix.height : 600 fmt.pix.pixelformat : 0x47504a4d [MJPG] fmt.pix.field : NONE fmt.pix.bytesperline : 0 fmt.pix.sizeimage : 341333 fmt.pix.colorspace : SRGB fmt.pix.priv : 0 controls VIDIOC_QUERYCTRL(BASE+0) id : 9963776 type : INTEGER name : "Brightness" minimum : 0 maximum : 255 step : 1 default_value : 128 flags : 0 VIDIOC_QUERYCTRL(BASE+1) id : 9963777 type : INTEGER name : "Contrast" minimum : 0 maximum : 255 step : 1 default_value : 32 flags : 0 VIDIOC_QUERYCTRL(BASE+2) id : 9963778 type : INTEGER name : "Saturation" minimum : 0 maximum : 255 step : 1 default_value : 28 flags : 0 ### video4linux device info [/dev/video0] ### general info VIDIOCGCAP name : "UVC Camera (046d:0809)" type : 0x1 [CAPTURE] channels : 1 audios : 0 maxwidth : 1600 maxheight : 1200 minwidth : 48 minheight : 32 channels VIDIOCGCHAN(0) channel : 0 name : "Camera 1" tuners : 0 flags : 0x0 [] type : CAMERA norm : 0 tuner audio picture VIDIOCGPICT brightness : 32896 hue : 0 colour : 7196 contrast : 8224 whiteness : 0 depth : 0 palette : unknown buffer window VIDIOCGWIN x : 0 y : 0 width : 800 height : 600 chromakey : 0 flags : 0In the semi-poor light in the R3 house at night, this value produces a passable photo
The default values are
name : "Brightness" maximum : 255 default_value : 128 name : "Contrast" maximum : 255 default_value : 32 name : "Saturation" maximum : 255 default_value : 28More resolutions in a list format. Requires installation of luvcview on the Linux...
Please find attached the output of the: "luvcview -L"
SDL information:
Video driver: fbcon
Hardware surfaces are available (900k video memory)
Device information:
Device path: /dev/video0
/dev/video0 does not support read i/o { pixelformat = 'MJPG', description = 'MJPEG' } { discrete: width = 160, height = 120 }
Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5, { discrete: width = 176, height = 144 }
Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5, { discrete: width = 320, height = 240 }
Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5, { discrete: width = 352, height = 288 }
Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5, { discrete: width = 640, height = 480 }
Time interval between frame: 1/30, 1/25, 1/20, 1/15, 1/10, 1/5, { discrete: width = 800, height = 600 }
Time interval between frame: 1/15, 1/10, 1/5, { pixelformat = 'YUYV', description = 'YUV 4:2:2 (YUYV)' } { discrete: width = 160, height = 120 }
Time interval between frame: 1/15, 1/10, 1/5, { discrete: width = 176, height = 144 }
Time interval between frame: 1/15, 1/10, 1/5,
http://www.ideasonboard.org/uvc/
http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gst
Using Gstreamer with Ruby. A partially-incomplete tutorial