Page 1 of 2

Same event stored twice

Posted: Sat Nov 02, 2024 12:39 am
by eracc
I am not sure what I have done to get this result, but each of my modect events are storing twice under my new storage location. Where do I need to look to fix this?
Screenshot at 2024-11-01 16-33-03.png
Screenshot at 2024-11-01 16-33-03.png (155.53 KiB) Viewed 3346 times

Re: Same event stored twice

Posted: Sun Nov 03, 2024 2:55 pm
by Quantum
Let's see your monitors. (Console)

Re: Same event stored twice

Posted: Sun Nov 03, 2024 6:04 pm
by eracc
Here is the console.
Screenshot at 2024-11-03 09-03-15.png
Screenshot at 2024-11-03 09-03-15.png (76.77 KiB) Viewed 3224 times

Re: Same event stored twice

Posted: Sun Nov 03, 2024 6:08 pm
by eracc
Before you ask, here are the zones. ;)
Screenshot at 2024-11-03 09-07-10.png
Screenshot at 2024-11-03 09-07-10.png (773.71 KiB) Viewed 3223 times

Re: Same event stored twice

Posted: Sun Nov 03, 2024 9:19 pm
by iconnor
I think what is happening is that your camera has a large keyframe interval. We always have to start a recording with a keyframe, so we have to rewind in the queue till we find one. I think we are going back to the same start keyframe as event 1.

Maybe increase the minimum event length, or decrease you keyframe interval in the camera.

Re: Same event stored twice

Posted: Mon Nov 04, 2024 6:11 pm
by eracc
Thanks for the reply! I decreased the key frame interval on the camera to match the frame rate. It was larger than the maximum frame rate, which may mean you have a good point here. :) I will report back.

Re: Same event stored twice

Posted: Sun Nov 10, 2024 8:15 pm
by eracc
Unfortunately nothing I did would fix the doubling of events. So I deleted Monitor-1 to recreate the camera setup again with a new Monitor, but now my log is filling up with an error about monitor 1, which of course no longer exists:

Code: Select all

"2024/11/10 - 11:04:36 AKST",zmdc,,59498,ERR,"'zmc -m 1' exited abnormally, exit status 255",zmdc.pl,'-
"2024/11/10 - 11:04:36 AKST",zmc_m1,,101349,ERR,"No monitors found",zmc.cpp,214
"2024/11/10 - 11:04:36 AKST",zmc_m1,,101349,ERR,"Can't use query result:",zm_monitor.cpp,903
"2024/11/10 - 11:04:36 AKST",zmc_m1,,101349,ERR,"Bogus number of lines return from query, 0 returned for query SELECT `Id`, `Name`, `ServerId`, `StorageId`, `Type`, `Function`+0, `Enabled`, `DecodingEnabled`, `LinkedMonitors`, `AnalysisFPSLimit`, `AnalysisUpdateDelay`, `MaxFPS`, `AlarmMaxFPS`,`Device`, `Channel`, `Format`, `V4LMultiBuffer`, `V4LCapturesPerFrame`, `Protocol`, `Method`, `Options`, `User`, `Pass`, `Host`, `Port`, `Path`, `SecondPath`, `Width`, `Height`, `Colours`, `Palette`, `Orientation`+0, `Deinterlacing`, `DecoderHWAccelName`, `DecoderHWAccelDevice`, `RTSPDescribe`, `SaveJPEGs`, `VideoWriter`, `EncoderParameters`, `OutputCodec`, `Encoder`, `OutputContainer`, `RecordAudio`, `Brightness`, `Contrast`, `Hue`, `Colour`, `EventPrefix`, `LabelFormat`, `LabelX`, `LabelY`, `LabelSize`,`ImageBufferCount`, `MaxImageBufferCount`, `WarmupCount`, `PreEventCount`, `PostEventCount`, `StreamReplayBuffer`, `AlarmFrameCount`, `SectionLength`, `MinSectionLength`, `FrameSkip`, `MotionFrameSkip`, `FPSReportInterval`, `RefBlendPerc`, `AlarmRefBlendPerc`, `TrackMotion`, `Exif`,`RTSPServer`, `RTSPStreamName`,`SignalCheckPoints`, `SignalCheckColour`, `Importance`-1 FROM `Monitors` WHERE Id=1.",zm_db.cpp,154
What do I do to clean that up?

What I have tried:
  • Searching the Wiki for deleting a monitor - no joy (maybe I just missed it)
  • Restarting ZM - no joy
  • Running zmaudit.pl - no joy

Re: Same event stored twice

Posted: Sun Nov 10, 2024 10:49 pm
by iconnor
I don't know why it didn't auto-stop the dead monitor, but just restart zoneminder

Re: Same event stored twice

Posted: Mon Nov 11, 2024 3:36 pm
by eracc
As I noted above, I did restart ZM. I just now did a full stop then start and am still getting this error:

Code: Select all

