LoginSignup
26
35

More than 5 years have passed since last update.

Raspberry Pi でカメラ

Last updated at Posted at 2016-04-28

以下のサイトを参考に実施

USB カメラが認識されているか確認

$ lsusb
Bus 001 Device 004: ID 046d:09a2 Logitech, Inc. QuickCam Communicate Deluxe/S7500

Motion をインストール

$ sudo apt-get install motion

設定変更

$ sudo vi /etc/motion/motion.conf

書き変え

  • localhostのみの操作アクセス制限をoffに
    webcontrol_localhost on
     ↓
    webcontrol_localhost off

  • localhostのみの表示アクセス制限をoffに
    stream_localhost on
     ↓
    stream_localhost off

起動

$ sudo motion -c /etc/motion/motion.conf

または

$ sudo motion -n
(Run in non-daemon mode)

動体検知で /var/lib/motion に静止画が保存される

停止

$ sudo service motion stop

PC からアクセス

ブラウザで設定変更

http://XXX.XXX.XXX.XXX:8080/
ブラウザから設定値をコントロールできる

ブラウザでストリーム表示

枠は表示されるが画像が表示されない
Video device fatal error - Closing video device

どこかのタイミングで静止画が保存されなくなった
reboot して

$ sudo motion -n

で、静止画が保存されるようになった
ストリーミングもOK

動体検知した部分だけ動画にして保存している

設定変更

$ sudo vi /etc/motion/motion.conf

書き変え

  • 静止画を保存しない
    output_pictures on
     ↓
    output_pictures off

  • サイズ
    width 640 # 幅
    height 480 # 高さ

26
35
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
26
35