while True: ret, frame = cap.read() if not ret: break

How to view your IP camera remotely via a web browser - TP-Link