程式狂想筆記

一個攻城師奮鬥史

0%

使用 Docker 架設 Motioneye 試用小記

原本想研究MieszkoMakuch/pi-security-camera: University project: Smart security camera on raspberry pi with email notifications and web interface,來當做監視器,但前置作業就要先搞好 OpenCV,最近看到 HomeLab.001 樹梅派ARM架構升級版 ODROID N2 搭建多功能服務器 這篇提到 Motioneye (影像監視) ,看介紹感覺都符合我要使用的。

網路上教學

好多人都有拿來用,目前我先用筆電小試。

簡單使用 Docker

官網就有 Docker 實作,我這邊先整理我在筆電執行的指令。

1
2
3
4
5
6
7
8
9
10
docker run --name="motioneye" \
--device=/dev/video0 \
-p 8765:8765 \
--hostname="motioneye" \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/motioneye:/etc/motioneye \
-v /var/lib/motioneye:/var/lib/motioneye \
--restart="always" \
--detach=true \
ccrisan/motioneye:master-amd64

這樣就完成了。

這邊注意,/dev/video0 是指你的攝像頭。

http://192.168.1.111:8765進去介面,帳號/密碼為 admin/(空白),進去新增Camera 就能完成。沒想到還滿快的。

失敗小記

我原先去 Docker Hub 找 jshridha/motioneye - Docker Image | Docker Hub,但執行不能成功。

但我發現,指令跟官方有差異。

1
2
3
4
5
6
7
8
9
10
docker run -d --name=motioneye \
--device=/dev/video0 \
-p 8081:8081 \
-p 8765:8765 \
-e TIMEZONE="America/New_York" \
-e PUID="99" \
-e PGID="100" \
-v /mnt/user/appdata/motioneye/media:/home/nobody/media \
-v /mnt/user/appdata/motioneye/config:/config \
jshridha/motioneye:latest
1
2
-e PUID="99" \
-e PGID="100" \

這個好像跟攝像頭權限有關係,但在我機器要使用

1
2
-e PUID="0" \
-e PGID="0" \

不知道為什麼官方就可以不用加???

未來研究

NOTE

  1. Line / Disocrd 通知、Email 通知
  2. 智米攝影機 改機(RTSP)

還在猶豫刷機還是買支援RSTP 的 IP Camera,刷機沒法刷回台版。有機會無法用米家APP操作。

當然也有考慮找支援RSTP 協定的攝影機。