Ok, here's a possible solution
How to Create Thumbnail & Leading Edge JPEG Image Files from a Camera's Most Recent Alert
Purpose: These
Blue Iris 'Action set' actions create alert *.jpg files that may be uploaded by the Pushover API.
The files are created via these Blue Iris HTTP commands:
http://192.168.1.3:8600/thumbs/@400613452
... database thumbnail
http://192.168.1.3:8600/file/clips/@400613452.bvr
... leading edge trigger image (from clip)
Instructions: The method may seem a bit kludgy, but it gets the job done.
It requires four, maybe five, 'Alert' tab 'On alert' actions.
In essence, it
dynamically creates and executes two PowerShell scripts.
#1 is a
'Write to a file' action that creates a PowerShell script that replaces '@' character with '%40' in the URLs in the script created by action #2.
#2 is a
'Write to a file' action that creates a PowerShell script that executes the above mentioned Blue HTTP interface commands and saves the JPEGs to the hard disk.
#3 is a
'Run a program' action that executes the script in action #1.
#4 is an
OPTIONAL delay if needed...
so far I've had success without using a delay.
#5 is a
'Run a program' action that executes the script in action #2.
The details for actions 1,2,4 & 5 follow...
Screenshots:
Code:
Note: I've attached the code as a text file. This will make it easier to edit the path for the scripts and *.jpgs to match your system.
Code:
Action #1 - PS Script #1
File: D:\Blue Iris\Snapshots\replace_text.ps1
Parameters: $path = "D:\Blue Iris\Snapshots\grab_images.ps1"\n$word = "@"\n$replacement = "%%40"\n$text = get-content $path \n$newText = $text -replace $word,$replacement\n$newText > $path
Action #2 - PS Script #2
File: D:\Blue Iris\Snapshots\grab_images.ps1
Parameters: Invoke-WebRequest &LAN/file/clips/&ALERT_DB.bvr -OutFile "D:\Blue Iris\Snapshots\&CAM_leading_edge.jpg"\nInvoke-WebRequest &LAN/thumbs/&ALERT_DB -OutFile "D:\Blue Iris\Snapshots\&CAM_thumbnail.jpg"
Action #3 - Run script from Action #1
File: powershell.exe
Parameters: -File "D:\Blue Iris\Snapshots\replace_text.ps1"
Action #5 - Run script from Action #2
File: powershell.exe
Parameters: -File "D:\Blue Iris\Snapshots\grab_images.ps1"
BTW - the double percent entry in action #2 is not a typo... Blue Iris will interpret %40 as one of its numbered macros. A double '%%' is required to create a literal percent character.
When your camera triggers, you should see the following files
======
If you've never run PowerShell scripts on your system before...
then you may need to enable execution before the actions #3 & #5 will work.
Follow the instructions here:
How to enable execution of PowerShell scripts?
=====
EDIT #1: To simplify things, you can opt to NOT include action #1 after the utility script 'replace_text.ps1' has been created the first time.
Recreating it every time has the benefit of avoiding failure of the action set should the script ever be deleted.
I've attached a copy of the utility script if you'd prefer to add it to the folder yourself, and thus avoid adding task #1 to each camera.
=====
EDIT #2 (2/22): It just dawned on me that it might be preferable to
use a Blue Iris macro to store the path used for the scripts & images, as this makes the tasks easier to mange in the future, should you change drives or folders. Note that
if you do this, you should not use the method in Edit #1.
I've attached rev1 of this text file 'actions_fields.rev1.txt'. It uses Blue Iris macro %900.
To create this macro, use the steps previously shown in
post #73:
1. Execute this command from your browser. Replace my webserver address with yours.
http://192.168.1.3:8600/admin?macro=900&text=
2. Open 'regedit.exe'.
3. Navigate to registry key Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Perspective Software\Blue Iris\Macros.
4. Double-click reg key %900 and paste in your current path, like 'D:\Blue Iris\Snapshots'.