Fine tuning motion for outdoor camera

Forum for questions and support relating to the 1.31.x releases only.
Locked
dinki
Posts: 8
Joined: Wed Sep 19, 2018 6:32 pm

Fine tuning motion for outdoor camera

Post by dinki »

OS: Linux omv 4.17.0-0.bpo.3-amd64 #1 SMP Debian 4.17.17-1~bpo9+1 (2018-08-27) x86_64 GNU/Linux
ZM version: v1.31.47 running in Docker containter (
Camera: ieGeek Wifi Wireless Security Camera Outdoor IP Camera (https://www.amazon.com/gp/product/B01JLZKSD8/)

ZM Settings
General:
Source Type->Ffmpeg
Function -> Modect
Max FPS-> 5
Alarm Max FPS-> 5
Reference Image Blend % ge -> 3.125%
Alarm Reference Image Blend % ge -> 3.125%

Camera Settings:
Resolution-> 1280x720
Bit rate-> 512 kbps
Max Frame rate-> 3
Key frame interval-> 10
Variable bit rate

I've managed to get ZM up and running and it seems to be fantastic! I am having issues with getting motion detect working well though. I've read through the manual, wiki and other posts (https://wiki.zoneminder.com/index.php/U ... r_Dummies?), but still am not getting the desired results.

I've set modified my zone to exclude portions that I do not want to be triggered:

Image

This reduced the detect area to 70% of the frame rather than 100%

I've tried fast and best presets for high sensitive and neither are triggering well. Occasionally it will catch a car going down the road. I was watching and saw the mail truck arrive at my mailbox while another car passed it on the side and a person walking a dog was all in the zone and ZM did not trigger.

I've tried twiddling with the presets trying to get the sensitivity better. Here's the settings I'm using now:

Image

Can someone tell me what I might be doing wrong? Thanks for your time and patience.
dinki
Posts: 8
Joined: Wed Sep 19, 2018 6:32 pm

Re: Fine tuning motion for outdoor camera

Post by dinki »

Well it seems my settings may be working a bit better after all. I'm now getting captures but it's mostly the trees/bushes blowing in the wind. I'm guessing if I twiddle with something in the settings it will decrease that sensitivity. Can someone tell me where the best modifications should be made?

In reviewing my captures, I noticed some that had this weird green throughout portions of the frame. Here's an extreme case:

Image

What might be causing this? Is this the same green screen as mentioned here https://wiki.zoneminder.com/Doing_your_ ... SP_streams

Also, I'm noticing some ghosting in another capture:

Image

I've captured my logs in case that can help diagnose https://pastebin.com/2GfKmmyq
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Fine tuning motion for outdoor camera

Post by knight-of-ni »

1) Do not rely on the presets for outdoor cameras. Plan on configuring the motion settings by hand for every outdoor camera.

2) Assuming the objects of interest are on the ground, don't point your camera at the sky. Assuming you want to capture the cars in the street, lower the camera's field to the level of the soffit on the house on the left. Even though you have currently excluded the upper portion from motion detection, that upper portion will still affect how the camera adjusts to changing light levels (sun, moon, that street light, etc), and that will indirectly affect how well motion detection works.

3) Only after completing the previous step, exclude your shrubberies from motion detection. You can do this by carefully creating active zones that do not include the shrubberies, or just create one big active zone and add inactive zones around the shrubberies. See: https://wiki.zoneminder.com/Defining_Zones

4) Recommend you set your ref image blend % to 12. Setting it too low, like you have it set now, tends to create events that never end, especially when the camera is outdoors.

5) Search the forums for the infamous ffmpeg smearing problem. We get the same question every week. Seems you found one of the links that talks about it so just do what it says. The first thing to do is set your transport to TCP. In addition, increase the rate at which key frames are sent. In your camera, change the key frame interval from 10 to 3, so that you get a new key frame approx every second.

6) Setting your pixel threshold low is good for initial testing purposes because that will cause zoneminder to generate motion statistics for virtually everything. That will give you an idea of how many pixels are changing when the trees blow, for example, which allows you to set your Alarm Areas to a value a little bigger then that. Normally, I run a pixel threshold of about 20 everywhere. That usually works for me.
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: Fine tuning motion for outdoor camera

Post by knight-of-ni »

One other thing, I recall Wide Dynamic Range (WDR) setting on cheaper cameras can also be a source of ghosting or smearing around moving objects. If the camera in question has this setting, either lower the value or turn it off. The side effect to this is areas in the shadows will be under exposed. You may have to strike a balance.
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/
dinki
Posts: 8
Joined: Wed Sep 19, 2018 6:32 pm

Re: Fine tuning motion for outdoor camera

Post by dinki »

Thanks for the tips. This is fantastic! I was able to set up my zones around the bushes/trees so that should be good now.

The only other thing that I'm struggling with is clips that are too short. I'm seeing videos of cars passing on the road that stop when I know the car continued down the road and then out of frame. I'm not sure why this is happening as I'm sure that motion has continued. I've tried increasing my post event image count in the hopes of extending the clips but I'm still seeing the 'action' truncated.

I'll keep digging on this one, but ZM is very close to replacing Blue Iris for my needs and I'll soon be able to power down that windows box. Thank you for your help and guidance.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Fine tuning motion for outdoor camera

Post by knight-of-ni »

See the documentation about the image buffers.
https://zoneminder.readthedocs.io/en/st ... uffers-tab

You need to set a pre-event buffer and a post event buffer.
The values are in frames. I usually go with 5 seconds pre and 5 post so do the maths to convert seconds to frames using the frame rate of your camera. Also keep in mind the overall image buffer must be greater than the pre event buffer. This is all in the documentation.
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: Fine tuning motion for outdoor camera

Post by knight-of-ni »

Once your buffers are set, then that's when you should start lowering the Min Area fields until you capture the events you are looking for.
This is a tuning process that will often require you to strike a balance. Making things really sensitive will record cards going down the street but it will also cause false triggers when the wind blows, light level changes, weather changes, etc.

Oh, and while it is somewhat easier to work in % area, changing your units to pixels will give you a lot finer control.
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/
dinki
Posts: 8
Joined: Wed Sep 19, 2018 6:32 pm

Re: Fine tuning motion for outdoor camera

Post by dinki »

Thanks again for these tips and explaining these things to me. ZM is REALLY powerful and I'm actually enjoying discovering how to best use it. I am using percent right now and will try to wrap my head around using it in pixel mode. All the best to you.
bmbrady77
Posts: 1
Joined: Mon Sep 02, 2019 2:18 pm

Re: Fine tuning motion for outdoor camera

Post by bmbrady77 »

Sorry for resurrecting an old thread, but it seems that this thread is a top google hit concerning this issue. In light of that, and for any others that come across this thread trying to figure out how to best set motion parameters for outdoor cameras, I too have struggled with this for the last few days and have since figured out a decent way to tame this beast...

I apologize in advance if this has been suggested already in another thread. For me, the best balance of capturing what I want with minimal false alarms was achieved by using blobs, and setting the units to pixels. To find out the exact area (in pixels) to set for blob area, view the camera image at actual size, and then use a screen capture (I use OSX shit+CMD+4) and draw the smallest square that you woud want to detect in the image. From there, you can see the actual size in pixels of your desired area for that image, and use those dimensions to properly set the area.

This seemed to be the key to getting things fine tuned for me. Hope this helps anyone else that happens across this thread...
Locked