AI motion detection with BlueIris: an alternate approach

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67
Question: Is there a way to configure watchPattern in triggers.json to recursively check for any new jpg in any subfolders under C:\ftp?
Assuming you've mounted the ftp folder to /aiinput in Docker then something like this will probably work for the watch pattern: /aiinput/overview/OverviewPTZ/**/*.jpg. The watchPattern supports globs, but I've never tried with it so you may have to play around with it a bit.
 

actran

Getting comfortable
Joined
May 8, 2016
Messages
806
Reaction score
732
Thanks @neile for suggestion but it doesn't look like it's working based on logs:

2020-07-03T08:19:01-07:00 [Triggers] Loaded configuration from /run/secrets/triggers
2020-07-03T08:19:01-07:00 [Triggers] Loaded configuration for Sidewalk Person detector
2020-07-03T08:19:01-07:00 [Trigger manager] Unable to read contents of watch folder /aiinput/overview/OverviewPTZ/** for trigger Sidewalk Person detector. Check and make sure the image folder is mounted properly. Error: ENOENT: no such file or directory, scandir '/aiinput/overview/OverviewPTZ/**'
2020-07-03T08:19:01-07:00 [Main] Unable to access one or more watch locations.

***Attached triggers.json as txt so it will upload to this thread.

***docker-compose.yml has this:

- c:/ftp:/aiinput

Assuming you've mounted the ftp folder to /aiinput in Docker then something like this will probably work for the watch pattern: /aiinput/overview/OverviewPTZ/**/*.jpg. The watchPattern supports globs, but I've never tried with it so you may have to play around with it a bit.
 

Attachments

Last edited:

Roger

Getting the hang of it
Joined
May 30, 2014
Messages
89
Reaction score
47
Location
Bellevue, WA
Hello,
Have been playing with this on an eval version of BI to see if I want to use it. Have it working successfully except for the triggering. I keep getting these errors in the output:
trigger_1 | 2020-07-03T10:36:56-07:00 [Web request] /aiinput/Street.20200703_103655727.jpg: Calling trigger uri trigger_1 | 2020-07-03T10:36:56-07:00 [Web request] /aiinput/Street.20200703_103655727.jpg: Failed to call trigger uri : RequestError: Error: connect ECONNREFUSED 127.0.0.1:81

The same url works in a browser window locally on the machine I am running this on. Any ideas?

Thanks,
Roger
 

Roger

