前置工作:
准备一个 usb 摄像头,连接到树莓派上
lsusb 查看摄像头是否连接
1. 安装 motion
apt-get install motion
2 . 配置 motion 自启动,编辑配置文件 /etc/motion/motion.conf
daemon off 改为 daemon on start_motion_daemon=no 改为 start_motion_daemon=yes webcam_localhost on 改为 webcam_localhost off
3. 查看 motion 是否启动 ,进程存在代表启动成功
ps aux|grep motion
4. 浏览器访问实时画面 http://192.168.1.13:8081/
这里是树莓派的 ip、端口 ,8081 为 motion 的 webcam 默认端口,如需修改编辑 /etc/motion/motion.conf 的 webcam_port 属性
其他配置:
# 1. 设置用户名和密码
# 2. 分辨率设置
3. 关闭 motion
sudo killall -TERM motion
4. 启动 motion
montion