转:http://bbs.ickey.cn/group-topic-id-57570.html
http://www.cnblogs.com/qinyg/p/3355707.html
motion 简介:
它是一个开源的linux下的 视频监控软件,主要功能有:
1.web远程监控
2.动作探测报警,当有人或物体进入摄像区域,则启动触发脚本,如发送邮件短信之类的通知客户
4.可以录像保存证据
5.开源地址 http://www.lavrsen.dk/foswiki/bin/view/Motion)
先去下载源代码:https://github.com/sackmotion/motion
1.下载motion 源码
orangepi@orangepi:~/app/motion/motion$ git clone https://github.com/sackmotion/motion.git
2.下载FFmpeg库
git clone https://github.com/dwbuiten/FFmpeg.git
3.安装必要的库,否则编译可能会出错
sudo apt-get install libv4l-dev
sudo apt-get install zlib1g-dev
4.开始编译
进入 FFmpeg
编译:
./configure make sudo make install
进入motion
同上
./configure make sudo make install
5.配置motion,插上USB摄像头
直接输入 motion 启动
#motion
orangepi@orangepi:~/app/motion/motion$ motion [0] [ALR] [ALL] conf_load: could not open configfile /usr/local/etc/motion.conf: [0] [CRT] [ALL] conf_load: Not config file to process using default values [0] [NTC] [ALL] motion_startup: Using default log level (NTC) (6) [0] [NTC] [ALL] motion_startup: Motion Git-28b7cb2a4297c78b9c08c9ce29a648aeb22120d0 Started [0] [NTC] [ALL] motion_startup: Logging to syslog [0] [NTC] [ALL] motion_startup: Using default log type (ALL) [0] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC) [0] [NTC] [ENC] ffmpeg_init: ffmpeg LIBAVCODEC_BUILD 3609190 LIBAVFORMAT_BUILD 3607397 [0] [NTC] [ALL] main: Thread 1 is device: /dev/video0 input -1 [0] [NTC] [ALL] main: Stream port 0 [0] [NTC] [ALL] main: Waiting for threads to finish, pid: 17400 [1] [NTC] [ALL] motion_init: Thread 1 started , motion detection Enabled [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1 [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0: [1] [WRN] [ALL] motion_init: Could not fetch initial image from camera Motion continues using width and height from config file(s) [1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1 [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1 [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:发现提示 在/usr/local/etc/motion.conf缺少配置文件,那我们就配置下。应该就有一些信息输出了,但是还需要做一些配置,查看配置文件:
orangepi@orangepi:~/app/motion/motion$ ls *.conf motion-dist.conf thread1.conf thread2.conf thread3.conf thread4.conf
发现
motion-dist.conf
配置文件,打开修改之~~~
欲看详情,请看下回分解。。。