Analysis creates 10 sec events

Current Development version likely to have breaking changes
Post Reply
jrtaylor71
Posts: 16
Joined: Mon Oct 10, 2022 3:15 pm

Analysis creates 10 sec events

Post by jrtaylor71 »

Zonemider 1.37.40, 15 ip cameras, all set to 10fps, i frames at 20, resolution at 960 to 2k, all using h264 pass through, no jpeg storage and stored as mp4.

As soon as analysis is turned on CPU usage and memory goes very high, even with one camera, and starts to create events evry 10 to 30 seconds.

Any ideas?
jrtaylor71
Posts: 16
Joined: Mon Oct 10, 2022 3:15 pm

Re: Analysis creates 10 sec events

Post by jrtaylor71 »

So I figured out what is going on but not sure how to fix it. When analysis is on it creates a new event each time there is an alarm frame. In past versions you would only have 1 event file.

Is there a way to go back to the old way with only 1 event file?
User avatar
burger
Posts: 434
Joined: Mon May 11, 2020 4:32 pm

Re: Analysis creates 10 sec events

Post by burger »

I think I'd recommend simply running 1.36, the stable release instead.

Though this is the first I've heard of such an error.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
jrtaylor71
Posts: 16
Joined: Mon Oct 10, 2022 3:15 pm

Re: Analysis creates 10 sec events

Post by jrtaylor71 »

I could never get 1.36 to work properly. Always had very high CPU usage and would use up all the memory of the server. I am ok with 1.37 as I am not having those problems. It records properly and load is about 5 to 7 most of the time with memory usage at 10Gig. I have been using zm long before IP camera's were a thing and USB camera's were just being introduced.

Here is what the event look like.

Code: Select all

	
Event 15811
	15811	Event-15811
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:37:13 AM CDT	6/2/23, 8:42:00 AM CDT	00:04:47	2875	5	5	1	1	Default	37.06MB
	
Event 15827
	15827	Event-15827
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:41:58 AM CDT	6/2/23, 8:42:35 AM CDT	00:00:36	363	57	78	1	3	Default	4.99MB
	
Event 15831
	15831	Event-15831
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:42:34 AM CDT	6/2/23, 8:44:14 AM CDT	00:01:39	999	3	3	1	1	Default	13.13MB
	
Event 15835
	15835	Event-15835
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:44:12 AM CDT	6/2/23, 8:44:23 AM CDT	00:00:10	103	14	14	1	1	Default	1.80MB
	
Event 15837
	15837	Event-15837
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:44:22 AM CDT	6/2/23, 8:44:35 AM CDT	00:00:12	123	13	13	1	1	Default	2.04MB
	
Event 15838
	15838	Event-15838
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:44:34 AM CDT	6/2/23, 8:44:55 AM CDT	00:00:21	213	33	33	1	1	Default	3.09MB
	
Event 15845
	15845	Event-15845
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:44:54 AM CDT	6/2/23, 8:45:09 AM CDT	00:00:14	151	14	14	1	1	Default	2.31MB
	
Event 15849
	15849	Event-15849
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:45:08 AM CDT	6/2/23, 8:45:19 AM CDT	00:00:10	107	14	17	1	3	Default	1.78MB
	
Event 15850
	15850	Event-15850
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:45:18 AM CDT	6/2/23, 8:45:48 AM CDT	00:00:29	301	40	44	1	2	Default	4.24MB
	
Event 15853
	15853	Event-15853
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:45:48 AM CDT	6/2/23, 8:46:23 AM CDT	00:00:34	349	57	57	1	1	Default	4.82MB
	
Event 15854
	15854	Event-15854
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:46:22 AM CDT	6/2/23, 8:46:34 AM CDT	00:00:11	117	14	14	1	1	Default	1.91MB
	
Event 15855
	15855	Event-15855
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:46:32 AM CDT	6/2/23, 8:47:06 AM CDT	00:00:33	335	53	53	1	1	Default	4.53MB
	
Event 15857
	15857	Event-15857
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:47:04 AM CDT	6/2/23, 8:47:24 AM CDT	00:00:20	203	15	15	1	1	Default	2.96MB
	
Event 15858
	15858	Event-15858
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:47:24 AM CDT	6/2/23, 8:47:39 AM CDT	00:00:15	151	25	25	1	1	Default	2.27MB
	
