mocord vs bulk frames, creates events of 1sec to 30mn+

Forum for questions and support relating to the 1.30.x releases only.
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

mocord vs bulk frames, creates events of 1sec to 30mn+

Post by marcmerlin »

Re-reading the docs, I'm unclear on this.
The whole point of mocord is to record frames even if there is no alert trigger, because the alert may not be sensitive enough and/or I may want to see things like the wind or sun moving or whatever doesn't otherwise trigger alerts.
However bulk is designed so that 100 frames that are the same, don't save 100 jpegs on my disk, and only save one to save me space.
However, bulk will also only record a frame every 30 to 100 or so seconds depending on my frame rate if the alert is not triggered, which means it doesn't really do what I need.
Am I correct that I need to set bulk frames to 0 and be ready for a lot more disk use if I want true mocord?
I am recording in 1080p+, so my frames seem to be around 300KB. At 1fps, that's 20MB per minute or 288GB per day per camera. Ouch, that would hurt.
So, I guess I'm either stuck with using bulk, or switching to H264 output, which is not supported by zoneminder, correct?

But if I keep things as is, I'm still confused as to how it works, please look at this:
Why do I have events as long as 36mn with 6608 frames, and then events with 1 second and 1 frame?
you can find a zoomed version here: http://www.awesomescreenshot.com/image/ ... 00b5023de3

Image
Last edited by marcmerlin on Fri Mar 16, 2018 1:12 am, edited 1 time in total.
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by marcmerlin »

Is it a fair guess to say that maybe no one but me uses mocord then? :)
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by knight-of-ni »

Because you are using mocord with a bulk frame value > 0, your system is just as dependent on accurately configured motion detection settings as modect.

When you see cases where ZoneMinder missed important information, because it was writing bulk frames, that means the motion detection did not kick ZoneMinder out of bulk frame mode (it does that by signalling a motion alarm), which gets us to the question you asked in your other thread about how to set motion detection properly.

You've been asking a lot of questions, which is certainly a good thing, but what I'd recommend is we focus purely on getting your motion detection working acceptably. Once you get that going, then lets talk about mocord and anything else. You may find you might not even need mocord at that point.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by marcmerlin »

Sorry for the late answer.
Basically I now understand that mocord doesn't really do what I wish it did, and seems poorly tested and little used.

I think you are basically all saying crank up the motion detection and deal with the flow of bad alarms for movement that is not movement I care about but enough that I get frames if I want to review later.

Does that sound more or less right?
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by knight-of-ni »

No, that is not what I'm saying. If you are claiming the motion zone is going into alarm when there is no visible activity, then that means your zones are not tuned properly.

The combination of mocord + bulk frames requires you to set and then tune your motion detection zones, no different than if you were using modetect.

Mocord works perfectly fine, but most don't use it because it simply isn't needed. The use case for mocord is to prove that no motion was occurring during a certain period of time, but you aren't using it that way. You are instead trying to use it as if it were some kind of work around to an improperly configured motion zone. That won't work, and I can see why you might be disappointed. The real fix is to tune your motion detection zones. Once your zones are set up properly, you may find you don't need to use mocord, like everyone else, but it will certainly work at this point if you wanted to use it.

Tuning your zones is not something we've talked about in detail yet so if you need help with that feel free to ask for help in the motion detection thread you created earlier.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by knight-of-ni »

Argh... it seems I'm mixing up forum users again.
When I wrote my last response, I was writing it on the assumption I had responded to your question about how to set up motion detection here:
viewtopic.php?p=105190

The only problem is that wasn't you! My apologies. I do recommend you read the response in that thread. It gives basic pointers on how to set up motion detection. Once you've your zone set up, we then need to tune the zone. It's not hard, but I can't really tell you how to do it until you can give a couple of examples w/ data of undesired events.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by marcmerlin »

Thanks for your answer. I read your other message, thanks. I'm indeed in the case of outdoor camera, wide field of view, and lots of pixels (2Mpix or more).
It's indeed challenging not to pick up the shadows that are moving due to clouds going by, branches that are moving with the wind, and still pick up an event like someone walking down the pathway but from a distance where they are only a small portion of the captured image.
There is the advanced motion capture option, but I think with 12 cameras in high def and a 4 core computer, I just don't have the horsepower to run that (blob detection).
There is no easy answer here obviously. I mistakenly thought that mocord would take care of my needs, but I now see that effectively my needs were more wishful thinking than what's reasonably doable: either ZM is recording, or it's not. Bulk frames are just a bit of a hack on a half way state, and if I turn bulk frames down to 1 (from 100), I'll end up with so much disk and file I/O that I doubt my system will handle it.
Thanks for your answers,
Marc
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by marcmerlin »

So, I put a bit more time into it, and one problem I noticed is mocord on a night camera.
At night, movement is not enough to trigger alarm.
Once the alarm has been triggered, I really wish I could have it go back in time and show frames before the alarm, which are shown as bulk right now.

