servfox和spcaview的使用

来源:互联网 发布:成都知美术馆地址 编辑:程序博客网 时间:2024/06/05 06:26

Kernel version :2.6.22.6
Crosstool      :arm-linux-gcc-3.4.1
Board          :FL2440
System         :Ubuntu 10.10
Source         :servfox.rar, spcaview-20061208.rar, SDL-1.2.13.rar

/*********************************************/

servfox -g -d /dev/video0  -s 320x240 -w 7070

spcaview -g -s 320x240 -w 192.168.0.11:7070


注意:一定要加-g这个参数,否则会出现SDL依赖之类的错误。

/**********************************************/


1.servfox的移植 采集摄像头数据
解压,修改Makefile,第二行的-I 跟的是内核源码的头文件目录

CC=arm-linux-gcc

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


再修改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文件,将它放到FL2400上,输入命令./servfox -g -d /dev/video0  -s 320x240 -w 7070 ,打印出:
servfox version: 1.1.2 date: 07:10:2005 (C) mxhaard@magic.fr
Waiting .... for connection. CTrl_c to stop !!!!
zc3xx: probe 2wr ov vga 0x0000

 

2.Linux上编译spcaview.由于此软件包依赖与libsdl,所以在安装spcaview之前,必须要安装 SDL-1.2.13.

解压源码包:  tar zxvf SDL-1.2.13.tar.gz

安装源码包:  cd SDL-1.2.13; 运行 ./configure 文件,编译文件 make ,安装文件 make install。在安装的过程中,注意安装的路径,可以通过查看配置文件获得安装路径或者修改路径。

 

安装spcaview软件:

tar zxvf spcaview-20061208;cd spcaview-20061208;make

ok啦,在源文件目录上,可以看到三个可执行文件,spcacat spcaserv spcaview

spcacat 简单图片的抓取工具,不能用于网络监视客户端。

Spcaserv shi 流媒体服务器,

Spcaview 工具是用来纪录数据流,也能用来播放数据,也能作为网络监视客户端用。

我们可以在Linux上运行: ./spcaview -g -s 320x240 -w 192.168.0.11:7070

其中192.168.0.11是服务器的IP地址,这样我们就可以在PC机上看见USB摄像头采集进来的数据了。

 

 

参考链接:

使用servfox 和spcaview架设嵌入式Linux视频服务器:
http://blogold.chinaunix.net/u2/81592/showart_1891319.html

 

 

 

原创粉丝点击