Create GIFs from alerts & clips; Send Pushover notifications with GIF attachments [Part 1/3]

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,133
Reaction score
1,242
Location
SF Bay Area
I've developed a Powershell script that can be used to:
  • Create customized GIFs from any Blue Iris alert/clip (or DAT file if it exists), and
  • Send these GIFs as a Pushover notification attachment.
KEY POINTS: (EDIT 3/21/2024 - script update V2 fixed the limitations described in bullets 2-3)
  1. By default, this script creates GIFs by extracting JPG images from a Blue Iris Artificial Intelligence analysis DAT file (if it exists, and if it contains sufficient images).
  2. Extracting JPGs from a DAT file versus from a 'live' BVR stream sends Pushover GIF notifications in a few seconds vs 10s of seconds.
  3. The reason why is that the HTTP interface command \file\clips cannot extract JPGs while they are still buffered in an actively recording BVR stream.
  4. From my testing, JPG images cannot be grabbed from an actively recording BVR clip until the full alert duration has passed.
  5. It is worth noting that for any fully recorded alert (those showing a duration in the Clips list), GIFs can be created (manually) in just a few seconds via either method (BVR or DAT file JPG extraction).
This post is in 3 parts
  1. Quick How-to Guide
  2. Script Usage / Parameters Guide (post #2)
  3. How to 'Tune' GIFs for individual Cameras (post #3)
Demos
PART 1 - Quick How to Guide

STEP #1:


You must install ffmpeg before you can use the script

If your Blue Iris PC does not already have ffmpeg installed, then I suggest the following:​

  1. Download and install Chocolatey for Individual Use ... Installing Chocolatey
  2. Install the latest ffmpeg build by using the following command in cmd.exe. or powershell ... Builds - CODEX FFMPEG @ gyan.dev
  3. choco install ffmpeg
This method ensures that ffmeg is properly configured, that it resides in the machine's environment path, and is ready to run.​

STEP #2:

Install the script and its companion 'user settings file'

  1. Extract all the files from the attached zip file to your desktop, or scripts folder.
  2. Please note that the folder used must be in your PC's environment path.
  3. Create a root folder for this script - it will be used to process the GIF files; to archive GIF and DAT files, etc.
  4. To use the folder, you must edit a user setting in the appropriate Powershell script file (see Step #3)
NOTE: If you've never used PowerShell on your Blue Iris PC, you may first to need to change its default security policy.​
Open PowerShell in Administrator mode, and type the following, then hit the Enter key: Set-ExecutionPolicy RemoteSigned
(click here for a nice beginner's tutorial to using PowerShell).​

STEP #3:

Edit the user settings file

The user settings file is named 'BI_gif_tool_user_settings.ps1'​

  1. Open the file in a code text editor (I use Notepad++)
  2. Edit the REQUIRED variables in the USER SETTINGS section (see screenshot)
  3. Ignore the remaining settings for now. They provide customizations that you may want to explore later.
app_reqd_user_settings.png

STEP #4:

Test the script from the console

  1. Open an Admin PowerShell window, or Powershell-ISE window
  2. Select and copy the following command and paste it into a text editor (notepad is fine)
    BI_gif_tool.ps1 -UI3Rec xxxxxxxxx -Quiet
  3. Open UI3, select a camera, then select any alert that shows a duration (meaning it is done recording)
  4. Click in the UI3 browser's address bar, then select the value after the rec= argument, as in the screenshot below
    ui3_address_bar_rec_argument.png


  5. Copy the selected value to the clipboard.
  6. Return to Notepad, and paste the clipboard over the the xxxxxxxxx argument value
  7. Select the entire command, then copy/paste it to the Powershell console.
  8. Hit the Enter key.
The response should look like one of the following 2 screenshots. You should also receive your first GIF Pushover notification,​
If this camera was configured to create an AI DAT file with sufficient images, then the response will look like the 2nd screenshot​
console_demo_1.png console_demo_2.png
NOTE: The script can also be executed from an Admin cmd.exe window using a command like powershell.exe "C:\ps_scripts\{scriptname}.ps1 args"​

STEP #5:

Test on a camera Alert action set

  1. Click 'Camera settings' > Alerts tab
  2. Click 'On action..." to open the action set
  3. Create a new 'Run a program' action, and configure it as shown in the following screenshot
  4. Safe the changes.
  5. Trigger the camera - by actually walking across its FOV
on_alert_action.png

Here's the copy/paste code for the 'Parameters' field...​
Please note that the backslash (\) in the -AlertRec parameter, and the triple double quotes (""") in the -Msg parameter are ESSENTIAL.

Code:
"C:\ps_scripts\BI_gif_tool.ps1" -AlertRec \&ALERT_DB -Msg """<b>&CAM</b> &MEMO <a href='&WAN/alerts/&ALERT_DB?fulljpeg'>Hi-Res</a> <a href='&WAN/ui3.htm?rec=&ALERT_DB'>UI3</a>"""
or...​
Code:
"C:\ps_scripts\BI_gif_tool.ps1" -IgnoreDatFile -AlertRec \&ALERT_DB -Msg """<b>&CAM</b> &MEMO <a href='&WAN/alerts/&ALERT_DB?fulljpeg'>Hi-Res</a> <a href='&WAN/ui3.htm?rec=&ALERT_DB'>UI3</a>"""


and/or test on a camera Preset

  1. Click 'Camera settings' > 'PTZ/Control' tab
  2. Click 'Edit Presets..." to open the preset editor
  3. Create a new 'Run a program' action, and configure it as shown in the following screenshot
  4. The code for the 'Parameters' field is the same as above
ptz_presets_edit.png ptz_preset_action.png


STEP #6:

Configure a Camera to always create an AI 'DAT' file

  1. Click 'Camera settings' > Trigger tab
  2. Click 'Artificial Intelligence..." to open the AI dialog
  3. Configure it as shown in the following screenshot
trigger_ai_settings.png


Script Zip File
EDIT (2024-03-18 1:15p): updated to v2
PLEASE NOTE: if you are updating, you must edit & use the new user-settings-file - tip: to facilitate editing, rename the existing file before unzipping the update.
 

Attachments

Last edited:

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,133
Reaction score
1,242
Location
SF Bay Area
Create GIFs from alerts & clips; Send Pushover notifications with GIF attachments [Part 2/3]

PART 2 - Script Usage / Parameters Guide

The following is displayed when you run the script from a Powershell console.

Code:
======================================================================================================
BLUE IRIS GIF TOOL - MAKE GIFS FROM CLIPS; SEND PUSHOVER NOTIFICATIONS WITH GIF ATTACHMENT
------------------------------------------------------------------------------------------------------
Usage: BI_gif_tool.ps1 [args]
Args:  -AlertRec (or -AlertDB) [-AlertMemo -DelayPct]
        or -DbRec (or -UI3Rec) [-AlertMemo]
        or -Live -Camera [-DelayPct]
       -Seconds
       -ImagesCnt -Height -FPS
       -TrimBegPct -TrimEndPct
       -NukeDatFile
       -NoPush -NoBiLog -NoArchiveGIF
       -Quiet -Demo
Note:  WHEN USING THIS SCRIPT FROM A BLUE IRIS ACTION SET...
       use [-AlertRec \&ALERT_DB] <-- KEY POINT: a backslash (or backtick '`') prefix is ESSENTIAL
       use [-AlertMemo &MEMO]
Note:  try [-Live] with [-DelayPct <100] to experiment with reducing the delay for BVR buffering
Note:  use [-IgnoreDatFile] to ignore a DAT file, which is used by default (if it exists)
Note:  use [-DbRec] or [-UI3Rec] to make GIFs from any existing alert with a duration
Note:  use [-Seconds] to change the default GIF duration; DEFAULT is 10 sec when using [-Live],
       else it's the Alert's duration (when using [-AlertRec] or [-UI3Rec])
Note:  use [-TrimBegPct], [-TrimEndPct] make GIF from a portion of the [-AlertRec] clip
Note:  use user-setting '$gif_trim_end_custom' to customize trim based on AI labels (e.g. 'vehicle')
Note:  use [-NukeDatFile] to remove DAT file from Blue Iris storage (always archived first)
Note:  use [-NoPush] to skip notification; also disables management of GIF size to below 2.5 MB
Note:  use [-Quiet] to suppress verbose output when executed from the console; shows CLI return object
Note:  use [-Demo] to skip notification/logfile/delete actions (useful when tuning GIF params)
Returns: (json string) if successful, or (string) if failure
    * (json) is like {'result: success, data: {gif_method: viaDat, gif_kb: 497.5, ...}}
    * (string) is like 'ERR/...'
------------------------------------------------------------------------------------------------------
The following is a description (and key points) for each command line parameter...

One of the following parameters must be used
-AlertRec, -AlertDB, -DbRec, -UI3Rec, or -Live

These 2 parameters handled identically​
-AlertRec = (string) alert record, typically via Blue Iris macro &ATTACH_DB
KEY POINT: when using the Blue Iris macro &ALERT_DB with this parameter, a backslash (or backtick '``') prefix is essential
-AlertDB = (string) alert record, typically used when executing the script from the console​
These 2 parameters are handled identically​
-DbRec = (string) Blue Iris database record for clip, like 208953322
-UI3Rec = (string) first (or hyphenated) numeric values following UI3 URL argument &rec=
e.g., 'ui3.htm?rec=208953322-1181690'​
These 2 parameters must used together​
-Live = (switch) create GIF from specified camera's stream​
-Camera = (string) camera shortname (required with -Live argument)​

-AlertMemo = (string) alert AI memo, typically via Blue Iris macro &MEMO;
however, this parameter may also be used to insert artificial AI labels when tuning GIFs for an individual camera

These 3 parameters are used by the Pushover API
-Msg = [string] Pushover notification message - may contain HTML
If unspecified, the message will summarize parameters for the GIF image (height, size, duration, etc.)
-Title = (string) custom title for pushover message
If unspecified, the title is the script's name
-Priority = (integer) -2|-1|0|1|2; -2=lowest, -1=low(silent), 0=normal, 1=high-priority, 2=emergency

These 2 parameters offer management of DAT file usage;
they can also be handy when tuning GIFs for an individual camera
-IgnoreDatFile = (switch) ignores 'DAT' file (if it exists);
by default, a DAT file is always used if it contains N or more JPGs;
N is specified in the user-settings file $gif_DAT_reqd_images; the default is 4
-NukeDatFile = (switch) removes DAT file from Blue Iris storage (always archived first to '\_dat_archive\') ;
NOTE: script execution from the console also puts file in the Windows Recycle Bin

This parameter may be useful if the Blue Iris developer allows the HTTP interface command \file\clips\ to grab JPGs that are still buffered in an actively recording BVR stream (Ken has replied that this is doable - and is on his future to do list)
-DelayPct = (integer) percentage of alert's duration to wait before extracting JPGs from an actively recording clip

These 4 parameters customize the GIF
-ImagesCnt = (integer) count of JPGs to use in the GIF animation
-Height = (integer) GIF'S height dimension; units pixels
-FPS = (integer) GIF frames per second
-Seconds = [integer] GIF duration; overrides the default (the alert's duration, or 20 sec with -Live parameter)

These 4 parameters customize the GIF's duration
-TrimBegPct = (integer) percentage of alert clip to trim from GIF animation (left side)
-TrimEndPct = (integer) percentage of alert clip to trim from GIF animation (right side)
-TrimEndCust = (object) applied only when the alert 's 'memo' contains a label in user-setting $gif_trim_end_custom

The 4 parameters are switches that can be useful when 'tuning' GIFs for an individual camera
-Demo = (switch) disables sending notifications, and posting to the Blue Iris logfile
-NoPush = (switch) disables automatic Pushover notifications; NOTE: also disables management of GIF size to under 2.5 MB
-NoBiLog = (switch) disables automatic logging to the blue Iris logfile
-NoArchiveGif = (switch) disables automatic archiving of GIF files

These 2 switches manage the script's output
-Quiet = (switch) disables ALL background messaging, and all Console messaging EXCEPT warnings and return object
-RtnHashtable = (switch) returns Powershell hashtable instead of default JSON string
 
Last edited:

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,133
Reaction score
1,242
Location
SF Bay Area
Create GIFs from alerts & clips; Send Pushover notifications with GIF attachments [Part 3/3]

PART 3 - How to 'Tune' GIFs for Individual Cameras


Tips:

  1. When 'tuning' GIFs you will usually not want log the results to the Blue Iris logfile - use switch -NoBiLog
  2. To minimize output to the screen - use switch -Quiet
  3. To prevent sending a notification -NoPush or -Quiet
Key point:
Keep in mind that a slower notification delivery time is the tradeoff for GIF customizations that cannot use an alert's DAT file.

Scenarios :

(EDIT 3/31/2024 - the functionality in Scenario #1 was removed in V1.9+)
#1 - I want the faster notifications that result from creating GIFs via DAT files, but I don't want to clutter my Blue Iris Alerts folder with excessive DAT files
If you are using DAT files for the sole purpose of creating GIF files, then this desire can be accomplished by using switches -NukeDatFile, and optionally -NoArchiveDat.
Try this...
BI_gif_tool.ps1 -AlertRec \&ALERT_DB -NukeDatFile
which removes the DAT file from Blue Iris storage
Note: just in case you may want to reuse it for tuning, the DAT file is auto-archived in the script's root folder (e.g., 'D:\BI_gif_tool\_dat_archive')
or
BI_gif_tool.ps1 -AlertRec \&ALERT_DB -NukeDatFile -NoArchiveDat
which skips auto-archiving of the DAT file.

This PERMANENTLY deletes the the DAT file (Note: if you are running the command from the console, the file may still be available in the Recycle bin)

#2a - An object of interest appears in only the first few images of the GIF. How can I eliminate the empty frames?
This can be accomplished by trimming the end of the alert clip used to create the GIF.
Try this...
BI_gif_tool.ps1 -DbRec xxxxxx -IgnoreDatFile -TrimEndPct N
increase N in increments, e.g., 20, 30, 40... until you get the desired result.

#2b - Similiarly, an object of interest appears in only the last few images of the GIF.
Try this...
BI_gif_tool.ps1 -DbRec xxxxxx -IgnoreDatFile -TrimBegPct N
increase N in increments, e.g., 10, 15, 20... until you get the desired result.

#3 - I want a more video-like GIF
This can be accomplished by increasing both the number of JPGs used and the FPS.
Try this...
BI_gif_tool.ps1 -DbRec xxxxxx -IgnoreDatFile -ImagesCnt N -FPS X
increase N in increments, e.g., 10,15,20... and X in increments, e.g., 10,15,20... until you get the desired result.

#4 - I want a larger GIF (suitable for viewing on a computer or tablet)
Try this...
BI_gif_tool.ps1 -DbRec xxxxxx -Height X
increase X in increments, e.g., 500, 750, 1000... until you get the desired result.

#5 - I want higher quality GIFs in my Pushover notification, but want to limit the attachment size
Try the options in #3 & #4 above.
Monitor the GIF size in KB until you get the desired result. Size is shown in both the console output, and the Pushover notification message.

#6 - I want to dynamically reduce the empty frames from the end of my GIF based on the subject type (e.g. vehicles vs people).
This scenario can apply when your camera's field of view includes both fast and slow moving objects. The script can dynamically trim the alert based on the AI labels that appear in the alert's memo.
Try this...
BI_gif_tool.ps1 -DbRec xxxxxx -IgnoreDatFile -TrimEndCust
In the user-settings file, tweak the object variable $gif_trim_end_custom = @{} until you get the desired result.
 
Last edited:

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,133
Reaction score
1,242
Location
SF Bay Area
Create GIFs from alerts & clips; Send Pushover notifications with GIF attachments [Addendum]

TBD
 
Last edited:

scoob8000

Getting the hang of it
Joined
Dec 28, 2018
Messages
101
Reaction score
48
Location
PA
Cool. I want to play with this when I get some free time. How big are the GIF's the it produces?
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,133
Reaction score
1,242
Location
SF Bay Area
Cool. I want to play with this when I get some free time. How big are the GIF's the it produces?
GIF size depends, of course, on the number and size the JPG files used, AND the GIF -Height you specify.

For most of my cameras (2K), using 10 JPGs, and a GIF height of 320 pixels, I'm seeing GIF sizes less than 700-800 KB.
I've yet to see any over 2,000 KB.

I'll report a more refined analysis later.

EDIT:
PS - The script automatically checks the GIF's size. If the GIF exceeds the 2.5MB limit imposed by the Pushover API, it will try to remove one JPG at a time until the GIF's size conforms to the API limit.
 
Last edited:

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,133
Reaction score
1,242
Location
SF Bay Area
I should note that the script automatically logs all activity to a CSV file in the script's root folder $app_path.
The source file (DAT or BVR), GIF properties (image count, height, duration, size, etc.), and script performance times are logged.

Similar data are also logged to the Blue Iris logfile, if you've configured this in the user-settings file (setting $post_to_BI_logfile_flg).
 
Last edited:
Joined
Nov 10, 2022
Messages
4
Reaction score
1
Location
Southwest USA
This is great, thanks for all the work! I'm trying it out now and first thoughts are:
  1. Why does it need my (or "an") admin username and password? I understand that it must be necessary, but why? Looks like API calls to BI... but I'm wary putting that info in a script that I haven't fully read yet. I appreciate the well documented code though.
    Eventually I plan to create a "giftool" user and make it admin and put a lot of restrictions on it. Still, non-admin would be easier to go with.
  2. How is my pushover API key, user, device NOT among the required settings in Part 1 Step 3? You must need that, no? Looks like it has your pushover key, etc? If I test this will it send you my images? I assume this is an oversight? :lol:
  3. Your examples in Part 3 all show "BI_gif_tool.exe", but the script is just a .ps1?
In any case, this looks awesome and I can't wait to begin using it!
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,133
Reaction score
1,242
Location
SF Bay Area
This is great, thanks for all the work! I'm trying it out now and first thoughts are:
  1. Why does it need my (or "an") admin username and password? I understand that it must be necessary, but why? Looks like API calls to BI... but I'm wary putting that info in a script that I haven't fully read yet. I appreciate the well documented code though.
    Eventually I plan to create a "giftool" user and make it admin and put a lot of restrictions on it. Still, non-admin would be easier to go with.
  2. How is my pushover API key, user, device NOT among the required settings in Part 1 Step 3? You must need that, no? Looks like it has your pushover key, etc? If I test this will it send you my images? I assume this is an oversight? :lol:
  3. Your examples in Part 3 all show "BI_gif_tool.exe", but the script is just a .ps1?
In any case, this looks awesome and I can't wait to begin using it!
1. The script sends the following JSON and HTTP interface commands to the Blue Iris web server.
  • JSON cmds: login, logout, cliplist ... cliplist do not require admin credentials
  • HTTP commands: /admin/log ... this one requires admin credentials
2. You are correct. Will be fixed in V1.4. (post #1)
3. You are correct. I've fixed the typos in post #3

If you are ok with not using the Blue Iris logfile feature, a non-admin account may do it for you.

Thanks for the sharp eyes!!
 
Last edited:
Joined
Nov 10, 2022
Messages
4
Reaction score
1
Location
Southwest USA
Had some trouble but finally got it working! My problem was not enough images because I didn't add a "DoNotCancel" in the AI settings (post 1, Step #6 -- my bad).
The error handling/reporting for "not enough images" didn't work out quite right, I had to add some debugging to be able to see the error message on the console, even without -Quiet.

I added some Write-Host's to get the output circled in yellow. Otherwise I just got the errors in red, no gif files, and not much indication why.
The error lists 2/4 images, but I think it should have said 2/6 because $gif_DAT_reqd_images = 6 in the 1.5 settings file I was using?
1688142567732.png

Pushover only shows two frames in the message list and message view, on my iPhone. I had to click on the message, then click on the gif to see all 8 frames animating.
Also should the default PO priority be Emergency? I've set mine back to 0.

Thanks again for making this! I've wanted animated gifs since discovering pushover.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,133
Reaction score
1,242
Location
SF Bay Area
Had some trouble but finally got it working! My problem was not enough images because I didn't add a "DoNotCancel" in the AI settings (post 1, Step #6 -- my bad).
The error handling/reporting for "not enough images" didn't work out quite right, I had to add some debugging to be able to see the error message on the console, even without -Quiet.

I added some Write-Host's to get the output circled in yellow. Otherwise I just got the errors in red, no gif files, and not much indication why.
The error lists 2/4 images, but I think it should have said 2/6 because $gif_DAT_reqd_images = 6 in the 1.5 settings file I was using?
View attachment 166589

Pushover only shows two frames in the message list and message view, on my iPhone. I had to click on the message, then click on the gif to see all 8 frames animating.
Also should the default PO priority be Emergency? I've set mine back to 0.

Thanks again for making this! I've wanted animated gifs since discovering pushover.
Glad you got it working.

I'll add better error trapping for the condition you noted, and post V1.6 in the next day or so.
BTW, if you do update, please note that you can reuse the user settings file, so be sure you don't overwrite it when unzipping the update.

I started this project thinking GIFs would be a novelty as a Pushover attachment, but went ahead anyway because I found it an interesting challenge.
After using GIFs the past few weeks, I've found them surprisingly helpful in the following ways:
  • For rapidly discerning the path taken by an observed object - especially when it is viewed by multiple cameras.
  • For showing subsequent objects that appear just AFTER the 1st object has triggered the alert (e.g., a mail truck not triggering because a person on the sidewalk preceded it by a few moments).
  • I'm relying less on using the UI3 link in the Pushover message to view alerts; thus I'm using less data on my portable device cellular plan.
 
Last edited:
Joined
Feb 1, 2021
Messages
4
Reaction score
2
Location
Alpha Centauri
Had some trouble but finally got it working! My problem was not enough images because I didn't add a "DoNotCancel" in the AI settings (post 1, Step #6 -- my bad).
The error handling/reporting for "not enough images" didn't work out quite right, I had to add some debugging to be able to see the error message on the console, even without -Quiet.

I added some Write-Host's to get the output circled in yellow. Otherwise I just got the errors in red, no gif files, and not much indication why.
The error lists 2/4 images, but I think it should have said 2/6 because $gif_DAT_reqd_images = 6 in the 1.5 settings file I was using?
View attachment 166589

Pushover only shows two frames in the message list and message view, on my iPhone. I had to click on the message, then click on the gif to see all 8 frames animating.
Also should the default PO priority be Emergency? I've set mine back to 0.

Thanks again for making this! I've wanted animated gifs since discovering pushover.
  • I was having the same issues; however, with the exact opposite solution. When I used DoNotCancel, CP-AI would not detect anything. I tried using +real-time images starting at 3, 4, 8, 12, 50, and 999 and various analyze timings
  • With "To cancel" empty, I get the "Warning: DAT file has fewer images than required (3/4)" with any +real-time images listed above and analyze setting 100ms and above
  • This script works perfect with "To cancel" empty, +real-time @ 999, and analyze set at 50ms
@jaydeel Thanks for the script! This works great. I had a slight learning curve as I no knowledge of PowerShell (and programming), but I was able to figure out my problems such as setting environment variables to get the script recognized by PowerShell.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,133
Reaction score
1,242
Location
SF Bay Area
This script works perfect with "To cancel" empty, +real-time @ 999, and analyze set at 50ms
Thanks for the description of what is working for you.

Out of curiosity, a few questions/comments:
  1. With your settings in the last bullet, how many images are typically captured in the DAT file?
    (You can determine this by opening some DAT files… or easier, this should be indicated in your pushover notification messages by the ‘(DATx)’ label if you have user-setting $append_DAT_tag_flg=$true).
  2. How many cameras are you using the script on?
  3. I understand that every camera’s field-of-view requirements are different, but to me ‘Analyze one each’ at 50ms seems quite fast. I typically use 500 (on my driveway cams with faster moving objects) and 750 ms (for my other cams - entry, front door, gate, etc. - where people and animals are the primary objects). See the screenshot below.
  4. I’d be interested in seeing your script’s log file (BI_gif_tool.ps1.csv). Would you be willing to DM it to me?
1688914919326.png
 
Last edited:
Joined
Feb 1, 2021
Messages
4
Reaction score
2
Location
Alpha Centauri
Thanks for description of what is working for you.

Out of curiosity, a few questions/comments:
  1. With your settings in the last bullet, how many images are typically captured in the DAT file?
    (You can determine this by opening some DAT files… or easier, this should be indicated in your pushover notification messages by the ‘(DATx)’ label if you have user-setting $append_DAT_tag_flg=$true).
  2. How many cameras are you using the script on?
  3. I understand that every camera’s field-of-view requirements are different, but to me ‘Analyze one each’ at 50ms seems quite fast. I typically use 500 (on my driveway cams with faster moving objects) and 750 ms (for my other cams - entry, front door, gate, etc. - where people and animals are the primary objects). See the screenshot below.
  4. I’d be interested in seeing your script’s log file (BI_gif_tool.ps1.csv). Would you be willing to DM it to me?
View attachment 167357

1. Majority of the time I am getting about 5-6 images, highest up to 9 images.

2. I am running the script on six 4K cameras and two 2MP cameras. I am running a dedicated server with a threadripper x2950 processor, 32GB of ram, and a RTX 3060 GPU. The GPU is running both NVDEC and CP-AI. GPU maxes out at 42% utilization with 7.5GB out of 12GB VRAM in use.

3. I normally my settings at at least 250ms. That said, I am actually very impressed with 50ms. I don't know why, but my people hits have a higher percentage rating than before. This includes nighttime in a dark walkway lit up by infrared.

4. I'll send it right over to you.
 

silencery

Pulling my weight
Joined
Oct 6, 2015
Messages
223
Reaction score
153
@jaydeel

Awesome script! Thanks for putting it together!

Ran into a hiccup with forgetting to reboot the host after adjusting the environment vars, but everything else went smoothly! This is much more polished than my old pieced-together scripts for the same function (I was using scripts to convert jpg alerts into GIF).

Just one problem: I can't seem to get the priority adjusted. Any ideas what might be causing this? I've used many variations of the following, but the pushover priority always remains at emergency (2)

"G:\BlueIris\custom-scripts\BI_gif_tool.ps1" -AlertRec \&ALERT_DB -Msg """<b>Hi! Activity at the door (&MEMO)</b>""" -Title """home notification""" -Priority 0

-Priority "0"
-Priority 0
-Priority ""0""
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,133
Reaction score
1,242
Location
SF Bay Area
Just one problem: I can't seem to get the priority adjusted. Any ideas what might be causing this? I've used many variations of the following, but the pushover priority always remains at emergency (2)
It may be a bug... checking now.

EDIT: Confirmed bug. I mistyped the -Priority parameter as [string] instead of [int]. PS7 was forgiving, but PS5 was not.
When Powershell is executed in the background (e.g., from a Blue Iris Run-a-program action), scripts are executed using PS5.
When I test scripts from the Console, I'm usually using PS7. I forgot to test also in Powershell-ISE, which uses PS5.
 
Last edited:
Top