Camera Streams

This sub-forum has all the frameworks dealing with cameras.
Post Reply
varghesesa
Posts: 90
Joined: Thu Jul 11, 2019 9:52 pm

Camera Streams

Post by varghesesa »

Introduction
This article is about issues with the quality of your video streams at different endpoints.

This article is NOT about connecting cameras. If you want to know how to connect cameras correctly review the Connect cameras correctly section in the Checklist.

If the camera will not connect, the Camera connection errors article explains how to leverage the error codes to troubleshoot the error.

If the camera was working and has since stopped, the No signal errors article helps identify other causes that can result in cameras not connecting.

This article focuses on the quality of the video streams. The cameras are connected but the video is choppy, stutters etc. How do you address the issue? Suppose the video is fine on the console but terrible during playback or when viewing from the mobile app?

This article explains the concept of BI video pipelines and explains how to easily troubleshoot video quality issues with your connected cameras. For example, if playback is not working on your Android phone /tablet, you will know from this article that the video pipeline is

Recording -> Decode -> Encode -> Playback on device.

By knowing the pipeline, you can now tweak settings associated with each node (Record, Decode, Encode, Device) in order to get the issue resolved.

If you prefer to watch the webinar associated with this article, checkout the Camera Connections and Streams webinar.

Reference: If you want to learn more about how streaming and encoding works, a great reference article was created by IPVM titled "H.264 vs MJPEG - Quality and Bandwidth Tested". If you are not familiar with IPVM, they are a great resource for research and information regarding surveillance and security cameras.

Issue
We receive tickets associated with the camera streams being choppy, lagging in time, stuttering, loses signal or no signal error followed up with, however, the camera is up and working fine in the camera vendor's app.

The issue here is the vendor app is pulling streams from a proprietary port and protocol. The app is also an active solution, i.e. a user opened the app and wants to view a camera so the camera wakes up and delivers a quality, bandwidth optimized stream to the user.

Blue Iris (BI), like all VMS systems, is passively viewing all the time. Because we are a third party solution, we have access to different ports and settings on the available ports are crucial for BI to deliver a quality user experience.

Video Pipeline: Camera settings x BI Settings

In order for BI and your cameras to work well together, you have to take into account Camera and BI settings. The Video Streaming Pipelines webinar complements this section of the article. Once you understand the video pipelines, it becomes easy to understand the settings that can affect a particular pipeline and thus figure out why your video streams are not working.



Video Pipeline

All the Gotchas and fixes to gotchas further below are based on the combination of Camera settings x BI settings. In order to really understand the fix, understanding the video pipelines that exist in BI is pertinent. Once you understand the pipelines, it becomes much easier to know what effect the Camera settings x BI settings have on the pipeline. If you are curious to go deeper, reference the Blue Iris Streaming Overview article.


Image

*** Coming soon: Direct to wire ***
Bypass decoding / encoding completely. Send the camera encoding straight to remote endpoints. The remote device (mobile app, UI3, web site, YouTube etc) is responsible for decoding the stream successfully.



Gotchas: Video Artifacts

As you know, the Gotchas section documents learnings from past tickets. All the below Gotchas provide quick visuals of the issue. This is to allow users to quickly identify their issue and resolution. For those with more curiosity, details on the fix in the context of BI video pipelines is provided. This way users can attain a deeper understanding of BI video pipelines in order to self-diagnose future issues and resolve themselves instead of opening a ticket.


Mobile app
First confirm live view and playback work from the console. There is no point trying to troubleshoot video on the mobile app unless the console is working.
Garbage in = Garbage out.

Live view

Gotcha 1: Video distortion

console-live-view-artifact.png
console-live-view-artifact.png (95.3 KiB) Viewed 20818 times

Issue: Encoding from BI is too complicated for your mobile device.
Video pipeline: Camera video/feed -> Decode -> Encode -> Mobile app
As soon as you introduce a remote endpoint, the Encode node in the video pipeline is introduced.

