找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 51150|回复: 46

摄像头用motion做监控非常棒!

  [复制链接]
本帖最后由 coldmoon 于 2010-5-21 21:41 编辑

画面上只要有变化,就会保存照片到置顶位置。太适合做监控了

我在三个路由实现了该监控,分别是mi424wr,db120,7231-4p.其中7231-4p是使用dd-wrt 其余两个使用openwrt-backfire.
首先在http://downloads.openwrt.org/backfire/10.03  根据硬件平台下载安装motion及相关的ipk包,
然后编辑vi /overlay/etc/motion.conf, 我的编辑文件内容如下
# Rename this distribution example file to motion.conf
#
# This config file was generated by motion "3.2.11.1"


############################################################
# Daemon
############################################################

# Start in daemon (background) mode and release terminal (default: off)
daemon off

# File to store the process ID, also called pid file. (default: not defined)
process_id_file /var/run/motion/motion.pid

############################################################
# Basic Setup Mode
############################################################

# Start in Setup-Mode, daemon disabled. (default: off)
setup_mode off

###########################################################
# Capture device options
############################################################

# Videodevice to be used for capturing  (default /dev/video0)
# for FreeBSD default is /dev/bktr0
videodevice /dev/video0

                                         
                                                                                   
# Image width (pixels). Valid range: Camera dependent, default: 352               
width 320                                                                          
                                                                                   
# Image height (pixels). Valid range: Camera dependent, default: 288               
height 240                                                      
                  
                                                                                   
                                                                          
                                                                       
                                                                                       

# Motion Detection Settings:
############################################################

# Threshold for number of changed pixels in an image that
# triggers motion detection (default: 1500)
threshold 1500 这个是改变探测灵敏度,越小越灵敏
# Automatically tune the threshold down if possible (default: off)
threshold_tune off

# Noise threshold for the motion detection (default: 32)
noise_level 32

# Automatically tune the noise threshold (default: on)
noise_tune on







# Live Webcam Server
############################################################

# The mini-http server listens to this port for requests (default: 0 = disabled)
webcam_port 8081  #远程端口
# Quality of the jpeg images produced (default: 50)
webcam_quality 50

# Output frames at 1 fps when no motion is detected and increase to the
# rate given by webcam_maxrate when motion is detected (default: off)
webcam_motion off

# Maximum framerate for webcam streams (default: 1)
webcam_maxrate 1

# Restrict webcam connections to localhost only (default: on)
webcam_localhost off #必须改成off才能通过pc访问

# Limits the number of images per connection (default: 0 = unlimited)
# Number can be defined by multiplying actual webcam rate by desired number of seconds
# Actual webcam rate is the smallest of the numbers framerate and webcam_maxrate
webcam_limit 0


############################################################
# HTTP Based Control
############################################################

# TCP/IP port for the http server to listen on (default: 0 = disabled)
control_port 8080

# Restrict control connections to localhost only (default: on)
control_localhost on

# Output for http server, select off to choose raw text plain (default: on)
control_html_output on

# Authentication for the http based control. Syntax username:password
# Default: not defined (Disabled)
; control_authentication username:password

##############################################################
# Thread config files - One for each camera.
# Except if only one camera - You only need this config file.
# If you have more than one camera you MUST define one thread
# config file for each camera in addition to this config file.
##############################################################

# Remember: If you have more than one camera you must have one
# thread file for each camera. E.g. 2 cameras requires 3 files:
# This motion.conf file AND thread1.conf and thread2.conf.
# Only put the options that are unique to each camera in the
# thread config files.
thread /etc/thread1.conf
thread /etc/thread2.conf
# thread /etc/thread3.conf
# thread /etc/thread4.conf
  #如果有多个摄像头要把使用这部分,否则全部注释掉

因为字符限制,上面只是把需要修改的地方写上了
修改好后,在/etc目录下 输入 motion -c motion.conf

这时候只要摄像头画面有变化,就出现采集图片到设置目录了.

在windows下也可以使用palantir    (在这里下载http://www.fastpath.it/products/palantir/pub/pclient.exe) 的pc客户端 连接 192.168.1.1:8081就可以看到图片了,这个完全是一张张图片播放的 所以不连贯.

评分

参与人数 3恩山币 +3 收起 理由
shino*** + 1 已收藏
面具*** + 1 泥马,真给力!
qaq*** + 1 泥马,真给力!

查看全部评分

羡慕  想整一个
回复

使用道具 举报

 楼主| | 显示全部楼层
用palantir的windows客户端可以时时监控
回复

使用道具 举报

有详细的操作过程吗
回复

使用道具 举报

 楼主| | 显示全部楼层
我就是直接装的backfire 10.03  然后安装motion,telnet编辑/etc/motion.conf,把摄像头的/dev/video0 改成自己的硬件,把照片保存路径改到u盘上,然后
motion -c motion.conf 运行就可以了
回复

使用道具 举报

冒个泡学完就走。回头试试。
回复

使用道具 举报

慢慢思考吧,总有一天俺也要做一个
回复

使用道具 举报

楼主能发个详细的教程吗?造福大众。
回复

使用道具 举报

怎么把图像格式调整为JPG格式。。我的301的头对YUV支持不好。。
图象乱。。 唉,没找到怎么改。。
回复

使用道具 举报

楼主,这个motion中的默认图像格式是YUV420P。
在配置文件中找不到什么地方改他,。,
回复

使用道具 举报

mark
回复

使用道具 举报

楼主,这个motion中的默认图像格式是YUV420P。
在配置文件中找不到什么地方改他,。,
gggggg 发表于 2010-6-18 00:57



你试试修改以下选项:

# v4l2_palette allows to choose preferable palette to be use by motion
# to capture from those supported by your videodevice. (default: 8)
# E.g. if your videodevice supports both V4L2_PIX_FMT_SBGGR8 and
# V4L2_PIX_FMT_MJPEG then motion will by default use V4L2_PIX_FMT_MJPEG.
# Setting v4l2_palette to 1 forces motion to use V4L2_PIX_FMT_SBGGR8
# instead.
#
# Values :
# V4L2_PIX_FMT_SN9C10X : 0  'S910'
# V4L2_PIX_FMT_SBGGR8  : 1  'BA81'
# V4L2_PIX_FMT_MJPEG   : 2  'MJPEG'
# V4L2_PIX_FMT_JPEG    : 3  'JPEG'
# V4L2_PIX_FMT_RGB24   : 4  'RGB3'
# V4L2_PIX_FMT_UYVY    : 5  'UYVY'
# V4L2_PIX_FMT_YUYV    : 6  'YUYV'
# V4L2_PIX_FMT_YUV422P : 7  '422P'
# V4L2_PIX_FMT_YUV420  : 8  'YU12'
v4l2_palette 2
回复

使用道具 举报

libav的代码使用浮点,在板上没办法用。有没知道libav是用整数实现的?
回复

使用道具 举报

请问有谁保存录像成功的?搞了两天都没搞定。
官网的motion安装包不支持ffmpeg,重新编译了个支持的,但还是识别不了视频格式。
可能ffmpeg编译有问题?
回复

使用道具 举报

搞定录象没有呀 等高人出手
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-5-11 07:14

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表