Slow FPS and CPU issues - only in NCS

So this has been an adventure and one which doesn’t really shed NCS in a very positive light for me.

I’m going to start with the questions I need answered, which were not fully formed until the end of my discovery in writing this post, but I will post them once up top as a basis for where we are going:

1) How to accurately judge FPS in NCS?
2) Why have I been able to increase my FPS when it comes to recording, but my live view is so achingly slow?
3) Why is NCS apparently so inefficient compared to the alternatives in both properly utilizing the available CPUs resources and using so much of them?

Context: I’ve been using iNCS intermittently for a couple of years and most of the issues I always wrote off due to a an old junky FOSCAM model which was not getting very good FPS. I would say it averaged around 5-7, sometimes I’d see it as low as 3-4, and occasionally it got upwards of 8-10.

I had always discounted all my motion sensing problems (needing to set sensitivity too high to reliable get all person movement, but at the same time this triggered too many light related events) due to the fact this was just an older camera, with poor FPS, on a 2.4 WiFi connection that maybe wasn’t the most reliable.

So, I finally decided to improve my situation by purchasing a Reolink E1 Pro (ONVIF compatible). 4K camera @ 25 FPS with both wired and 2.4/5 Ghz WiFi.

Unfortunately, it seemed that my NCS problems weren’t any better and, in fact, seems the built in camera functions outperform NCS in almost every way (though there are still some reasons I would like to use NCS, and thus me bringing this issue up).

The issue was very low FPS compared to any of the alternatives

So it is a bit hard to measure true FPS in all cases. Not every client reports it directly and those that do, don’t always do it clearly or reliably (looking at you NCS). To understand my issue, it is best to first view this video.

On the left we have NCS showing a live stream of the Reolink. On the top right we have VLC showing a live stream. On the bottom right we have the Reolink client showing the same stream.
You can see by tracking the ms that on the two right images it is possible to make out pretty much one number in every ms, but the NCS video looks choppy, skipping numbers. This is a rough example of how NCS was simply suffering from a much lower frame rate.

As some more specific proof, here is a shot of the recorded framerate of each of these sources:

You can see that NCS is only recording about 9-10 FPS, whereas the other tools are recording in the full 25 fps at 4K.

To add insult to injury I want to note here that in this example the NCS server is actually hard wired to the camera (via switch) whereas the computer which was running the VLC and Reolink streaming/record was on WiFi. IOW, this clearly doesn’t seem to be a network bandwidth issue.

The questions are what exactly is the FPS that NCS is reporting and since it is clearly low in the recordings, why?

So, I’d like an explanation as to how NCS reports FPS(?), because it is a bit confusing. See this image:

In the top left NCS is reporting 24 FPS. Where is it getting this number from?
At 4K it is almost impossible to actually make out what I believe the actual FPS is (another example of how NCS hasn’t kept up with modern display technology). If we try to zoom into the lower-right corner it appears to be showing 6/25. I can only assume this means I’m getting about 6 FPS out of … a maximum of 25? Well where is it determining the maximum of 25 is and why is that different than the 24 reported above?

So what have we established?
a) NCS FPS reporting is confusing and inconsistent (and poorly documented)
b) Regardless of A, it is clear that the actual FPS being shown and recorded is much lower than the other programs.

I did multiple tests with NCS using different quality video streams (set via the ONVIF “Output Resolution” setting in NCS) and measuring FPS and CPU usage of the NCS server. This is what I found:

  • At 2560x1440 I get recordings of 9.5 FPS. The NCS CPU gets as high as 50% (but like in all cases mentioned this is a high, and probably averages about 5% lower).
  • At 1920x1280 I get recordings of 13.2 FPS. CPU max 40%
  • At 1024x768 I get recordings of 22.2 FPS. CPU max at 25%
  • At 640x480 I get recordings of 25 FPS. CPU max at 20%

I did these tests last night. Upon revisiting them this morning after a restart of NCS the CPU numbers are even lower. For instance, when viewing the 2560 feed my CPU never goes above about 15%. When recording the stream it maxes at 27% and yet still only gets < 10 FPS.

Also, to be clear the CPU numbers I have given above (in all cases) are the CPU usage of the NCS process. The overall CPU numbers are about 5% higher as nothing else is going on with the system during this time.

So it is clear that the higher the resolution, the more taxed the CPU is. However you don’t buy a CPU to have it sit 50% idle. Why at 1920x1080 (or higher) am I only using 30-50% of my CPU but still having such low frame rates?

