Hikvision 4K/8MP video delay/lag in BI - Help!

The Jeff

n3wb
Joined
May 21, 2018
Messages
12
Reaction score
1
Location
NB, Canada
Hi all,

Newish to Blue Iris but have been toying with IP cameras (recreationally) over the last few years. Certainly not an expert but relatively techy.

Here is my issue :

Background :Full BI license, currently setup with only 2 cameras : a FOSCAM FI9831W (baby monitor) and a new HIKVISION DS-2CD2185 (8MP 4K H265 camera).

The HIKVISION is set to 4k resolution, 20 fps, medium video quality and H264 encoding (for now) in the camera. Direct-to-disk recording is enabled. I have also enabled Intel HD hardware accelaration for H264 in the settings.

Problem : The problem is that the HIKVISION initially starts in sync but as it runs a delay builds between the system time and the camera time (I have the camera's timestamp and BI's time stamp both showing). After a few hours, there is a about a 60-70 second delay between reality and the feed on BI. When the camera is initially started, there is about a 2-3 second delay.

What can I try? I currently have motion detection setup within BI, should I hand that over to the camera?

Specs :
Intel i7 3612QM (2.10GHZ, 6MB cache)
4GB DDR3 PC-12800 RAM
Intel HD Graphics
Samsung 860 EVO SSD for OS
4TB WD Blue Hard drive for storage

I certainly doubt that my specs are the problem, especially with only those 2 cameras setup. The plan is to have 2x 8MP HIkivison, 2x 4MP Hikvision and the 1x FOSCAM (960p).

Additional background : this problem seemed to have been worse, I did go from Demo to Full BI license yesterday and also turned on the Intel HD hardware acceleration. This helped quite a bit, but the delay still seems to be a problem, the delay just takes longer to build than before.

I appreciate any help!!
 

The Jeff

n3wb
Joined
May 21, 2018
Messages
12
Reaction score
1
Location
NB, Canada
Also, BI reports CPU usage between 35-45% with some blips slightly over 50... Task manager does report lower CPU usage for BI and overall than those numbers. Not sure which one is most accurate.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,682
Reaction score
14,043
Location
USA
I can think of two possible reasons for this happening.

1) The CPU could be struggling to process 4K video @ 20 FPS in realtime even with the aid of hardware acceleration. It is about equivalent to 80 FPS at 2MP after all. Try reducing the frame rate to 15 FPS in the camera's web interface. Blue Iris also has a "Max rate" setting you could tweak to match, but this mostly just controls a buffer size and therefore memory usage, not CPU usage. It may even be necessary to drop the frame rate further, like 10 FPS. This is a 3rd-gen mobile CPU running at just 2.1 GHz, maybe even slower if it doesn't have sufficient cooling and is getting throttled due to heat. It is not like a desktop i7.

Anyway #1 is what makes the most sense to me. That is a quad core chip with hyper-threading so when you have nearly 50% CPU usage that means you're nearly using all of 4 cores just on those two cameras.

2) The camera's clock may be running slow, causing Blue Iris to intentionally let frames pile up. I don't think this is it, but just in case try toggling the "Use RTSP/stream timecode" checkbox in the IP camera configuration panel:

 

The Jeff

n3wb
Joined
May 21, 2018
Messages
12
Reaction score
1
Location
NB, Canada
Thank you! I will try this later this evening once I get home.

