移植servfox和spcaview遇到的一些问题

来源:互联网 发布:win7设置网络参数 编辑:程序博客网 时间:2024/05/16 17:29

前提是已通过nfs将共享目录挂载到了开发板上

一、移植servfox我用版本是servfox-R1_1_3.tar.gz

1,进入servfox-R1_1_3目录修改Makefile.arm为Makefile

2,修改Makefile文件

SERVFLAGS= -O2 -DLINUX $(WARNINGS) –I /home/linux-2.6.12/include

make成功

3,在超级终端输入以下命令ln -s /dev/v4l/video0 /dev/video0

4,进入/tmp(我的共享目录挂在地)目录输入下面的命令./servfox -d /dev/video0 -g -s 320x240 -w 7070

可是出现错误:-sh:servfox not found

出错的原因是在编译时对c库进行的是动态链接

回到servfox-R1_1_3修改Makefile在下面几行代码中添加-static如红色部分

servfox: $(OBJSERVER)
$(CC) $(SERVFLAGS) -static -o servfox $(OBJSERVER) $(SERVLIBS) 
server.o: server.c
$(CC) $(SERVFLAGS) -static -c -o $@ $<

spcav4l.o: spcav4l.c spcav4l.h
$(CC) $(SERVFLAGS) -static -c -o $@ $<

utils.o: utils.c utils.h
$(CC) $(SERVFLAGS) -static -c -o $@ $<

tcputils.o: tcputils.c tcputils.h
$(CC) $(SERVFLAGS) -static -c -o $@ $<

保存后make clean ;make

这次还是有错误,错误是segmentation fault,解决方法把4.3.2的编译器换成3.3.2的就OK啦

二、编译spcaview版本是spcaview-20061208

编译时出现如下错误

SDL/SDL.h: 没有那个文件或目录

等一些类似的错误

错误原因是缺少libsdl库:SDL是一个自由的跨平台的多媒体开发包,适用视频音频和其他应用的软件

可到这里下载libsdl库的源码 http://www.libsdl.org/download-1.2.php

下载到pc解压缩tar zxvf SDL-1.2.15.tar.gz

进入SDL-1.2.15目录./configure生成Makefile

之后执行以下命令make ;   make install;没有新的错误出现libsdl库已安装好了

再次进入spcaview-20061208目录执行make成功!大笑

执行./spcaview -g -s 320x240 -w 192.168.0.15:7070可以看到摄像头采集的数据了


spcaview编译成功后会生成三个可执行文件分别是spcacat spcaserv spcaview

spcacat 简单图片的抓取工具,不能用于网络监视客户端。
spcaserv  流媒体服务器。
spcaview 工具是用来纪录数据流,也能用来播放数据,也能作为网络监视客户端用。


三、 Serfox和Spcaview的命令参数

(1)spcaview的命令参数

Spcaview version: 1.1.7 date: 06:11:2006 (C) mxhaard@magic.fr 
usage: spcaview [-h -d -n -c -v -j -z -g -l -s -m -a -f -b -t -p] [-i inputfile 
| -o outputfile] 
-h      print this message 
-d      /dev/videoX       use videoX device 
-n      norme 0->pal 2->secam 1->ntsc 
-c      input channels 0..9 exclude 4 and 5 
-v      disable video output for raw recording 
-j      disable video output and userspace decoding 
-z      compress yuv420p video output with DPSH encoder 
-g      use read method for grab instead mmap 
-l      default 320x480   use input size 640x480 
-s      widthxheight      use specified input size 
-m      widthxheight      use specified ouput size 
-a      default 0 -> nosound    1-> microphone 2-> mixer output 
-f      video format default yuv others options are r16 r24 r32 yuv jpg 
-b     enable automatic brightness adjustment 
-t     print statistics 
-p x getPicture every x seconds 
-p x && -o getPicture every x seconds and record in outfile 
-w      Address:Port read from Address xxx.xxx.xxx.xxx:Port 
-N x    take a x pictures and exit if p is not set p = 1 second 

(2)serfox的命令参数

-h      print this message 
-d      /dev/videoX       use videoX device 
-g      use read method for grab instead mmap 
-s      widthxheight      use specified input size 
-w      port      server port


原创粉丝点击