Skip to content

Motion-detection using a substream?

edited November 2014 in SecuritySpy
I'm a new SecuritySpy user, so this may already be supported somehow...

My camera is a Dahua HFW4300S, which has a native video resolution of 2048x1536. I'm using SecuritySpy on a Mac Pro 1,1, and the CPU usage is *really* high -- hovering around 120% -- when the camera is set to its native resolution and 20fps.

By reducing the camera resolution to 15fps @ 1080p and the bitrate from 4096 Kbps to 2048 (CBR), I've cut the CPU usage down to 60%, but this also means my captured videos aren't nearly as good as they could be, which defeats the purpose of having a high-resolution camera in the first place.

This camera supports two substreams as well, so is there a way that I could have SecuritySpy's motion detection code run on a low-resolution substream (at, say, D1 resolution and 10fps) while still capturing the main, full-resolution video stream when motion is detected?

I'm not recording continuous video, only when motion is detected, and I don't recompress anything, the camera is currently set to encode using H.264H.

Comments

  • Hi Richard,

    It's a good idea (and possible with a few setup steps) but having two streams coming into SecuritySpy instead of one will only increase the CPU usage. With a temporally-compressed format such as H.264, SecuritySpy has to decompress all incoming frames, so that the video is instantly ready for display to the screen, capture to movie files, and sending via the web server, amongst other things. This what is using your Mac's CPU.

    This is partly because the camera is very high resolution (3MP). I wouldn't recommend lowering the resolution, but lowering the frame rate will significantly reduce CPU consumption, without affecting the quality too much. This is the main thing that you can do to lower the CPU; 5-10fps is a good range for video surveillance.

    Lowering the bitrate won't significantly affect the CPU usage but will significantly affect the quality, so stick to the higher quality setting. We normally recommend using VBR (Variable Bit Rate) with a medium-high quality. VBR will ensure that the camera can adjust to cope with encoding the video in a range of different circumstances without compromising quality.

    The other thing to note is that 100% CPU usage (as reported by Activity Monitor) may not actually be that bad: if your Mac Pro has 8 cores for example, this is only an 8th of your Mac's total processing power.

    Hope this helps.
Sign In or Register to comment.