ZoneMinder / zmeventnotification

Machine Learning powered Secure Websocket & MQTT based ZoneMinder event notification server
408 stars 128 forks source link

live notifications only sending image, not animation #396

Closed RussH closed 3 years ago

RussH commented 3 years ago

Event Server version 6.1.24

Hooks version (if you are using Object Detection) app:6.1.24, pyzm:0.3.48

Are you using MLAPI? (Y/N) N

The version of ZoneMinder you are using: 1.34.26-bionic2 amd64 [installed]

What is the nature of your issue Bug/Question. (one of Bug, Enhancement, Question)

Details

Upgraded to current zmeventnotification, and have enabled live notifications to zmninja on an iPhone. However only the static image preview is sent as a notification, not the video. I can see the mp4 is created, I can play it with no issues on vlc. Ownership on the directory is good; www-data:www-data

Debug Logs (if applicable)

Important: Please post DEBUG logs NOT INF logs. Instructions on how to enable debug logs are posted HERE

zmesdetect_m1 log showing mp4 created fine.

06/02/21 16:14:42 zmesdetect_m1[14519] DBG2 image_manip.py:106 [animation: Grabbing Frame:101]
06/02/21 16:14:42 zmesdetect_m1[14519] DBG2 image_manip.py:106 [animation: Grabbing Frame:105]
06/02/21 16:14:42 zmesdetect_m1[14519] DBG2 image_manip.py:106 [animation: Grabbing Frame:109]
06/02/21 16:14:42 zmesdetect_m1[14519] DBG2 image_manip.py:106 [animation: Grabbing Frame:113]
06/02/21 16:14:42 zmesdetect_m1[14519] DBG2 image_manip.py:106 [animation: Grabbing Frame:117]
06/02/21 16:14:43 zmesdetect_m1[14519] DBG1 image_manip.py:112 [animation: Saving /var/cache/zoneminder/events/1/2021-06-02/42453/objdetect...]
06/02/21 16:14:43 zmesdetect_m1[14519] DBG1 image_manip.py:115 [Creating MP4...]
06/02/21 16:14:44 zmesdetect_m1[14519] DBG1 image_manip.py:120 [animation: saved to /var/cache/zoneminder/events/1/2021-06-02/42453/objdetect.mp4, size 807423 bytes, frames: 23]
06/02/21 16:14:44 zmesdetect_m1[14519] DBG1 zm_detect.py:545 [Closing logs]
from secrets.ini - URL configuration
secrets.ini:ZMES_PICTURE_URL=https://myurl.net/zm/index.php?view=image&eid=EVENTID&fid=objdetect&width=600
from cake_error.log
I can see some errors relating to the api;

Request URL: /zm/api/groups/associations.json?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjIyNjM2OTk3LCJleHAiOjE2MjI2NDQxOTcsInVzZXIiOiJydXNzaCIsInR5cGUiOiJhY2Nlc3MifQ.2gdWJolAzY_jUP8PbUJc312hTsJHg3XYpK0OtMt-e7A
Stack Trace:
#0 /usr/share/zoneminder/www/api/app/Plugin/Crud/Lib/CrudControllerTrait.php(31): Controller->invokeAction(Object(CakeRequest))
#1 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(193): AppController->invokeAction(Object(CakeRequest))
#2 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke(Object(GroupsController), Object(CakeRequest))
#3 /usr/share/zoneminder/www/api/app/webroot/index.php(117): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#4 {main}
2021-06-02 14:15:36 Error: [MissingActionException] Action GroupsController::associations() could not be found.
Exception Attributes: array (
  'controller' => 'GroupsController',
  'action' => 'associations',
)
Request URL: /zm/api/groups/associations.json?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjIyNjM2OTk3LCJleHAiOjE2MjI2NDQxOTcsInVzZXIiOiJydXNzaCIsInR5cGUiOiJhY2Nlc3MifQ.2gdWJolAzY_jUP8PbUJc312hTsJHg3XYpK0OtMt-e7A
Stack Trace:
#0 /usr/share/zoneminder/www/api/app/Plugin/Crud/Lib/CrudControllerTrait.php(31): Controller->invokeAction(Object(CakeRequest))
#1 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(193): AppController->invokeAction(Object(CakeRequest))
#2 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke(Object(GroupsController), Object(CakeRequest))
#3 /usr/share/zoneminder/www/api/app/webroot/index.php(117): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#4 {main}
2021-06-02 14:15:36 Error: [MissingActionException] Action GroupsController::associations() could not be found.
Exception Attributes: array (
  'controller' => 'GroupsController',
  'action' => 'associations',
)
Request URL: /zm/api/groups/associations.json?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjIyNjM2OTk3LCJleHAiOjE2MjI2NDQxOTcsInVzZXIiOiJydXNzaCIsInR5cGUiOiJhY2Nlc3MifQ.2gdWJolAzY_jUP8PbUJc312hTsJHg3XYpK0OtMt-e7A
Stack Trace:
#0 /usr/share/zoneminder/www/api/app/Plugin/Crud/Lib/CrudControllerTrait.php(31): Controller->invokeAction(Object(CakeRequest))
#1 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(193): AppController->invokeAction(Object(CakeRequest))
#2 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke(Object(GroupsController), Object(CakeRequest))
#3 /usr/share/zoneminder/www/api/app/webroot/index.php(117): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#4 {main}
2021-06-02 16:48:42 Error: [MissingActionException] Action GroupsController::associations() could not be found.
Exception Attributes: array (
  'controller' => 'GroupsController',
  'action' => 'associations',
)
Request URL: /zm/api/groups/associations.json?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNjIyNjQ4OTIwLCJleHAiOjE2MjI2NTYxMjAsInVzZXIiOiJydXNzaCIsInR5cGUiOiJhY2Nlc3MifQ.TKEySNBSwNka74NpBPUo3VC-OzBR7a5uU1r4gjuEd-M
Stack Trace:
#0 /usr/share/zoneminder/www/api/app/Plugin/Crud/Lib/CrudControllerTrait.php(31): Controller->invokeAction(Object(CakeRequest))
#1 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(193): AppController->invokeAction(Object(CakeRequest))
#2 /usr/share/zoneminder/www/api/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke(Object(GroupsController), Object(CakeRequest))
#3 /usr/share/zoneminder/www/api/app/webroot/index.php(117): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#4 {main}
2021-06-02 17:07:51 Error: [MissingActionException] Action GroupsController::associations() could not be found.
Exception Attributes: array (
  'controller' => 'GroupsController',
  'action' => 'associations',
)

Is there a configuration someplace to set to send the mp4 and not the picture?

Please let me know if there's something further I can try (or have missed!).

RussH commented 3 years ago

Pushover works just fine, so no major issue.

pliablepixels commented 3 years ago

You'll have to see debug logs of zmeventnotification.pl to see what is the URL it is using for sending the image/animation. Note that animation only works in iOS.

RussH commented 3 years ago

so I launched with sudo -u www-data /usr/bin/zmeventnotification.pl --debug and gathered the following logfile whilst triggerfing an event by walking on front of it zmeventnotification-debug.log

pliablepixels commented 3 years ago

Everything looks good. I missed your ZM version - 1.34 I'm not sure when it was released, but it may be likely that version of ZM doesn't support passing video files via URL See this post - the code was added to ZM Mar 2020.