(Solved) - Feed delays over time then drops frames. Blue Iris and Dahua

Pips

n3wb
Joined
Dec 28, 2017
Messages
16
Reaction score
3
Location
UK
Update: Disable VPP fixed this issue

My feeds generally work, but a feed will slowly get delayed, up to around 2 mins, then suddenly be live again and drop 2mins of video. I have memory cards in the cameras and they record this period locally with no issue, so something between Dahua and BI causes this issue.

I record the local camera time from Dahua and the BI overlay so I can see what the delay is in the images attached. Normally this is a few seconds so all good. I have tried numerous settings with BI, below are the current ones. The feed images are before and just after the catch up. The delay took around 20mins to build up to 2mins before it cleared. It will then run in sync for ages until I see a repeat.

I have Dahua (IPC-HDW5231R-ZE and SD49225T-HN) plus other brands. I only see this on the all the Dahua feeds but at different times.

Any suggestions how to troubleshoot? CPU load is generally 50-60, decent network. I have removed several cameras to greatly reduce load but delay still occurs.

Thanks

BlueIris set1.jpg BlueIris set2.jpg UI3_-_Blue_Iris 1.jpg UI3_-_Blue_Iris 2.jpg
 
Last edited:

fenderman

Staff member
Joined
Mar 9, 2014
Messages
36,897
Reaction score
21,250
My feeds generally work, but a feed will slowly get delayed, up to around 2 mins, then suddenly be live again and drop 2mins of video. I have memory cards in the cameras and they record this period locally with no issue, so something between Dahua and BI causes this issue.

I record the local camera time from Dahua and the BI overlay so I can see what the delay is in the images attached. Normally this is a few seconds so all good. I have tried numerous settings with BI, below are the current ones. The feed images are before and just after the catch up. The delay took around 20mins to build up to 2mins before it cleared. It will then run in sync for ages until I see a repeat.

I have Dahua (IPC-HDW5231R-ZE and SD49225T-HN) plus other brands. I only see this on the all the Dahua feeds but at different times.

Any suggestions how to troubleshoot? CPU load is generally 50-60, decent network. I have removed several cameras to greatly reduce load but delay still occurs.

Thanks

View attachment 42382 View attachment 42383 View attachment 42384 View attachment 42385
How is your network setup? Is the blue iris pc plugged into the router or the same switch as the cameras?
 

Pips

n3wb
Joined
Dec 28, 2017
Messages
16
Reaction score
3
Location
UK
How is your network setup? Is the blue iris pc plugged into the router or the same switch as the cameras?
BI PC is connected to the cameras via a single switch or two switches linked together depending on the camera. Decent Unifi poe switches in use. Only 1 remote camera uses a point to point radio link with high signal strength. same issues on all dahua cameras regardless if same switch, 2 switches or radio. Cameras that work with no issue are cheap wifi non dahua.
 

fenderman

Staff member
Joined
Mar 9, 2014
Messages
36,897
Reaction score
21,250
BI PC is connected to the cameras via a single switch or two switches linked together depending on the camera. Decent Unifi poe switches in use. Only 1 remote camera uses a point to point radio link with high signal strength. same issues on all dahua cameras regardless if same switch, 2 switches or radio. Cameras that work with no issue are cheap wifi non dahua.
What are your bitrates?
 

fenderman

Staff member
Joined
Mar 9, 2014
Messages
36,897
Reaction score
21,250
also try selecting rtsp main steam from the dropdown or use find inspect.
 

Pips

n3wb
Joined
Dec 28, 2017
Messages
16
Reaction score
3
Location
UK
also try selecting rtsp main steam from the dropdown or use find inspect.
one camera is setup for rtsp main stream and has the same issue. Just used find inspect on another to see if that helps. new setup is attached dahua find.jpg
 

SouthernYankee

IPCT Contributor
Joined
Feb 15, 2018
Messages
5,170
Reaction score
5,320
Location
Houston Tx
For the problem camera set to bit rate type vbr
Set frame rate and iframe to 10 or 12, the same value.
I recommend all cameras use vbr and the same frame and iframe rate. Frame rate never over 15.

You Indicated that the switch's were cascaded., Are the ports that connected the two switch's giga byte ports.
I recommend this setup, the router connected to a gigabyte switch, the bi PC, and both Poe switches connected to the gigabyte switches.
 
Last edited:

Pips

n3wb
Joined
Dec 28, 2017
Messages
16
Reaction score
3
Location
UK
For the problem camera set to bit rate type vbr
Set frame rate and iframe to 10 or 12, the same value.
I recommend all cameras use vbr and the same frame and iframe rate. Frame rate never over 15.

You I dicated that the switch's were cascaded., Are the ports that connected the two switch's giga byte ports.
I recommend this setup, the router connected to a gigabyte switch, the bi PC, and both Poe switches connected to the gigabyte switches.
iframe had a min of 15 in the dahua web interface, should I set them both to 15?
yes all switch ports are gigabit.

Thanks for helping
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,005
Location
USA
Matching the iframe interval to the frame rate is unlikely to help. This sounds like a clock sync problem so I'd suggest checking the box in BI video properties "Use RTSP/stream timecode". It is enabled for all of my cams, Dahua or otherwise.
 

Pips

n3wb
Joined
Dec 28, 2017
Messages
16
Reaction score
3
Location
UK
Matching the iframe interval to the frame rate is unlikely to help. This sounds like a clock sync problem so I'd suggest checking the box in BI video properties "Use RTSP/stream timecode". It is enabled for all of my cams, Dahua or otherwise.
thanks, made that change and will see if it helps
 

