Fine tuning questions regarding Deepstack and alerts

Corvus85

Getting the hang of it
Aug 18, 2021
498
80
Australia
Hey all,

Firstly, here's my system specs:

  • Intel 11500K
  • 16GB RAM
  • 512GB PCI 3.0 M.2 SSD
  • 2TB 7200rpm HDD

I've currently got BI set up so that it records the substream continuously and only records mainstream when it detects alerts via Deepstack (continuous + alerts). So far with 2 Dahua cameras connected, it's barely scratching the CPU during normal operation (around 2-5% at idle), and RAM usage is only around 650MB.

I just have a few niggling questions that I can't seem to find answers for anywhere.

1. What are flags for? The documentation doesn't really elaborate. In the web UI, there's already a big dot next to the alert indicating if it's new or unwatched, so I don't need every alert to be flagged.

2. When analysing clips in BI using Deepstack to fine tune - why does it show several recognized objects that I haven't specified? I've only put 'person, cat, dog' in the 'to confirm' field, and nothing in 'to cancel'. They're not triggering anything, but why is Deepstack even analysing for these things? Doesn't that waste CPU resources?

3. My clips aren't starting at mainstream resolution early enough in BI. When I double click on one, it starts immediately when a person enters the frame - not 5 seconds before, like I've already set in the pre-trigger video buffer. I have my 'MAKE' time set to 0.3 seconds, and it looks like Deepstack is taking no longer than 200ms to identify objects. I want it set up so that the mainstream resolution starts recording 5 seconds before the alert happens, and reverts to substream 5 seconds after it stops detecting a person.

4. I understand that when continuous recording, alerts are just like bookmarks that point to a specific time. However, the player doesn't automatically stop after the alert is over. It just keeps playing through the rest of the substream recording. Is there any way to get the clips to behave more like actual clips and have them STOP when the alert is over? If I can somehow get the timeline to only show the timespan of the alert, as opposed to showing the entire timeline of the continuous recording, that would be amazing too.

5. In UI3, whenever I hover my mouse on a clip, the popup thumbnail is HUGE - it takes up the entire browser width. Is there a setting to make this popup smaller?

Thanks for any help.
 

Attachments

  • Screenshot 2022-01-04 140813.jpg
    Screenshot 2022-01-04 140813.jpg
    64.1 KB · Views: 42
  • Screenshot 2022-01-04 140837.jpg
    Screenshot 2022-01-04 140837.jpg
    63.6 KB · Views: 44
  • Screenshot 2022-01-04 140906.jpg
    Screenshot 2022-01-04 140906.jpg
    55.5 KB · Views: 44
  • Screenshot 2022-01-04 140930.jpg
    Screenshot 2022-01-04 140930.jpg
    82.3 KB · Views: 42
  • Screenshot 2022-01-04 141008.jpg
    Screenshot 2022-01-04 141008.jpg
    38.3 KB · Views: 40
  • Screenshot 2022-01-04 141052.jpg
    Screenshot 2022-01-04 141052.jpg
    64.1 KB · Views: 39
  • Screenshot 2022-01-04 141520.jpg
    Screenshot 2022-01-04 141520.jpg
    74.7 KB · Views: 39
1. Flags usually prevent an alert from being deleted.

2. Analyzing with DS after the fact is significantly different from the real time detection. When using analyze it will "detect" every object in the scene that it can possible recognize. If you want to see what actually happened during realtime detection you need to save the dat files and drag them into the DS window of the console. You already have that box checked and the dat files are in the alerts folder or the folder you're storing the continuous recordings in, I forget which at the moment.

3. I'd suggest a reboot to see if that cures the pre-trigger time being too short since it is configured for five seconds. You also want to set the "break" time to 5 seconds on the trigger tab of the camera configuration in BI. You currently have it set to 30 seconds.

4. On my system, BI will continue to play alerts until it hits a long "dead" time between alerts plus the break time is quite long at 30 seconds. I think that is what you may be seeing.