Event 15861
	15861	Event-15861
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:47:38 AM CDT	6/2/23, 8:48:07 AM CDT	00:00:28	287	29	29	1	1	Default	3.99MB
	
Event 15864
	15864	Event-15864
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:48:06 AM CDT	6/2/23, 8:50:06 AM CDT	00:01:59	1201	21	21	1	1	Default	15.41MB
	
Event 15877
	15877	Event-15877
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 8:50:06 AM CDT	6/2/23, 8:50:49 AM CDT	00:00:43	433	2	2	1	1	Default	5.80MB
	
Event 15885
	15885	Event-15885
	FrontDoorOutside	Continuous
	6/2/23, 8:50:48 AM CDT	6/2/23, 8:55:48 AM CDT	00:05:00	3004	1	1	1	1	Default	38.41MB
	
Event 15907
	15907	Event-15907
	FrontDoorOutside	Continuous
	6/2/23, 8:55:48 AM CDT	6/2/23, 9:00:48 AM CDT	00:05:00	3004	0	0	0	0	Default	38.17MB
	
Event 15926
	15926	Event-15926
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 9:00:48 AM CDT	6/2/23, 9:04:52 AM CDT	00:04:04	2449	6	6	1	1	Default	31.29MB
	
Event 15942
	15942	Event-15942
	FrontDoorOutside	Continuous
Motion: All
	6/2/23, 9:04:51 AM CDT	6/2/23, 9:05:26 AM CDT	00:00:34	351	3	3	1	1	Default	4.73MB
jrtaylor71
Posts: 16
Joined: Mon Oct 10, 2022 3:15 pm

Re: Analysis creates 10 sec events

Post by jrtaylor71 »

Camera config

Code: Select all

*************************** 1. row ***************************
                        Id: 1
                      Name: FrontDoorOutside
                   Deleted: 0
                     Notes: 
                  ServerId: 0
                 StorageId: 1
            ManufacturerId: 26
                   ModelId: 27
                      Type: Ffmpeg
                  Function: Monitor
                 Capturing: Always
                 Analysing: None
            AnalysisSource: Primary
             AnalysisImage: YChannel
                 Recording: Always
                   Enabled: 0
           DecodingEnabled: 1
                  Decoding: Always
              JanusEnabled: 0
         JanusAudioEnabled: 0
    Janus_Profile_Override: 
   Janus_Use_RTSP_Restream: 0
           Janus_RTSP_User: NULL
Janus_RTSP_Session_Timeout: 0
            LinkedMonitors: NULL
                  Triggers: 
         EventStartCommand: 
           EventEndCommand: 
                 ONVIF_URL: 
            ONVIF_Username: 
            ONVIF_Password: 
             ONVIF_Options: 
      ONVIF_Event_Listener: 0
          ONVIF_Alarm_Text: 
           use_Amcrest_API: 0
                    Device: 
                   Channel: 0
                    Format: 0
            V4LMultiBuffer: NULL
       V4LCapturesPerFrame: 1
                  Protocol: NULL
                    Method: rtpRtsp
                      Host: NULL
                      Port: 
                   SubPath: 
                      Path: rtsp://192.168.55.68:554/11
                SecondPath: NULL
                   Options: NULL
                      User: NULL
                      Pass: NULL
                     Width: 1280
                    Height: 960
                   Colours: 4
                   Palette: 0
               Orientation: ROTATE_0
             Deinterlacing: 0
                   Decoder: libx264
        DecoderHWAccelName: NULL
      DecoderHWAccelDevice: NULL
                 SaveJPEGs: 0
               VideoWriter: 2
               OutputCodec: 0
                   Encoder: libx264
           OutputContainer: mp4
         EncoderParameters: 
               RecordAudio: 0
           RecordingSource: Primary
              RTSPDescribe: 0
                Brightness: -1
                  Contrast: -1
                       Hue: -1
                    Colour: -1
               EventPrefix: Event-
               LabelFormat: 
                    LabelX: 0
                    LabelY: 0
                 LabelSize: 2
          ImageBufferCount: 3
       MaxImageBufferCount: 121
               WarmupCount: 0
             PreEventCount: 5
            PostEventCount: 5
        StreamReplayBuffer: 0
           AlarmFrameCount: 3
             SectionLength: 300
         SectionLengthWarn: 0
          MinSectionLength: 10
                 FrameSkip: 0
           MotionFrameSkip: 0
          AnalysisFPSLimit: 2.00
       AnalysisUpdateDelay: 0
                    MaxFPS: NULL
               AlarmMaxFPS: NULL
         FPSReportInterval: 100
              RefBlendPerc: 12
         AlarmRefBlendPerc: 6
              Controllable: 0
                 ControlId: NULL
             ControlDevice: MainProfileToken
            ControlAddress: NULL
           AutoStopTimeout: NULL
               TrackMotion: 0
                TrackDelay: NULL
            ReturnLocation: -1
               ReturnDelay: NULL
           ModectDuringPTZ: 0
               DefaultRate: 100
              DefaultScale: 0
              DefaultCodec: auto
         SignalCheckPoints: 0
         SignalCheckColour: #0000be
                 WebColour: #617244
                      Exif: 0
                  Sequence: 1
                 ZoneCount: 1
                   Refresh: NULL
                  Latitude: NULL
                 Longitude: NULL
                RTSPServer: 0
            RTSPStreamName: 
                Importance: Normal
              MQTT_Enabled: 0
        MQTT_Subscriptions: 
