Reducing the CPU utilisation for SS with Hikvision?
  • I think that this may be a question for Ben :-)

    I've got a Mac Mini 2011 with integrated Intel graphics. The fan is constantly gunning away with VPCDecoderXPCService using up 90%+ CPU across a number of threads. I suspect that this is because the Mac is not using hardware to decode the H264 stream coming from the Hikvision camera but rather software decoding.

    I've enabled "Camera Motion Detection" in SS so I [think I] use the camera to trigger rather than SS to analyse but the CPU use is still around 30%+ as I am running 20fps at 4mp (this I'd like to keep as for live streaming/motion capture, I'd like the fastest refresh and highest resolution that I can get).

    Is there a way that I can reduce the CPU usage for SS when the camera is idle (i.e. no one is viewing the live stream and SS isn't capturing video when motion detection has been triggered?

    Cheers, Andy
  • While I don't have an answer to reducing CPU load, the motion detection is the huge culprit. On my Mac Pro, I have 7 cameras in SS and just disabled motion detection, but kept continuous capture going and the CPU load hovers at < 5%. Apparently the Mac Pro doesn't have hardware decoding either.
  • Thanks sgruby, maybe its a setting I have incorrect in SS which is causing it to analyse all of the time?

    Here are the settings I have, if this is any good?

    Camera -> Device -> Recompress Video -> Disabled
    Recompress Audio -> Enabled

    Camera -> Setup -> Video Motion Detection -> Disabled
    Camera Motion Detection -> Enabled

    Camera -> Masks -> Nothing defined

    Camera -> Continuous Capture -> Enabled and "Manual Control" for schedule

    Camera -> Motion Capture -> Enabled and "Manual Control" for schedule (I arm it using the IOS app when I leave the house)

    Camera -> Actions -> Manual Control (I arm it using the IOS app when I leave the house)

    Compression -> Video codec H264 -> Quality 100
    Audio codec AAC -> Quality 100
  • Unfortunately I don't think that the 2011 Mac minis have hardware-accelerated H.264 video compression/decompression; I think this was introduced in the 2012 models.

    To assess how much work your Mac's CPU is doing, the relevant figure to check is the "Idle" percentage in the bottom-left corner of the CPU section of Activity Monitor. You want this to be at least 10%. If it's less than 10%, the Mac is really struggling to keep up, and you should reduce the cameras' frame rates.

    But there are also settings in SecuritySpy you can tweak to reduce the CPU usage, sometimes dramatically. Andy, it sounds like you have all the right settings except one: try enabling the "Decompress incoming frames only when required" option under Preferences -> General.

    From the manual: "By default, SecuritySpy will decompress all incoming video frames, whether or not each one is actually required. The advantage in doing so is that frames are then available at all times, so if video from a camera is suddenly required after a period of not being required (e.g. a video window is opened after previously being closed), then a video frame will will be available immediately; otherwise there may be a significant delay until decompression can resume and the next frame is available.

    Enabling this option could result in significantly lower CPU usage, especially if the features that require decompression are used infrequently. Such features include motion detection, display in video windows, delivery via the web interface, and recording to disk where SecuritySpy is performing recompression of the video stream."
  • Thanks Ben,

    The idle is 67% with one camera so not too bad. I'll see if I can get hold of a Mini 2012 with discreet graphics.

    I've now checked the "Decompress incoming frames only when required", when the streams aren't live; the idle is around 85% and the VPCDecode service isn't active until I launch the streams.

    So a success!

    Thanks again
  • Hi Andy,

    Great to hear that.

    When using this option, I would advise that you make sure the camera's key frame rate is not too high (this is the frequency of key frames in the video stream and can be referred to by the following names by various camera manufacturers: I-frame interval / I-frame rate / GOV length / Intra frame period), otherwise there will be a significant delay when a frame is required to be decompressed after a period of frames not being required. A good setting is around twice the frame rate of the video stream (so if the camera is streaming at 10fps, then set the key frame rate to 20 - this way, the maximum delay will be only 2s).

    However, 67% idle means that the Mac is only undergoing light resource usage, so in this case I would question the need to use the "Decompress incoming frames only when required" setting. But it's entirely up to you - there are advantages and disadvantages either way and you might prefer one benefit over another.
  • Thanks Ben, it was set to 50 (20 fps) so have cranked it back to 40.

    Its still lightning quick to start capturing when motion is detected with the "decompress only when required" option on, I plan to add another 3 of these cameras so the load should work out ok.

    Cheers again

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!