Settings for camera that will use less RAM?

Hi I keep getting low memory messages and started thinking that they may have started after I added two Amcrest cams to my system

I know that with an increase number of cams added to SS there will be an increased utilization of RAM

I also realize that my M1 Mac mini with only 8GB RAM is a contributing factor

However, keeping all this in mind, are there settings for each camera that can be tweaked that will end up with less RAM/memory usage?

Thanks

Comments

  • How much memory is SecuritySpy using? It changes based on what you’re doing. My memory usage goes way up and I get the same message when I try to use the browser to play saved footage. Otherwise it only uses a few hundred MBs. Camera settings shouldn’t make much of a difference. And any camera setting that does help probably just degrades your audio or video quality.

  • I’ll have to check

    But it’s gotten to the point where I keep SS open, Messages, Mail and an empty Safari window open and that’s it, anything else including a few tabs in Safari and the Mac slows to a crawl

    Even with just those few things open I get the memory email multiple times per day

    I’ve had @Ben check my activity monitor memory usage and nothing seems amiss with regards to SS

  • Did Ben tell you which app was using a lot of RAM?

    Here is a look at mine. Right after starting it, then attempting to play captures from 2 cameras, and then attempting to play video from 4 cameras. SecuritySpy and VTDecoder go nuts. Eventually I’ll get the need more memory emails like you.

    https://imgur.com/a/1B806YV

  • I’ll try that before during after thing and see how the memory usage changes, thanks for that

  • SS running in the background (ie, camera feed views not open): VTDecoder 363MB, SS 237MB

    Camera feed views window open: VTDecoder 377, SS 300

    Playing a single capture: VTDeocder 580, SS 500

    Playing a single live feed: SS 500, VTDecoder 370

  • Mine only goes nuts when I try to play more than 1 captured file at the same time. Try that and see how it goes. In my case above, I tried to play 2, then 4. The player just doesn't behave in these cases and isn't useable.

  • Ben
    Ben
    edited February 2022

    The features in SecuritySpy that use significant RAM are as follows:

    • Pre-capture, under Preferences > Cameras > Motion Capture (best to keep this to 3s or shorter)
    • Instant video replay, under Preferences > General (turn this off if you have RAM issues)
    • Every camera stream that comes into SecuritySpy that needs to be decoded (can't really avoid this)
    • Any video window that is displaying live video (so keep these closed when not using)
    • The AI-based smart object/motion detection (you may want to revert to standard motion detection instead)
    • Any camera that has recompression enabled under Preferences > Cameras > Device (so make sure this is all turned off)
    • Playback in the Browser
    • Encoding video for sending via the web interface.

    Unfortunately, even a few running apps can consume the meagre 8 GB RAM in these machines. And remember the RAM is shared between all systems including GPU. My general advice would be to check the above settings to make sure these are all within reasonable ranges, avoid using video windows too much when not needed, and reduce camera frame rates.

  • Helpful info @Ben thank you as usual for great support

  • By the way, would an iPad mini constantly displaying a camera feed or camera grid utilize RAM on the host Mac?

    I’m thinking of replacing some old wall mounted Control4 touchscreens with iPads to use for camera feed viewing (primarily), and HomeKit stuff secondarily

  • Ah... Pinkoos, When you said "Camera settings" I took that more literally, as in the physical camera settings. Each physical camera also has settings, but as I said...


    Were you able to see how your RAM was affected when playing back multiple streams of captured video footage?

  • Not that is not my normal use case scenario, so I haven’t checked that out yet

  • Hi @pinkoos - yes, if you have a viewer that is constantly pulling live video stream(s) from the server Mac, this will use a certain amount of RAM on the server Mac.

  • Ok I figured but just wanted to verify

  • Ben,

    Just for kicks, I decided to play 5 of my captured videos at once, using Quicktime, on loop so they keep playing. My Mac didn't skip a beat.

    https://imgur.com/a/F8vusgP

    When using SS, which uses VTDecoderXPService, those 2 processes alone take 10GB of RAM to play 4 files, but really can't handle even 2 files without choking. See my links in previous post. QT here is handling 5 and Swap is less than 1GB, where as with SecuritySpy browser, Swap is 5+ GB, in additional to the 10GB mentioned above. Maybe like the OP, nobody ever plays more than 1? I'd really like to figure this out. Please?

  • Hi @Senna_F1 - compared to QuickTime Player playing back a few files, the Browser in SecuritySpy has to do a lot more work as it has to put together day-long compositions containing all the video data for the day. This allows it to smoothly transition from one file to the next as it plays. Perhaps it is this aspect of how the Browser works that is using a lot of memory and leading to poor performance. For this task, SecuritySpy doesn't handle the memory management directly but rather this is done by Apple's AVFoundation code. I wonder if there is a way for us to tell AVFoundation how to cache data or use RAM more efficiently - I will investigate this. Meanwhile, could you please send a screenshot to support@bensoftware.com that shows the memory usage of SecuritySpy and the VTDecoderXPService when playing back footage in the Browser. Please also send a debug file so that I can check your recording settings (SecuritySpy menu > Debug submenu > Create Debug File On Desktop).

  • Are you looking for something different than the screenshot I posted earlier in this thread? Those 2 high memory usage screenshots are from playing 2 files, and then 4 files, in SecuritySpy Browser and shows VTDecoder as well. BTW, I noticed that the memory usage graph that comes with SecuritySpy doesn't seem to show anything over 800MB usage, while the MacOS data is showing several GB. I will send this and debug file to support.

    Thanks!

    https://imgur.com/a/1B806YV

  • Apologies, you did indeed post screenshots above. I'll look into ways we can economise on memory usage in the Browser. The problem is that even though only one file is being played at any one time in the Browser (or two if two cameras are selected etc.), the Browser is first creating day-long compositions that contain the footage from the whole day so that playback at any point during the day, and moving from playing one file to the next, can be achieved seamlessly - it seems like it could be this that is using the memory (I'm wondering if the underlying Apple framework that is responsible for maintaining the compositions could be attempting to load all files from the whole 24 hour period into memory).

    If you look at the captured files in the Finder and locate an average day folder (i.e. a folder with the name in YYYY-MM-DD format that contains files for a whole day), how large are these folders roughly?

  • Senna_F1
    edited February 2022

    The Folders range in size from 9 - 2 GB for the day. Average is in the 5 - 7 GB range. I also store all of this on 970EVO SSD that's as fast as the main SSD, just FYI. https://imgur.com/a/2Y5o5Fs

    This might help you too.

    SUMMARY

    - 5 of 5 cameras currently online

    - 1605 movie files recorded in total

    - 0 image files recorded in total

    - 22.5 GB of data recorded in total

    - 100.0% software uptime

    - 21% average CPU usage

    - Frequent high memory pressure; this computer needs more RAM