Performance: Blue Iris Tuning
Posted: Mon Jul 19, 2021 7:33 pm
Introduction
This article helps explain the levers that are available to setup your BI server to run optimally. If your CPU usage is high, >80%, this article can help identify optimizations. Ideally, BI should be running less than 50%.
BI Optimizations
First, walk through the Windows Tuning article just to make sure Windows is not in conflict with BI.
Below are the general steps to tune your system if you want to confirm everything is setup optimally.
This article helps explain the levers that are available to setup your BI server to run optimally. If your CPU usage is high, >80%, this article can help identify optimizations. Ideally, BI should be running less than 50%.
BI Optimizations
First, walk through the Windows Tuning article just to make sure Windows is not in conflict with BI.
Below are the general steps to tune your system if you want to confirm everything is setup optimally.
- For all the cameras you need to have healthy video streams and setup dual streams for the high res cameras(2MP+).
Follow the Connect cameras correctly section of the Checklist. - Record direct to disk not re-encode. Camera settings -> Record tab -> Video file format and compression.
Confirm all video paths still work. See Blue Iris Streaming Overview for all video paths. For example, Live view to console, Playback to console, Live view to remote endpoint (UI3, Mobile app), etc. - Hardware Video Acceleration: Turn on hwva for various parts of the video path for your cameras.
As stated above, confirm all video paths still work.
Enabling Hardware Acceleration is very dependent on how well the hardware performs with YOUR cameras. Only way to know for sure is to test.
Legacy settings
With dual streams and D2D recordings, the need for "Limit decoding unless required" is largely no longer needed since you get such HUGE CPU savings with these two new features. They remain in the software for backwards compatibility for those users that have not upgraded their hardware or updated their software.
Limit decoding gotcha: Limit decoding to save CPU usage tells BI to only decode key frames and ignore the rest.
Keep in mind if you have a key frame ratio less than one, you will notice artifacts with the Limit decoding setting. In particular, a common key frame ratio of 0.5 means a key frame is sent to BI every 2s. By doing so, the camera stream will only update every 2s in the live view. You many not notice this, unless you have the clock overlay. You will suddenly notice the clock increments every other second instead of every second!
Also BVR gotcha: Hardware acceleration is great when you are encoding / decoding steady streams. It is often turned off in playback mode (Also BVR setting) because in playback, users are frequently stopping, rewinding, skipping forward in order to find the point of interest. This use case is not conducive for hardware acceleration.
Final thoughts
This article progressively moves you through the steps needed to optimize camera connections.
Camera settings -> D2D Recordings -> Hardware acceleration.
When troubleshooting, work backwards, simplify the problem and see if the streams improve. By working backwards, you can identify the issue.
Turn off hardware acceleration -> Switch recording back to re-encode -> Adjust camera settings- Turn off hardware acceleration. Camera settings -> Video tab -> Hardware decode. Set to No. Does the live video / streams improve?
- Switch back to Re-encode in recording settings. Does playback improve?
Example 1: GPU improves quality.
You never know if your hardware acceleration will work in your environment until you test with your cameras. For example, observe the image from this high resolution camera from the camera's app. The colors and contrast are very vibrant.
Below is a side by side comparison of BI software decode vs Nvidia decode.
The color and contrast looks equivalent to the camera app from the Nvidia decoder! Because the Nvidia card provided a better stream, the customer also turned on Video settings -> Also BVR. This was a case where the Also BVR setting was enabled because the quality and thus user experience was improved, not because the customer was hoping for CPU savings.
Example 2: GPU leads to artifacts.
Sometimes, the GPU decoding can lead to artifacts.
Because the hardware acceleration was decreasing the quality and user experience, this customer chose to turn off hardware acceleration for this camera. The server could handle the additional CPU load and the customer was more concerned about the quality of the user experience.