mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Ensure final frame in preview is not duplicated
This commit is contained in:
parent
cfda531f5a
commit
c716e4b1cb
@ -229,10 +229,6 @@ class PreviewRecorder:
|
|||||||
self.write_frame_to_cache(frame_time, frame)
|
self.write_frame_to_cache(frame_time, frame)
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.should_write_frame(current_tracked_objects, motion_boxes, frame_time):
|
|
||||||
self.output_frames.append(frame_time)
|
|
||||||
self.write_frame_to_cache(frame_time, frame)
|
|
||||||
|
|
||||||
# check if PREVIEW clip should be generated and cached frames reset
|
# check if PREVIEW clip should be generated and cached frames reset
|
||||||
if frame_time >= self.segment_end:
|
if frame_time >= self.segment_end:
|
||||||
# save last frame to ensure consistent duration
|
# save last frame to ensure consistent duration
|
||||||
@ -257,6 +253,9 @@ class PreviewRecorder:
|
|||||||
# include first frame to ensure consistent duration
|
# include first frame to ensure consistent duration
|
||||||
self.output_frames.append(frame_time)
|
self.output_frames.append(frame_time)
|
||||||
self.write_frame_to_cache(frame_time, frame)
|
self.write_frame_to_cache(frame_time, frame)
|
||||||
|
elif self.should_write_frame(current_tracked_objects, motion_boxes, frame_time):
|
||||||
|
self.output_frames.append(frame_time)
|
||||||
|
self.write_frame_to_cache(frame_time, frame)
|
||||||
|
|
||||||
def stop(self) -> None:
|
def stop(self) -> None:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user