Sub Stream Guide

  • Views Views: 108,300
  • Last updated Last updated:
  • Sub Stream Guide

    The not-quite-comprehensive guide to using sub streams in Blue Iris.

    Introduction

    Blue Iris is able to take advantage of sub streams to greatly reduce processing requirements starting with version 5.2.7 (May 1, 2020). As such, this can bring older systems, as well as non-intel CPUs into play as Quick Sync/Hardware Acceleration isn't a requirement now. Substantial improvements have been made since the feature was first introduced, so you should start with the latest version of Blue Iris.

    What is a sub stream?

    A sub stream is a secondary video stream provided by your IP camera. Sub streams are smaller (lower resolution and bit rate) and easier to process than main streams.

    Why use sub streams if they are lower quality?

    Sub streams typically reduce CPU usage by 5x to 20x and make a struggling system run great. The full quality main stream is still recorded and available when you need it.

    When you configure a camera in Blue Iris to use a sub stream, Blue Iris will pull video from both the "main" and "sub" streams. Each stream is used for different purposes.

    The main stream is used for:

    • direct-to-disc recording
    • single-camera live viewing and recording playback
    • audio

    The sub stream is used for everything else:

    • multiple-camera viewing
    • motion detection
    • alert snapshots
    • etc.

    How to configure a sub stream in the camera's web interface

    1. Resolution

      The most important part of configuring a sub stream is to choose a fairly low resolution. A "D1" resolution like 704x480 or 720x576 is available on most cameras and this is recommended for most users. Don't worry about the aspect ratio being wrong; Blue Iris should detect and correct this automatically. Some cameras offer HD sub streams, but using a high-definition sub stream would largely defeat the purpose.

    2. Frame Rate

      The Blue Iris developer has indicated that for best reliability, sub stream frame rate should be equal to the main stream frame rate. Blue Iris's frame pipeline is driven by the sub stream, so a slow sub stream will cause the main stream to be slow as well. Because sub streams are so efficient, it is often okay to ignore past advice about limiting frame rates to 15 FPS. Go as high as you want. Just make sure the main and sub streams have the same frame rate.

    3. I-Frame Interval (keyframe interval or "GOP")

      Blue Iris developer's recommendations:

      • The i-frame interval should be equal to the frame rate (for best responsiveness and stability).
      • The i-frame interval should be not higher than double the frame rate (if improved compression efficiency is required).
      • The main stream and sub stream should have the same frame rate and i-frame interval.

      Blue Iris will still work if you ignore the above recommendations, but you may have more problems. If you wish to tweak the i-frame interval, you should first know these facts:

      • A short i-frame interval on the main stream will help the main stream load faster when you maximize a camera.
      • Shorter i-frame intervals on both streams (main and sub) allow Blue Iris to begin direct-to-disc recording sooner after recording is triggered, so you require less pre-trigger video buffer in Blue Iris camera properties > Record tab.
      • Shorter i-frame intervals yield worse compression (lower quality and/or higher file size). Higher i-frame intervals yield better compression. How much this actually matters is difficult to judge.

      In all cases, I recommend the i-frame interval be between one and two times the frame rate, where the exact value you choose is a balance that suits your individual needs.

    4. H.264+, H.265+, Smart Codec

      Certain advanced video encoding options prevent a short i-frame interval and should not be used with Blue Iris for compatibility reasons. These options are usually called "Smart Codec" or "H.264+" or "H.265+" (note the "+" sign), and they should be disabled.

    How to configure a sub stream in Blue Iris

    First, make sure you have enabled direct-to-disc for the camera, otherwise the sub stream won't be used.

    Important: After you configure the sub stream, you need to reconfigure motion detection. Any zone definitions will be lost when you configure a sub stream. If you are modifying an existing system make record of your current zone definitions so that they can more easily be reconstructed.

    Go to the Network IP camera configuration panel. Blue Iris has separate inputs for the Main and Sub stream paths. First, try the dropdown box to the right of the word Sub to see if it has options. If so, it is likely that one of them will be what you need. If not, you can enter main and sub stream paths manually in the text boxes further to the right. The path you'll need to enter varies by camera manufacturer, but usually the difference between the main stream path and the sub stream path will be a single digit.

    Dahua cameras

    • Main Stream: /cam/realmonitor?channel=1&subtype=0
    • 1st Sub Stream: /cam/realmonitor?channel=1&subtype=1
    • 2nd Sub Stream: /cam/realmonitor?channel=1&subtype=2

    Dahua Configuration Screenshot

    Hikvision cameras

    • Main Stream: /Streaming/Channels/1
    • Sub Stream: /Streaming/Channels/2

    Hikvision Configuration Screenshot

    Other cameras

    If Blue Iris doesn't have the paths you need built-in, you may need to search the web for the RTSP URLs for your camera brand. ispyconnect has a public database of camera video stream paths for many brands, easily searched via Google: "ispyconnect hikvision rtsp URL"

    Another option is to use ONVIF Device Manager. Search YouTube for “onvif device manager rtsp url” and you will find a number of videos that show how to discover both the main and sub stream urls (select the camera’s profile, main or sub, and then Live Video to see the url).

    Reconfigure Motion Detection

    Since sub streams are lower resolution, you should consider reducing your minimum object size and "object travels" settings after you activate a sub stream for the first time.

    If you use Blue Iris's motion zones they must be configured again after you activate the sub stream. When you open the motion zone editor, you will notice the zones have reverted to their defaults, which is for Zone A to be completely filled in with all the other zones empty.

    Other Information

    Recording

    Direct-to-disc must be enabled in order for sub streams to work at all.

    Main streams are shown when you view a recording.

    For timeline playback to work properly, Blue Iris DVR (BVR) file format must be used. It is strongly recommended that you keep enabled "Record dual-streams if available", so that both the main and sub streams are written to BVR files. Recorded sub streams are used during multiple-camera timeline playback in order to keep your CPU usage from ballooning out of control.

    Confirming Operation

    If the sub stream has been properly configured the Status section of the camera’s General settings will show kB/s of the Main and Sub streams

    Sub stream General Screenshot

    Live Viewing

    When live viewing, the sub stream is used for cameras while they are in a grid view (e.g. "All cameras"). When you "solo" or "maximize" a single camera, Blue Iris will transition to the main stream so you can view with full quality. This causes a temporary increase in CPU / GPU resource consumption. A shorter i-frame interval on the main stream will help the transition happen faster.

    How much CPU savings to expect

    This table lists common IP video stream resolutions and their relative size compared to other resolutions. This is roughly equivalent to the amount of work Blue Iris must do to process a video stream of this resolution (assuming the same frame rate and video codec is used).

    Resolution Compared to 4K Compared to 4 MP Compared to 2 MP Compared to 1 MP Compared to D1 - PAL Compared to D1 - NTSC
    3840x2160 (4K) 100% 203% 400% 900% 2045% 2455%
    2688x1520 (4 MP) 49% 100% 197% 443% 1008% 1209%
    1920x1080 (2 MP) 25% 51% 100% 225% 511% 614%
    1280x720 (1 MP) 11% 23% 44% 100% 227% 273%
    704x576 (D1 Sub Stream - PAL) 5% 10% 20% 44% 100% 120%
    704x480 (D1 Sub Stream - NTSC) 4% 8% 16% 36% 83% 100%

    For example, a D1 resolution sub stream is about 4% or 5% as much work as a 4K main stream. To read it another way, a 2 MP stream is 5 to 6 times as much work as a D1 sub stream.

    Attachments

    • DahuaConfig.png
      DahuaConfig.png
      25.5 KB · Views: 11,925
    • HikvisionConfig.png
      HikvisionConfig.png
      16.6 KB · Views: 11,133
    • DahuaConfig2.png
      DahuaConfig2.png
      14.1 KB · Views: 66,152
    • HikvisionConfig2.png
      HikvisionConfig2.png
      13.1 KB · Views: 64,411
    • SubstreamGeneral.png
      SubstreamGeneral.png
      149.9 KB · Views: 58,628