链接地址:http://shumeipai.nxez.com/2016/09/01/raspberry-pi-motion-cameras-for-remote-monitoring.html
下面我们介绍如何来给树莓派装个USB摄像头,然后远程访问摄像头拍摄的即时画面。
首先你需要一个树莓派能兼容的USB摄像头,笔者用的是罗技(Logitech)C270 高清网络摄像头,插上即可。软件方面非常简单只需要一个软件:motion。
假设你的树莓派已经装好了 Raspbian 的系统,你只需要:
1
|
sudo
apt-get install
motion |
然后打开 motion daemon 守护进程,让他可以一直在后台运行:
1
2
3
|
sudo
nano /etc/default/motion #no修改成 yes : start_motion_daemon= yes |
修改motion的配置文件:
1
2
3
4
5
6
7
8
|
sudo
vim /etc/motion/motion .conf #deamon
off 改成 on deamon
on #设置分辨率 width
800 height
600 #关闭
localhost 的限制 webcam_localhost
off |
然后运行 motion:
1
|
sudo
motion |
现在我们的摄像头已经变成了一台网络摄像头。在chrome浏览器下访问 http://[your.domain]:8081 即可看到摄像头当前拍摄的画面。