pinewell's farmer blog 農業と電子工作、ソフトウェア、バイク、車

2013年4月3日

motionの設定、motion.conf。

Filed under: 育苗管理システム — pinewell @ 6:59 PM

おもむろにUSBカメラを挿す。
Apr 3 18:12:23 debian kernel: [ 5233.184994] usb 2-1: new high speed USB device using orion-ehci and address 2
Apr 3 18:12:24 debian kernel: [ 5233.775622] usb 2-1: New USB device found, idVendor=2084, idProduct=0009
Apr 3 18:12:24 debian kernel: [ 5233.855986] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 3 18:12:24 debian kernel: [ 5233.941562] usb 2-1: Product: BUFFALO BSW20K06H USB PC Camera
Apr 3 18:12:24 debian kernel: [ 5234.011446] usb 2-1: Manufacturer: Syntek
Apr 3 18:12:24 debian kernel: [ 5234.059473] usb 2-1: SerialNumber: STK00001
Apr 3 18:12:24 debian kernel: [ 5234.113725] usb 2-1: configuration #1 chosen from 1 choice
Apr 3 18:12:25 debian kernel: [ 5234.580160] Linux video capture interface: v2.00
Apr 3 18:12:25 debian kernel: [ 5234.721386] uvcvideo: Found UVC 1.00 device BUFFALO BSW20K06H USB PC Camera (2084:0009)
Apr 3 18:12:25 debian kernel: [ 5234.857449] input: BUFFALO BSW20K06H USB PC Camer as /devices/platform/orion-ehci.1/usb2/2-1/2-1:1.0/input/input0
Apr 3 18:12:25 debian kernel: [ 5234.983617] usbcore: registered new interface driver uvcvideo
Apr 3 18:12:25 debian kernel: [ 5235.057385] USB Video Class driver (v0.1.0)
これがでてくれば認識OK。
/dev/video0ができているはず。

motionの動作確認。
最低限、/etc/motion/motion.confの

webcam_localhost on をコメントアウトし、
webcam_localhost offにする。

#motion
これでデーモンモードじゃない状態で起動。いろいろ出てくる。
適当なブラウザで http://%LS-GLのIP%:8081/ で画像が見ているはず。

動くことが確認できたら、
#vi /etc/motion/motion.conf

daemon off を daemon on
width 320 -> 640
height 240 -> 480
framerate 2 -> 100
auto_brightness off -> on
brightness 0 -> 127
ffmpeg_cap_new on -> off
locate off -> on

target_dir /tmp/motion -> target_dir /var/www/motion
snapshot_filename %v-%Y%m%d%H%M%S-snapshot -> snapshot_filename snapshot/%Y%m%d%H%M%S-%v-%q-snapshot
jpeg_filename $v-%Y%m%d%H%M%S-%q -> jpeg_filename %Y/%m/%d/%H%M%S-%v-%q
webcam_quality 50 -> 100
control_port 8080 -> 8070
control_localhost on -> off
; on_picture_save value -> on_picture_save /var/www/motion/bin/indexcopy.php %f

ディレクトリはあらかじめ作っておこう。
#mkdir /var/www/motion
#chmod 777 /var/www/motion

で、動くことが確認できたら
#vi /etc/default/motion
start_motion_daemon=no -> yes

コメントはまだありません »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress