ZoneMinder / zoneminder

ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras.
http://www.zoneminder.com/
GNU General Public License v2.0
5.17k stars 1.23k forks source link

Event playback skips some events #4186

Open j-marz opened 2 hours ago

j-marz commented 2 hours ago

Describe Your Environment

Describe the bug Playback of filtered events misses some events if the the next sequential event ID has a timestamp that is earlier than the next event ID. Changing the event list sorting doesn't resolve the issue.

To Reproduce Steps to reproduce the behavior:

  1. cause a zmtrigger event across multiple monitors
  2. configure different pre-event buffers per monitor (this changes the event start time - ie. larger pre-event buffer will have earlier start time even though it was trigger later in the zmtrigger list)
  3. list matching events using a filter
  4. sort events by ID, name or start time (issue occurs in all scenarios)
  5. playback in ascending order
  6. notice some events are skipped and never playback

Expected behavior event playback honors the filter sorting and doesn't skip events

Debug Logs NA

j-marz commented 2 hours ago

Looks like playback uses the filter query and doesn't update the query when the event list sorting changes (e.g. change table sorting in event list view after running filter and before playback). Updating the event filter to sort by ID instead of start time seems to work (ie. doesn't skip events), but the side effect is the events don't technically play in chronological order.

connortechnology commented 1 hour ago

in zms when it goes to get the next event, it uses the following SQL: SELECT Id FROM Events WHERE MonitorId = %d AND Id > last_event_id ORDER BY Id ASC LIMIT 1 So yeah, if the Ids are out of sync, it will mess up. It ignores the filter sort. In fact the filter is never passed to zms.

Which view is this? event view, or montage review?