linux虚拟机下serfox+spcaview的搭建

来源:互联网 发布:美即黑茶酵力面膜知乎 编辑:程序博客网 时间:2024/05/29 10:05

编译环境:          Vmware6.5+Fedora14

编译器:              gcc-4.5.1

 

下载servfox安装包,我用的是servfox-R1_1_3.tar.gz,执行西面的命令

解压:

[root@sheryuan arm]# tar zxvf servfox-R1_1_3.tar.gz

进入安装目录: 

[root@sheryuan arm]# cd servfox-R1_1_3

修改Makefile文件名,注意Makefile.i386对应的是pc机的Makefile文件

[root@sheryuan servfox-R1_1_3]# mv Makefile.i386 Makefile

编译:
[root@sheryuan servfox-R1_1_3]# make

在摄像头接入的情况下,运行servfox测试:
[root@sheryuan servfox-R1_1_3]# ./servfox -d /dev/video0 -g -s 320x240 -w 7070

可能会出现如下的错误:
 servfox version: 1.1.3 date: 11:12:2005 (C) mxhaard@magic.fr
wrong spca5xx device
Not a JPEG webcam sorry Abort !

修改spcav4l.c文件,将文件中的这些语句注释掉:
/*if(vd->cameratype != JPEG) {
        exit_fatal ("Not a JPEG webcam sorry Abort !");
}*/

/*  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 !");
*/

重新编译:

[root@sheryuan servfox-R1_1_3]# make clean ; make

再次运行servfox进行测试,出现下面的打印信息基本可以说明安装成功:
[root@sheryuan servfox-R1_1_3]# ./servfox -d /dev/video0 -g -s 320x240 -w 7070
 servfox version: 1.1.3 date: 11:12:2005 (C) mxhaard@magic.fr
wrong spca5xx device
Waiting .... for connection. CTrl_c to stop !!!!

假如有一台虚拟机成功安装了spcaview,在该虚拟机spcaview安装目录下执行以下命令:
[root@localhost spcaview-20061208]# ./spcaview -g -w 115.156.196.243:7070

如果有采集的画面出现,并且当运行servfox的虚拟机出现连接虚拟机的ip地址,说明完全成功:

 servfox version: 1.1.3 date: 11:12:2005 (C) mxhaard@magic.fr
wrong spca5xx device
Waiting .... for connection. CTrl_c to stop !!!!
Got connection from 115.156.196.242


[root@localhost myfile]# tar zxvf spcaview-20061208.tar.gz
[root@localhost myfile]# cd spcaview-20061208
[root@localhost spcaview-20061208]# make

spcaview可以接受servfox的采集数据,但不能自己采集和播放

 

windows下也可以用spcaview进行视频播放,现在很容已下载到免安装的spcaview-windows.rar包:

直接下载一个spcaview-windows.rar包,解压到C盘
进入cmd命令解释器:
进入c盘spcaview-windows目录release文件夹下下
确保采集端servfox运行的情况下(如ip为115.156.196.242的虚拟机已经运行servfox进行视频采集./servfox -d /dev/video0 -g -s 320x240 -w 7070),输入如下命令:
spcaview.exe -g -w 115.156.196.242:7070

出现小面的摄像头镜头: