mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Add more debug logs for preview and output (#14833)
This commit is contained in:
parent
fc0fb158d5
commit
2eb5fbf112
@ -63,6 +63,7 @@ def output_frames(
|
|||||||
birdseye: Optional[Birdseye] = None
|
birdseye: Optional[Birdseye] = None
|
||||||
preview_recorders: dict[str, PreviewRecorder] = {}
|
preview_recorders: dict[str, PreviewRecorder] = {}
|
||||||
preview_write_times: dict[str, float] = {}
|
preview_write_times: dict[str, float] = {}
|
||||||
|
failed_frame_requests: dict[str, int] = {}
|
||||||
|
|
||||||
move_preview_frames("cache")
|
move_preview_frames("cache")
|
||||||
|
|
||||||
@ -99,7 +100,16 @@ def output_frames(
|
|||||||
|
|
||||||
if frame is None:
|
if frame is None:
|
||||||
logger.debug(f"Failed to get frame {frame_id} from SHM")
|
logger.debug(f"Failed to get frame {frame_id} from SHM")
|
||||||
|
failed_frame_requests[camera] = failed_frame_requests.get(camera, 0) + 1
|
||||||
|
|
||||||
|
if failed_frame_requests[camera] > config.cameras[camera].detect.fps:
|
||||||
|
logger.warning(
|
||||||
|
f"Failed to retrieve many frames for {camera} from SHM, consider increasing SHM size if this continues."
|
||||||
|
)
|
||||||
|
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
failed_frame_requests[camera] = 0
|
||||||
|
|
||||||
# send camera frame to ffmpeg process if websockets are connected
|
# send camera frame to ffmpeg process if websockets are connected
|
||||||
if any(
|
if any(
|
||||||
|
@ -154,6 +154,7 @@ class PreviewRecorder:
|
|||||||
self.start_time = 0
|
self.start_time = 0
|
||||||
self.last_output_time = 0
|
self.last_output_time = 0
|
||||||
self.output_frames = []
|
self.output_frames = []
|
||||||
|
|
||||||
if config.detect.width > config.detect.height:
|
if config.detect.width > config.detect.height:
|
||||||
self.out_height = PREVIEW_HEIGHT
|
self.out_height = PREVIEW_HEIGHT
|
||||||
self.out_width = (
|
self.out_width = (
|
||||||
@ -274,7 +275,7 @@ class PreviewRecorder:
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def write_frame_to_cache(self, frame_time: float, frame) -> None:
|
def write_frame_to_cache(self, frame_time: float, frame: np.ndarray) -> None:
|
||||||
# resize yuv frame
|
# resize yuv frame
|
||||||
small_frame = np.zeros((self.out_height * 3 // 2, self.out_width), np.uint8)
|
small_frame = np.zeros((self.out_height * 3 // 2, self.out_width), np.uint8)
|
||||||
copy_yuv_to_position(
|
copy_yuv_to_position(
|
||||||
@ -303,7 +304,7 @@ class PreviewRecorder:
|
|||||||
current_tracked_objects: list[dict[str, any]],
|
current_tracked_objects: list[dict[str, any]],
|
||||||
motion_boxes: list[list[int]],
|
motion_boxes: list[list[int]],
|
||||||
frame_time: float,
|
frame_time: float,
|
||||||
frame,
|
frame: np.ndarray,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
# check for updated record config
|
# check for updated record config
|
||||||
_, updated_record_config = self.config_subscriber.check_for_update()
|
_, updated_record_config = self.config_subscriber.check_for_update()
|
||||||
@ -332,6 +333,10 @@ class PreviewRecorder:
|
|||||||
self.output_frames,
|
self.output_frames,
|
||||||
self.requestor,
|
self.requestor,
|
||||||
).start()
|
).start()
|
||||||
|
else:
|
||||||
|
logger.debug(
|
||||||
|
f"Not saving preview for {self.config.name} because there are no saved frames."
|
||||||
|
)
|
||||||
|
|
||||||
# reset frame cache
|
# reset frame cache
|
||||||
self.segment_end = (
|
self.segment_end = (
|
||||||
|
Loading…
Reference in New Issue
Block a user