Testing methodology:

  • Tested both Wireless and Wired, didn’t seem to make a difference
  • Tested in NCS using both rtsp and ONVIF feeds (which use rtsp, so shouldn’t matter). Results were the same.

I tried adjusting almost every setting available in NCS and in the end, it seems that the one thing that fixed my issue was the Multi-threading option in the “Encoding/Streaming” options. I’m not sure what the default is/was, but on my system it was set to “Single”. Changing this to Auto or 8 massively increased my FPS on recording!!!

But this is only part of the solution (problem?)!!!

EDIT: So this is the point I need to interject/change tact a bit. I have been discovering some things while I investigate this issue. While all the above information is accurate, I need to make some comments on CPU. These additional findings may make some of the numbers above a bit inaccurate, in total, but still seemingly accurate in comparison with each other (i.e. scale).

I was previously using Task Manager which I’ve recalled is a very poor way on modern systems to monitor actual CPU usage. I’ve switched to using Process Monitor. In PM, when I was set to only a single CPU I was getting CPU utilizations around 60%, when I bumped this up to more CPUs I was able to increase about 20 FPS while utilizing about 80%.

But still, something wasn’t right. I’m still only at 80% CPU. Why wasn’t NCS pushing even harder to maximize my CPU and get a few extra FPS? After all, CPU is meant to be used. It doesn’t help anyone to have 20-30% idle CPU during the most intensive tasks.

This is when I noticed something strange in Task Manager on the NCS server. It only showed my CPU running at 1.6 Ghz, well under half its rated speed. I went ahead and ran a few stress tests. Including Prime95 torture test which maxed out my CPU around 99% and showed speeds closer to 3.5 Ghz.
I also streamed a video on Plex which required the server to encode it and my processor shot up to 80% with similar speeds.

So why, when it needed CPU, did NCS not actually use not only more utilization, but didn’t ramp up speed as well? Well, I think the answer is because NCS is not coded properly. I don’t know enough about designing software in this regards, but I can tell you I don’t have the issue on other programs which require heavy CPU utilization.

I was able to solve this (at least in testing), but changing my Windows Power Plan from “Balanced” where the Minimum power state of the CPU rate can be as low as 5%, to “High Performance” where the rate is locked in at 100% all the time. You shouldn’t need to configure your system in this way for well designed applications. The idea is that the CPU only uses what it needs and doesn’t keep its clock rate up when there is nothing to do. As soon as there is something to do however it should increase to the maximum it is designed for. This is how every other program I tested behaves, but not NCS.

Here you can see exactly what I mean. First, here is P95 running a stress test, properly behaving when in Balanced mode:

Now here is NCS, configured to use all CPUs running in balanced mode:

Only 1.58 GHz and 80% CPU!
Now when we switch Power Plan to High Performance:

Processor doubles in speed and CPU utilization drops to 50%.

And guess what? Full 25 FPS recording!

As another contrast, and to be a bit gracious to NCS. The Reolink client running on the same system has a bit of the same issue. Namely it seems to not increase the CPU clock when encoding in Balanced mode and only takes full advantage if the power plan is set to High Performance.
However, even in this case when recording a 2560x1440 stream at 25FPS it only uses 30% of the CPU in balanced and only 15% in High Performance mode when it is actually utilizing the processor.

NCS still seems very inefficient in this regard.

Additionally, even after all of this, while I can seemingly get recording to give m my full 25 FPS at 4K, I cannot seemingly get anything better than about 7-9 FPS when viewing the live feed. I seem to have no issues with a live feed over VLC or Reolink’s software (or ONVIF DM).

So to reiterate what I need help with resolving:

  1. How to accurately judge FPS in NCS?
  2. Why have I been able to increase my FPS when it comes to recording, but my live view is so achingly slow?
  3. Why is NCS apparently so inefficient compared to the alternatives in both properly utilizing the available CPUs resources and using so much of them?

I want to close this with an aside on the state of NCS:

Specifically, I want to briefly state how disappointing the lack of development on NCS is. As has been said in multiple threads it seems that Henrik is the only employee doing anything by minding these forums. And while his level of knowledge of the product is high, he is mostly now relegated to apologist for the poor outdated features of NCS. For some reason (paid marketing) NCS still comes up as a recommended solution on various “best of” type blog posts for a PC based DVR solution, but outside of those rankings, no one talks about this software. Just Google “netcam studio site:reddit.com” and you will see there has been virtually no talk since 2018 of this product and even what’s out there pales in comparison to almost any other solution.

