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