SouthernYankee

IPCT Contributor
Joined
Feb 15, 2018
Messages
5,170
Reaction score
5,320
Location
Houston Tx
On some cameras the Iframe can not be set less than the frame rate, so only one iframe per second.

I think the problem is an overload in the network path, as the OP indicated that there were drop frames.
If running windows 10 have a screen shot of the task manager, make sure the GPU data is showing.

It may be that the use of the BI time stamp is causing problems, BI may (not positive) need to decode the frame, insert the time stamp and re encode the frame.

Also take a screen shot of the Status (three vertical bar button) camera tab. This shows all the cameras, there bit and frame rate.

Is the problem camera on wifi ?
 

Pips

n3wb
Joined
Dec 28, 2017
Messages
16
Reaction score
3
Location
UK
On some cameras the Iframe can not be set less than the frame rate, so only one iframe per second.

I think the problem is an overload in the network path, as the OP indicated that there were drop frames.
If running windows 10 have a screen shot of the task manager, make sure the GPU data is showing.

It may be that the use of the BI time stamp is causing problems, BI may (not positive) need to decode the frame, insert the time stamp and re encode the frame.

Also take a screen shot of the Status (three vertical bar button) camera tab. This shows all the cameras, there bit and frame rate.

Is the problem camera on wifi ?
No wifi cameras have an issue. The camera issue moves between my 4 Dahua cameras, doesn't happen at the same time. 3 are wired gigabit via unifi switches, 4th has an airmax radio link at 375Mbit high signal strength and usage around 2%.

BI CPU load doesn't seem to spike, it's around 50-60. GPU is low. Dedicated server so no other tasks.
I only turned on the BI time stamp to help troubleshoot, as without it I was unable to tell if the feed was delayed easily. Problem occurs with no overlays enabled at BI.
I have 9 cameras in total. Problem only seen on the Dahua models. In group outside_dahua screen shot. Sorry I use groups so cameras show up multiple times.

Thanks for the help everyone.
task.jpgcameras.jpg

task.jpg
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,005
Location
USA
Are you certain the stream is actually getting delayed and it is not just the timestamps drifting apart?

4th has an airmax radio link at 375Mbit high signal strength and usage around 2%
A bit off topic, but that is overkill for one camera. You could reduce the channel width to its minimum value. It will lower the capacity (max bandwidth) of the link but make it receive and transmit less interference. Your output power might also be too high. Short range links with UBNT radios usually work great on minimum output power, further reducing interference created by your radios.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,005
Location
USA
I wonder if the Blue Iris developer can provide some way of mitigating this issue or at least notifying users about delayed streams. UI3 does both. heh.

This old patch note speaks of how BI buffers H.264 frames, and does not suggest an upper limit to the number of frames BI will buffer. As this buffer gets larger (more frames in it), there would be more apparent delay in the video playback.

Blue Iris 4.6.4 Patch Notes said:
  • A new option on the Video tab in camera properties "Limit decoding unless required" can be used to lower CPU demand by only decoding video key frames instead of all frames. Generally an H.264, H.265 or MPEG4 stream will encode a key frame once each second, and this is usually enough for the motion detector to operate. When the software determines that ALL frames are required for webcasting or recording without direct-to-disc mode, all frames will be decoded. In addition, all frames will be decoded if the camera is selected or full screen. One CAVEAT to note: the H.264 decoder uses a pipeline--4 or more frames can be in this pipeline at any time. You will notice this effect when decoding only key frames--the output may be delayed by 4-12 or more seconds and will "catch up" once all frames are again decoded.
There are several reasons why video delay could increase. One reason is if the stream is too resource-intensive and the CPU can't keep up. However this does not seem to be the case here. 2 MP @ 15 FPS streams are easy for an i7-6700 at half load. Also if it was this issue then I would expect the delay to be very inconsistent, sometimes spiking up or down.

Another reason for delay could be a minor timekeeping error in the system clock. This could explain a delay that is very slow and very steady, continually increasing to some point of failure. In this case, Blue Iris would be intentionally allowing frames to build up in the buffer because it thinks it is decoding at the right pace.
 

SouthernYankee

IPCT Contributor
Joined
Feb 15, 2018
Messages
5,170
Reaction score
5,320
Location
Houston Tx
It is strange that it moves between cameras.
Do the cameras use the BI PC for there time source ?
Do the cameras have a update time interval that seems to correspond to the resink of the time ?
 

Pips

n3wb
Joined
Dec 28, 2017
Messages
16
Reaction score
3
Location
UK
It is strange that it moves between cameras.
Do the cameras use the BI PC for there time source ?
Do the cameras have a update time interval that seems to correspond to the resink of the time ?
cameras use time.google.com update every 10mins and pc uses time.microsoft.com. They do show the same time when i check.
Its very confusing!
 

Pips

n3wb
Joined
Dec 28, 2017
Messages
16
Reaction score
3
Location
UK
anyone have ideas how I can troubleshoot this? I made all the above changes but the issue still happens. It must be something with my setup as its common cameras with BI. Are there any logs or places I can look for ideas? I just don't know if I should be looking at cpu, network, camera settings etc...
 

fenderman

Staff member
Joined
Mar 9, 2014
Messages
36,897
Reaction score
21,250
anyone have ideas how I can troubleshoot this? I made all the above changes but the issue still happens. It must be something with my setup as its common cameras with BI. Are there any logs or places I can look for ideas? I just don't know if I should be looking at cpu, network, camera settings etc...
for hardware acceleration are you using intel only or vpp?
 
Top