Sunday, March 21, 2010

CCTV and Free software

Image by  jordi.martorell
I do a lot of work with local businesses. I design websites, install point of sale systems, and do computer repair. Several weeks ago a local business owner who I've worked with in the past approached me with a computer that was refusing to boot. He needed it back quickly, as this PC controlled his CCTV.



"I had someone look at it, and they said the power supply was bad"  he said to me. Normally I would run the system through its paces and test it throughly before I returned it. This machine, however, was the controller for his security cameras. He need it back quickly, so I replaced the power supply. I turned it on, watched it boot, shut it down and returned it.

Long story short, two days later I have the same computer sitting in front of me. The power supply is fine, but the motherboard is shot. I've got a week to build a CCTV system as cheaply as I can. Hardware is easy, generic (linux compatible) capture card, new motherboard/processor 1GB ram, 2 HDs.

Software was a little less easy. I was unfamiliar with the whole scene, but it was highly recommended to me that I try Zoneminder. So I installed Xubuntu, downloaded and installed all the codecs that Zoneminder requires, and installed zoneminder and XawTV. None of this was anything out of the ordinary. I had to follow some basic set-up instructions as detailed here.

Everything appeared to be working. I took the machine back to the shop, plugged it in and started Zoneminder. I pulled up a firefox window and was able to get video feed for 4 of his 13 cameras. Things are going much more smoothly than normal, and 4 cameras is much better than no cameras. But as a long term solution 4 just isn't enough!

I was confused, I expect all the cameras to show up. The card billed itself as having 16 inputs through a special dongle. It turns out that the card has 4 chips that support 4 channels each, for a total of 16 multiplexed channels. Apparently this is the common way for capture cards to be built.

So each of the digitizers, the chips on the card, appears as a separate device to the computer. I can pull 1 frame at a time off of four cameras. Then I 'change the channel' so to speak, and pull 1 frame off of four more cards, repeating this until all the cameras are accounted for. This means that I'm pulling down 3-5 FPS off of each camera.

As I've never done this before, I still had a hard time figuring out exactly what was going on. I used the wonderful XawTV to figure out which channels on which devices lined up to which camera. Within minutes I had the software recording live feeds. With a little more configuration, I had each camera recording while the store was open, and running motion detection when the store was closed. If a movement was detected, the camera would start recording, and even send out an email!


All in all it has been a rewarding and interesting experience. and I've discovered that a security camera system can be set up cheaply and quickly. A basic set up, with 1-2 cameras shouldn't cost more than $400! I look forward to the opportunity to set up some more!

2 comments:

  1. Jordi Martorell is a Catalan name.

    ReplyDelete
  2. It's also the flikr username of the individual who took this excellent photo.

    ReplyDelete