鏈接地址: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 即可看到攝像頭當前拍攝的畫面。