ZoneMinder / zmNinja

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

Swipe to next event for the same monitor id not working #274

Closed abishai closed 8 years ago

abishai commented 8 years ago

I migrated to 1.30-rc1 ZM and I'm running FreeBSD, so I suspect ZM devs will ignore me :) I hope, you can shred some light on the matter.

I viewing events from timeframe page. Gapless playback works like a charm, however when I swipe to next event, the original event starts from the beginning.

ZMNinja logs: Jun 17, 2016 10:38:19 PM DEBUG Hmm jump error {"data":"","status":500,"config":{"method":"POST","transformResponse":[null],"url":"http://zm.dacha.abinet.ru/index.php","headers":{"Content-Type":"application/x-www-form-urlencoded","Accept":"application/json, text/plain, /"},"data":{"view":"request","request":"stream","connkey":"37474","command":"13","auth":"feada90f05e3d905de4c1f077d8bd11c"},"timeout":15000},"statusText":"Internal Server Error"} Jun 17, 2016 10:38:19 PM DEBUG sendCmd error:{"data":"","status":500,"config":{"method":"POST","transformResponse":[null],"url":"http://zm.dacha.abinet.ru/index.php","headers":{"Content-Type":"application/x-www-form-urlencoded","Accept":"application/json, text/plain, /"},"data":{"view":"request","request":"stream","connkey":"37474","command":"13","auth":"feada90f05e3d905de4c1f077d8bd11c"},"timeout":15000},"statusText":"Internal Server Error"} Jun 17, 2016 10:38:19 PM DEBUG Sending 13 to 37474 Jun 17, 2016 10:38:19 PM INFO using zms to move

syslog: Jun 17 22:37:38 zm zms[2870]: ERR [Unable to send raw frame 13: Broken pipe]

broken pipe is common error for me, it pops up when I close any stream from web - montage, event playback and so on. I don't know the reason, but it looked harmless enough to be ignored. Looks like socket closed while ZM still writing stuff to it.

I don't beleive I can figure out how to fix it myself on ZM side, can some additional checks be implemented on ZMNinja side to ensure the next event starts? Looks like ZMNinja scared a little :)

pliablepixels commented 8 years ago

The "Internal Server Error" is an Apache error, not zmNinja, so not sure what I can do - zmN uses zms POST commands to change events (via the web server)

pliablepixels commented 8 years ago

Just checked - I'm not seeing any issues (There are times it fails, but its not 500 - its timeout - can't do much there - zms doesn't respond - its flakey)

abishai commented 8 years ago

"command":"13" is the next event command? Is there command to stop stream first and then request new? Because, gaplsss event works somehow.

abishai commented 8 years ago

Or try to repeat the same request if it fails. Looks like zms simply dies when it stops before all frames fetched.

pliablepixels commented 8 years ago

So interestingly, gapless does not require a command to be sent to move to the next one - if you start the stream with mode=gapless zms will keep moving to the next ones (as opposed to mode=single) --> thats why it keeps working - one the command is set, it doesn't need updates.

Swipes on the other hand send POST commands. Yes, there is a command to stop https://github.com/ZoneMinder/ZoneMinder/blob/66a3fef61ebd10c45968a3706021d45d027e28be/src/zm_stream.h#L60

pliablepixels commented 8 years ago

And yes, I can probably try harder at zmNinja to make these commands work. I'll take a look the week after next --> I am on travel till Thu.

abishai commented 8 years ago

Looks like zms really throws error when it stops before all frames are fetched. This can be hard to find. I'll try sniffer to get additional information.

BTW, I enabled ZM debug and found strange POST from ZMNinja every time it start event playback. The first request contains no eventid.

