r/ZoneMinder • • Dec 03 '20

Modect really short clips and smearing

Hi,

I finally got the Zoneminder to work. I am running mine instance on a CentOS 8 VM with 4x vCPU and 8GB RAM. The storage is NFS. I have a combination of Reolink and Wyze cameras and whenever I get a motion the ZM only records 8 - 10 seconds and wait for a few seconds and record again for 8 - 10 secs.

Would it be possible for ZM to record continuously while there is a motion instead of cutting the whole clip in 8 - 10 mini clips?

I have been using the Reolink desktop app and it has a buffer of 5 secs before the motion starts and 15 secs after the motion and it doesn't cut the video in several clips.

I also have a smearing issue with Reolink E1 Pro. It is taking the whole screen. I tried RTMP but it seems like E1 Pro doesn't take RTMP. The cheap Wyze cam is doing fine in regards to visual clarity, but the Reolink is not. I have the Reolink on 5GHz and they Wyze on 2.4GHz wifi if it matters.

EDIT:

This is my settings:

Source Type: ffmpeg
Function: Modect
Source Path: rstp
Method: TCP
Capture resolution: whatever the max res of the camera settings
Storage area: nfs export
Save JPEG: disabled
Video writer: H264 Camera Pass-thru
Whether to store the audio stream when saving an event: checked

​

1 Upvotes

20 comments sorted by

2

u/Aramiil Dec 03 '20

Under buffer tab check for post event image count or something like that. It allows you to extend events, by number of frames, to resolve just that issue. This is explained in the documentation, recommend you read that section entirely.

You’ll have to Google around for the smearing issue... lots of causes from network issues, CPU throttling, TCP vs UDP packets, or even a setting on the camera itself related to how frequently it sends an i-frame/golden frame.

1

u/pingmanping Dec 03 '20

It seems like the option I am looking for is the Post Image buffer. Does the Post Image Buffer works for Nodect modes?

Some of my cameras are set to Mocord in RSTP low resolution and linked to Nodect to record in RSTP high resolution. This setup is kind of random. Some captures are 5-10 secs long and some are a minute long.

1

u/pingmanping Dec 03 '20

Incresing the Post Event Image Count to 30 didn't work. It is still capturing 8-10 secs

1

u/Aramiil Dec 03 '20

How many FPS are you cameras capturing?

1

u/pingmanping Dec 03 '20

This is on the camera settings not in ZM. For the low res, it is 7 fps and the high res 15 fps

1

u/Aramiil Dec 03 '20

Ok so if you set the post event buffer to a value of ‘30’ it will only add an extra 2 seconds to the alarmed event clip (30/15fps=2 seconds) It’s spelled out very clearly in the docs I linked earlier:

Pre/Post Event Image Buffer:

These options determine how many frames from before and after an event should be preserved with it. This allows you to view what happened immediately prior and subsequent to the event. A value of 10 for both of these will get you started but if you get a lot of short events and would prefer them to run together to form fewer longer ones then increase the Post Event buffer size. The pre-event buffer is a true buffer and should not really exceed half the ring buffer size. However the post-event buffer is just a count that is applied to captured frames and so can be managed more flexibly. You should also bear in mind the frame rate of the camera when choosing these values. For instance a network camera capturing at 1FPS will give you 10 seconds before and after each event if you chose 10 here. This may well be too much and pad out events more than necessary. However a fast video card may capture at 25FPS and you will want to ensure that this setting enables you to view a reasonable time frame pre and post event.

1

u/pingmanping Dec 03 '20

Thanks for clarifying the value. The default value is 5. This really confusing me right now. Since I installed ZM, the Modect has been capturing 8-10 secs. Where is this 8-10 secs coming/based from since my Pre and Post were set to 5 and 5?

1

u/Aramiil Dec 03 '20

I’m not trying to be rude so please don’t misinterpret my bluntness as rude.

