I’m sure this has been described thousands of times, but today it took me again almost one hour to find out how to set up the webcam application on Linux. This HowTo was made for Debian like systems, if you are experienced enough you can easily port this HowTo onto other distros like Fedora/Redhat, Gentoo or SuSE, too.
Here we go:
sudo apt-get install webcam v4l-conf
- save the following content into your user’s home directory under
[grab] device = /dev/video0 text = "webcam %Y-%m-%d %H:%M:%S" infofile = filename fg_red = 255 fg_green = 255 fg_blue = 255 width = 320 height = 240 delay = 3 wait = 0 input = composite1 #norm = pal rotate = 0 top = 0 left = 0 bottom = -1 right = -1 quality = 75 trigger = 0 once = 0 [ftp] host = www user = webcam pass = xxxxxx dir = public_html/images file = webcam.jpeg tmp = uploading.jpeg passive = 1 debug = 0 auto = 0 local = 1 ssh = 0
- now perform
#v4l-info | grep name name : "Camera 1" name : "Brightness" name : "Contrast" name : "Saturation" name : "Venus USB2.0 Camera"
and replace the first green line in
.webcamrc( input = composite1) with the result you’ve got in this step “Camera 1″. Your cam will likely be called differently. Your line in .webcamrc should now look like this:
webcam > /dev/null 2>&1 &
webcam is a simple program, you don’t have any switches and you have to care your self for an automatic launch at system start.
webcamis done by kill.
input = Camera 1
You don’t need quotes for the spaces in order to escape special characters.
# webcam reading config file: /root/.webcamrc invalid input: composite1 # (or spca533, spca5xx, ZC301-2, uvcvideo )
Solution: does v4l-info really returns “composite1″ as camera name for you? Replace the name you’ve got from v4l-info with the input name composite1
# webcam reading config file: /root/.webcamrc invalid norm: pal
Solution: uncomment the line “norm = pal”, it’s also working without it here.
tuner ioctl VIDIOCGTUNER: Invalid argument audio ioctl VIDIOCGTUNER: Invalid argument
Solution: I don’t have any solution for it, it’s working for me, even these errors occur.
The picture wasn’t uploaded onto the remote machine.
Solution: make sure in your
.webcamrcthese values are set correctly if you try to use ssh.
local = 0 ssh = 1
Go through all your steps manually. Did you inserted on the target machine (where the picture should be send to) your
~/.ssh/authorized_keys2for a passwordless connection? Use ‘
ssh-keygen -t dsa‘, if you didn’t before.
Don’t use ftp, it’s very unsafe.