Frame Id Type Time Stamp Time Delta Score
20 Normal 23:10:46 12.65 0
21 Normal 23:10:47 13.31 0
22 Normal 23:10:47 14.00 0
23 Normal 23:10:48 14.72 0
24 Normal 23:10:49 15.43 0
25 Normal 23:10:50 16.10 0
100 Bulk 23:11:39 65.95 0
110 Alarm 23:11:46 72.50 23
111 Alarm 23:11:47 73.13 17
112 Alarm 23:11:47 73.76 12
113 Alarm 23:11:48 74.44 10
114 Normal 23:11:48 75.03 0
Pedulla
Posts: 167
Joined: Thu Nov 27, 2014 11:16 am
Location: Portland, Or

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by Pedulla »

@marcmerlin,
To really dial in the Mo.Detection you will need multiple system configs that you schedule (cron) for different parts of the day. Think morning, day, dusk, night.
See Here: http://zoneminder.readthedocs.io/en/lat ... ay-or-week

Day and night, Color & IR all have different different "pixel difference" ranges and the system needs the Mo.Detection to account for that.
It's a lot of twiddling, so make sure you backup your db. ;)
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by marcmerlin »

Thanks @pedulla. I guess I can do this, but generally isn't there a setting to have ZM rewind and show a fair amount of frame before an alarm? Or once something is tagged as bulk, there is no going back and allowing to have ZM unbulk it?
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by marcmerlin »

I'm still very confused as to how bulk work and what it's doing with mocord. I'm pretty sure at this point zoneminder is buggy there, and that probably few people outside of me are using this code.

Like I have this event pool of 55 frames and 45 seconds (why was it cut that way? No idea..)

All frames are marked as normal, so they were not bulk'ed. Yet, I get 10 seconds between frames, and then it jumps from frame 25 to 55 with a 45 second jump. What's going on?

Frame Id Type Time Stamp Time Delta Score
Frames - 5076676
(frame1-19 cut out by me)
20 Normal 23:09:35 10.24 0
21 Normal 23:09:35 10.88 0
22 Normal 23:09:36 11.43 0
23 Normal 23:09:37 11.97 0
24 Normal 23:09:37 12.38 0
25 Normal 23:09:37 12.88 0
55 Normal 23:10:10 45.85 0

then the next event is exactly 2 frames. 2 frames only, really?
Frames - 5076692
Frame Id Type Time Stamp Time Delta Score
1 Normal 23:10:01 0.00 0
2 Normal 23:10:14 12.69 0

But wait, 23:10:01 < 23:10:10, so the next 2 frame only event overlaps with the previous one.

Then the next event looks like this:
Frames - 5076695
Frame Id Type Time Stamp Time Delta Score
1 Alarm 23:10:24 0.00 92
2 Alarm 23:10:24 0.10 92
3 Alarm 23:10:25 0.21 90
4 Alarm 23:10:25 0.32 88
5 Alarm 23:10:25 0.43 90
6 Alarm 23:10:25 0.65 89

6 frames, all alarm, and then it jumps to the next event that 159 frames, and after a 2mn gap, which is a big deal again.
Frames - 5076712
Frame Id Type Time Stamp Time Delta Score
1 Normal 23:12:14 0.00 0
2 Normal 23:12:15 0.48 0
3 Normal 23:12:16 1.10 0
4 Normal 23:12:16 1.51 0
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by marcmerlin »

Another bug with bulk frames.
When I go to the frame list, click on frame ID on a bulk frame, I get the frame, then I click on next, it gives me the next frame in sequence, that has been deleted.
https://host/zm/index.php?view=frame&ei ... &scale=100
https://host/zm/index.php?view=frame&ei ... &scale=100
fid 101 does not exist due to bulk:
100 Bulk 23:33:18 67.79 0
200 Bulk 23:34:30 139.66 0
249 Alarm 23:35:07 176.66 6
250 Normal 23:35:08 177.49 0

That's a minor bug, but likely another hint that hardly anyone uses mocord/bulk
Pedulla
Posts: 167
Joined: Thu Nov 27, 2014 11:16 am
Location: Portland, Or

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by Pedulla »

Sorry, I'm not much more help.
I use mocord for a 24x7 patrol ptz for 10min events. I have not used bulk frames. I just buy more drives because they are so cheap now.
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by marcmerlin »

Thanks Pedulla. So, bulk frames are on by default. Did you change the default to take bulk frames from 100 to 0?
jbg70
Posts: 19
Joined: Tue Dec 30, 2008 9:00 am

Re: mocord vs bulk frames, creates events of 1sec to 30mn+

Post by jbg70 »

It looks similar to my posts here about missing frames in bulk frames in mocord mode:
viewtopic.php?f=36&t=25510&p=97509#p97509

There also an issue opened here:
https://github.com/ZoneMinder/zoneminder/issues/1698

.... but nobody looks to be interested!
Locked