Analysis FPS dropping to 0.24

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
doubledown00
Posts: 6
Joined: Tue Oct 26, 2021 12:20 pm

Analysis FPS dropping to 0.24

Post by doubledown00 »

The problem in a nutshell:
I have two cameras that at different points in the day will drop to 0.24 Analysis FPS while still capturing at around 12 FPS. Network problems and system bottleneck causes have been crossed out. Both cameras worked fine in their old locations and configurations for over a year, problem started after they were moved. The fact that the capture and viewing FPS remains at 12 is really baffling. The fact that I can view the camera fine in the iphone App suggests the problem is strictly with how ZM is doing frame analysis. Since it works fine at night, mornings, evening, etc, is it possible direct sunlight is confusing the analysis? I have no idea.

Problem statement:
For over a year I have run zoneminder with these same four cameras with no problems. Recently I moved two camera to different positions to cover a back alley. Both are on the same power source. One faces Southeast, the other Southwest. As of right now (7:40 a.m. CST) they are all capturing fine and have been for hours.

Yesterday around 10:00 a.m. I noticed that the Southeast camera (MAF-Backcam1 in the screenshot) was missing movement. Upon further investigation the analysis FPS had dropped to 0.24. I compared the settings to it's twin (MAF-Backcam2) which was working fine. Settings were the same. After about an hour of investigation I deleted the camera, re-added, and all appeared fine.

Later in the day around 3:30 or 4:00 p.m. MAF-Backcam2 started the same. When the problem happens, it appears in the monitor that the view is stuck between two frames that keep repeating back and forth (screenshot attached). In that screenshot, the time in the upper left hand corner would cycle back and forth between 17:40:56 and 17:40:58.

By about 6:30 or 7:00 p.m. all was back to normal.

System:
Intel® Core™ i7-6700TE Processor (Quad core)
15 GB ram
2 TB SSD
Redhat Enterprise Linux 8
I was running Zoneminder 1.34 when it all started, then ran updates. Now running 1.36.8. Issue appears on both versions.

Camera config:
Ffmpeg
Modect
Analysis FPS, Maximum FPS, and Alarm Maximum FPS are all blank.
12.5%
12.5%
Video writer: Camera passthrough
Image Buffer Size: 3
Maximum Image Buffer Size: 0
Warmup Frames: 0
Pre Event Image Count: 100
Post Event Image Count: 120
Stream Replay Image Buffer: 0
Alarm Frame Count: 1

Things I have tried / checked:
System: Load average is fine. There's 4 gig of free ram. Disk read / write IOs are low (see screenshot).
Network: Pings to the camera are good.
If I open the camera on an Iphone app, video appears normal.
Deleted and re-added second camera.
Zoneminder logs don't show any errors for restarted process, trunkated frames, etc.
Other cameras continue record fine during this time.
I tried setting Analysis FPS to 5, rate still went back down to 0.24.
I tried changing the video writer to h264.
Each time when I made a configuration change and the Modect restarted, the analsys framerate would go back to 12 FPS and stay there for about 10 - 20 seconds before dropping again.
To eliminate any bandwidth variations, changed both cameras to Constant Bit Rate (were both variable).
Significantly reduced the size of the zone and selected pre-set for least quality and sensitivity.

We'll see what happens as the sun rises this morning.
Attachments
stucktimer.jpg
stucktimer.jpg (657.37 KiB) Viewed 1104 times
linuxstatus.jpg
linuxstatus.jpg (870.48 KiB) Viewed 1104 times
doubledown00
Posts: 6
Joined: Tue Oct 26, 2021 12:20 pm

Re: Analysis FPS dropping to 0.24

Post by doubledown00 »

Screenshot of what things "should" look like when working normally. Will post another when things go awry.
zoneminder-all cams working.jpg
zoneminder-all cams working.jpg (110.4 KiB) Viewed 1099 times
doubledown00
Posts: 6
Joined: Tue Oct 26, 2021 12:20 pm

Re: Analysis FPS dropping to 0.24

Post by doubledown00 »

Aaaannnnddd.....it's on!
zoneminder-cam not working.jpg
zoneminder-cam not working.jpg (94.46 KiB) Viewed 1096 times
User avatar
iconnor
Posts: 2881
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Analysis FPS dropping to 0.24

Post by iconnor »

You are using video encode? This means that the encoder cannot keep up. Try adding preset=ultrafast in encoder options.

The reason is starts out ok is that the encoder buffers a ton of frames before doing any real work.
doubledown00
Posts: 6
Joined: Tue Oct 26, 2021 12:20 pm

Re: Analysis FPS dropping to 0.24

Post by doubledown00 »

iconnor wrote: Wed Oct 27, 2021 4:24 pm You are using video encode? This means that the encoder cannot keep up. Try adding preset=ultrafast in encoder options.

The reason is starts out ok is that the encoder buffers a ton of frames before doing any real work.
If I understand you correctly, you're talking about the h.264 encoder setting.
Initial settings were using pass through. When the problem started I tried encoding as a test. When the behavior continued regardless, it was set back to pass through.
Post Reply