标题:用V4L2为什么不能设置图片参数?
作者:cdutherbert
日期:2010-03-27 15:31
内容:
我买了个摄像头单是不知道什么芯片的,用lshal 查看显示:
usb_device.product = 'USB2.0 PC CAMERA'(string)
usb_device.product_id = 12944(0x3290)(int)
usb_device.speed = 12.0 (12) (double)
usb_device.speed_bcd = 4608(0x1200)(int)
usb_device.vendor = 'ARKMICRO'(string)
usb_device.vendor_id = 6380(0x18ec)(int)
但是在V4L2设置图片格式为320x240的时候
memset ( &fmt, 0, sizeof(fmt) );
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = 320;
fmt.fmt.pix.height = 240;
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_JPEG;
if (ioctl(fd, VIDIOC_S_FMT, &fmt) < 0)
{
printf("set format failed\n");
}
运行的时候就显示:set format failed。没有通过。请问做过USB摄像头采集的,是不是摄像头必修要ZC30x这种芯片才行。如果不知道芯片型号就不行?谢谢。
#1 [lishiyong110 03-28 19:54]
不知道你使用什么摄像头 你要查一下你所使用的摄像头可以输出的图像格式 好像比较多的是YUYV,你可以试试
#2 [cdutherbert 03-29 19:40]
问题好像解决了,好像这个摄像头比较差,不能设置分辨率。只能保持原来的分辨率。
#3 [chenxiaba 04-08 20:16]
也是这个问题很久了
如今还在弄,网上的一些程序总是会在这一步出错,但是为什么有的程序却可以用,有的不能用
还想请教搂住
#4 [chenxiaba 04-08 20:17]
我的QQ:894390203
#5 [chenxiaba 04-08 20:18]
usb_device.product = 'USB 2.0 PC Camera' (string)
usb_device.product_id = 6539 (0x198b) (int)
usb_device.speed = 12.0 (12) (double)
usb_device.vendor = 'Alcor Micro Corp.' (string)
usb_device.vendor_id = 1423 (0x58f) (int)
usb_device.version = 1.1 (1.1) (double)
想问下我这个USB摄像头它自带的分辨率是多少?
这点我有些看不懂,谢谢~