fs4412开发板学习笔记(十)

来源:互联网 发布:精子优化处理检查 编辑:程序博客网 时间:2024/06/05 02:50
移植motion:1.从官网http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome下载最新的motion-3.2.122.tar -xzf motion-3.2.12.tar.gz 解压3.mkdir motion 创建安装目录4.设置(详细说明见http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideInstallation)/*--host:arm-linux-交叉编译--prefix:安装目录*/#./configure --host=arm-none-linux-gnueabi   --prefix=${PWD}/_install/ ./configure  --host=arm-none-linux-gnueabi --build=i486-gnu-linux --prefix=${PWD}/_install/--with-jpeg-mmx=no ./configure --host=arm-none-linux-gnueabi --with-jpeg-mmx=no --prefix=${PWD}/_install/ --with-ffmpeg=/home/linux/workdir/motion/ffmpeg-0.8.15/_install ./configure --host=arm-none-linux-gnueabi --prefix=${PWD}/_install/ --with-ffmpeg=/home/linux/workdir/motion/ffmpeg-2.5.4/_installffmpeg:1.从官网下载http://ffmpeg.org/download.html2.下载yamsmwget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz#tar xzvf yasm-1.3.0.tar.gz#cd yasm-1.3.0#./configure --prefix=/usr/local/yasm#make#make install #vi /etc/profileexport PATH="$PATH:/usr/local/yasm/bin"2.安装ffmpeg:mkdir _install./configure  --prefix=${PWD}/_install/ --enable-shared --disable-static --disable-yasm --enable-gpl --cc=/usr/local/toolchain/toolchain-4.6.4/bin/arm-none-linux-gnueabi-gcc --enable-cross-compile --arch=arm --disable-stripping --target-os=linux./configure  --prefix=${PWD}/_install/ --enable-shared --enable-static --disable-yasm --enable-gpl --cc=/usr/local/toolchain/toolchain-4.6.4/bin/arm-none-linux-gnueabi-gcc --enable-cross-compile --arch=arm --disable-stripping --target-os=linux./configure --enable-shared --disable-yasm --prefix=/${PWD}/_install/ make make install(1)把lib中的三个链接库libavcodec.so libavformat.so libavutil.so复制到/usr/lib下。把include目录下的ffmpeg目录复制到/usr/include下。3.编译motion(1) 在motion进行./configure的时候显示Fatal Error YOU MUST HAVE jpeg Support?将motion_so/libjpeg*  复制到/usr/libapt-get install libjpeg62-dev(2)make(2.1)motion.h:43:28: fatal error: linux/videodev.h: No such file or directory  ===>>apt-get install libv4l-dev*  将motion.h的"#include <linux/videodev.h>" 改为                       #include <libv4l1-videodev.h>  (2.2)netcam.h:19:21: fatal error: jpeglib.h: No such file or directory=====>> apt-get install libjpeg8-dev(2.3)/usr/include/jpeglib.h:26:62: fatal error: jconfig.h: No such file or directory=====>>从http://www.ijg.org/下载jpegsrc.v9a.tar.gztar xzf jpegsrc.v9a.tar.gzcd jpeg-9a/System types:  --build=BUILD     configure for building on BUILD [guessed]  --host=HOST       cross-compile to build programs to run on HOST [BUILD]  --target=TARGET   configure for building compilers for TARGET [HOST]./configure CC=arm-none-linux-gnueabi-gcc --prefix=${PWD}/_install/ --enable-shared --enable-static --build=i486-gnu-linux --host=arm-linux --target=armmakemake installcp /usr/local/include/jconfig.h /usr/include/(2.4)video.h:15:28: fatal error: linux/videodev.h: No such file or directory  将video.h的"#include <linux/videodev.h>" 改为                       #include <libv4l1-videodev.h>  (2.5)can't find -lzapt-get install zlib1g-devcp /lib/x86_64-linux-gnu/libz.so.1.2.3.4 /home/linux/workdir/motion/ffmpeg-0.8.15/_install/lib(2.6)ffmpeg.c: In function 'ffmpeg_init':ffmpeg.c:232:5: warning: implicit declaration of function 'av_register_protocol' [-Wimplicit-function-declaration]ffmpeg.c: In function 'get_oformat':ffmpeg.c:275:9: warning: implicit declaration of function 'guess_format' [-Wimplicit-function-declaration]ffmpeg.c:275:12: warning: assignment makes pointer from integer without a cast [enabled by default]将av_register_protocol改为av_register_all();将guess_format改为av_guess_format(3)make installcp _install/bin/motion /source/rootfs/usr/sbincp _install/etc/motion-dist.conf /source/rootfs/etc/motion.confcp /usr/lib/libjpeg.so.62 /source/rootfs/lib/cp /usr/lib/libjpeg.so.9 /source/rootfs/lib/4.运行调试motion(1)配置motion.confdaemon off  #关掉deamon模式quiet onlocate on  #探测到图像中有运动时,把运动区域用矩形框起来videodevice /dev/video0  #加载USB摄像头的设备width 640    #图像宽度height 480    #图像高度framerate 5   #每秒最大捕获帧数target_dir /motion  #设置拍摄图片的存储目录threshold_tune off  #设置是否使用motion detection阈值自动调节。设置off时,可以由threshold指定当探测到多少像素变化时,判断为图像中有运动。threshold 3000      #这个是改变探测灵敏度,越小越灵敏,这里设为3000像素值ffmpeg_cap_new on #在detect到运动时,用视频记录下来ffmpeg_video_codec msmpeg4 #设定视频的编码器webcam_localhost off  #必须改成off才能通过pc访问webcam_maxrate 8snapshot_interval 5  #设定自动采集图片的周期,当有运动被检测到时,采集频率会自动变高。如果设置0,则无运动物体时不自动拍照on_event_start /root/detected  #当该事件产生时执行detected脚本,该脚本是简单的可执行shell脚本,下同on_event_end /root/end  #当该事件产生时执行end脚本gap 5 #设置,在探测到运动后,多长时间没有运动的话就触发运动结束指令on_event_end。(2)运行: motion -c motion.conf问题1:VFS: Mounted root (nfs filesystem) readonly on device 0:11.[1] Error opening file ./01-19700101000142-00.jpg with mode w: Read-only file system[1] Can't write picture to file ./01-19700101000142-00.jpg: Read-only file system解决:在开发板运行[root@farsight ]# mount192.168.1.110:/source/rootfs on / type nfs (ro,relatime,----)可知挂载的nfs为roLinux下出现Read-only file system的解决办法:正常运行中的网站,忽然间出现session目录不可写,连接服务器一看,任何关于写硬盘的命令都不能用,提示Read-only file system,使用一条命令即可搞定此问题:mount -o remount rw /      ||    \/    目的:使根目录可写由于/etc/fstab文件编辑错误 而引起的不能正常进入系统解决方法就是修改/etc/fstab文件成原来正常格式 删除错误的或者是不存在的挂载目录操作:根据提示进入修复模式 Login incorrect.(Repair filesystem) 1 # vi /etc/fstab但是修复模式下(read-only system) 文件是被保护的不能修改 运行下面命令 把系统文件权限改成可读写(rw)(Repair filesystem) 1 # mount -o remount,rw /使根目录可写.即可以修复/etc/fstab文件,使之可写.然后就可以vi修改了保存 wq(Repair filesystem) 1 #reboot问题2:Wrong JPEG library version: library is 62, caller expects 90由于使用了libjepg.so.62但编译的时候使用了非ARM平台的库重新配置jpeg库,编译后使用ARM平台的库再编译motion远程监控:在火狐或者谷歌浏览器输入http://192.168.1.140:8081/,来实时监控监控
0 0
原创粉丝点击