减少队列中帧的数量,降低延迟
This commit is contained in:
@@ -725,7 +725,7 @@ class FrameProcessorWorker(threading.Thread):
|
||||
|
||||
# 抽帧控制
|
||||
if ts - self.last_ts.get(cam_id, 0) < target_interval:
|
||||
self.raw_queue.task_done()
|
||||
# self.raw_queue.task_done()
|
||||
continue
|
||||
self.last_ts[cam_id] = ts
|
||||
|
||||
@@ -793,9 +793,10 @@ class FrameProcessorWorker(threading.Thread):
|
||||
# logger.info(f"[PERF] Camera {cam_id} - Total: {total_time:.1f}ms | "
|
||||
# f"Detect: {detect_time:.1f}ms | "
|
||||
# f"Encode: {encode_time:.1f}ms | ")
|
||||
self.raw_queue.task_done()
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"[ERROR] Frame processing failed for camera {cam_id if 'cam_id' in locals() else 'unknown'}: {e}")
|
||||
logger.exception("Exception details:") # 打印完整的堆栈跟踪
|
||||
# 继续处理下一帧,不要退出循环
|
||||
finally:
|
||||
self.raw_queue.task_done()
|
||||
|
||||
Reference in New Issue
Block a user