motion是Linux下一款开源的摄像头监控软件,用命名行运行,只保存有运动物体的图像。
sudo apt install motion
sudo cp/etc/motion/motion.conf/etc/motion/motion.conf.bak
sudo vim /etc/motion/motion.conf
更改文档中以下内容
width640 #图像的宽
height480 #图像的高
target_dir /home/pi/motion-images #图片保存的路径
stream_localhost off #允许通过网页查看摄像头
stream_auth_method2 #开启密码认证
stream_authentication 用户名:密码 #网页查看摄像头的用户名和密码4
mkdir ~/motion-images
sudo motion
用浏览器登陆树莓派的网址192.168.1.105:8081,会弹出用户名和密码的对话框,输入用户名和密码后看到图像就成功了。
sudo vim /etc/rc.local
在exit 0前添加 motion , 保存,就会开机自动运行了。
本人英语渣,有翻译不对的地方请指出
选项Range/Values Default说明
auto_brightnessValues: on,off
Default: off让motion自动调节视频的的亮度,只适用于不带有自动亮度调节的摄像机
brightnessValues: 0-255