"2024/11/11 - 06:32:06 AKST",zmdc,,59498,ERR,"'zmc -m 1' exited abnormally, exit status 255",zmdc.pl,'-
"2024/11/11 - 06:32:06 AKST",zmc_m1,,104839,ERR,"No monitors found",zmc.cpp,214
"2024/11/11 - 06:32:06 AKST",zmc_m1,,104839,ERR,"Can't use query result:",zm_monitor.cpp,903
"2024/11/11 - 06:32:06 AKST",zmc_m1,,104839,ERR,"Bogus number of lines return from query, 0 returned for query SELECT `Id`, `Name`, `ServerId`, `StorageId`, `Type`, `Function`+0, `Enabled`, `DecodingEnabled`, `LinkedMonitors`, `AnalysisFPSLimit`, `AnalysisUpdateDelay`, `MaxFPS`, `AlarmMaxFPS`,`Device`, `Channel`, `Format`, `V4LMultiBuffer`, `V4LCapturesPerFrame`, `Protocol`, `Method`, `Options`, `User`, `Pass`, `Host`, `Port`, `Path`, `SecondPath`, `Width`, `Height`, `Colours`, `Palette`, `Orientation`+0, `Deinterlacing`, `DecoderHWAccelName`, `DecoderHWAccelDevice`, `RTSPDescribe`, `SaveJPEGs`, `VideoWriter`, `EncoderParameters`, `OutputCodec`, `Encoder`, `OutputContainer`, `RecordAudio`, `Brightness`, `Contrast`, `Hue`, `Colour`, `EventPrefix`, `LabelFormat`, `LabelX`, `LabelY`, `LabelSize`,`ImageBufferCount`, `MaxImageBufferCount`, `WarmupCount`, `PreEventCount`, `PostEventCount`, `StreamReplayBuffer`, `AlarmFrameCount`, `SectionLength`, `MinSectionLength`, `FrameSkip`, `MotionFrameSkip`, `FPSReportInterval`, `RefBlendPerc`, `AlarmRefBlendPerc`, `TrackMotion`, `Exif`,`RTSPServer`, `RTSPStreamName`,`SignalCheckPoints`, `SignalCheckColour`, `Importance`-1 FROM `Monitors` WHERE Id=1.",zm_db.cpp,154
Next suggestion, please. :)

Re: Same event stored twice

Posted: Tue Nov 12, 2024 12:38 pm
by iconnor
The only thing I can think of would be if there was a rogue process left behind. CHeck for two zmdc.pl or two zmwatch.pl in ps | grep zm

sudo zmdc.pl status

Will tell us if the currently talking zmdc thinks it should be running zmc -m 1. To stop it we can do sudo zmdc.pl stop zmc -m 1. But something else like zmwatch.pl might restart it.

Re: Same event stored twice

Posted: Tue Nov 12, 2024 3:32 pm
by eracc
Thanks for the hints. I should have thought to check the process list myself. Doh!

For clarity this is a FreeBSD 13.4-RELEASE system. I ran top and watched the www user processes, which is nginx and ZoneMinder, then stopped ZoneMinder and nginx. Imagine my surprise to find several ZoneMinder zombie processes still running, including six zmc processes for two cameras :D, and showing up in top after both services were stopped. Now I know why the CPU load seemed higher than it should be. ;)

To "fix" it, at the CLI where I logged in as root, I used:

Code: Select all

pkill -U www
That got rid of all the remaining processes except for php-fpm, whcih respawned new processes on new PIDs. I am guessing that is normal at this point and just left those. Then I restarted ZoneMinder and nginx to see what popped up. Looks "normal" in top now and only showing two zmc processes for two cameras, which is what I expect.

It appears the service zoneminder stop and service zoneminder restart on the FreeBSD port are not completing a stop of the previous processes for ZoneMinder. Now that I know that, I can make sure I use stop and verify the processes are gone before I start the service again.

Re: Same event stored twice

Posted: Tue Nov 12, 2024 3:50 pm
by eracc
For future me, and anyone else needing this info, make sure these services are up and running on the FreeBSD port:
  • mysql-server
  • fcgiwrap
  • php_fpm
  • nginx
  • zoneminder
There should be one zmc process per enabled camera.

Re: Same event stored twice

Posted: Tue Nov 12, 2024 7:22 pm
by iconnor
Hmm... I may try to find some time to look into this. All processes are managed by zmdc and should kill them all. Perhaps something is different on freebsd.

Re: Same event stored twice

Posted: Tue Nov 12, 2024 7:40 pm
by eracc
Well, since FreeBSD is not Linux, it is definitely different from Linux. All of the base tools installed with the base OS are not GNU. Only add-in packages from ports may be GNU. For example the pkill in FreeBSD base is BSD licensed and has different switches than the pkill used in many Linux distributions. So that is one difference.

Re: Same event stored twice

Posted: Tue Nov 12, 2024 8:29 pm
by iconnor
I took a quick look and the init script just wraps zmpkg.pl which should be fine. I did some start/stops and all the processes started/died appropriately... so not simple to replicate.