mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-08-03 00:37:21 -04:00
A capture crash can leave events with no frames, no Length and no EndDateTime. The API's EndTimeSecs virtual field reported these with an end of NOW(), the fallback meant for a genuinely in-progress recording, so every orphan appeared to span from its start until now. On a monitor with hundreds of these, the events all overlapped: at a typical timestamp 313 events covered the same instant. findEventByTime is a binary search that assumes non-overlapping ordered events, so it returned an essentially arbitrary one, and zms then streamed a different event than the JS believed was playing. That is the erratic playback and event/stream mismatch seen in montage review. Two changes: - Event model EndTimeSecs: for an event with no EndDateTime and Length 0, report end = StartDateTime (zero duration) instead of NOW(). An event with no length has no span to occupy, so it no longer overlaps others. - montagereview receive_events: skip events with no frames. There is nothing to review in an empty event, and dropping them keeps the timeline and event selection to real recordings. The same NOW() fallback exists in web/ajax/events.php and web/skins/classic/views/montagereview.php; those paths are not used by montage review's event load and are left unchanged. Verified on a monitor with 521 orphaned events: overlapping events at a given instant dropped from 313 to 2, and the streamed event now matches the selected event with sub-second drift. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ZoneMinder API
This is the ZoneMinder API. It should be, for now, installed under the webroot e.g. /api.
app/Config/database.php.default must be configured and copied to app/Config/database.php
In addition, Security.salt and Security.cipherSeed in app/Config/core.php should be changed.
The API can run on a dedicated / separate instance, so long as it can access the database as configured in app/Config/database.php