ubuntu下motion的安装调试

环境:ubuntu12.04

版本:motion 3.2.12

最近刚好弄视频抓拍移动监测这一块,听说motion,是这调试了一下,记录下来。我是在pc虚拟机下面调试的,有关开发板哪一方面的可以参考这个博客里面的内容,其实大致差不多,(http://blog.csdn.net/guozhiyuan20095318/article/details/7310486)。

1.首先是获取源码,我已经上传了,也可以google下载,ubuntu下可以直接运行sudo apt-get install motion安装。

2.配置文件。我也是根据网上的资料来配置的,首先配置的是motion.conf,具体的内容我贴上网上的资料。建议大家原始的conf文件做一个备份,另外在自动发送邮件配置的时候肯呢个会出问题,我的配置文件如下:

#!/bin/bash


echo "111111111111111on_motion_end1111111111111111"


DIRC="/root/motion/snapshots/"


VIDEOTIME="/root/tmp/videotime"


TIME=$(cat $VIDEOTIME)
echo $TIME
ALARM_EMAIL="/root/tmp/myalarm.txt"


 


echo "Subject: Motion detected - $TIME - $DIRC" > $ALARM_EMAIL


echo "">> $ALARM_EMAIL


echo "Motion detected - check $TIME.avi">>$ALARM_EMAIL


MAILBODY=$(cat $ALARM_EMAIL)


 


#first trying of sending the avi video
echo $DIRC*$TIME
echo $MAILBODY
#echo $MAILBODY | mutt -s $TIME -a $DIRC*$TIME.avi [email protected]
echo $MAILBODY | mutt -s $TIME -a "$DIRC*$TIME.avi" -- [email protected] < "/root/aaa.txt"


 


#second trying of sending the avi video


TIME=$(expr $TIME - 1)
#TIME=$(expr $TIME)
echo $TIME
echo $MAILBODY | mutt -s $TIME -a $DIRC*$TIME.avi [email protected]

运行前,先修改这个文件/root/motion.conf,我的motion.conf

# Minimal motion example config file provided by the

# Debian motion package - for basic webcam operation.

#

# You most certainly want to investigate

# /usr/share/doc/motion/examples/motion-dist.conf.gz

# for further configuration options. Also, refer to the

# motion man page and /usr/share/doc/motion/motion_guide.html

# for detailed information on configuration options.

 

daemon off

quiet on

locate on

 

# You may very well need to change this (check with 'dmesg'

# after plugging in your webcam).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值