06/18/16 12:15:52.168494 zms[100220].DB1-zm_logger.cpp/234 [LogOpts: level=DB9/DB9, screen=OFF, database=OFF, logfile=DB9->/var/log/zoneminder/zm_debug.log.31565, syslog=INF]
06/18/16 12:15:52.168781 zms[100220].DB1-zm_utils.cpp/262 [Detected a x86\x86-64 processor with SSSE3]
06/18/16 12:15:52.168807 zms[100220].DB1-zms.cpp/102 [Query: source=event&mode=jpeg&event=&frame=1&replay=single&rate=100&connkey=515832&scale=100&auth=a306d89941daf860e3685311737e350b]
06/18/16 12:15:52.168869 zms[100220].DB1-zm_user.cpp/172 [Attempting to authenticate user from auth string 'a306d89941daf860e3685311737e350b']
06/18/16 12:15:52.169318 zms[100220].DB1-zm_user.cpp/235 [Checking auth_key '...Change me to something unique...admin*4ACFE3202A5FF5CF467898FC58AAB1D61502944110.0.0.112185116' -> auth_md5 'a306d89941daf860e3685311737e350b']
06/18/16 12:15:52.169335 zms[100220].DB1-zm_user.cpp/241 [Authenticated user 'admin']
06/18/16 12:15:52.170326 zms[100220].FAT-zm_event.cpp/756 [Unable to load event 0, not found in DB]

06/18/16 12:15:52.507772 zms[100220].DB1-zm_logger.cpp/234 [LogOpts: level=DB9/DB9, screen=OFF, database=OFF, logfile=DB9->/var/log/zoneminder/zm_debug.log.31566, syslog=INF]
06/18/16 12:15:52.508011 zms[100220].DB1-zm_utils.cpp/262 [Detected a x86\x86-64 processor with SSSE3]
06/18/16 12:15:52.508036 zms[100220].DB1-zms.cpp/102 [Query: source=event&mode=jpeg&event=12257&frame=1&replay=single&rate=100&connkey=515832&scale=100&auth=a306d89941daf860e3685311737e350b]
06/18/16 12:15:52.508061 zms[100220].DB1-zm_user.cpp/172 [Attempting to authenticate user from auth string 'a306d89941daf860e3685311737e350b']
06/18/16 12:15:52.508539 zms[100220].DB1-zm_user.cpp/235 [Checking auth_key '...Change me to something unique...admin*4ACFE3202A5FF5CF467898FC58AAB1D61502944110.0.0.112185116' -> auth_md5 'a306d89941daf860e3685311737e350b']
06/18/16 12:15:52.508556 zms[100220].DB1-zm_user.cpp/241 [Authenticated user 'admin']
06/18/16 12:15:52.509499 zms[100220].DB3-zm_stream.cpp/70 [FPS:6.24, MXFPS:10.00, BFPS:6.24, EFPS:6.24, FM:1]
06/18/16 12:15:52.509522 zms[100220].DB3-zm_stream.cpp/77 [aEFPS:6.24, aFM:1]
06/18/16 12:15:52.510029 zms[100220].DB2-zm_event.cpp/859 [Event:12257, Frames:61, Duration: 9.77]
06/18/16 12:15:52.510518 zms[100220].DB4-zm_db.cpp/89 [Success running query: select Id, Name, ServerId, Type, Function+0, Enabled, LinkedMonitors, Device, Channel, Format, V4LMultiBuffer, V4LCapturesPerFrame, Protocol, Method, Host, Port, Path, Options, User, Pass, Width, Height, Colours, Palette, Orientation+0, Deinterlacing, RTSPDescribe, Brightness, Contrast, Hue, Colour, EventPrefix, LabelFormat, LabelX, LabelY, LabelSize, ImageBufferCount, WarmupCount, PreEventCount, PostEventCount, StreamReplayBuffer, AlarmFrameCount, SectionLength, FrameSkip, MotionFrameSkip, AnalysisFPS, AnalysisUpdateDelay, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc, AlarmRefBlendPerc, TrackMotion, SignalCheckColour, Exif from Monitors where Id = 5]

Not related to original bug report, but curious.

abishai commented 8 years ago

BTW, is for zms powered event playback controls work? Pause, fast forward, fast rewind and playback scrollbar looks dead, without and errors from ZM.

abishai commented 8 years ago

Ahh, commands are processed by PHP ? So, it's web server answer? I can debug that then. Maybe some silly configuration error was made.

abishai commented 8 years ago

Right,configuration issue. Sorry for false alarm. But, my ray of hate goes to person put @ in socket functions. Was a socket but MUTED (arrr) issue

pliablepixels commented 8 years ago

no problem - glad you resolved it.