Fix: Adjust encoder settings. Global settings -> Web server tab -> Advanced -> Configure.
  • Set quality to 50%.
  • Hardware acceleration = No. Hardware encoding almost never works with mobile media players. Best to encode in BI software.
  • In the Advanced section, change Profile to main.
encoder options.png
encoder options.png (44.06 KiB) Viewed 20837 times

Gotcha 2: Camera Stream Issues

If you believe an update is causing the issue, go back to a previous version, confirm issue goes away and let us know. That is valuable information and may help resolve the issue. However, we may still need to troubleshoot in your environment to understand why the current version does not work.

Isolate the issue

The question here is whether the issue is with the network or the mobile app. To rule out the network, open a web browser on the mobile device and try to connect and login to the web server. Is the web interface working well? If not, the issue resides with your BI server or the network.

Server
An easy way to test whether your server is the bottleneck is to turn the Shield to red. You have shutdown many core functions on the server including trigger, record, alert. Does streaming to the endpoint now work better? Then you know your CPU is working too hard. Otherwise you will need to troubleshoot your network.

Mobile app
If UI3 works fine on the mobile device, then the issue must reside with the video pipeline.
Camera feed -> Decode -> Encode -> Media player on remote device

A common problem is the encoder settings. The above settings generally work across media players.


Playback

The biggest difference between remote endpoint playback (mobile app, UI3) vs console playback is the Encoding node.
Video Pipeline:
Recorded file -> Decode -> Encode -> Mobile device

Before troubleshooting remote endpoint playback, confirm console playback is working. See above.
Garbage in = Garbage out.

Gotcha 1: Playback is a black screen when playing on a remote endpoint (web interface, mobile app)

Reported issues: Playback at a remote endpoint is not working. Other ticket descriptions below.
  • Playback is a gray screen. Playback is a black screen.
  • Randomly restarts from the beginning. Playback hangs.
Encoding-HighToBaseline.png
Encoding-HighToBaseline.png (52.99 KiB) Viewed 20818 times


First confirm console playback is working. If so, encode settings is the only node left that could be causing issues.

Fix: Simplified encoding settings. Global settings -> Web server -> Advanced -> Configure (Stream 0)
The Live view section above has a screenshot of Encoder settings that usually works. Most important settings:
  • Hardware acceleration = No. Critical fix.
  • Maybe limit bit rate will have an effect.
  • Maybe Resize output frame width x height will have an effect.


Gotcha 2: Playback on Mobile device is not smooth

Similar to above, the Encoding settings is often the culprit.
The issue could also be with the video player on the device. For example, we have seen tickets where playback was fine on a Samsung galaxy and broken on a Pixel 6. A good test beyond simplifying encoding settings is test whether you can connect to the server from the mobile web browser. If the UI3 interface works then the culprit could be the video player. Browsers use their own video players.


File Export

Export to file has the same complexity as Playback with ONE more layer of complexity, the encoding settings similar to remote access.
Video Pipeline: File recording -> Decode -> Encode -> File (usually mp4)

Gotcha 1: Export to file
Pulsating jaggies happening at consistent intervals, e.g. every 1s.
pulsating jaggies.png
pulsating jaggies.png (200.56 KiB) Viewed 21276 times

Reported issue:
The user was attaching a 10s MP4 file with their email alerts.

Symptom: The video starts out fine but consistently every 1s or 2s, i.e. key frame interval, the image gets very pixelated. The key symptom is the fact this happens in a consistent interval like every 1s or 2s implying BI or the stream is having issues processing the key frame.

The Fix:

Video path: Recorded file -> Decode -> Encode -> Save to file (MP4)
  • Encode: Turn off hwva.
    We got lucky. As you can see, the video path has many hops that could cause issues.
    Starting from the end and working backwards is always a good strategy.

Next steps / Submitting a Ticket

If still an issue, the Camera issues article explains needed ticket information.
Post Reply