WebCam网络摄像头5 usb 使用

usb摄像头芯片是中芯微的zc0301pl
http://www.vimicro.com.cn/product/pdf/ZC301PL-1107-V10-EN.pdf

[cpp]  view plain copy
  1. [root@FriendlyARM bin-song]# usb 1-1.2: new full speed USB device using s3c2410-ohci and address 10  
  2. usb 1-1.2: New USB device found, idVendor=0ac8, idProduct=301b  
  3. usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0  
  4. usb 1-1.2: Product: PC Camera  
  5. usb 1-1.2: Manufacturer: Vimicro Corp.  
  6. usb 1-1.2: configuration #1 chosen from 1 choice  
  7. gspca: probing 0ac8:301b  
  8. zc3xx: probe 2wr ov vga 0x0000  
  9. zc3xx: probe sensor -> 0011  
  10. zc3xx: Find Sensor HV7131R(c)  
  11. gspca: probe ok  

/************************************************************************************************************************************/
执行,,如下---使用google code上的mjpg-streamer  for mini2440,如前面4篇
[cpp]  view plain copy
  1. FriendlyARM bin13]# ./start_uvc.sh   
  2. MJPG Streamer Version.: 2.0  
  3.  DBG(input_uvc.c, input_init(), 133): argv[0]=UVC webcam grabber  
  4.  i: Using V4L2 device.: /dev/video0  
  5.  i: Desired Resolution: 640 x 480  
  6.  i: Frames Per Second.: 5  
  7.  i: Format............: MJPG  
  8.  requested MJPG but got JPEG format instead//格式  
  9.  DBG(dynctrl.c, initDynCtrls(), 139): adding control for 0  
  10.  DBG(dynctrl.c, initDynCtrls(), 143): uvcioc ctrl add error: errno=22 (retval=-1)  
  11.  DBG(dynctrl.c, initDynCtrls(), 139): adding control for 1  
  12. ...  
可以执行,但是用浏览器浏览时图像有问题---


发现上面line 8 
 requested MJPG but got JPEG format instead
在源码中找到这行------在plugins/input_uvc/v4l2uvc.c的init_v4l2()函数,大概line 150  

[cpp]  view plain copy
  1. if(vd->fmt.fmt.pix.pixelformat!=vd->formatIn)  
  2. {  
  3.     char fourcc1[5]={0,0,0,0,0};  
  4.     char fourcc2[5]={0,0,0,0,0};  
  5.     memmove(fourcc1,(char*)&vd->formatIn,4);  
  6.     memmove(fourcc2,(char*)&vd->fmt.fmt.pix.pixelformat,4);  
  7.     fprintf(stderr, " requested %s but got %s format instead\n",fourcc1,fourcc2);  
  8.    vd->formatIn = vd->fmt.fmt.pix.pixelformat;  
  9. }  
将这个if块注释掉就正常啦 。。。
秀一张很模糊很美的图片----是摄像头差劲,10元一个。

/************************************************************************************************************************************/
如果使用友善提供的编译好的程序,考到板子上执行会有如下问题
[cpp]  view plain copy
  1. [root@FriendlyARM /mjpg-streamer]# ./start_uvc.sh   
  2. MJPG Streamer Version.: 2.0  
  3.  i: Using V4L2 device.: /dev/video0  
  4.  i: Desired Resolution: 640 x 480  
  5.  i: Frames Per Second.: 5  
  6.  i: Format............: MJPEG  
  7.  Pixel format is unavailable, using JPEG   
  8.  should never arrive exit fatal !!  
  9.  i: init_VideoIn failed  
  10.   
  11. [root@FriendlyARM /mjpg-streamer]# ./start_uvc_yuv.sh   
  12. MJPG Streamer Version.: 2.0  
  13.  i: Using V4L2 device.: /dev/video0  
  14.  i: Desired Resolution: 640 x 480  
  15.  i: Frames Per Second.: 5  
  16.  i: Format............: YUV  
  17.  i: JPEG Quality......: 80  
  18.  Pixel format is unavailable, using JPEG   
  19.  should never arrive exit fatal !!  
  20.  i: init_VideoIn failed  
提供的编译好的程序和源码不是一个版本的。所以没法troubleshooting。
但问题貌似和上面那个一样,把那个if块注释掉应该可以解决。


/************************************************************************************************************************************/
以下3种方法均可。http://192.168.1.230:8080/
详见天嵌网络摄像头说明书。

借来天嵌板子WebCam的mjpg_streamer input_uvc.so output_http.so
,考到micro2440的/home/plg,/mjpg-streamer/www/是以前用的。
执行如下,使用mjpg-streamer测试usb摄像头,正常。
[cpp]  view plain copy
  1. [root@FriendlyARM plg]# ./mjpg_streamer  -i "./input_uvc.so" -o "./output_http.so -w /mjpg-streamer/www/"  
  2. MJPG Streamer Version.: 2.0  
  3.  i: Using V4L2 device.: /dev/video0  
  4.  i: Desired Resolution: 640 x 480  
  5.  i: Frames Per Second.: 5  
  6.  i: Format............: MJPEG  
  7.  o: www-folder-path...: /mjpg-streamer/www/  
  8.  o: HTTP TCP port.....: 8080  
  9.  o: username:password.: disabled  
  10.  o: commands..........: enabled  
  11. zc3xx: probe 2wr ov vga 0x0000  

uvc_stream借来,
使用uvc-streamer测试usb摄像头 ,正常。
[cpp]  view plain copy
  1. [root@FriendlyARM plg]# ./uvc_stream   
  2. Using V4L2 device.....: /dev/video0  
  3. Resolution............: 640 x 480  
  4. frames per second.....: 5  
  5. TCP port..............: 8080  
  6. motor control TCP port: 8081  
  7. zc3xx: probe 2wr ov vga 0x0000  

input_cmoscamera.so借来,
使用mjpg-streamer测试cmos摄像头了,正常。
[cpp]  view plain copy
  1. [root@FriendlyARM plg]# ./mjpg_streamer  -i "./input_cmoscamera.so" -o "./output_http.so -w /mjpg-streamer/www/"  
  2. MJPG Streamer Version.: 2.0  
  3.  i: Using CMOS Camera device.: /dev/camera  
  4.  i: Desired Resolution: 640 x 512  
  5.  i: Frames Per Second.: 5  
  6.  i: Format............: YUV  
  7.  i: JPEG Quality......: 80  
  8.  o: www-folder-path...: /mjpg-streamer/www/  
  9.  o: HTTP TCP port.....: 8080  
  10.  o: username:password.: disabled  
  11.  o: commands..........: enabled  

由于天嵌提供的这方面的资料全一些,所以后面就分析天嵌的WebCam了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值