Optimize and train Motion Detection and DS

Joshude

Young grasshopper
Joined
Jan 5, 2021
Messages
30
Reaction score
4
Location
Germany
Hello folks,

I have 3 (and a half (Reolink)) cameras in my BI installation. All runs fine, except for the MD and DS. I've tested it after installation and with people it seems to run fine. But the installation is on a remote house with no people around most of the year. So i want to detect Deer, Moose, Bears, Foxes etc.
I can see trails of animals in the snow, but the cameras won't trigger or DS would cancel the alarm. BI has enough storage to store the clips, so i have some of them where animals were roaming the area. Is there any way to use the clips to check what BI would to and to optimize the alarm-settings?

Here are some screenshots of my settings:

2021-12-08 10_07_49-Window.jpg 2021-12-08 10_08_05-Window.jpg 2021-12-08 10_08_26-Window.jpg

There are tripwire-rules all over the area to cover everything
2021-12-08 10_11_25-Window.jpg

Thanks :)
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,871
Reaction score
48,514
Location
USA
Blue Iris is great and works with probably more camera brands than most VMS programs, but there are brands that don't work well or not at all - Rings, Arlos, Nest, Some Zmodo cams use proprietary systems and cannot be used with Blue Iris, and for a lot of people Reolink doesn't work well either.

Blue Iris and Reolinks do not work well together, but the same principles applies for almost any low end consumer grade camera. It is just Reolinks is one of the more consumer end cameras people buy and come to this site as to why it is pointed out often about. I have a cheapo camera for overview purposes so it doesn't matter, but it exhibits this same behavior even though in the settings I can set an iframe...

This was a screenshot of a member here where they had set these cameras to 15FPS within the cameras (and look some of the sub FPS were dropped to 5 and KEY of 0.25 which is a recipe for missed motion):

1638963936767.png

Now look at the key - that is the iframes ratio. Blue Iris works best when the FPS and the iframes match. Now this is a ratio, so it should be a 1.00 if it matches the FPS. The iframes not matching (that you cannot fix or change with a reolink) is why they miss motion in Blue Iris and why people have problems. This is mainly why people are having issues with these cameras and there are many threads showing the issues people have with this manufacturer and Blue Iris. It is these same games that make the camera look great as a still image or video but turn to crap once motion is introduced.

The Blue Iris developer has indicated that for best reliability, sub stream frame rate should be equal to the main stream frame rate and these cameras cannot do that and there is nothing you can do about that with these cameras... The iframe rates (something these cameras do not allow you to set) should equal the FPS, but at worse case be no more than double. This example shows the cameras going down to a keyrate of 0.25 means that the iframe rates are over 4 times the FPS and that is why motion detection is a disaster with these cameras and Blue Iris...A value of 0.5 or less is considered insufficient to trust for motion triggers reliably...we have seen people come here where the reo/BI combo missed them pulling their car into their garage, so it would probably miss your little thief LOL.

A key of 0.25 means that if the object can be in and off of your camera view in under 4 seconds, it will miss the motion. Folks have seen the key drop to 0.10 with these cams, which means if an object is not on your screen for longer than 10 seconds, it will miss the motion.

Compounding the matter even worse...motion detection is based on the substream and look at the substream FPS - they dropped down to below 6 FPS with an iframe/key rate of 0.25 - you will miss motion most of the time with that issue...DeepStack probably won't work at all...

Now compare above to mine and cameras that follow industry standards that allow you to actually set parameters and they don't manipulate them. You will see that my FPS match what I set in the camera, and the 1.00 key means the iframe matches:

1638964131845.png

Return them if you can.

Here is the unofficial thread showing all the issues folks have with Reolinks. Despite our repeated attempts to ask people to share a good quality night time motion video, as you will see, it doesn't exist. If all you care about knowing is what time something happened, then maybe these are the right cameras if the person is in the field of view long enough, but you will never be able to IDENTIFY them...

 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,871
Reaction score
48,514
Location
USA
Now with that said, the camera you are showing above is a Dahua not reolink.

You have too many IVS rules. Try just one and make it an intrusion box. Center the house in the frame so when it starts autotracking it doesn't have to pan first.

In your settings, uncheck the use mainstreams.

Are you using the whole field of view for motion - you do not show your zones.

Check the box to save Deepstack analysis so you can playback why it cancelled.

Are you using that camera for Plate Recognizer? If not, turn that off too. Clearly that image is not calibrated to read plates.
 

Joshude

