fix: only write analysis jpegs for alarm frames#4997
Open
SteveGilvarry wants to merge 1 commit into
Open
Conversation
Since the 1.38 analysis pipeline, every analysed packet carries an analysis_image so the live analysis view can show full colour. Event AddFrame wrote an analysis jpeg whenever the packet had one, so SaveJPEGs 'Analysis images only' saved every frame of the event instead of only alarmed frames as in 1.36. Gate the write on frame_type == ALARM to restore the old behaviour. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
|
I think the if (packet->analysis_image) used to do the gating. But now we always assign analysis_image. Instead we should only populate analysis-image if we have motion detection score (See line 2364 of zm_monitor.cpp). Thing is, AI comes later and may also create it, but with a zero motion score, so frame type != ALARM. So I don't think this is the way to go. |
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.
Fixes #4996
Problem
Since the 1.38 analysis pipeline rewrite,
packet->analysis_imageis created for every frame that goes through motion detection (so the live Analysis view shows full colour instead of greyscale).Event::AddFramewrote an analysis jpeg whenever the packet had one — which is now always — so SaveJPEGs = Analysis images only (if available) saved every analysed frame of the event instead of only alarmed frames as in 1.36. On a 10fps Always Recording + Always Analysing monitor that is ~6,000 jpegs (~4GB) per 10-minute event vs ~400MB on 1.36.Fix
Gate the analysis-jpeg write on
frame_type == ALARM, restoring 1.36 semantics: analysis jpegs are only written for alarm frames (including scored pre/post-alarm buffer frames). The live analysis view is unaffected.🤖 Generated with Claude Code