您的位置:首页 > 运维架构 > Linux

ARM-Linux下用Servfox和Spcaview 建立嵌入式视频监控系统

2014-03-27 19:58 477 查看
作者:liusaoyue

转自:/article/9301482.html

一 移植摄像头驱动

目前摄像头(Webcam)在 Linux 中驱动基本成熟,缺少的是应用程序的支持,比如即时通讯工具支持视频的好程序比较少。在国内,大多摄像头的芯片组是Z-Star,也有显示为Vimmicro(和Z-Star是同样的芯片)的。目前Linux下的摄象头驱动可以使用spca5xx,spca5xx是LINUX下的万能摄象头驱动,也支持支持ZC30X系列摄像头。可以从http://mxhaard.free.fr/download.html
下载。

在 Linux中,硬件的驱动程序,都是由内核支持的;目前比较新内核版本也集成了一些的摄像头驱动。所以支持也是极为正常的。内核对硬件的支持分为内置于和外挂模块两种方便。对于摄像头来说,大多是模块支持的。比如我用的博创开发板就加入了spca5xx摄象头驱动的支持。如果开发板没有加入,可以把spca5xx稍加修改移植到ARM平台下。

二 移植服务器端程序servfox

下载servfox-R1_1_3.tar.gz,解压,进入其目录,观察,发现没有makefile,但有一个makefile.arm,还有一个makefile.386,将makefile.arm改名为makefile,然后修改Makefile文件将CC改成arm-linux-gcc,然后输入命令make编译即可。

将可执行文件servfox复制到nfs共享目录,启动开发板,挂载nfs服务器,运行servfox,出错,提示为找到该命令,老问题,以前遇到过类似问题,原因是该命令为动态链接,而开发板上没有相关的库文件,所以无法运行,解决方法。

1静态链接 回到PC,打开makefile,将所有用到arm-linux-gcc的地方,都加上一个参数-static,其实就三个地方。然后重新编译,在开发板上运行,输入命令:

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

2 动态链接 把生成的动态链接库加载到开发板

运行中遇到的问题,servfox的设备必须是/dev/video0,直接用这个/dev/v4l/video0不行,提示v4l接口错误,建个链接

(ln -s /dev/v4l/video0 /dev/video0)

三 编译客户端程序spcaview

SpcaView 软件包,包括一组工具:

spcaview工具是用来纪录数据流,也能用来播放数据,既可以做采集端,也可以做接收端。

spcaserv 是流媒体服务器

spcacat 简单图片的抓取工具

下载spcaview-20061208.tar.gz,解压,进入其目录,直接编译,make

生成可执行文件spcaview,运行之

./spcaview -g -s 320x240 -w 192.168.141.236:7070

段错误的解决方法:用mmap方法不行,必须要用read方法,运行servfox时加参数-g。

四 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: