本帖最后由 TQ-lkp 于 2012-11-14 14:27 编辑
唉。。。。。之前在论坛上看了好多关于这个问题,都没有找到答案(要么问题回答一半没下文,要么就是“啊,已解决。”然后不把方法贴出来,在此鄙视那些人!!!!!!!!!!!!!!)。
言归正传:下面是我做的过程,本人语文不好,看不懂的可以回帖问我。一定尽力解决!!!
先把《《基于天嵌科技的SKY2440/TQ2440的 Linux系统移植手册》》的 附录2Web服务器的移植 按手册一步步做好
(这时候你会发现,LED灯可以控制但是,视频就是打开不了!!!!!!这是因为我们文件系统中的web文件中servfox(在webcam.cgi里面)根本没有启动。)
于是我就是想自己手动启动:在串口终端输入
[root@EmbedSky ]# servfox -g -d /dev/video0 -s 320x240 -w 7070
回车后出现 -/bin/sh: servfox: not found
这说明本身自带的servfox可执行文件不能用,于是有了以下步骤
【移植servfox】
从 下面附件下载servfox-R1_1_3.tar.gz源码包,解压到linux下(一般放在/opt/EmbedSky/目录下)
步骤一:修改Makefile(原为Makefile.arm,把.arm去掉就行)文件为。
CC=arm-linux-gcc
(SERVFLAGS= -O2 -DLINUX $(WARNINGS) –I/home/yuaf/linux-2.6.15/include这步可不要)
步骤二:make,在当前文件夹下就可以看到生成的可执行文件servfox,把此可执行文件拷贝到文件系统/usr/bin
步骤三:在开发板中运行 servfox –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 !!!!
说明servfox已成功运行起来了。
然后在网中打开摄像头就可以了
其实
在步骤三中会出现问题二看不到上面的现象,而是出现下面现象
[root@EmbedSky]# /usr/bin/servfox -g -d /dev/video0 -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,将蓝色字部分都注释掉,否则移植到板上会出现"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文件,将它放到TQ2400上,输入命令./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 当看到上面段打印的信息,顿时内牛满面啊啊啊!!赶紧的打开网页点击摄像头,画面出来了,那个激动啊!!!
|