5. In UI3 you've got me there. Maybe @bp2008 can offer some advice.

You don't need to redact local IP addresses, we all use the same ranges and they are "public". The only IP that needs to be redacted is the WAN IP for the BI server itself.

I'd also suggest using motion detection, zones, rather than object detection. It can reduce false triggers significantly. Most people only use object detection in BI to filter major scene lighting changes for that very reason.
 
1. Flags usually prevent an alert from being deleted.

Ok, so how do I turn them off? I eventually want them to be deleted when the drive is full.


3. I'd suggest a reboot to see if that cures the pre-trigger time being too short since it is configured for five seconds. You also want to set the "break" time to 5 seconds on the trigger tab of the camera configuration in BI. You currently have it set to 30 seconds.

Already rebooted. Same thing.
Why would I change it to 5 seconds? I already had that before, but it was creating far too many clips. For example, when I have a delivery driver turn up at the door, they're normally standing still for longer than 5 seconds while I walk to the door. Also, when I have contractors working in my backyard, I want fewer, longer clips to get as much mainstream recording as possible. Right now, the mainstream recording is stopping EXACTLY when the moving object as identified by deepstack has moved out of the frame. I want it to last 5 seconds longer than that, and begin 5 seconds before it comes into the frame.

What would you suggest given this criteria?


4. On my system, BI will continue to play alerts until it hits a long "dead" time between alerts plus the break time is quite long at 30 seconds. I think that is what you may be seeing.

I doubt it's the break time. Check this out. This is how the timeline looks when I double click on a 1min 22sec clip in my alerts. It spans 1 hour in total. Why is this happening?
1641348522225.png


I'd also suggest using motion detection, zones, rather than object detection. It can reduce false triggers significantly. Most people only use object detection in BI to filter major scene lighting changes for that very reason.

I'm using all three. Isn't this the best practice to reduce false triggers? For some reason, when I was only using motion detection, Deepstack wouldn't detect blatantly obvious people in well-lit areas, regardless of how small I set the object size or how low I set the min. contrast. Any suggestions?
 
To get rid of flagged alerts simply uncheck the "flagged confirmed alerts" on the AI tab of the camera. You currently have that checked.

If you want all high resolution don't use sub streams.

Mixing object detection and motion detection will result in too many false triggers, short triggers and probably other trigger problems. As I said, most use motion triggers quite successfully. I use motion detection and have none of the problems you are encountering. I also use DS to filter any false triggers that may occur. Clips work as expected with the changeover from sub to main stream occurring as the action enters the scene. You could try shutting off DS for a little while and testing to see if the switch to main stream occurs when you really want it to. If there's nothing moving in the scene main stream isn't particularly important, at least to me. I suspect your clip is an hour because the camera is triggered by object detection for an hour. Something is making BI trigger for that long. Does the camera show activity like that in the console? What does UI3 show for the length of that clip?
 
If you want all high resolution don't use sub streams.

No, you're misunderstanding. Please pay attention.
I want the mainstream recording to kick in from the first 5 seconds before the detected movement till 5 seconds after the last detected movement as identified by Deepstack. Currently when I open an alert, the clip starts immediately when a person enters the frame, and then keeps playing far beyond any person leaves the frame and beyond the alert length, as I've shown in the timeline screenshot above.

How do I fix this? Surely this can't be difficult to achieve.

As I said, most use motion triggers quite successfully.

Ok. That doesn't really help me though. Why is it that in well-lit areas, even though the scene is detecting motion when I go back and analyze with motion detector, that deepstack isn't picking up a person, no matter how small I set the min. object size or contrast?

I use motion detection and have none of the problems you are encountering.

Ok that's great. I don't see how that helps me though. I need suggestions.

I also use DS to filter any false triggers that may occur.

As explained, I already use DS.

If there's nothing moving in the scene main stream isn't particularly important, at least to me.

Ok, I see your point. But the clips still aren't starting 5 seconds before detection - substream or mainstream. How do I fix this?


