Fix ONVIF recordings stopping at section_length boundary despite active trigger#4588
Draft
Fix ONVIF recordings stopping at section_length boundary despite active trigger#4588
Conversation
When an ONVIF-triggered event reaches section_length and closes, a new event should immediately open if the ONVIF alarm is still active. Previously, new events only opened if state==ALARM, but ONVIF alarms may be active without the state being ALARM yet. This caused recording to stop even though the ONVIF trigger was still active. Now checks onvif->isAlarmed() and Amcrest_Manager->isAlarmed() when deciding to open a new event in RECORDING_ONMOTION mode. Co-authored-by: connortechnology <925519+connortechnology@users.noreply.github.com>
Combine ONVIF and Amcrest alarm checks with OR operator for cleaner code and remove trailing whitespace. Co-authored-by: connortechnology <925519+connortechnology@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix recordings not extending past end of current event
Fix ONVIF recordings stopping at section_length boundary despite active trigger
Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ONVIF-triggered recordings in
RECORDING_ONMOTIONmode stop when events reachsection_length, even when the ONVIF alarm remains active. Expected: recordings continue in a new event until trigger clears.Root Cause
Event opening logic only checked
state == ALARM, but ONVIF triggers setonvif->isAlarmed()independently. When an event closes atsection_length, the monitor state may not beALARMyet, preventing new event creation despite active external trigger.Changes
onvif->isAlarmed()andAmcrest_Manager->isAlarmed()when deciding to open new events inRECORDING_ONMOTIONmodeApplies to both ONVIF and Amcrest external triggers under
WITH_GSOAPcompilation flag.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.