监控摄像头linux开发,PC机(ubuntu)实现usb摄像头监控

2.servfox的移植采集摄像头数据

1修改Makefile

解压,修改Makefile,第二行的 -I跟的是内核源码的头文件目录

CC=gcc

SERVFLAGS= -O2 -DLINUX $(WARNINGS) -I /home/test/temp6410/linux-2.6.28.6/include

2再修改spcav4l.c

再修改spcav4l.c,将蓝色字部分都注释掉,否则移植到板上会出现"Not a JPEG webcam sorry Abort "或者“could't set video palette Abort"的错误

/* Only jpeg webcam allowed */

/*if(vd->cameratype != JPEG) {

exit_fatal ("Not a JPEG webcam sorry Abort !");

}*/if(debug) printf ("StreamId: %d Camera\n", vd->cameratype);/* probe all available palette and size Not need on the FOX always jpeg

if (probePalette(vd ) < 0) {

exit_fatal ("could't probe video palette Abort !");

}

if (probeSize(vd ) < 0) {

exit_fatal ("could't probe video size Abort !");

}

err = check_palettesize(vd);

if(debug) printf (" Format asked %d check %d\n",vd->formatIn, err);

*/vd->videopict.palette = vd->formatIn;

vd->videopict.depth = GetDepth (vd->formatIn);

vd->bppIn = GetDepth (vd->formatIn);

//vd->framesizeIn = (vd->hdrwidth * vd->hdrheight * vd->bppIn) >> 3; // here alloc the output ringbuffer

vd->framesizeIn = (vd->hdrwidth * vd->hdrheight >> 2 ); // here alloc the output ringbuffer jpeg only

erreur = SetVideoPict (vd);

erreur = GetVideoPict (vd);/* if (vd->formatIn != vd->videopict.palette ||

vd->bppIn != vd->videopict.depth)

exit_fatal ("could't set video palette Abort !");

if (erreur < 0)

exit_fatal ("could't set video palette Abort !");*/

之后make一下,会生成servfox文件。

说明:成功编译。正确。

将servfox文件放到mini6410上,输入命令./servfox -d /dev/video2 -g -s 640x480 -w 7070,注意:/dev/video2是我的摄像头设备名,有的是/dev/video0,最好用cat /dev/video2 > /usr/a.jpg测试一下能不能拍摄到图片到/usr/a.jpg文件上,以便确定摄像头名称。

运行./servfox -d /dev/video2 -g -s 640x480 -w 7070后,正常是应该如下显示

./servfox -d /dev/video2 -g -s 640x480 -w 7070

servfox version: 1.1.2 date: 07:10:2005 (C)

Waiting .... for connection. CTrl_c to stop !!!!

3.spcaview部分

解压spcaview-20061208.tar.gz,这里主要用到里面的http-java-applet文件夹,将该文件夹里的所有文件复制到mini6410上的/var/www/目录中(我这里新建一个webcam目录来存放)。

之后就搞掂了``测试一下

接上摄像头,终端分别输入./boa和./servfox -d /dev/video2 -g -s 640x480 -w 7070

然后在windows或者linux的浏览器中打开网址这时候就能看到摄像头的内容了(IE上显示java可能需安装jre环境,直接安装jre-6u10-windows-i586-p-s.exe就可以了)。 这里的jre包可以安装最近的开发包,今天最新的这个。

d7a8e0fe44fdf62dab98e24be732c3f3.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值