I suspect your clip is an hour because the camera is triggered by object detection for an hour.

The way I understand it is that if I enable Deepstack, it shouldn't matter if there's object detection happening, because it will only confirm the alert and generate a clip on AI detection. Isn't this correct?

Does the camera show activity like that in the console?

I'm not sure what you mean. You mean the status window? What/where am I looking for such activity? And how?

What does UI3 show for the length of that clip?

Exactly the same thing as BI.
 
Keep in mind that the "Analyze with Deepstack" under "Testing & Tuning" will ALWAYS perform better than live as it is after the fact and should not be used as an analysis tool to try to figure out why it didn't see a car or person. It should only be used to see what DeepStack can find in that clip, like "hmm I wonder if DeepStack can find a toothbrush" and then walk around with a toothbrush and have it identify it. I can run this on a camera not using Deepstack and it will show EVERYTHING that Deepstack has in its objects to find that it sees in the clip. This method will show you EVERY ITEM deepstack searches for.

You need to use the .DAT file analysis that shows how DeepStack responded and behaved live. You have to select it under AI for the camera to check the Deepstack analysis option. Only then can you start to figure out why it it is behaving like it is or missing something.

Deepstack works best if you have a zone identified, even if it is the whole image as Zone A. You are not using the zones (the box isn't checked), but instead you are using the object detection.

Without some video and screenshots of your field of view and associated settings, hard to say, but a common issue is people using object detection the wrong way. Uncheck the boxes in the trigger that says it has to move so many pixels and uncheck the reset box.

These two features are used to try to prevent false triggers, and you have have opposite going on. Only use these if you have too many false triggers. None of my cameras use those features. Of course they are field of view dependent and YMMV.

Change it from Continuous + Alerts to Continuous + Triggers and you may get your pre and post buffer.
 
  • Like
Reactions: Corvus85
You have to select it under AI for the camera to check the Deepstack analysis option. Only then can you start to figure out why it it is behaving like it is or missing something.

Do you mean 'Save DeepStack analysis details'? If so, I've already got it checked.
So I just have to drag the .dat file into the 'deepstack' tab in the status window to see what it actually detected?

Deepstack works best if you have a zone identified, even if it is the whole image as Zone A. You are not using the zones (the box isn't checked), but instead you are using the object detection.

Thanks, this is new information to me. I haven't read this anywhere in the help file or anywhere else. Would've saved a lot of trouble if it was. So I should turn off object detection and just tick 'use zones', even if the whole frame is a zone?

Change it from Continuous + Alerts to Continuous + Triggers and you may get your pre and post buffer.

Okay, interesting. Can you expand on that? I mean why would that work vs. continuous + alerts?
Sorry for the noob questions.


Also is there any advice you could give for the other questions in my OP?
 
Yep. I usually open the Deepstack tab and then minimize that box and then play the clip I am interested in and hit pause and then go back to that DeepStack tab. Saves me from having to find the actual .DAT tab.

Yep, turn off object detection as it relates to moves so many pixels and reset if after a certain size. Instead put A in for the Zone crossing. If you decide to use more than one zone to try to knock out so many triggers to deepstack, always have Zone A as the whole screen and then use simple instead of edge.

Triggers will start the moment there is motion. Alerts, depending on your setup and how long it takes deepstack to analyze may be resulting in your pre and post not working correctly, or it is a bug thinking it is an ONVIF trigger so it isn't recording the pre and post.

Also, in the camera itself, do the FPS and iframes match? You can look at the BI camera status page under KEY and if the KEY is less than 1.00, that will contribute to missed motion as well.
 
Triggers will start the moment there is motion. Alerts, depending on your setup and how long it takes deepstack to analyze may be resulting in your pre and post not working correctly, or it is a bug thinking it is an ONVIF trigger so it isn't recording the pre and post.

But won't this mean that it'll create a clip for EVERY trigger - regardless of whether or not it's confirmed by DeepStack??


Also, in the camera itself, do the FPS and iframes match? You can look at the BI camera status page under KEY and if the KEY is less than 1.00, that will contribute to missed motion as well.

Yep. there's one iframe for every 15 seconds, and both mainstream and substream are set to 15fps in the camera settings and BI settings. So what else could it be?

Also, how do I fix this nonsense?
1641354862385.png

This is a 15 min timeline for a 1min, 33 second clip. When I open the alert, it starts precisely when motion starts (instead of 5 seconds before like I want it to), and then after the clip ends (as denoted by the end marker), it just continues playing.

These timelines can easily be an hour long. In fact, considering this example is the latest alert, every time I open it, the timeline gets longer, the longer I leave it.
 
It already creates a clip for every cancelled trigger, you just have the box checked to not show them on your timeline. Go to the cancelled alerts and you will see all the cancelled clips. Try it and see if it gives you what you are looking for. Most here use Cont+triggered.

One iframe for every 15 seconds with a 15 FPS would mean the iframes is set to 225. I do not think you meant that?

You fix the motion to having zones and that will go a long way towards fixing it.

It should just continue playing as you are recording continuously. The alert is just like a tag or bookmark, so when you start playing an alert clip, it will continue after the clip ends. Change it to just recording on alerts, but then it will just jump to the next alert with a block of time missing when there wasn't motion.
 
It already creates a clip for every cancelled trigger, you just have the box checked to not show them on your timeline. Go to the cancelled alerts and you will see all the cancelled clips. Try it and see if it gives you what you are looking for. Most here use Cont+triggered.

Yeah I know that. But I mean won't 'cont+triggered' lead to every trigger showing up as a confirmed alert, even if not confirmed by deepstack??

One iframe for every 15 seconds with a 15 FPS would mean the iframes is set to 225. I do not think you meant that?

Sorry, I meant one iframe for every 15 frames.

It should just continue playing as you are recording continuously. The alert is just like a tag or bookmark, so when you start playing an alert clip, it will continue after the clip ends. Change it to just recording on alerts, but then it will just jump to the next alert with a block of time missing when there wasn't motion.

I get that it's recording continuously (that's what I want), but isn't there a way to only play the alert and have it stop at the end of the alert?

Also, why does the alert only start the instant a person is detected, but not 5 seconds before like I want it to?
 
Have you made any of the suggested changes we have mentioned or are we going to keep going around in circles with questions on why the pre trigger isn't working LOL?

NO, cont+triggered will only show up as a confirmed alert if you are using deepstack.

I know the end of the alert stops when it goes from mainstream to substream.

As I have said, let's change the cont+alerts to cont+triggered and see if that fixes your pre trigger.

Are you recording direct-to-disc and not messed that up changing the encoding? That can affect the pre and post buffers as well.

If you have done everything we mentioned above and it still isn't working, then there is a bug in your camera and it would be best to delete the cam in BI and add it again fresh.
 
Have you made any of the suggested changes we have mentioned or are we going to keep going around in circles with questions on why the pre trigger isn't working LOL?

Yeah I have. No change. I just went outside to trigger the camera and the timeline is still growing wayyyyy past the alert clip, and the thing just keeps playing through. It also shows about a minute before the recording, although the alert clip itself is still starting the instant I walked into the frame, and not 5 seconds before like I want it to.
1641357265972.png

To further illustrate what I mean. Here's what the timeline shows for the same alert when I play it again after writing the above paragraph:
1641357403108.png

It keeps getting longer, and longer, and longer.

Surely there's a way to have it STOP playing at the end of the alert??

As I have said, let's change the cont+alerts to cont+triggered and see if that fixes your pre trigger.

It didn't. As you can see above, there's always an arbitrary long length of time before the start frame of the alert (it's always different. Can be several minutes to an hour), but when I click the alert clip, it starts precisely when a person walks into the frame, and not 5 seconds before, like I want it to.

Are you recording direct-to-disc and not messed that up changing the encoding? That can affect the pre and post buffers as well.

Here's my settings for the record and encoding tabs.

1641357581516.png

1641357590992.png

If you have done everything we mentioned above and it still isn't working, then there is a bug in your camera and it would be best to delete the cam in BI and add it again fresh.

I've done this multiple times, and it's happening on both of the cameras I have connected.

Any suggestions?
 
Last thing to try would be to uncheck the high definition box under the motion detection options.

After that, your settings are like mine and mine works as intended.
 
After that, your settings are like mine and mine works as intended.

Can you show me a screenshot of your timeline when you open an alert? Does it behave like mine does? And does it start playing precisely when a person is identified, or does it start playing a few seconds before that you've specified?

And does yours stop playing after the alert is finished? Or does it continue playing through the continuous substream recording?

It's ridiculous that it continues playing as the timeline keeps growing, because it means it's impossible to scrub within older alerts because the start and end markers get closer and closer together. Come on, there must be SOME way to stop this from happening. I can't be the only one seeing this behaviour.

FYI, this is what my clips are showing.

1641359441437.png
 
Last edited:
When I play an alert clip, it begins playing at the beginning of the pre-buffer.

But like we have said, you set yours up using features most don't under motion detection like checking the high definition box and using object detection without zones, so maybe with deepstack, those functions are not working as you think they should - those were all features originally in Blue Iris to try to knock out false triggers, so maybe some double negative is going on using those AND deepstack.

Your behavior of the clips is normal. Here is one of mine when I play a clip:

1641372473461.png

So the beginning of the blue line on the far left indicates the beginning of the BVR file. The green triangle is the beginning of this clip and the red is the end of this clip. If I let it run all the way through, the blue progress status line will go all the way to the far right.

Yours keeps growing because you have not checked the cut and combine box under record. Change that to 1 hour and each BVR file will only be one hour in length and will not grow once that BVR file is stopped and a new one is created. And then your start/stop will not get closer together as time goes on. Right now, your BVR file just continues to get larger and larger and thus the start/stop get closer together as that timeline increases.

When I select an alert clip to play, I see the motion and when either the video switches from mainstream to substream OR I see the blue line above goes past the red triangle, I know that alert is done. All you do then is select the next alert image to the left if you wanna see the next alert - that is how you scrub through the alerts. That part is working as intended. This playback view will not show multiple start/stops for each alert, that is what the timeline below this is for, as well as the postage stamp alert images to the left.
 
Last edited:
  • Like
Reactions: Corvus85
But like we have said, you set yours up using features most don't under motion detection like checking the high definition box and using object detection without zones, so maybe with deepstack, those functions are not working as you think they should.

I've followed your recommendation and disabled those, but it makes no difference to the pre-buffer playback position.

Yours keeps growing because you have not checked the cut and combine box under record. Change that to 1 hour and each BVR file will only be one hour in length and will not grow once that BVR file is stopped and a new one is created. And then your start/stop will not get closer together as time goes on. Right now, your BVR file just continues to get larger and larger and thus the start/stop get closer together as that timeline increases.

Ok thanks! That's a really good explanation and helpful advice! I've changed that now - although it still doesn't solve the problem I'm having where the alert doesn't start playing 5 seconds before the person walks into the frame - is that how yours behaves?
 
Mine works as intended and the alert clip starts at the beginning of my prebuffer.

Maybe try under add to alerts list - change it from hi rez images to database only. Maybe that is causing the delay. Hi rez images for the thumbnail alert image is overkill and is again one of the feature you are using that may be interfering with what you want accomplished. You can always get higher quality jpeg for that under the record option and select the jpeg box.
 
Ok MAJOR PROBLEM.

Now that it's night, I'm not getting ANY CONFIRMED ALERTS on one of my cameras - even when the porch lights are giving excellent light - it's just not detecting any persons, despite the fact that they are within 5 feet of the camera and moving across the frame.

Even when I pause the cancelled clip when a person is in the frame and open the status window, nothing shows in the Deepstack tab - it's blank.

This is what the logs say:

1641376684133.png

Help???