ZoneMinder / zmNinja

High performance, cross platform ionic app for Home/Commerical Security Surveillance using ZoneMinder
http://zmninja.zoneminder.com
Other
1.01k stars 270 forks source link

Playback of events fails using view=video mode #275

Closed trx909 closed 8 years ago

trx909 commented 8 years ago

Platform & OS Version Android 5.1.1 & Desktop (Ubuntu 16.04)

The version of the app you are reporting: 1.1.93

What is the nature of your issue Bug

Details I use a current snaphost of the feature-h264-videostorage branch. Playback of recorded videos works fine in the browser, but not with zmNinja. With zmNinja 1.1.7 everything is ok. There are no errors in the debug-log, but you could see youself:

Jun 21, 2016 10:06 PM INFO API for event detailshttp://beta/zm/api/events/525.json Jun 21, 2016 10:06 PM INFO API for event detailshttp://beta/zm/api/events/525.json Jun 21, 2016 10:06 PM DEBUG EventCtrl: Scrubbing will turn on now Jun 21, 2016 10:06 PM DEBUG EventCtrl:loading one more page just in case we don't have enough to display Jun 21, 2016 10:06 PM DEBUG EventCtrl: success, got 37 events Jun 21, 2016 10:06 PM DEBUG EventCtrl: grabbing events for: id=0 Date/Time:- Jun 21, 2016 10:06 PM DEBUG EventCtrl: found 2 pages of events Jun 21, 2016 10:06 PM DEBUG Setting up carousel watchers Jun 21, 2016 10:06 PM DEBUG EventCtrl: grabbing # of event pages Jun 21, 2016 10:06 PM DEBUG getInitialEvents called Jun 21, 2016 10:06 PM DEBUG Not sending WSS message as event server is off Jun 21, 2016 10:06 PM INFO Image padding digits reported as 5 Jun 21, 2016 10:06 PM INFO ZM_EVENT_IMAGE_DIGITS is already configured for 5 Jun 21, 2016 10:06 PM INFO Returning pre-loaded list of 1 monitors Jun 21, 2016 10:06 PM INFO Force calling resize Jun 21, 2016 10:06 PM DEBUG All images loaded Jun 21, 2016 10:06 PM INFO Whoops!! Monitors have changed. I'm resetting layouts, sorry! Jun 21, 2016 10:06 PM INFO Monitors that are active and not DOM hidden: 1 while grid has undefined Jun 21, 2016 10:06 PM INFO Did NOT find a packery layout Jun 21, 2016 10:06 PM INFO Stream authentication construction: Jun 21, 2016 10:06 PM INFO Data Model: Did not find any stream mode of auth Jun 21, 2016 10:06 PM INFO DataModel: Did not find a stream auth key, looking for user= Jun 21, 2016 10:06 PM DEBUG DataModel: Getting auth from http://beta/zm/index.php?view=watch&mid=2&connkey=761590 with mid=2 Jun 21, 2016 10:06 PM INFO Inside Montage Ctrl:We found 1 monitors Jun 21, 2016 10:06 PM DEBUG skipping image refresh, packery is still loading Jun 21, 2016 10:06 PM DEBUG Setting image mode to snapshot, will change to image when packery is all done Jun 21, 2016 10:06 PM DEBUG API 1.30.0: Monitor 2 will use fid for direct image access Jun 21, 2016 10:06 PM INFO multi server list loaded{"servers":[]} Jun 21, 2016 10:06 PM INFO ZM_EVENT_IMAGE_DIGITS is 5 Jun 21, 2016 10:06 PM INFO Monitor load was successful, loaded 1 monitors Jun 21, 2016 10:06 PM DEBUG Now trying to get multi-server data, if present Jun 21, 2016 10:06 PM INFO Got API version: 1.30.0 Jun 21, 2016 10:06 PM INFO ZM has recaptcha disabled - good Jun 21, 2016 10:06 PM INFO getMonitors:Loading all monitors Jun 21, 2016 10:06 PM DEBUG Jun 21, 2016 10:06 PM INFO No Event Server configured, skipping refresh Jun 21, 2016 10:06 PM DEBUG getAPIversion called Jun 21, 2016 10:06 PM DEBUG Config URL for digits is:http://beta/zm/api/configs/viewByName/ZM_EVENT_IMAGE_DIGITS.json Jun 21, 2016 10:06 PM DEBUG PortalLogin: auth success Jun 21, 2016 10:06 PM INFO Stream authentication construction: Jun 21, 2016 10:06 PM INFO Deferring auth key, as monitorId unknown Jun 21, 2016 10:06 PM DEBUG auth-success emit:Successful Jun 21, 2016 10:06 PM INFO zmAutologin successfully logged into Zoneminder Jun 21, 2016 10:06 PM INFO Checking if reCaptcha is enabled in ZM... Jun 21, 2016 10:06 PM INFO zmAutologin called Jun 21, 2016 10:06 PM DEBUG Resetting zmCookie... Jun 21, 2016 10:06 PM INFO Cancelling zmAutologin timer Jun 21, 2016 10:06 PM DEBUG PIN code entered is correct, or there is no PIN set Jun 21, 2016 10:06 PM DEBUG unlock called with check PIN=true Jun 21, 2016 10:06 PM INFO not checking for touchID Jun 21, 2016 10:06 PM INFO User credentials are provided Jun 21, 2016 10:06 PM DEBUG Inside Portal login Enter handler Jun 21, 2016 10:06 PM INFO Setting up POST LOGIN timer

