I talked about the Arlo security camera system in my last post, and so far I think it’s a good system for what it does. The main benefit is also the main limitation – the cameras are battery powered. That makes them easy to fit and move around but also means they’re not really suited to areas with high traffic. Lots of motion means lots of activations of the camera which means poor battery life.
With that in mind I have mine covering the side and back of my house. At the front I need a more traditional camera. For a couple of years I was making do with a USB webcam pointing out of the window, managed by the open source Zoneminder software (of which more over the new few posts)
It worked quite well. Image quality was OK but with a few severe limitations.
In the winter and near sunset, low light would cause internal reflections within the window glass and that reduced the image quality and triggered false alarms for motion. It was also no use at night – for that you need infrared and even if the camera had an IR light it would just reflect off of the window.
I needed a camera outside.
I wanted it to tie in with Zoneminder and I knew I wasn’t going to install several cameras. A standalone IP based camera seemed like the best bet. The main requirement was that it could provide a stream to third party applications like Zoneminder so that I didn’t need to use the proprietary software that came with it. Sadly some promising cameras only worked with their own software and cloud services. While that was OK for the Arlo system, it wouldn’t really work for the main camera, especially if I wanted 24×7 recording.
Wifi also seemed like a good idea. With a wifi based camera I’d only need to run a power cable outside. Unfortunately they all seem to have a bit of a design flaw – a big bundle of cables exit the camera which would have to be housed outside with just the power cable routed inside. Not a show stopper – a junction box on the wall would handle that.
I tried two and returned them both. Both had poor picture quality and couldn’t maintain a reliable stream.
I then looked into wired ethernet cameras and decided that one that ran on power over ethernet (POE) would be ideal because it would still mean only a single cable going through the wall. I was already running out of ports on my router so I added an 8 port switch that had 4 POE ports.
The one I went for is the Hikvision DS-2CD2042WD-I. It’s capable of up to 4MP resolution (2688×1520 pixels) at 20fps and can supply two streams at different resolutions.
It’s worth mentioning clones here. If you shop online you’ll find IP CCTV cameras ranging in price from a variety of manufacturers. Most of them are basically identical in features and often in software – they vary mainly in build quality and reliability. Most are – to put it diplomatically – clones of Hikvision or Foscam. Some of these might be officially licenced, I don’t know. Many are not. I thought it was worth going for what seemed to be a recognised major brand.
It was certainly easy to set up and is smaller and less obtrusive than some of the others I looked at. The main quirk is that it came preconfigured with a fixed IP address on the 192.168.1 subnet. If you’re not using that subnet there are ways to change it, but I’m surprised it didn’t run DHCP. On my network that was fine anyway and once I had it attached I just changed the IP to one outside of my router’s DHCP allocation range.
The software is quite comprehensive. It can record to a network share and has various options for notifications and motion detection. However, I didn’t intend to use it for anything other than basic configuration of the camera and I certainly wasn’t going to make it available over the internet.
With things like the Mirai botnet making the news recently I was very wary of opening up access to the camera from the internet. I don’t know how secure the Hikvision software is, and I’m not qualified to judge. What I can say is that upgrading the firmware is not a simple process – even finding the latest version is difficult and unless you’re absolutely sure it’s right for your camera there’s a risk you can brick it. I figured it was safer to leave the camera alone and only allow it to be accessed from my internal LAN.
My Zoneminder instance is available over the internet, running on my home server over an SSL link and proxied behind another web server. I’m in control of patching the server and of exactly what ports are open to the internet. It’s still a risk, but the balance is worth it – the data isn’t that valuable and it’s reasonably well protected.
Integrating the camera with Zoneminder was a piece of cake. I set it up in Zoneminder with a source type of ffmpeg and put in the RTSP feed URL.
The full URL is in the form rtsp://user:password@ipaddress/Streaming/Channels/1 for the main stream, with 2 for the substream.
And that was that – the hardest part was fitting it outside and running the cable, but I had help with that (OK, if you know me, when I say “I had help” you know I mean “my dad came round and did it for me” – what can I say? I do software, not hardware!)
The picture quality is great. For obvious reasons I’m not going to post an example of the view outside my house so you’ll have to take my word for it, but it copes very well in low light and the IR images are surprisingly clear given that they’re lit only by a ring of IR lights around the camera lens.
That does lead to a problem. High resolution cameras really tax Zoneminder. The quad core CPU on my server is now devoting about 40% of one CPU to capturing the stream and 40% of another to analysing it. That’s not too bad – it’s still only 25% of the overall CPU capacity – but I’d still like to get it down without sacrificing image quality by reducing the resolution or fps of the stream.
In my next post I’ll talk about why Zoneminder struggles and what strategies are available to cope.in Home Automation