Server 0.6
parent
dcac92d7e5
commit
a7b7a571c3
|
|
@ -127,8 +127,11 @@ def _process_stream(camera):
|
||||||
if cap is None:
|
if cap is None:
|
||||||
cap = cv2.VideoCapture(rtsp_url)
|
cap = cv2.VideoCapture(rtsp_url)
|
||||||
if not cap.isOpened():
|
if not cap.isOpened():
|
||||||
|
print(f"[ERROR] {camera['name']} (IP: {camera['ip']}) failed to connect. Check if 401 Unauthorized or 403 Forbidden.")
|
||||||
with lock: state["cameras"][cam_id]["status"] = "error"
|
with lock: state["cameras"][cam_id]["status"] = "error"
|
||||||
time.sleep(5); cap = None; continue
|
time.sleep(10); cap = None; continue
|
||||||
|
|
||||||
|
print(f"[SUCCESS] {camera['name']} (IP: {camera['ip']}) connected and streaming over TCP.")
|
||||||
with lock: state["cameras"][cam_id]["status"] = "live"
|
with lock: state["cameras"][cam_id]["status"] = "live"
|
||||||
|
|
||||||
ret, frame = cap.read()
|
ret, frame = cap.read()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue