High CPU Usage / Choppy live video

jrferreira
Posts: 6
Joined: Mon Aug 10, 2020 3:15 pm

High CPU Usage / Choppy live video

Post by jrferreira »

I'm running a rather basic system (3 cameras over RTSP, 720p@10FPS each) on the latest version of Blue Iris. I have all the usual optimizations configured (Direct to Disk recording, Intel HW accelerated decoding, framerates limited to 10 FPS, etc). As of now, motion detection is disabled. Basically, I followed this guide here:

https://ipcamtalk.com/wiki/optimizing-b ... cpu-usage/

The computer is an Intel i5-2500k (overclocked to 4.2GHz) with 8Gb of RAM and I have two problems with this:

- Live view is EXTREMELY choppy (something like 1 frame every 2 seconds). If I trigger a recording, though, it comes out fine. And sometimes, out of nowhere, live view starts displaying perfectly, only to break again after a while.
- CPU use is absurdly high for such a small system. It sits at 80~90% the whole time, even if the application is minimized.

By comparison, if I set the same 3 streams up in iSpy or AgentDVR on the same computer, CPU use is around 10-15% and they all display perfectly in real time. Streams run fine on VLC as well.



Any tips would be appreciated :)
Matts1984
Posts: 496
Joined: Fri Apr 10, 2020 1:12 pm
Location: Maryland, USA

Re: High CPU Usage / Choppy live video

Post by Matts1984 »

Nothing jumps out at me yet and you should definitely be better off than that I'd think. Its an older CPU but still, you're not pushing it that hard (well shouldn't be).

Can you post a screenshot of your Blue Iris Status -> Cameras tab? (the little graph like icon with an upward lightning bolt arrow at top left of console window)
Blue Iris 5.8.9.x | Server 2022 VM | Xeon E5-2660 v3 @ 2.60GHz - 16 Cores | 24GB RAM | 8TB RAID | Sophos UTM WAF | Mostly various SV3C Cameras
jrferreira
Posts: 6
Joined: Mon Aug 10, 2020 3:15 pm

Re: High CPU Usage / Choppy live video

Post by jrferreira »

Here :)
Attachments
biu.jpg
biu.jpg (84.24 KiB) Viewed 7859 times
Matts1984
Posts: 496
Joined: Fri Apr 10, 2020 1:12 pm
Location: Maryland, USA

Re: High CPU Usage / Choppy live video

Post by Matts1984 »

I've got to be honest, I'm a little confused on this one. Your MPixels per camera is actually really low, yet your total MP/s at the bottom is actually quite high (and I think why your CPU is so taxed). A couple things, in your first post you noted your streams were 10 fps but the status shows it's incoming at 20 fps. Fixing that to actually be 10 should make a huge difference. I run mine at 10 fps and the fluidity (is that a word?) of motion is still just fine for me. Your keyframes (sometimes referred to as i-frames) also seem off. They show at .2 or .1 and ideally you'd want them to be 1.0. This is a camera side setting though I know some manufacturers do not present this config option. In my environment I controlled this by setting the "Key frames" to the same value as the fps (10 and 10 to be exact). Lastly, if those tweaks don't get your to a reasonable performance (I'd recommend either way) is to configure Substreams if possible. This would net you the biggest CPU gain while only increasing network load a minimal amount.

I was about to say I can't figure out why .9 + .9 + .9 is coming out to 55.2 MP/s but I think I just figured that out, it IS your Keyframes. Ideally your system should only have to parse an image once per second (at least according to the BI manual)... yours is currently doing it 5 to 10x per second. I think addressing everything above with absolutely fix your issue.
Blue Iris 5.8.9.x | Server 2022 VM | Xeon E5-2660 v3 @ 2.60GHz - 16 Cores | 24GB RAM | 8TB RAID | Sophos UTM WAF | Mostly various SV3C Cameras
Matts1984
Posts: 496
Joined: Fri Apr 10, 2020 1:12 pm
Location: Maryland, USA

Re: High CPU Usage / Choppy live video

Post by Matts1984 »

For reference, this is what mine looks like. My hardware is obviously different but I run consistently under 10% CPU... often times under 5%
Capture.JPG
Capture.JPG (47.56 KiB) Viewed 7857 times
Blue Iris 5.8.9.x | Server 2022 VM | Xeon E5-2660 v3 @ 2.60GHz - 16 Cores | 24GB RAM | 8TB RAID | Sophos UTM WAF | Mostly various SV3C Cameras
jrferreira
Posts: 6
Joined: Mon Aug 10, 2020 3:15 pm

Re: High CPU Usage / Choppy live video

Post by jrferreira »

Thanks a lot, that is definitely a step in the right direction!

The issue, however, seems to be not on the streams themselves but on how Blue Iris is decoding them. I would say that the fact that both iSpy and AgentDVR can process the same three streams at about 10 or 15% CPU load supports that theory. Also, if I check the same three streams running in iSpy I can see that they are running at ~10 FPS (I don't think I can check the keyframe interval, though). Same thing if I open one of the streams in VLC, the codec information tells me it is 10 FPS (although again, no keyframe information).
Attachments
iSpy.jpg
iSpy.jpg (126.16 KiB) Viewed 7836 times
vlc.jpg
vlc.jpg (71.12 KiB) Viewed 7836 times
Matts1984
Posts: 496
Joined: Fri Apr 10, 2020 1:12 pm
Location: Maryland, USA

Re: High CPU Usage / Choppy live video

Post by Matts1984 »

I definitely see your reasoning there and can't argue. I don't know those other systems at all other than having heard of the name. In my experience, all the settings I mentioned are completely controlled on the camera - not in BI. If I tweak the settings on any of my cameras, I can in real-time see the stats change in that BI status window. Based on that, BI doesn't alter the incoming feed or modify it to fit a need, it accepts what is sent.

Again, I can't say why it so different with the same cameras to the other software packages but to me it would SEEM that the others in some way override the feed and modify it to a format that results in usability whereas BI takes what it's fed... and you (well I have had to) just modify what it's being fed. I could be wrong, I'm just looking at this from this side of things.

I'm not sure what kind of cameras you have but it might be worth just poking around in their GUI to see the settings. Not suggesting you change them - yet :D
Blue Iris 5.8.9.x | Server 2022 VM | Xeon E5-2660 v3 @ 2.60GHz - 16 Cores | 24GB RAM | 8TB RAID | Sophos UTM WAF | Mostly various SV3C Cameras
jrferreira
Posts: 6
Joined: Mon Aug 10, 2020 3:15 pm

Re: High CPU Usage / Choppy live video

Post by jrferreira »

Well, it gets weirder :D

I flashed a different firmware on the camera. Now, while I do have roughly 15 FPS with 1.0 keyframes, the total MP/s is even higher than before (considering that I have only one camera running).
Attachments
bi_2.jpg
bi_2.jpg (77.97 KiB) Viewed 7833 times
Matts1984
Posts: 496
Joined: Fri Apr 10, 2020 1:12 pm
Location: Maryland, USA

Re: High CPU Usage / Choppy live video

Post by Matts1984 »

Yes however BI is now seeing the resolution at 2.1 MP vs the previous at .9. So there is definitely some wonky stuff going on if it was a firmware update.

I see this is a Wyze camera. I think there have been some quirks regarding those but I could be wrong. Maybe other members can chime in. That said, the stats it's showing seem reasonable. On a previous screenshot I saw that your camera does appear to support multiple streams (ie substream). Importing that to BI - with the substream/Stream 1 being of lower resolution, allows BI to do motion detection and processing based on the lower quality stream (which is more than sufficient) and the recording for us humans maintains the higher quality. This would tick up your network load a bit, but lower CPU as processing doesn't need to be done on the higher Bitrate feed.
Blue Iris 5.8.9.x | Server 2022 VM | Xeon E5-2660 v3 @ 2.60GHz - 16 Cores | 24GB RAM | 8TB RAID | Sophos UTM WAF | Mostly various SV3C Cameras
jrferreira
Posts: 6
Joined: Mon Aug 10, 2020 3:15 pm

Re: High CPU Usage / Choppy live video

Post by jrferreira »

The previous firmware (dafang) allowed me to select the resolution of the stream and I was streaming 720p (hence the 0.9) at a fairly low bitrate. I flashed back Wyze's original firmware (the beta, with RSTP) that does only 1080p, so that's where the 2.1 MP comes from :)

Be that as it may, looking at the status in your screenshot, the increase in resolution shouldn't really account for 29.4 MP/s :D I have that with a single camera, while you have 4 cameras at roughly double the bitrate and have a third of the total MP...
This would tick up your network load a bit, but lower CPU as processing doesn't need to be done on the higher Bitrate feed.
The thing is that I am not doing any processing (no motion detection, overlays disabled, etc). I'm really just displaying the stream, heh.

Still, thanks for the inputs!
Post Reply