修改线程架构

This commit is contained in:
邓智航
2026-01-26 17:26:33 +08:00
parent b3997c2646
commit 3282d4d77e
2 changed files with 70 additions and 53 deletions

View File

@@ -262,15 +262,15 @@ def video_stream_thread():
# f"filesink location={filename} "
# )
# out = cv2.VideoWriter(gst_pipeline, cv2.CAP_GSTREAMER, 0, fps, (width, height))
out1 = cv2.VideoWriter('output1.mp4', fourcc, 30.0, (1280, 720))
out2 = cv2.VideoWriter('output2.mp4', fourcc, 30.0, (1280, 720))
# out1 = cv2.VideoWriter('output1.mp4', fourcc, 30.0, (1280, 720))
# out2 = cv2.VideoWriter('output2.mp4', fourcc, 30.0, (1280, 720))
while not stop_event.is_set():
try:
frame = video_queue.get(timeout=1)
# small_frame = cv2.resize(apply_soft_roi(frame), (1280, 720))
server.provide_frame(frame)
out1.write(frame)
out2.write(frame)
# out1.write(frame)
# out2.write(frame)
except queue.Empty:
continue
except Exception as e:
@@ -320,8 +320,8 @@ def video_stream_thread():
# except Exception as e:
# print(f"[Video] 重连中... {e}")
# time.sleep(3)
out1.release()
out2.release()
# out1.release()
# out2.release()
print("[Video] 线程结束")