This article focuses on resolving video quality issues of a camera at the console. This article explains how to resolve many live video issues by knowing the video pipeline.
If your camera window has the warning symbol below, please resolve. This alone may resolve your issue and not requiring proceeding further.
If there is no warning symbol, it becomes more challenging how to resolve the issue. For example the video is choppy when viewing from the console.
Once you know the video pipeline, it becomes easy to understand and troubleshoot the issue. The Camera streams article explains all the video pipelines. For live view at the console, the video path is:
Video path: Camera video / feed -> Decode -> Console view
Camera video / feed
Nothing has a bigger impact on any of the video pipelines than the camera encoding settings. Garbage in = <uncertainty>
We created an entire article for dealing with Cameras, the Camera setup article. If the live view video has issues, go to the Camera settings section and simplify the video encoding so BI has the best shot of interpreting the video.
Decode
The Video tab -> Hardware decode section deep dives into selecting HA and turning it on/off for cameras. That being said, I have seen issues with HA on and off. With it on, there were tickets showing video artifacts (ghost images, discussed further below). With it off, a user's PC could not handle the load of decoding the camera which resulted in significant delays in the video feed.
I have also seen tickets where users upgraded their gpu graphics card which improved results. But I do not have the expertise to know when or why the upgrade had a positive affect. The hardware recommendations article -> Server Recommendations section goes into detail about Intel QuickSync via iGPU vs external graphics cards. In general, a PC with an iGPU (QuickSync) is favored. I have seen on occasion where a graphics card upgrade (NVidia) did provide improvements as well.I have a camera out of 10 cameras that has lately been consistently delayed on blue iris by a minute or more sometimes.
This section is learnings from past tickets. We apply the video pipeline to quickly get to resolution.
Video artifacts
Gotcha 1: Video distortion
Reported Issues. Many, many artifacts/permutations of the same issue.
- Green bars as seen below.
- Washed out image
Simplify encoding. In this case, we changed the camera's encoding from H.264 High to H.264 Baseline. Alter Camera encoding settings until streams work.
Reported Issue:
Ghost images. See below.
Very common problem.
Ghost images occur when BI cannot decode the intermediate frames (p-frames / b-frames) coming from the camera. The image on the left, i.e. the actual scene was in the same mp4 video (video created on phone recording the console, not an mp4 export. to be discussed below) and would flash every 1s which was the key frame. In the ghost image (intermediate frame) you can kind of make out the mailbox behind the man walking. FYI, I enlarged the ghost image portion in the second image so you could see the correlation to the original scene. The image is not to scale.
The fix: Decode node
Turned off hwva.
In this case, the encoding/decoding incompatibility was between the camera and Intel QuickSync. For some reason, the camera stats were saying the key frame ratio was 30 (mjpeg stream). It was almost as if the H.265 encoding from the camera was interpreted by the hwva as an mjpeg stream and thus rendering each intermediate frame as if it were a key frame. When hwva was turned off, the key frame ratio was 1 just as the camera settings show (GOP 1 I-frame / 1s).
As mentioned earlier, the user used his mobile device to create the video, not exporting to a file in BI. The user stated when exporting to a file (MP4), the video was fine. Big clue.
The video path for exporting to video is:
Read the file (recording) -> Decode -> Encode -> Save to MP4.
The video pipeline for live view is very basic: Camera feed -> Decode -> Live view. If your live view quality is poor you only have 3 options.
- Revisit the camera feed settings: Camera setup article has best practices. (Fix for Gotcha 1)
- Toggle hwva on/off and see if video improves. Video tab article discusses hwva and the many other BI server settings affecting streams. (Fix for Gotcha 2)
- If you turned off hwva (above) and the issue was resolved, maybe upgrade drivers or upgrade the graphics card.
- Maybe revisit your connector settings. Switch from Generic/RTSP driver (Step 2) to a vendor driver (Step 3) and see if it makes a difference.
Streaming artifacts
These gotchas are more about the video quality being smooth, i.e. not choppy, jittery, lagging etc.
Gotcha 1: Choppy streams
Choppy streams, i.e. the live view or the playback is not smooth or the seconds on the time overlay are not sequential. These issues are almost entirely due to camera encoding settings. If the cameras are speaking Spanish and BI is speaking English, neither party can understand each other resulting in a poor experience.
Video path: Camera video -> Decode -> Console view
Gotcha 2: Camera streams lagging or sluggish or high latency
Video path: Camera video -> Decode -> Console view
- Camera video: Check out the camera stats, Status -> Cameras tab. The FPS should be at least 15 fps.
- Camera video: Look at the key frame ratio in Camera -> Stats. Anything less than 0.5 may provide a bad experience. Set Key frame interval = fps, e.g. 15.
- Revisit Camera setup article.
Video path: Camera video -> Decode -> Console view
Almost always, camera streams are sluggish because BI is not receiving enough key frames (i-frames). Need to alter encoding settings on the camera.
As stated above, key frame ratios less than 0.5 lead to sluggish cameras.
Revisit Camera setup article.
CPU maxed out
The other reason for lagging camera feeds in live view is the cameras are high resolution and the BI server cannot keep up. If your CPU is running above 80%, it is working too hard. In my opinion, above 50% is concerning. My CPU with (4) 2 MP cameras (I know, not much) hovers around 8%.
See CPU Utilization Gotcha for possible fixes.
Video path: Camera video/feed -> Decode -> Console view
Camera feed: Change stream setting from Constant Bit Rate (CBR) to Variable Bit Rate (VBR)
Suppose a key frame is sent from the camera every 1s. If the CBR setting is too low, then the camera needs to perform image optimizations to get the frame across the network. Those optimizations lead to the glitches. So simply changing the camera setting to VBR instead of CBR should resolve the issue. In general, setting your cameras with VBR is a better user experience. CBR should only be considered if you have network bandwidth issues.
Streaming artifacts are often due to camera encoding settings or HA as seen above. Occasionally, Video tab settings can affect streams. If the above suggestions do not resolve the issue, revisit the Video tab article. Below are settings that generally work. The highlighted settings are the ones that usually get people in trouble when set or unset to non-default values.