Young grasshopper
Joined
Jan 5, 2021
Messages
30
Reaction score
4
Location
Germany
Okay sorry, maybe the first sentence was misleading. I have 3 Dahuas and one Reolink. Hence 3 and a half camera :) Sorry, maybe was a bad joke.
I've tried intrusion, but read here on the forums, that zig-zag tripwires work the best. So i've covered the area in tripwires. Since there can only be max 10 (or 20?, i don't remeber) points per rule i had to make multiple. But only tripwire and only covering the area where i want to get alarms.

1638964909752.png 1638965106475.png 1638965178646.png

I've unchecked the "use Mainstreams" on all 4 cameras. I'll test to deactivate motion detection and DS on the reolink, but that's not my main problem. I see tracks of animals on my pictures (see last picture, bottom right) and just want to setup motion detection and DS to work better :)
So let's not fix the reolink, as i know it might cause issues. Any tips on the Dahuas are appreciated! :)
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,871
Reaction score
48,514
Location
USA
LOL - I figured that was the case, but you never know LOL.

OK you have several issues here you have lumped into one.

Is the autotrack PTZ tracking correctly? This is independent of DeepStack.

In many instances tripwires work best and in some instances intrusion zones work best. But you should try to limit it to no more than 3 per preset. Too many and the little processor in the camera will miss motion.

Deepstack and PTZ with autotrack typically don't work well together. It is tracking, so nothing will be stationary. It is zooming in and out and that can be problematic for Deepstack.

Do you also have the camera sending you alerts outside of BI? You cannot set up 5 IVS rules and have only one of them alert you in BI - you either pull and BI acts on all of the IVS triggers or you set up zones in BI for alerts in a certain area.

Are your camera settings in the camera GUI dialed in to your field of view, or are you on auto/default settings?

Some of the wildlife you are trying to track with DS will simply be too small for many of those field of views.

In short, I think you are trying to accomplish too much with one camera.
 

Joshude

Young grasshopper
Joined
Jan 5, 2021
Messages
30
Reaction score
4
Location
Germany
Is the autotrack PTZ tracking correctly? This is independent of DeepStack.
Yes, PTZ is working fine, tested only with persons, works with cars, too!

In many instances tripwires work best and in some instances intrusion zones work best. But you should try to limit it to no more than 3 per preset. Too many and the little processor in the camera will miss motion.
Okay, i'll just give it a shot, reduce the presets and will try with intrusion vs. tripwire. Problem is, that I can't force an animal into the zone. Hence the question if it's possible to "refeed" a clip where there is an animal to check if DS would set an alarm off.

Deepstack and PTZ with autotrack typically don't work well together. It is tracking, so nothing will be stationary. It is zooming in and out and that can be problematic for Deepstack.
Had no issues so far, but i get where you're coming from. I think in the past, the camera would trigger an alarm, the alarm image was analyzed by DS and is positive would trigger. In the background, the camera was autotracking. Worked good for people and cars so far.

Do you also have the camera sending you alerts outside of BI? You cannot set up 5 IVS rules and have only one of them alert you in BI - you either pull and BI acts on all of the IVS triggers or you set up zones in BI for alerts in a certain area.
No alarms outside of BI, cameras are only setup in BI and only used through BI.

Are your camera settings in the camera GUI dialed in to your field of view, or are you on auto/default settings?
What do you mean? What camera settings in the GUI? I've setup some settings in the cameras, but are you onto something specific?

Some of the wildlife you are trying to track with DS will simply be too small for many of those field of views.
Yeah, thats for sure. The first camera was positioned a bit more to the left and zoomed in a bit and triggered on a fox, which DS recognized as a dog with more than 70%. That was okay. Most animals are larger, like deer, moose and reindeers.

Thanks so far!
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,871
Reaction score
48,514
Location
USA
In BI, you can playback a clip and left click the mouse and turn on DeepStack Analysis. It will at least show you IF it could identify anything during the playback. Keep in mind this is different than the real time analysis and it will ID anything that DeepStack recognizes whether you asked for it to identify or not. So it cannot be used to say "Why did it find it here and not during real time", but it will at least let you know if it can ID it.

As far as settings, I mean things like shutter and brightness and gain, etc. Even though we can make it out on the screen, DeepStack analyzes it differently so if in its "eyes" everything is the same contrast at the pixel level, it will miss it.

In my opinion, shutter (exposure) and gain are the two most important parameters and then base the others off of it. Shutter is more important than FPS. It is the shutter speed that prevents motion blur, not FPS. 15 FPS is more than enough for surveillance cameras as we are not producing Hollywood movies. Match iframes to FPS. 15FPS is all that is usually needed.

Many people do not realize there is manual shutter that lets you adjust shutter and gain and a shutter priority that only lets you adjust shutter speed but not gain. The higher the gain, the bigger the noise and see-through ghosting start to appear because the noise is amplified. Most people select shutter priority and run a faster shutter than they should because it is likely being done at 100 gain, so it is actually defeating their purpose of a faster shutter.

But first, run H264, smart codec off, CBR, and 8192 bitrate to start. This should make it more crisp.

I think you should also take off manual IR - your camera is low so you are getting a lot of IR bounce off the ground that is degrading the picture.

Go into shutter settings and change to manual shutter and start with custom shutter as ms and change to 0-8.3ms and gain 0-50 (night) and 0-30 (day)for starters. Auto could have a shutter speed of 100ms or more with a gain at 100 and shutter priority could result in gain up at 100 which will contribute to significant ghosting and that blinding white you will get from the infrared.

Now what you will notice immediately at night is that your image gets A LOT darker. That faster the shutter, the more light that is needed. But it is a balance. The nice bright night image results in Casper during motion LOL. What do we want, a nice static image or a clean image when there is motion introduced to the scene?

So if it is too dark, then start adding ms to the time. Go to 10ms, 12ms, etc. until you find what you feel is acceptable as an image. Then have someone walk around and see if you can get a clean shot. Try not to go above 16.67ms (but certainly not above 30ms) as that tends to be the point where blur starts to occur. Conversely, if it is still bright, then drop down in time to get a faster shutter.

You can also adjust brightness and contrast to improve the image.

You can also add some gain to brighten the image - but the higher the gain, the more ghosting you get. Some cameras can go to 70 or so before it is an issue and some can't go over 50.

But adjusting those two settings will have the biggest impact. The next one is noise reduction. Want to keep that as low as possible. Depending on the amount of light you have, you might be able to get down to 40 or so at night (again camera dependent) and 20-30 during the day, but take it as low as you can before it gets too noisy. Again this one is a balance as well. Too smooth and no noise can result in soft images and contribute to blur.

Do not use backlight features until you have exhausted every other parameter setting. And if you do have to use backlight, take it down as low as possible.

After every setting adjustment, have someone walk around outside and see if you can freeze-frame to get a clean image. If not, keep changing until you do. Clean motion pictures are what we are after, not a clean static image.
 
Top