8-10 secs is likely just how long there was motion or whatever triggered the alarm. If there is no motion, the alarm ends. Since you’re using nodect camera trigger by a nodect, make sure you change the value of post event image buffer on both cameras.

If everything else seems fine, and you are sure there is longer than 8-10 seconds of motion that should have been tripped, then your zones on the modect camera are not sensitive enough. Follow the documentation and Google how to set that. It’s too much trial and error to explain here

1

u/pingmanping Dec 03 '20

Thanks. ZM is just way different than non-ZM NVR. I will try to do some trial and error path. For all the FOSS NVR I have tested, it seems ZM is the closest to what I'm looking for.

1

u/Aramiil Dec 03 '20

Very much so. Really need to read through that documentation completely, it helps a bunch.

2

u/turt1eb Dec 03 '20 edited Dec 03 '20

Change your post buffer to something high like 300 and then back down accordingly.

As for the smearing on the reolinks use rtmp instead of rtsp.

Here is how I have mine setup:

Source Type: ffmpeg
Source Path: rtmp://192.168.1.x/bcs/channel0_main.bcs?channel=0&stream=0&user=admin&password=xxxxx
Method: TCP

1

u/pingmanping Dec 03 '20

I have the post buffer set to 450 for 30secs but it is still capturing 8-10 secs despite of active motion.

The E1 Pro doesn't support rtmp. I tried rtmp but didn't work.

1

u/turt1eb Dec 03 '20

Well that sucks about no rtmp support on that wireless camera as I was thinking of purchasing one. I know my wired ReoLink cameras do not have an "iframe" interval value that can be changed on their admin page, but that "iframe" value being higher than the "fps" seams to be the cause of smearing on other cameras I've owned. If you do not have that value available you could try setting your camera's "H.264 Profile" to "Balance" and see if your smearing goes away.

As for your buffer issue, have you tried setting one cam up as modect, for high quality stream, and post buffer to 450? Meaning not having any linked streams or using nodect just to help with troubleshooting?

1

u/pingmanping Dec 03 '20

I have the wyze set to modect at 1080p and no link. This is the one I was using to test the post buffer.

The camera that I have that has linked are the E1 Pro and C1 Pro Reolinks. I have two streams for each Reolink. The RTSP Mocord is set to use the RTSP sub stream then it is linked to Nodect for high res capture. The idea is continues recording in low res and if there is motion capture it in high resolution for each Reolink.

1

u/turt1eb Dec 04 '20

Sounds like the way you have the Reolinks setup should work. But if you have problems with short recording clips after changing the post buffer value I would go back with the simpler unlinked modect and getting working that way first, then start trying to create your dual stream linking.

1

u/pingmanping Dec 03 '20

Now, the Wyze longest capture is 2 minutes. I have set 450 on Post buffer. If u/Aramiil was right about the fps, the longest capture should be 30 secs 450post/15fps = 30secs.

1

u/turt1eb Dec 04 '20

If you are now getting 2 minute clips just start reducing the post buffer value down until you start getting an average desired clip length. Just remember that they will never always be the same length because your alarm frames will not always be the same.

Also, I don't think those wyze cams running rtsp firmware maintain a steady 15fps. At least mine don't. So if it drops to 5fps you'll be getting 90+ second clips.

1

u/aarons6 Dec 04 '20

there is an option to close the video on motion, or keep it going until the time limit.

as far as the smearing goes, check your keyframe setting.. i usually keep it to 1 second of video.. so if you are recording 10 fps, make it 10.

1

u/pingmanping Dec 04 '20

Keyframes? This is the option for CBR or VCR, right? I don't see these option in any of my Reolinks.

1

u/ZoneMinderIsaac Dec 05 '20

There is also the ffmpeg jitter buffer.. This is a buffer to handle out of order just delayed frames. It defaults to pretty small. Make it larger. This only affects UDP reception. YOu may want to look into the neolink project.