Server 0.6

Server
ahmedmujtaba-gif 2026-04-17 13:26:20 +05:00
parent dcac92d7e5
commit a7b7a571c3
1 changed files with 4 additions and 1 deletions

View File

@ -127,8 +127,11 @@ def _process_stream(camera):
if cap is None:
cap = cv2.VideoCapture(rtsp_url)
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"
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"
ret, frame = cap.read()