ラズパイ motionで監視カメラ
root@raspi-81:/etc/motion# diff motion.conf.orig motion.conf 11c11,12 < daemon off --- > #daemon off > daemon on 282c283,284 < ffmpeg_video_codec swf --- > #ffmpeg_video_codec swf > ffmpeg_video_codec mpeg4 314c316,317 < locate off --- > #locate off > locate on 359c362,363 < target_dir /tmp/motion --- > #target_dir /tmp/motion > target_dir /home/hiraawa/motion 413c417,418 < webcam_localhost on --- > #webcam_localhost on > webcam_localhost off root@raspi-81:/etc/motion#
201401追記
上記のままだと、自動的にaviファイル(つまり動画ファイル)がつくられてしまふので
ffmpeg_cap_new off
にすると幸せになれる
root@raspi-81:/etc/motion# motion [0] Processing thread 0 - config file /etc/motion/motion.conf [0] Motion 3.2.12 Started [0] Motion going to daemon mode [0] Exit motion, cannot create process id file (pid file) /var/run/motion/motion.pid: No such file or directory root@raspi-81:/etc/motion# root@raspi-81:/etc/motion# mkdir /var/run/motion
この状態で、motionコマンドを直接たたけば動くはず。実際うごきました。
root@raspi-82:/etc/default# pwd /etc/default root@raspi-82:/etc/default# cat motion # set to 'yes' to enable the motion daemon #start_motion_daemon=no start_motion_daemon=yes root@raspi-82:/etc/default#
つぎに/etc/init.d/motion startを叩けば動くと期待したんだ、psしてもmotionが見えない
/var/log/syslogをみると
Sep 3 10:01:45 raspi-82 motion: [0] Processing thread 0 - config file /etc/motion/motion.conf Sep 3 10:01:45 raspi-82 motion: [0] Motion 3.2.12 Started Sep 3 10:01:45 raspi-82 motion: [0] Exit motion, cannot create process id file (pid file) /var/run/motion.pid: Permission denied
これを直して、
つづいてjpg ファイルの保存場所をmotionが読めるように変更。
/mnt/sda1のパーミッションを777に変えてみたらうごいたとさ