Big mother's watching you
I want to make this blog a nice blog about my Linux adventures including tips which might be useful or someone.
First of a series of articles i want to write about my 'security' cam.
For a long time i wanted to have a webcam connected to my Linux webserver. Mainly for fun, but also a bit for purpose.
Unfortunately i couldn't find a webcam working without problems on Linux.
In the end i found a cheap Trust cam, a Spacecam 120 which used the GSPA drivers. Unfortunately this was a low-res cam (320x240) and very bad image quality when lightlevel was a bit low. Besides that the GSPA drivers were discontinued.
I also bought i more recent Trust WB-3250p which was entirely unusable on Linux.
Lately i found a Logitech webcam, the C200 for only €20,- a piece and after finding some documents by Logitech telling Linux support was good i bought one. So i started trying different Linux software useable for surveillance purposes. First i tried camsource which worked with the Trust cam, but unfortunately it didn't work with the Logitech. Soon i found out that camsource was v4l version 1 and that it was discontinued. The driver for the Logitech cam (uvcvideo) was a v4l 2 driver. For a moment i felt that buying the Logitech was a mistake.
But then i found the great software motion. It's fairly resource friendly (uses 10% CPU on my Athlon XP 2200+ from 2003) and has nice features.
It's continuously grabbing images from the webcam(s) and compares the images to detect motion. when motion is detected it saves a short MPEG file with accompanying thumbnail image.
When i found that the Logitech webcam worked with Linux i bought another one to have 2 cams. I wrote a simple PHP script which uses the filenames to get the times en event id.
Recently i got another rabbit as company for the one i already had. I wanted to know how the new rabbit was doing when is was away for work. But also for a long time i wanted to know how active the my first rabbit is when i am away.
Besides of that: The houseowner is known to use the sparekey of my rented room whenever he feels it's necessary. Although this is illegal, there's not much to do about it. Using the webcam at least i know when such has happened.
The software is perfect because it gives an overview of all the movement events that day: No need to watch a webcam all day.
A few problems arose with this configuration. In the server is also a TV card (i also use it as regular PC and for watching TV). Apparently during boot the USB bus was initialized before the PCI TV card which resulted in the webcam being video0 en video1 and the TV card /dev/video2. This wasn't very reliable so i wanted to assign device names to the webcams and TV card. Trying to force the TVcard to be /dev/video0 created a mess, so next i tried assigning an extra symlink leaving the device nodes as the were. So now /dev/TV-kaart is a symlink to whatever /dev/video the TVcard is and /dev/webcam1 en webcam2 are symlinks to the respective webcams.Another problem was that it turned out that my computer has only 3 USB root hubs and only one of them is USB 2. Problems with bandwidth arose (errormessage: no space left on device) but setting the grabbing imageformat of one of the webcams from YUYV to MJPEG seems to solve the problem.
Here's is the udev file: it's in /etc/udev/rules.d and named 10-local.rules:
SUBSYSTEM=="video4linux", ATTR{name}=="*video (ASUSTeK P7131*",SYMLINK+="TVkaart"
SUBSYSTEM=="sound", ATTRS{id}=="SAA7134",SYMLINK+="TVDSP"
SUBSYSTEM=="video4linux", SUBSYSTEMS=="usb", KERNELS=="1-1", SYMLINK+="webcam1"
SUBSYSTEM=="video4linux", SUBSYSTEMS=="usb", KERNELS=="1-2", SYMLINK+="webcam2"
One other alternative is Zoneminder. It's also available for Windows. I didn't try it myself: It looks a bit overkill for my purposes and besides it doesn't look resource friendly to me.
Camsource is included in de default OpenSuSE repo and Zoneminder and motion are available in additional OpenSuSE repositories.
In Holland it's not legal to point a surveillance cam on the public street. I also heard about a case where a burglar was filmed by a webcam and that the images couldn't be used because of privacy restrictions.
This , of course, only applies to citizens, not for the government and big companies:
In this country the government monitors and saves information for several years about internet, email and telephone, public transportation use movements by car, childhood details, medical details about every single citizen without laws to restrict government access to this data.
In Holland the police does 1700 telephone taps a day! (2200 a year in the US), often without the mandatory notice to the person being tapped.
The webcam watching the rabbit.
The PHP page with thumbnails en clickable videos.
Just a sample video: It shows some activity from Nelson (the black rabbit)
Honey, I'm home !
0 comments:
Post a Comment