Picture issue on notification

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
Frozn
Posts: 4
Joined: Wed Jul 05, 2023 11:33 pm

Picture issue on notification

Post by Frozn »

Hey all,
I have ZM setup with notifications pushed through to pushover but running into an issue where when multiple notifications are stacked in a short time, the photo becomes partially blocked.
The issue became apparent since I have two cameras with overlapping trigger zones, so when two cameras trigger an alarm, both notifications are sent out with either one or both photos being blocked.

Is there any way to fix the photos being sent, or maybe delay the notifications a few seconds apart?
There's no issue when notifications are separated in time, but even if the same camera triggers multiple times in a short time, it does the same thing.

Running ZM v1.36.33
Camera 1 sub stream in mocord, main stream in nodect linked to sub stream
Camera 2 sub stream in mocord, main stream in nodect linked to sub stream

zmeventnotification.ini file is still in default mode for pictures from what I can tell

Code: Select all

# BESTMATCH should be used only if you are using bestmatch for FID in detect_wrapper.sh
# objdetect is ONLY available in ZM 1.33+
# objdetect_mp4 and objdetect_gif is ONLY available
# in ZM 1.35+
picture_url = !ZMES_PICTURE_URL
picture_portal_username=!ZM_USER
picture_portal_password=!ZM_PASSWORD
Image
Image
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Picture issue on notification

Post by iconnor »

I've been tracking a similar problem, havn't found a fix yet though. Stay tuned
Frozn
Posts: 4
Joined: Wed Jul 05, 2023 11:33 pm

Re: Picture issue on notification

Post by Frozn »

Good to hear I'm not the only one.
Removing one camera, I'm also noticing that it happens occasionally even when only one camera is triggered.

Doing a little digging, I found inside pushapi_pushover.py that it tries to pull the alarm.jpg then snapshot.jpg.
Most of the pictures with no issues have been the snapshot.jpg
But the partial images that get sent out are neither the alarm.jpg or the snapshot.jpg that gets recorded in storage but rather some frame in between the two that doesn't exist outside of the .mp4 file.
It's as though it's trying to generate an additional image in the middle of the recording.
I don't know if that's any help or not, but looking forward to a fix.

Code: Select all

# ES passes the image path, this routine figures out which image
# to use inside that path
def get_image(path, cause):
    # as of Mar 2020, pushover doesn't support
    # mp4
    if os.path.exists(path+'/objdetect.gif'):
        return path+'/objdetect.gif'
    elif os.path.exists(path+'/objdetect.jpg'):
        return path+'/objdetect.jpg'
    prefix = cause[0:2]
    if prefix == '[a]':
        return path+'/alarm.jpg'
    else:
        return path+'/snapshot.jpg'
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Picture issue on notification

Post by iconnor »

snapshot gets updated everytime there is a frame with more motion. We really need locking around generating these images.
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Picture issue on notification

Post by iconnor »

I have implemented locking jpg reading/writing.. hopefully it solves this problem.

So checkout the latest 1.37 (1.37.41) and see how it goes.
Frozn
Posts: 4
Joined: Wed Jul 05, 2023 11:33 pm

Re: Picture issue on notification

Post by Frozn »

Thanks for the quick fix,
Unfortunately I am running ZM on a docker inside unraid with no update to 1.37 as far as I can see.
So I'm unable to test it at this time.
User avatar
iconnor
Posts: 2904
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Picture issue on notification

Post by iconnor »

Well I may consider merging the fixes to 1.36.34 so maybe your docker will update and get it.
Frozn
Posts: 4
Joined: Wed Jul 05, 2023 11:33 pm

Re: Picture issue on notification

Post by Frozn »

Thank you for your work.
I'll keep an eye out for updates.
Post Reply