I have added 2 other 4MP cameras on top since writing this post and they are perfectly in sync (and do not change). My logic is that shouldn't everything suffer if the CPU is maxed out? If the 8MP camera is overtaxing the CPU, shouldn't the other cameras also be lagging, etc. I guess I could try install BI on a different system (I have a laptop with i7 6500U that I can try with, to see if it performs better with the same camera config.

Also, in the camera properties screen, it seems to show around 650 bit rate and around 9 fps for the 8MP camera... My camera internally is set to 20 fps...
 

fenderman

Staff member
Joined
Mar 9, 2014
Messages
36,906
Reaction score
21,282
How is your network setup? Is the bi pc connected to the same switch as cams or to the router?
 

The Jeff

n3wb
Joined
May 21, 2018
Messages
12
Reaction score
1
Location
NB, Canada
My network is setup as follows : 1 router with an uplink to a 8-port gigabit poe switch. The BI machine and the cameras are connected to this switch. There is also another 5 port gigabit switch uplinked from the router as well, but no cameras or PC's connected to that one. These are unmanaged switches - devices get their IP addresses assigned via DHCP from the router (I think), except for those that I assigned to have static IP's (the BI PC and the cameras are all static).

Hopefully that makes sense!
 

The Jeff

n3wb
Joined
May 21, 2018
Messages
12
Reaction score
1
Location
NB, Canada
There are a lot of devices on the network... I wonder if there is network congestion or something? Could that be a possibility?

I have a smart home with a lot of stuff connected to wifi and ethernet. Off the top of my head, there are 5 IP cameras, a Ubiquiti Unifi AP, 5 sonos players/amps (some ethernet, some wifi), a Lutron smartbridge, 2x TV set top boxes, a Yamaha A/V receiver, NVidia Shield, 2 smart phones, 2 tablets, 3 computers, a Harmony hub and probably a few others that are connected to the same subnet.
 

fenderman

Staff member
Joined
Mar 9, 2014
Messages
36,906
Reaction score
21,282
There are a lot of devices on the network... I wonder if there is network congestion or something? Could that be a possibility?

I have a smart home with a lot of stuff connected to wifi and ethernet. Off the top of my head, there are 5 IP cameras, a Ubiquiti Unifi AP, 5 sonos players/amps (some ethernet, some wifi), a Lutron smartbridge, 2x TV set top boxes, a Yamaha A/V receiver, NVidia Shield, 2 smart phones, 2 tablets, 3 computers, a Harmony hub and probably a few others that are connected to the same subnet.
Should not matter..if the PC and cams are on the same switch nothing should be passing through the router.
 

Terk

Pulling my weight
Joined
Feb 14, 2018
Messages
247
Reaction score
106
I doubt it is congestion on your LAN. I'm guessing your camera is hardwired to the POE switch and not through a WiFi bridge? I had setup a new Dahua verifocal camera and everything was working fine including the zoom controls, however after a few days I noticed that camera was displaying with a significant delay when I would stand in front of it and wave it would be around a minute before I would see myself wave however in the web interface the camera would show real-time, or within a second anyway. I'm not sure if this sounds like the same thing you are seeing as well as I didn't notice if the displayed time was lagged as well but I'm guessing it was. The issue ended up being the make and model in the video settings for the camera had to be changed different from what a few of my other similar but not identical Dahua cameras were configured. Once I found the right combination for that camera the zoom controls still worked and the video was real-time.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,682
Reaction score
14,043
Location
USA
Thank you! I will try this later this evening once I get home.

I have added 2 other 4MP cameras on top since writing this post and they are perfectly in sync (and do not change). My logic is that shouldn't everything suffer if the CPU is maxed out? If the 8MP camera is overtaxing the CPU, shouldn't the other cameras also be lagging, etc.
Not necessarily. The video decoding might not be as heavily multi-threaded as we all assume it to be, so you could be maxing out a core with the 8MP camera, and other cores can't pick up the slack because a single thread of instructions must be executed in order.

I guess I could try install BI on a different system (I have a laptop with i7 6500U that I can try with, to see if it performs better with the same camera config.
That is only a marginally faster CPU and has half as many cores. It might handle the 8K camera slightly better but will be overall worse for BI.

Also, in the camera properties screen, it seems to show around 650 bit rate and around 9 fps for the 8MP camera... My camera internally is set to 20 fps...
That could mean Blue Iris is only able to decode 9 FPS at 4K resolution with your CPU. This camera is set to stream H.264 right? Not H.265?
 

The Jeff

n3wb
Joined
May 21, 2018
Messages
12
Reaction score
1
Location
NB, Canada
Yes, hard wired to switch directly, no bridge.

Thanks for info on CPU, did not realize that the old 3612QM was about same speed as the new 6500U. The 6500U is a low-voltage variant for an ultrabook so I guess that explains. In reality, however, the 6500U machine feels ten times faster and snappier. Both have SSD's, etc.

Yes, camera is set to H.264? I suspect that H.265 would be worse (since there is no hardware acceleration for H.265, although the H.265 should result in lower bitrate)...
 

The Jeff

n3wb
Joined
May 21, 2018
Messages
12
Reaction score
1
Location
NB, Canada
I doubt it is congestion on your LAN. I'm guessing your camera is hardwired to the POE switch and not through a WiFi bridge? I had setup a new Dahua verifocal camera and everything was working fine including the zoom controls, however after a few days I noticed that camera was displaying with a significant delay when I would stand in front of it and wave it would be around a minute before I would see myself wave however in the web interface the camera would show real-time, or within a second anyway. I'm not sure if this sounds like the same thing you are seeing as well as I didn't notice if the displayed time was lagged as well but I'm guessing it was. The issue ended up being the make and model in the video settings for the camera had to be changed different from what a few of my other similar but not identical Dahua cameras were configured. Once I found the right combination for that camera the zoom controls still worked and the video was real-time.
I will look at the make and model - there are a few different variants under HIKVISION that would fit the description of the model number, not sure which one to use. Another thing to try this evening - will report back.

Very impressed by the speed and willingness to help a newbie on this forum, thank you! :)
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,682
Reaction score
14,043
Location
USA
Yes, camera is set to H.264? I suspect that H.265 would be worse (since there is no hardware acceleration for H.265, although the H.265 should result in lower bitrate)...
Correct. H.265 acceleration isn't working in Blue Iris. The developer blames Intel. It uses more CPU time than H.264 even when H.264 doesn't have hardware acceleration. H.265 typically results in better quality or a better bit rate (depending on how you set the bit rate), however the H.265 encoders aren't as mature as H.264 encoders so it probably has not reached is maximum potential yet.
 

The Jeff

n3wb
Joined
May 21, 2018
Messages
12
Reaction score
1
Location
NB, Canada
Ok - so played with all of the above suggestions. The RTSP timecode thing was not the issue.

It seems like the only thing that worked was reducing the resolution (one notch down to what I think is 1760p) and reduced the max bitrate from 5096 to 3072. It keeps up and stays in sync at 20fps.

The lower bitrate limit did not help when set to 2160p...

CPU Usage right now, with 3x cameras hooked up (about 11 MP total) is 25-30% with Memory used of 890MB. Still need to add another 10MP of cameras so will see what kind of load that puts on the machine.

Bit disappointed that I paid for 4K cameras and can`t actually set them to run at 4K, but 1760P is still very sharp and would rather smooth 1760P then choppy or delayed 2160P.

Would be open to other suggestions to try to improve my performance here but am satisfied with the resolution reduction. Thank you !

Jeff
 

The Jeff

n3wb
Joined
May 21, 2018
Messages
12
Reaction score
1
Location
NB, Canada
Any chance RAM is an issue? In BI, it says 70% memory usage (I suspect this is overall system...) says 1GB free ram, 888MB used (by BI?).
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,682
Reaction score
14,043
Location
USA
Maybe. You'll probably need more RAM to increase the camera load.

Make sure the Max rate setting in BI camera properties > Video tab is set equal to or just one higher than the camera's frame rate. This setting hugely affects memory usage without any benefit if it is set too high.
 

The Jeff

n3wb
Joined
May 21, 2018
Messages
12
Reaction score
1
Location
NB, Canada
I just ordered a 4GB stick of RAM to double my RAM to 8GB. Hopefully that will help. 4GB probably not enough for the system anyway, as it is also used as a central storage server and to run PLEX Media server for streaming to devices in the house.

Will recheck the max rate setting.
 
Top