Camera works great on Main stream only, adding Sub stream screws up the Main stream!

plomaris

Young grasshopper
Jul 2, 2014
71
23
I have a Hikvision (or clone) IPC3412 camera that works great in BI when I just put in the parameters for the Main Stream. However, if I then put in the parameters for the Sub Stream, the Main Stream freezes like every second or so when on full screen.

I have the main and sub stream parameters set up in the camera's web configuration.

What should I look at to try to resolve this problem? I have other cameras of the same or similar type that work with sub stream.

I would post pics, but neither "Insert image" nor "Attach Files" works. Geez.
 
Well I would expect that to work just fine. How long does the video freeze when it freezes? Is it just a short pause, like the video is only stuttering? If so that can be fairly normal for Blue Iris, which is not really good at adhering to frame timestamps very precisely.

As I understand it, Blue Iris uses frame timing from the sub stream to control main stream playback, and when things aren't perfectly in sync it can cause stuttering. Since you have it configured basically according to recommendations, I think it is fair to assume something about that particular camera or its firmware is acting a bit strangely.

Some suggestions:
  • Try unchecking the box "Use RTSP/stream timecode" in the Network IP camera configuration panel. It probably will make no difference at all, but is worth a try.
  • Maybe a different combination of frame rates may magically avoid the freezing issue:
    • Try some higher frame rates, e.g. 20, 25, or 30 FPS or anywhere in between. In my experience lower frame rates (e.g. 2 FPS, 6 FPS) have relatively big issues when using sub stream, but higher frame rates have less issues. However 15 FPS generally behaves fine for me.
    • Try setting the sub stream frame rate higher than main stream. This is not a normally recommended configuration, but it can still work. E.g. Main stream 15, Sub stream 20 or 30. Or Main stream 10, sub stream 15 or 20 or 30. Remember to keep the I Frame Interval matching the frame rate.
 
Also look in Blue Iris's status window (or the camera settings, general tab) to verify that the main stream and sub stream frame rates are both stable and close to the numbers you expected. E.g. on one of my cameras which is configured for 20 FPS, 20 iframe on both streams, it is not out of the ordinary to see numbers like 19.76/0.99 and 19.75/0.99. But if it was reporting a frame rate below 19 then I would be worried. (my own screenshot upload not currently working)
 
Well I would expect that to work just fine. How long does the video freeze when it freezes? Is it just a short pause, like the video is only stuttering? If so that can be fairly normal for Blue Iris, which is not really good at adhering to frame timestamps very precisely.

As I understand it, Blue Iris uses frame timing from the sub stream to control main stream playback, and when things aren't perfectly in sync it can cause stuttering. Since you have it configured basically according to recommendations, I think it is fair to assume something about that particular camera or its firmware is acting a bit strangely.

Some suggestions:
  • Try unchecking the box "Use RTSP/stream timecode" in the Network IP camera configuration panel. It probably will make no difference at all, but is worth a try.
  • Maybe a different combination of frame rates may magically avoid the freezing issue:
    • Try some higher frame rates, e.g. 20, 25, or 30 FPS or anywhere in between. In my experience lower frame rates (e.g. 2 FPS, 6 FPS) have relatively big issues when using sub stream, but higher frame rates have less issues. However 15 FPS generally behaves fine for me.
    • Try setting the sub stream frame rate higher than main stream. This is not a normally recommended configuration, but it can still work. E.g. Main stream 15, Sub stream 20 or 30. Or Main stream 10, sub stream 15 or 20 or 30. Remember to keep the I Frame Interval matching the frame rate.
It is just a very brief freeze, not even a second.
I went and checked another camera that is an identical model that works with sub stream and compared the parameters in the web interface. The only difference I saw was that the one that works with sub stream had 2048 for the bit rate for the Main Stream vs. 3072 for the other one. So, I updated the other camera to 2048 and that seems to fix the issue. I will monitor it for a while and see if that really did resolve the issue.
 
Weird. 3 Mbps is not really a high bit rate so I wouldn't expect it to cause problems. Anyway I'd recommend trying higher bit rates too instead of just lower ones. If you don't record the main stream continuously, then it can even be advisable to set it super high so you have all the quality the camera can offer when it really matters. That is my philosophy anyway. I'll set main stream as high as 8000+ Kbps on a 2 megapixel camera, and let the sub stream at 512-1024 Kbps fill in the gaps between triggered events.
 
  • Like
Reactions: looney2ns
Weird. 3 Mbps is not really a high bit rate so I wouldn't expect it to cause problems. Anyway I'd recommend trying higher bit rates too instead of just lower ones. If you don't record the main stream continuously, then it can even be advisable to set it super high so you have all the quality the camera can offer when it really matters. That is my philosophy anyway. I'll set main stream as high as 8000+ Kbps on a 2 megapixel camera, and let the sub stream at 512-1024 Kbps fill in the gaps between triggered events.
Well, Amazon just delivered and the main stream video was herky jerky like the guy was stopping every second, so my change didn't work. I will try your suggestion of increasing the bit rate. Thanks for the ideas!

Also, do you use CBR or VBR?
 
Last edited:
It now sounds like it is probably an issue of every iframe causing a stutter, which is also an issue sometimes in Blue Iris for reasons I don't entirely understand (something to do with i-frames either taking unexpectedly long for the camera to encode, or for Blue Iris to decode). I'd suggest trying CBR (constant bit rate) encoding instead of VBR to see if that makes a difference too. Otherwise, consider lengthening your iframe interval to 2x or 4x the frame rate, to reduce how often the stutter occurs. Increase buffer/record times accordingly in Blue Iris camera settings > Record tab, because recordings can only properly start at an i-frame.
 
It now sounds like it is probably an issue of every iframe causing a stutter, which is also an issue sometimes in Blue Iris for reasons I don't entirely understand (something to do with i-frames either taking unexpectedly long for the camera to encode, or for Blue Iris to decode). I'd suggest trying CBR (constant bit rate) encoding instead of VBR to see if that makes a difference too. Otherwise, consider lengthening your iframe interval to 2x or 4x the frame rate, to reduce how often the stutter occurs. Increase buffer/record times accordingly in Blue Iris camera settings > Record tab, because recordings can only properly start at an i-frame.

I tried a bunch of stuff and nothing worked. I'm just gonna leave it as is. Of 16 cameras, only 2 don't use sub stream, so I don't see it as a big deal. I'm at about 20%-25% CPU utilization. I've also reached out to Ken at BI. We'll see what he says.