Linux CCTV / camera / security cobblers here?

Discussion in 'SBC, ARM, Home Automation' started by drmike, Apr 5, 2016.

  1. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,709
    May 13, 2013
    Do we have any resident cobblers / DIY types who are using Linux for CCTV / security related? I mean legit Linux DIY not premade embedded systems.


    I am fussing with some China dump wifi cameras (read cheap).  Quite interesting little units for the price (bound to be more like them). ~ $15 a camera delivered.


    RTSP streaming from these and seems to be a really common software stack they are loading into lots of these China cams from many many brands.  


    Do we have people using the Open Source Zoneminder DVR / CCTV software?  Considering trying to get Zoneminder running on one of my unused ARM boards (yes it exists for ARM also).
     
    MannDude likes this.
  2. InertiaNetworks-John

    InertiaNetworks-John Inertia Networks, LLC Verified Provider

    182
    25
    May 23, 2013
    I'm currently using ZoneMinder, but I have found it takes up way more CPU than commercial software.


    I have 5 cameras running at 25 FPS, with a 1920x1080 resolution, and on a 4 core i5 ZoneMinder can barely keep up. Reducing the FPS to 12 seems to help.


    Overall, ZoneMinder is very good for open source, but I wouldn't expect to work all too well on any machine without very good processing power.
     
    RLT and drmike like this.
  3. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,709
    May 13, 2013
    Decent machine there and high res... More resources than I'd expect :(


    Overhead is just ZoneMinder out of the box, nothing additional complexity / addons / etc.?


    Definitely going to give the ARM variant a spin and see what we can make it do.
     
  4. TheLinuxBug

    TheLinuxBug New Member

    402
    356
    May 15, 2013
    For more than 1 camera you will at least need an Odroid C2, Zoneminder running 2 cameras one rtsp and the other mjpeg causes 50% load on the c2 and uses about 1GB of ram.  I attempted this on the RPi3 and it couldn't even handle it, ran with a load of 5 and was in constant IO wait because it didn't have enough CPU to process IO.  

    The above is normal operation with 1 person viewing both camera feeds.  If you don't intend to watch the feeds through zoneminder, it will reduce the load by about 25% but still was too much for the RPi3 to handle.


    Tip: if you install zoneminder and intend to use it, make sure you setup MySQL tmpdir to be /dev/shm or loading of events in the viewer will be ridiculously slow if you are waiting on IO of a memory card (I do not have an eMMC chip in my c2 yet, so using a SP 16GB Elite card, 85M/sec read, 10-12M/sec write).  May not need to do this if you have the eMMc as its much faster than the sdcard.


    Per my experience you need about 2Ghz (1 core) per camera you intend to use for processing, I am just using default 'modect' with Fast, high sensitivity settings.


    There is also the open source 'motion' which runs a little bit leaner, however, you can not define zones for detection and its not 100% stable all the time.  In other words, if you just need to stream your video and detect if there is 'any' motion changes, motion works.  The convenience and likely additional resources user of zoneminder is the fact you can actually specify 'zones' for it to detect instead of detecting across the whole feed like motion does.  Motion will use a little less resources and may function better in a case where you want to use a slower ARM board.  When I was testing it I just made my own web gateway using nginx with a proxy pass through to the feeds.  Wasn't very difficult, but again, zoneminder provides this interface out of the box (using Apache by default).


    One more note: As much as I am liking the zoneminder setup, I found that running 'ispy' in Windows, while uses a fair amount of resources is able to accomplish better rendering, better encoding and an overall better experience, especially if you want alerts (has many options).  However, my goal for a while now has been to offload the extra processing somewhere else than my main machine so I have more CPU for during work hours.  If you want something that just works and you have the hardware/license for Windows you will get a better experience out of ispy than from anything on Linux that I have used yet. (Hell if you have a nice enough machine you may be able to run ispy with wine?).


    my 2 cents.


    Cheers!
     
    Last edited by a moderator: Apr 6, 2016
    drmike likes this.