But it seems like the event is not being requested in the right way, the apache error-log show this every time:

[client xxx.xxx.xxx.xxx:45250] ERR [Path: 2/16/06/21/21/50/00/525-video.mp4]

and sometimes:

[client xxx.xxx.xxx.xxx:45250] PHP Notice: Undefined property: Event::$StorageId in /usr/share/zoneminder/www/includes/Event.php on line 31

I know that videostorage is bleeding edge, but as it worked before this issue should be not too hard to resolve.

Thanks for your help in advance.

pliablepixels commented 8 years ago

Path: 2/16/06/21/21/50/00/525-video.mp4

That's odd. What API version do you get when you do http://server/zm/api/host/getVersion.json?

trx909 commented 8 years ago
"version": "1.30.0",
"apiversion": "1.0"

Another apache error (I forget to include in first post) is:

[client xxx.xxx.xxx.xxx:43616] ERR [Success sending events/2/16/06/21/16/53/46/494-video.mp4]

But this doesn't occur always. Only the Path error appears every time.

The log of ZoneMinder itself shows the path error as well, but with the additional information of the File: /usr/share/zoneminder/www/views/view_video.php

pliablepixels commented 8 years ago

hmm if its 1.30 it should be fid= not path=. Any chance I can get access to a guest account with one monitor with video events? If so, please shoot me an email pliablepixels@gmail. I am on travel, so my response will be delayed

trx909 commented 8 years ago

I was creating a guest account and a cam with low res, but THIS monitor suddenly works. The filesizes of events are a lot shorter with this one. It seems like the file is beeing transfered correctly (network meter shows 100MBit for a minute) but zmNinja doesn't play it. Maybe the ZM log doesn't show errors but Info, because errors are always shown (strange way of debugging, but maybe...) After the file is transfered (somewhere), the message ERR [Success sending ... appears. But playback doesn't start. The only difference between these two monitors is the resolution, framerate and also the file size. The stream even origins of the same camera! (around 3MB/10min with low res and 800MB/10min with high res) If you still need the guest account I can send it later. Thanks.

pliablepixels commented 8 years ago

Hmmmm in that case are you sure old versions of zmNinja worked with these large files? Its the same video player. If you can create an account for me with some large videos that dont play that will help me debug

trx909 commented 8 years ago

After checking out old commits I tracked down the one responsible for the error. On May 5 you did changes to EventCtrl.js and EventModalStrl.js.

var videoURL;
if (event.Event.imageMode == 'path') videoURL = event.Event.baseURL + "/events/" + event.Event.relativePath + event.Event.DefaultVideo; else videoURL = event.Event.baseURL + "/index.php?view=view_video&eid="+event.Event.Id;

event.Event.baseURL seems to give a wrong path to the playback of video. Changing this to loginData.url solves the issue (for now).
But I really don't get why low res events do work from the beginning but high res not. A system with a clean installed ZM build (feature-h264-videostorage) had the same problems as before, so it is reproducible.

pliablepixels commented 8 years ago

So there are two separate issues:

a) The problem of wrong path: the core problem is elsewhere - I am not sure why your instance is going to that code. If you are using ZM version 1.30 or above, it should use a different construct. If you can give me access to your instance with a temp id, I can figure out what is going on with your install. In your debug logs, look for logs that say "API A Monitor X will use Y for direct image access" --> please tell me what the values for A, X and Y are

b) I might know what is going on with large files. To make sure the app does not get stuck indefinitely, I timeout HTTP calls (see app.js line 412) - I have a feeling that may be interfering. I'll add code to not add http timeouts if the file is an mp4

pliablepixels commented 8 years ago

Edit: looks like your logs already had the data for a)

Jun 21, 2016 10:06 PM DEBUG API 1.30.0: Monitor 2 will use fid for direct image access

That looks ok, so if possible please see if I can get access. It will be much harder to guess via logs

trx909 commented 8 years ago

I built zoneminder from scratch at the current state of feature-h264-videostorage. The master branch was merged recently so everthing should be at 1.30. Check your mails for login details.

pliablepixels commented 8 years ago

Ok found your email in my spam - will look at it asap

pliablepixels commented 8 years ago

your VM seems to be down - I can't seem to reach it

pliablepixels commented 8 years ago

This seems to be a problem with the view=video mode. I'll sync up with @connortechology on why this is so. In the mean time, I've added a toggle to force path=/x/y/z mode to play video

pliablepixels commented 8 years ago

@trx909 - I have a desktop version ready for testing - which OS and 32/64 bit?

trx909 commented 8 years ago

Ubuntu 64bit

pliablepixels commented 8 years ago

@trx909 - your VM is down - can you please keep it up for a few more days? I need to collect header data to figure out why @connortechnology 's patch is not working

trx909 commented 8 years ago

It will stay up until the issue is resolved.

pliablepixels commented 8 years ago

Should we close this?

trx909 commented 8 years ago

The new option works fine and as long as this issue doesn't occur anywhere else closing is probably the best thing to do.