田中はゆるく生きたい

カメラ導入②

その他

[blogcard url=”https://tanakaryo.net/memo/rasp-camera”]

無事カメラをつなげたらあとはカメラをもう一台増やそうと頑張ってみる。
motionでは全体の設定をmotion.conf、カメラ1をthread1、カメラ2をthread2に記述。

motionのいらない設定をコメントアウトし、threadを有効にするためthreadはコメントアウト解除。
threadは最初からファイルがあると説明しているサイトもあるが自分の場合はなかったのでmotionが指定しているところにわざわざファイルを作る。

sudo vi /etc/motion/motion.conf

[php]
#stream_port 8081
#videodevice /dev/video0
thread /etc/motion/thread1.conf
thread /etc/motion/thread2.conf
[/php]

thread /etc/motion/thread1.conf
[php]
stream_port 8081
videodevice /dev/video0
[/php]

thread /etc/motion/thread2.conf
[php]
stream_port 8082
videodevice /dev/video1
[/php]

確認はmotion -nなり init.d restartなりして終わり。