Getting the hang of it
Joined
May 30, 2014
Messages
89
Reaction score
47
Location
Bellevue, WA
OK, another question. Is there something I need to do to get the docker to start up again after a reboot? Restart is set to always in docker-compose.xml. Reboot the PC as a test and it didn't seem to start until I logged in. Do I need to set up auto login?
 

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67
OK, another question. Is there something I need to do to get the docker to start up again after a reboot? Restart is set to always in docker-compose.xml. Reboot the PC as a test and it didn't seem to start until I logged in. Do I need to set up auto login?
That's how I have my machine configured. It auto-logs in on reboot and then Docker starts up fine and the system comes up.
 

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67
2020-07-03T08:19:01-07:00 [Trigger manager] Unable to read contents of watch folder /aiinput/overview/OverviewPTZ/** for trigger Sidewalk Person detector. Check and make sure the image folder is mounted properly. Error: ENOENT: no such file or directory, scandir '/aiinput/overview/OverviewPTZ/**'
2020-07-03T08:19:01-07:00 [Main] Unable to access one or more watch locations.
Yeah, looks like it doesn't work. I gave it a try and had the same problem. I'd look at the camera configuration options to see if you can disable that folder structure and have it just write a flat list of images. Alternatively you might be able to get /aiinput/overview/OverviewPTZ to work as the watchPattern, but that will come with a pretty big performance penalty as the list of folders grows.
 

stk21

n3wb
Joined
Jul 5, 2020
Messages
4
Reaction score
3
Location
CO
Just wanted to reach out and say thanks. I got this up and running over the weekend with my synology surveillance station, docker on a separate linux machine, and pushover. everything works great.

Thanks
 

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67
Just wanted to reach out and say thanks. I got this up and running over the weekend with my synology surveillance station, docker on a separate linux machine, and pushover. everything works great.

Thanks
Awesome!
 

gbdesai

n3wb
Joined
May 21, 2020
Messages
19
Reaction score
3
Location
California
Current version: 5.1.0, released June 30, 2020.

A few weeks ago I came across The Hook Up's video on how to use gentlepumkin's now famous thread to set up AI motion detection with BlueIris. This sent me down the path of building a new PC, buying BlueIris, migrating all my IP cameras from Synology Surveillance Station, and getting the AI Tool up and running.
This is one fantastic package you've put together! After I spent the day putting together a setup with AI Tools following gentlepumkin instructions and Hook Up's video. This worked instantly. Got 14 cameras configured in the triggers file and turned it on.

One minor thing is that I'm getting all my telegram notifications, but only some of my pushover notifications. I checked the config and nothing seems wrong. I figured I must have misconfigured some sections, but know, it's all good.

What's the UserKeys in the trigger section for? I set my API and UserKey in the settings.json file, but seems like you have to specify something per trigger too. Not sure I'm using the right thing here.

Thanks again. Life changing package!
 

stk21

n3wb
Joined
Jul 5, 2020
Messages
4
Reaction score
3
Location
CO
This is one fantastic package you've put together! After I spent the day putting together a setup with AI Tools following gentlepumkin instructions and Hook Up's video. This worked instantly. Got 14 cameras configured in the triggers file and turned it on.

One minor thing is that I'm getting all my telegram notifications, but only some of my pushover notifications. I checked the config and nothing seems wrong. I figured I must have misconfigured some sections, but know, it's all good.

What's the UserKeys in the trigger section for? I set my API and UserKey in the settings.json file, but seems like you have to specify something per trigger too. Not sure I'm using the right thing here.

Thanks again. Life changing package!

Here is what I have in my trigger file for pushover.

"handlers": {
"pushover": {
"annotateImage": true,
"caption": "Person at Front Door {{formattedPredictions}}",
"userKeys": ["put your user key here"],
"cooldownTime": 7
},

The trigger itself is looking at 5 images every time and I didnt want all five images being sent so I set the cooldown to 7 seconds. once it sends the first pushover it will rest for 7 seconds.

The userkey and api key in the settings file is for the connection to the pushover api. the userkey in the trigger file is to actual send the message. it wouldnt work without it.
 

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67
This is one fantastic package you've put together! After I spent the day putting together a setup with AI Tools following gentlepumkin instructions and Hook Up's video. This worked instantly. Got 14 cameras configured in the triggers file and turned it on.
Glad it worked well!

One minor thing is that I'm getting all my telegram notifications, but only some of my pushover notifications. I checked the config and nothing seems wrong. I figured I must have misconfigured some sections, but know, it's all good.

What's the UserKeys in the trigger section for? I set my API and UserKey in the settings.json file, but seems like you have to specify something per trigger too. Not sure I'm using the right thing here.
Documentation for Pushover handlers is on the wiki. You need to specify the UserKey in the trigger so the system knows what user to send the notification to. In your case it's probably the same as your UserKey in settings.json, but if you wanted to send to someone else (e.g. a spouse) then you'd use their UserKey.
 

gbdesai

n3wb
Joined
May 21, 2020
Messages
19
Reaction score
3
Location
California
Glad it worked well!

Documentation for Pushover handlers is on the wiki. You need to specify the UserKey in the trigger so the system knows what user to send the notification to. In your case it's probably the same as your UserKey in settings.json, but if you wanted to send to someone else (e.g. a spouse) then you'd use their UserKey.
Yeah I did see that in the Wiki, and like I said it seems to work, just not all the time which is weird. I'll have to debug it in more detail. Again thanks!
 

gbdesai

n3wb
Joined
May 21, 2020
Messages
19
Reaction score
3
Location
California
Here is what I have in my trigger file for pushover.

"handlers": {
"pushover": {
"annotateImage": true,
"caption": "Person at Front Door {{formattedPredictions}}",
"userKeys": ["put your user key here"],
"cooldownTime": 7
},

The trigger itself is looking at 5 images every time and I didnt want all five images being sent so I set the cooldown to 7 seconds. once it sends the first pushover it will rest for 7 seconds.

The userkey and api key in the settings file is for the connection to the pushover api. the userkey in the trigger file is to actual send the message. it wouldnt work without it.

Thanks for the explanation. Makes sense. Maybe my 30 second cool down is killing some of the messages. I also have a 30 sec cooldown on telegram too. Will experiment with smaller numbers.
 

gbdesai

n3wb
Joined
May 21, 2020
Messages
19
Reaction score
3
Location
California
Masks are supported but different to AITools. Here you need to configure the zone in the triggers.json (IE "masks": [{"xMinimum": 530, "yMinimum": 230, "xMaximum": 630, "yMaximum": 290}]). I found using Paint.NET to find the coordinates of the area I wanted to mask worked well then defined them in the file.

Check out Defining masks here
Thanks for this. The docs don't show you the structure as far as I could see.

This will likely fix my masking issue!

I take it you can only have a single rectangular area?

UPDATE: Minor thing, I found "masks" failed but "mask" seemed to work and let the server start.
 
Last edited:

gbdesai

n3wb
Joined
May 21, 2020
Messages
19
Reaction score
3
Location
California
Sorry I'm posting so much, but I saw my images process on my BI machine (which is a moderately new retired gaming PC with i9 CPU) at around 1 to 1.5 seconds (these are 6K images). I just saw this on DeepStack's site...


No Windows support yet, but it's coming, seems that it could do analysis 5-20x faster. Guess it's already available for Linux. Good stuff.
 

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67
Thanks for this. The docs don't show you the structure as far as I could see.
It's shown in the table on the defining triggers page in the example column.

I take it you can only have a single rectangular area?
It's an array and supports as many rectangular areas as you like.

UPDATE: Minor thing, I found "masks" failed but "mask" seemed to work and let the server start.
The property name is "masks" not "mask". If you are having trouble getting this working open a support request over at github and include your triggers.json file and a copy of the logs.
 

gbdesai

n3wb
Joined
May 21, 2020
Messages
19
Reaction score
3
Location
California
It's shown in the table on the defining triggers page in the example column.

It's an array and supports as many rectangular areas as you like.

The property name is "masks" not "mask". If you are having trouble getting this working open a support request over at github and include your triggers.json file and a copy of the logs.
Apologies, missed it. Fixed and works great.

UPDATE: Also figured out why Pushover lost messages, images too large...
 
Last edited:

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67
Release 5.1.1 is now available:

- Relax the test for valid watchObject folders at startup. If the path has globs in it a warning will still get thrown but system startup will proceed. Resolves issue 342.

There are no breaking changes in this release. To update pull the latest image from Docker Hub and restart.
 
Top