浏览代码

only send frames to ffmpeg if there are clients listening

Blake Blackshear 3 年之前
父节点
当前提交
a8df97dc1a
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      frigate/output.py

+ 3 - 2
frigate/output.py

@@ -111,8 +111,9 @@ def output_frames(config, video_output_queue):
 
         frame = frame_manager.get(frame_id, config.cameras[camera].frame_shape_yuv)
 
-        # send frame to ffmpeg process
-        converter.write(frame.tobytes())
+        # send frame to ffmpeg process if websockets are connected
+        if len(websocket_server.manager) > 0:
+            converter.write(frame.tobytes())
 
         if camera in previous_frames:
             frame_manager.delete(previous_frames[camera])