Web カメラ

玄柴(KURO-SHEEVA)

またまた SheevaPlug の時のまんま。
「ハックの記録」に手順、結果を残しておくことは、 自分のためにでもある。

webcam のインストール

root@debian:~# apt-get install webcam
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libx11-data libxcb1 libxau6 libxdmcp6 libxcb-xlib0 libx11-6
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libdv4 libjpeg62 libv4l-0 ssh xawtv-plugins
Suggested packages:
  libdv-bin
The following NEW packages will be installed:
  libdv4 libjpeg62 libv4l-0 ssh webcam xawtv-plugins
0 upgraded, 6 newly installed, 0 to remove and 6 not upgraded.
Need to get 379kB of archives.
After this operation, 1335kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ports.ubuntu.com jaunty/main libdv4 1.0.0-1ubuntu2 [77.5kB]
Get:2 http://ports.ubuntu.com jaunty/main libjpeg62 6b-14 [91.0kB]
Get:3 http://ports.ubuntu.com jaunty/main libv4l-0 0.5.8-1 [64.4kB]
Get:4 http://ports.ubuntu.com jaunty/main ssh 1:5.1p1-5ubuntu1 [1244B]
Get:5 http://ports.ubuntu.com jaunty/universe xawtv-plugins 3.95.dfsg.1-8.1ubuntu1 [104kB]
Get:6 http://ports.ubuntu.com jaunty/universe webcam 3.95.dfsg.1-8.1ubuntu1 [40.8kB]
Fetched 379kB in 2s (154kB/s)
Selecting previously deselected package libdv4.
(Reading database ... 13604 files and directories currently installed.)
Unpacking libdv4 (from .../libdv4_1.0.0-1ubuntu2_armel.deb) ...
Selecting previously deselected package libjpeg62.
Unpacking libjpeg62 (from .../libjpeg62_6b-14_armel.deb) ...
Selecting previously deselected package libv4l-0.
Unpacking libv4l-0 (from .../libv4l-0_0.5.8-1_armel.deb) ...
Selecting previously deselected package ssh.
Unpacking ssh (from .../ssh_1%3a5.1p1-5ubuntu1_all.deb) ...
Selecting previously deselected package xawtv-plugins.
Unpacking xawtv-plugins (from .../xawtv-plugins_3.95.dfsg.1-8.1ubuntu1_armel.deb) ...
Selecting previously deselected package webcam.
Unpacking webcam (from .../webcam_3.95.dfsg.1-8.1ubuntu1_armel.deb) ...
Setting up libdv4 (1.0.0-1ubuntu2) ...

Setting up libjpeg62 (6b-14) ...

Setting up libv4l-0 (0.5.8-1) ...

Setting up ssh (1:5.1p1-5ubuntu1) ...

Setting up xawtv-plugins (3.95.dfsg.1-8.1ubuntu1) ...
Setting up webcam (3.95.dfsg.1-8.1ubuntu1) ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
root@debian:~#

.webcamrc の作成

デモでは、webcam を起動したら1つ jpg を撮って終了するので、 onece = 1
root@debian:~# cat > .webcamrc
[grab]
archive = /var/www/webcam.jpg
once = 1
root@debian:~#

webcam の実行

root@debian:~# webcam
reading config file: /root/.webcamrc
video4linux webcam v1.5 - (c) 1998-2002 Gerd Knorr
grabber config:
  size 320x240 [none]
  input (null), norm (null), jpeg quality 75
  rotate=0, top=0, left=0, bottom=240, right=320
root@debian:~# ls -l /var/www/webcam.jpg
-rw-r--r-- 1 root root 8341 Jul  1 23:25 /var/www/webcam.jpg
root@debian:~#
撮れてるみたい。

http://192.168.2.86/webcam.jpg にアクセスして 画像を確認する。

Good Going!



KURO-SHEEVA
楽天市場

←(前のページ)
D02HW でダイアルアップ
当月のハックの記録
SheevaPlug/玄柴(KURO-SHEEVA)をハックしよう トップ
(次のページ)→
iptables のインストール

Copyright (C) 2003-2010 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市