This document outlines the steps to connect IP Cameras successfully to Blue Iris (BI).
If you prefer to watch the webinar associated with this article, see the Camera Connections and Streams webinar.
More and more cameras are coming out with higher and higher resolutions (> 2MP). These cameras often provide two and sometimes three streams. The reason for the multiple streams is so camera vendors can provide better images and clarity (high resolution, more network bandwidth) and also provide a good user experience for remote access (mobile phones, web interfaces). This tension between higher resolutions and good user experience has resulted in cameras providing multiple streams.
The below steps explain how to connect cameras to BI with a single stream or multiple streams. If you have an older camera, multiple streams may not be available. For example, cameras with a resolution of 1 MP or less usually do not have or require dual streams. Most networks can support <1MP resolution cameras.
Closed environments
Some camera manufacturers have a closed environment, i.e. no 3rd party access to their cameras. Amazon Ring, Arlo and common examples. Some vendors are hybrid, they prefer to control the customer experience, however they also provide a public URL to their cameras for 3rd party access. Google Nest is the most common example.
Camera manufacturers that support 3rd party access will post ONVIF and/or RTSP support on their web product listings or documentation. If their product postings state vendor app, cloud solution with no mention of support for standards, well, those are tell-tale signs that the camera probably will not connect to BI.
How Blue Iris leverages the different streams
The biggest advantage of sub streams is the drastic drop in CPU usage for the same cameras. This savings is largely attributed to using the sub stream for live view in the all camera (mosaic) view which is the common view on most displays. By leveraging the sub stream at a much lower resolution, the decoding and displaying of the stream is much easier on the CPU. In addition, a significantly reduced amount of RAM is used on a per camera basis.
Specifically, in Blue Iris the main stream is used for:
- direct to disc recording so playback and evidence gathering is in high resolution
- single-camera live viewing and recording playback so if a user is focused on one particular camera, he/she has the clearest view possible
- audio recording
- multiple-camera view (mosaic view)
- motion detection
- alert snapshots etc
Follow basic steps below to connect your IP cameras.
In order to be successful, the camera encoding settings are set to work with BI.
Furthermore, you have the following information for each camera.
- IP Address
- Username
- Password
- Web, RTSP and ONVIF ports
UPnP / WS Discovery connections
Devices on the network may use various standard protocols such as WS-Discovery and UPnP (Universal Plug N Play) to let other devices know they exist on the network for connectivity. If your router also supports these protocols, then it is possible for BI to find these devices (unlikely and not recommended due to lack of security). In summary, there are two dependencies that need to be met before a camera is visible to BI:
- The router has to ALLOW UPnP traffic. Many ISP routers, e.g. AT&T, do not allow UPnP traffic because it presents a security risk. Crafty actors on the internet may find ways to discover devices on your network and get control.
Mesh routers, e.g. Orbi Mesh, do allow UPnP traffic, because these routers sit behind the ISP firewall. - Your cameras have to have UPnP enabled otherwise how can the camera be identified.
Provide the username / password of the camera and select Find/Inspect.
The Find/Inspect button will discover all cameras and/or devices existing on the network that support the above stated protocols.
Select the camera you want added to BI and BI will take care of the rest.
Besides security, another reason I am not a big fan of network discovery protocols is because they are "brittle". If the BI server restarts/reboots for any reason, the UPnP connection to the camera is usually broken by the router and a new connection needs to be established.
Using the methods below hardens the network setup so connections are automatically re-established after power outages and equipment restarts.
ONVIF is a standard protocol that allows third party software such as BI to gain access to capabilities from a camera for use within BI. Camera vendors may provide different levels of ONVIF support. Some may only provide the URI of the RTSP streams (i.e. access to the video streams). Other vendors may include more camera capabilities such as PTZ and/or audio controls with their ONVIF support.
ONVIF is by far the easiest way to connect cameras to BI. If the camera is not discovered in Step 1, continue providing more information. Provide the IP Address in addition to the username/password for the camera. Many vendors support ONVIF either through port 80 or 8999. Thus, BI will check those two ports by default. If you know ONVIF is available on a different port for your camera, replace 8999 with the value for your camera.
Hit Find/Inspect.
If an ONVIF connection was not established, the Find/Inspect dialog will tell you so.
No ONVIF Information
The first three lines show the timeout when trying to make an ONVIF connection on port 80.
The second three lines represent the timeout when trying to do the same on port 8999.
Know your cameras! Revisit ONVIF gotchas.
ONVIF Device Manager is a great tool as well to determine ONVIF support on your camera.
In contrast, below is a sample response from the camera when an ONVIF connection is established. Look at the volume of information transferred to BI.The second three lines represent the timeout when trying to do the same on port 8999.
Know your cameras! Revisit ONVIF gotchas.
ONVIF Device Manager is a great tool as well to determine ONVIF support on your camera.
Key information gathered via ONVIF to make connecting to cameras easy:
- Manufacturer: Many cameras are rebrands from another company (Original Equipment Manufacturer, OEM). The Manufacturer field often reveals the OEM. In below example, the User Guide stated Alptop but the OEM was iCamera. Very important information to know when choosing the appropriate driver in Step 3.
- RTSP URI(s): Probably the most important piece of information. This tells BI how to get access to the video from the camera. Without this information no video feeds will appear.
Also note, many cameras provide multiple streams. In this example, they are referred to as MainStream and SubStream. Make note of both streams. Occasionally, the sub stream does not auto-populate in the IP Config Dialog and you have to manually enter the URI. - PTZ settings. Almost always part of a camera's ONVIF implementation, these settings make it easy for 3rd party software to get access to the PTZ controls of a camera.
- Audio. Not frequently shared via ONVIF, however a great bonus to connect to a camera's microphone or speaker if available.
Camera streams and dual streams
If an ONVIF connection were made, the RTSP URL for the Main and Sub streams should be provided and populated in list boxes below. If the Main stream is only provided, it is often easy to guess the Sub stream based on the Main stream. The difference between the main stream path and the sub stream path will often be a single digit such as "stream0" to "stream1" or a word change such as "main" to "sub".
Setting a Main and Sub stream for your camera is a subtle but CRUCIAL step. This is what is meant by connecting Dual Streams for a camera. Customers have stated CPU utilization drops of 50%-70% after enabling dual streams on all their cameras. Nothing has a bigger impact on lengthening the longevity of your server.
Make note of all the other information that could be pulled from the camera depending on the level of ONVIF support.
Setting a Main and Sub stream for your camera is a subtle but CRUCIAL step. This is what is meant by connecting Dual Streams for a camera. Customers have stated CPU utilization drops of 50%-70% after enabling dual streams on all their cameras. Nothing has a bigger impact on lengthening the longevity of your server.
- PTZ controls and presets
- Sometimes audio is pulled from a camera with speakers via ONVIF
- Occasionally, 2-way talk is also pulled from a camera with speakers and microphone via ONVIF. (rarely)
From my experience, if the camera supports ONVIF, PTZ commands are pulled over as well. Unfortunately, some vendors only provide limited information such as RTSP urls via ONVIF. However, many, many vendors and camera rebrands implement the SAME PTZ functionality. What that means is if your camera supports PTZ but the PTZ controls do not come over via ONVIF, it's very possible one of the existing drivers listed in the PTZ/Control tab may work. See PTZ article for details.
Hit OK and the camera should connect.If you successfully connected your camera using ONVIF and the video and all the PTZ controls (if you have a PTZ camera) are working fine, then there may not be a need for this step. Generic/RTSP for the Make/Model may meet your requirements.
However, if there is more functionality you want to extract from the camera or you just want to experiment and see what other functionality has been leveraged from the BI drivers, then continue. See PTZ / Controls article to learn what other controls may be accessible via BI drivers. BI has been around for 20+ years. Over the years we have found ways to connect to cameras that do not have ONVIF and gain access to additional functionality provided by the cameras.
Another reason for this step is the PTZ commands from the camera via ONVIF are ok, but there is more functionality which you would like to leverage. Maybe the Make / Model is in our BI list. The BI drivers may be even more robust because a past customer had the same request. Worth a shot to test.
Audio and other advanced functionality
Finally, cameras that support ONVIF share their capabilities such as PTZ allowing BI to access those capabilities without needing the user to do anything. However, camera vendors frequently share their PTZ capabilities but not Audio and other functionality. It is very rare for advanced functionality such as two-way audio to be shared via ONVIF.
BI over the years, has reverse engineered many cameras to provide the advanced capabilities. This is one reason for the exhaustive list of Makes and Models listed in the IP Config Dialog. It is often due to a customer request for access to a camera feature (camera audio, two-way talk, IR light, windshield wiper etc.) that was not provided via ONVIF. Try the BI drivers, if the ONVIF integration is lacking functionality that you desire.
Choose BI Drivers (Make / Model)
This example shares best practices for using BI drivers. As always, I tried to connect via ONVIF. After entering username, password and IP address, I hit Find/Inspect.
Results from ONVIF below.
I populated the Mainstream and Sub stream fields based on the ONVIF output.
From the General tab, I could see the high-res video was being pulled twice! Basically the camera and BI was doing double the work for ZERO benefit. This can happen. Camera vendor software is often not great.
Make
Based on the above, the immediate fix (for this example) if you have no other information is to leave the Sub stream URI blank to prevent doubling the load on your resources.
However, from the UI of the camera software, I could immediately tell this camera was a Hikvision rebrand.
Always choose the Make of the camera (if it exists) first. If the Make does not exist but you know your camera is a rebrand from an OEM, e.g. Hikvision, choose Hikvision as the Make.
Model
The Model listing with an * is the recommended model. If the preferred driver does not work, try all the different models to see if any can make a connection to your camera. With each Make/Model selection, choose the OK button instead of Find/Inspect. If you hit Find/Inspect, BI tries to re-establish an ONVIF connection (the Make/Model will again go back to Generic/RTSP). Make sure the RTSP port value remains populated with the default 554 or the specific value provided by Advanced Port Scanner.
So I went back to the IP Config Dialog and selected Hikvision as the Make.
I also changed the Main and Sub fields to default. By doing so, you are telling BI to try alternative URI streams that worked with the driver instead of the ONVIF values.
When using BI drivers, often the sub stream default values are blank. However (as stated in Step 2), if the main stream works, then it becomes easy to often guess the sub stream. The difference between the main stream path and the sub stream path will often be a single digit such as "stream0" to "stream1" or a word change such as "main" to "sub".
In my example, I am familiar with Hikvision nomenclature and their cameras often distinguish between the main and sub stream via the ending 1 or 2 in the URI.
So the sub stream in image above is populated because I copy/pasted the main stream URI and altered the last value from a 1 to a 2.
What's great about BI is it remembers the ONVIF values AND the BI driver values, so you can Mix and Match!
Maybe the ONVIF URI delivers a better main stream. Maybe the BI driver delivers a better sub stream. You can experiment with ALL permutations!
Hit the Help button in the IP Config Dialog to understand the options. Deviate from the default settings with caution.
Use RTSP/stream timecode
By default, the timing is imposed by the camera.
By unselecting the feature, the software will try to spread the available frames evenly in time.
This might be a good test if the live view or playback is stuttering (playing fast then slow repeatedly)
RTSP Keep-alives
Toggle on/off. Does the stream start working? Hit Help button for details.
Decoder compatibility mode
Toggle on/off? Does the stream start working? Hit Help button for details.
Keep in mind, this setting can cause video artifacts.
Skip initial HTTP DNS and reachability tests
Anecdotal: For some reason, the BI server would not auto-reconnect to just one camera when the BI server would restart after a server reboot, e.g. a Windows update. If the user then right clicked in that camera window -> Restart camera, the camera would reconnect, but this would require the user be at the BI server any time the BI server restarted. The user selected Skip initial HTTP DNS and reachability tests which resolved the issue.
Setup RTSP back-channel for talk support (PCM-U format)
This should largely be unselected for most cameras. According to engineering, this is supported by only 2 cameras.
ONVIF Triggers
Cameras are becoming more and more capable over time, e.g. Person and Vehicle detection on the camera. ONVIF triggers allow 3rd party software like BI to take advantage of advanced camera triggers via ONVIF.
Follow steps below to enable BI triggers via camera triggers.
Connector setup
Activate ONVIF trigger events.
This selection tells BI to listen for events from the camera.
The software is listening for the IsMotion:true and IsMotion:false events to start and stop the trigger when you are using the "trigger until reset" option (see Trigger dialog screenshot further below).
The logs will let you know if BI is listening via Events log events.
Code: Select all
1 12/10/2021 10:08:04.253 AM Cam13 Events: subscription 00000190
1 12/10/2021 10:08:05.472 AM Cam11 Events: subscription 00000191
1 12/10/2021 10:08:06.891 AM Cam12 Events: subscription 00000190
1 12/10/2021 10:08:07.272 AM Cam13 Events: subscription 00000190
1 12/10/2021 10:08:08.477 AM Cam11 Events: subscription 00000191
Trigger tab
Select Camera settings -> Trigger tab -> Camera's digital input or motion alarm
This setting tells BI to trigger when an event arrives from the camera (i.e. ONVIF event) or other external events.
Testing
Many users have smart cameras with AI. BI also comes with the DeepStack AI solution. Many users activate each independently and determines which is most accurate for their setup. Others activate both. Better safe than sorry. Many ways to leverage multiple AI solutions.
Motion sensor
Activate the BI Motion sensor. Activate DeepStack as well if installed.
Select Camera settings -> Trigger tab -> Motion sensor.
Some users keep BI motion detection on (in addition to Camera's digital input or motion alarm) to double-check camera is not missing anything.
MiscellaneousActivate the BI Motion sensor. Activate DeepStack as well if installed.
Select Camera settings -> Trigger tab -> Motion sensor.
Some users keep BI motion detection on (in addition to Camera's digital input or motion alarm) to double-check camera is not missing anything.
(Optional) Camera settings ->Record tab -> Pre-trigger video buffer = 3-5s. More of a user preference. Many users like seeing 3-5s before the actual motion trigger.
Troubleshooting
When first setting ONVIF triggers, the log file will let you know if ONVIF events are being received (as stated above). Status button -> log tab. Good to have Status window open to see events. When the events come in, you can then observe whether BI is working correctly, by observing recording on the console and whether the appropriate alerts are being fired.
ONVIF Device Manager is a great tool to confirm which events are being sent by the camera.
Connecting cameras and getting video from your cameras is a crucial first step. But you may not be done. The next step is to make sure the BI Server settings are correct so the cameras deliver a good experience (smooth, high quality stream) on BI. The Video tab article will show you the way.
If the camera does not connect, review the Troubleshooting articles in the Troubleshooting Toolkit -> Cameras section.