使用motion进行摄像头监视
使用motion进行摄像头监视(树莓派)
安装
- 系统更新
sudo apt-get update
- 安装Vim
sudo apt-get install vim
- 终端输入
sudo apt-get install motion
配置motion
sudo vim /etc/default/motion
修改内容
# set to 'yes' to enable the motion daemon
start_motion_daemon=no
## 修改为start_motion_daemon=yes
sudo vim /etc/motion/motion.conf
tips:
可以通过vim的字符串匹配功能,快速定位到该项。
- 命令状态下
/字符串
回车- 使用
n
进行下一个
# Start in daemon (background) mode and release terminal (default: off)
daemon off
#修改为:daemon on
############################################################
# Live Stream Server
############################################################
# The mini-http server listens to this port for requests (default: 0 = disabled)
stream_port 8081
#修改为 8081 #这是端口
# Restrict stream connections to localhost only (default: on)
stream_localhost on
# 修改为 stream_localhost off
############################################################
# HTTP Based Control
############################################################
# TCP/IP port for the http server to listen on (default: 0 = disabled)
webcontrol_port 8080
# Restrict control connections to localhost only (default: on)
webcontrol_localhost on
##这里修改为 webcontrol_localhost off
# Output for http server, select off to choose raw text plain (default: on)
webcontrol_html_output on
# Image width (pixels). Valid range: Camera dependent, default: 320
width 320
## 这里的320可以修改为摄像头的分辨率 长
# Image height (pixels). Valid range: Camera dependent, default: 240
height 240
## 这里的240可以修改为摄像头的分辨率 宽
# Maximum number of frames to be captured per second.
# Valid range: 2-100. Default: 100 (almost no limit).
framerate 2
然后使用命令sudo motion
启动该软件
之后就可以在局域网内,通过ip+端口
的方式访问你的监控了。如网站输入192.168.0.111:8081
回车进行查看
想要退出的话sudo service motion stop
如果想查看自己摄像头的状况,树莓派系统下面安装luvcview
使用命令sudo apt install luvcview
安装完成之后,使用命令查看
luvcview -d /dev/video* -L
这是小睿的博客,如果需要转载,请标注出处啦~ヾ(≧▽≦*)o谢谢。