Sure, the 2 camera free limit, Window-based, and non-subscription model has some benefits, but only goes so far when the technology just doesn’t seem to work as well as what else is out there. I truly hope NCS gets some much needed updating for performance, camera compatibility (ease of configuration), and motion tracking algorithms.

I’ve been working on this issue for hours now. Hopefully my formatting above didn’t get to straggling and the overall narrative is still cohesive. Hopefully this information helps someone else and hopefully someone (i.e. Henrik) can provide at least some insight.

thanks.

Hello and thanks for a very comprehensive testing.
When NCS starts is should change the Power Plan to High Performance if that plan is available and enabled.
As you write changing the Multi-threading option to Auto will give the encoder much more cpu resources from the OS when dealing with high resolution and high FPS.

To answer the last 3 questions:
1.From the picture below


Top left corner: When adding the camera and if the FPS is set to 0 and Resolution is set to Native the figures show the resolution and FPS that is entering NCS. In this case resolution is 2560x1920 and FPS is 31. The numbers are usually the same as configured in the camera if the communication is fine.
Using the digital zoom (scroll wheel) at bottom right there is 20 / 31 FPS. The 31 FPS is the same as at top left.The number 20 FPS is the number of processed images. To add text, images, times etc to the video we use the Overlay function. To facilitate that the video must be converted to another format where text, images etc. can be added. Not every frame of the 31 ones are converted since that would use a lot of CPU resources. The added information is usually rather slow compared to the video FPS. In this case 20 frames (processed frames) of the 31 frames are converted. This number change. The frames are then converted back to the original format.
In the Settings for Overlay we have the variables pfps / fps
image
The Overlay can be disabled in the licensed version. In the configuration in the camera you can usually add necessary information so this function can be disabled.

2.If you have increased the FPS for recording it should be the same for the live view. Test the following. If NCS X is running change view so the camera video is not on display, only text. Connect to NCS with the web client and check if the problem is the same. To convert the video to view on a display use a lot of resources. With the web client HTML5 is used.

3.When you compare to other alternatives make sure that they do exactly the same. For these high resolutions and high FPS it might also be different programming languages and how they interact with the Windows OS and “deep resources” of the computer.

-Henrik

  1. I have never heard of an application designed to automatically change the power plan selected by the user. In fact, it would be poor practice for any application to do this (even if it were possible) since the power plan is selected by the user on an OS basis and should not be at the whim of an individual application. Furthermore to actually implement this ability (again, if possible) without notifying the user would be, IMHO a breach of security without properly notifying the user. Finally, other applications don’t require modifying the power plan to high performance to take full advantage of system resources, so NCS having to do so shows an issue with its design.

In any event, the high performance plan is available on my system, but NCS does not switch to it automatically (nor would I want it to as the right to do that should not be present in an application without explicit configuration. The application runs as a service on my system, so I’m not sure if that is why it doesn’t switch modes. If indeed it does have that capability, then perhaps it only does it when running interactively which would never work for any user running in server mode.

  1. In the example FPS I sent you can see 25 fps is shown in the top left, but 25 is shown in the bottom right. You state that these should be the same, but they are not.

  2. I am confused by your description of the overlay slowing down the program and your testing suggestions. Can you clarify how I show “text” but not “video”? What precisely should I be doing? Also, I have never used the web client - TBH I was not even aware there was one. I use NCS as a client to the server (the PC or mobile application). Are you stating that FPS is slower when using the applications?

Also are you stating that the first number shown in the bottom bottom right is the FPS of what is currently being “viewed” in the live feed and is not what is actually being recorded? What is the best way to reliably see an accurate FPS for what is being shown in the live view, and what is the best way to ensure what the recorded FPS is (short of viewing the completed file in VLC or similar - which wouldn’t necessarily be accurate since it could report 25 fps but if the software is causing frames to be encoded multiple time that wouldn’t be an accurate representation. i.e. Think of someone filming an standard film shown at 24fps with a high framerate, 60 fps camera. The resultant video would claim to be 60 fps, but the source it captured is only 24 and you would not see motion beyond that).

  1. It is difficult to compare to alternatives when the performance chasm is so stark (with NCS failing to perform). I have the camera client software recording with its text overlays at full resolution 25 fps and barely putting any stress on the processor (10%).

Your comments about different program languages, etc speaks directly to my points about NCS not being a modern piece of software and keeping up with technology. I don’t think there has been even a maintenance release in almost 8.5 years (February 2015)?

Thanks for your time.