树莓派摄像头配置

1. 安装

1
sudo apt install motion

2. 配置

备份配置文件

1
sudo cp /etc/motion/motion.conf /etc/motion/motion.conf.bak

打开配置文档

1
sudo vim /etc/motion/motion.conf

更改文档中以下内容

1
2
3
4
5
6
width 640      
height 480 #图像的高
target_dir /home/pi/motion-images #图片保存的路径
stream_localhost off #允许通过网页查看摄像头
stream_auth_method 2 #开启密码认证
stream_authentication 用户名:密码 #网页查看摄像头的用户名和密码

官方详细配置说明:http://lavrsen.dk/foswiki/bin/view/Motion/ConfigFileOptions

3. 运行

1
sudo motion