User avatar
burger
Posts: 434
Joined: Mon May 11, 2020 4:32 pm

Re: Analysis creates 10 sec events

Post by burger »

Ok, so it's not necessarily an issue of 1.36 or 1.37. Although 1.36 is not going to update as much, so I would still lightly recommend that. If you are not going to update 1.37, though you can go with that.

You are running 1280x960, and you mentioned you have analysis enabled. A few ideas:

1) Did you update from an earlier ZM? There are some settings that have changed from 1.34 to 1.36. You could try a reinstall of fresh 1.36 or 1.37.

2) You can limit the framerate of analysis.
but more importantly,
3) It 'is' common to see a computer unable to keep up with ZM. In this case, there is a limitation of CPU and or memory. With 10 at least 960p cameras, you will need some power. Like a decent server CPU, maybe 8 actual cores. That is with record. If you are doing mocord or modect, you might need even more power. However, you can do mocord on a lower res stream, and then just record the high res stream (disable analysis & decoding), and that is what I would recommend.

To put it simply, every time in my experience when I've seen ZM not able to make 10 minute events, it's been due to not enough CPU (but make sure memory isn't maxed out in htop). That all being said, you mentioned that this occurs even with 1 camera. In that case, I would recommend a quick reinstall, if you had upgraded from 1.34 or earlier. Starting with a fresh DB would be best, for this error to make sure it's not the... I forget the setting now, but there was one referring to maybe buffer frames, and if you had upgraded from 1.34 or 1.32 to 1.36, it would be too high (this may have been fixed during the update script, though).
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
jrtaylor71
Posts: 16
Joined: Mon Oct 10, 2022 3:15 pm

Re: Analysis creates 10 sec events

Post by jrtaylor71 »

Clean install of 1.37 with new database. Did not reinstall OS (Ubuntu 20.04 LTS). This is in a vm on an HP DL360P gen 8 with 128GB memory, 2 node cluster back by a 50TB NAS with 10GB redundant links (This is my personal home system). I had the vm set to 38 cores and 96GB of ram and it locked up the vm but this only happened because I had both encoder and decoder on with analysis.

Only problem I am having is it creates varying lengths of events when there is motion.
dougmccrary
Posts: 1322
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Analysis creates 10 sec events

Post by dougmccrary »

Perhaps Options->Config?
Screenshot 2023-06-05 at 23-11-53 ZM - Options.png
Screenshot 2023-06-05 at 23-11-53 ZM - Options.png (10.08 KiB) Viewed 2524 times
jrtaylor71
Posts: 16
Joined: Mon Oct 10, 2022 3:15 pm

Re: Analysis creates 10 sec events

Post by jrtaylor71 »

Thank you, that fixed it. Is this a new feature? If not the old default must have been time.
dougmccrary
Posts: 1322
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Analysis creates 10 sec events

Post by dougmccrary »

It's been there for a looong time. The default may have changed though. I rarely do a full fresh install.
Post Reply