import cv2 url = "rtsp://192.168.144.108:8000/165506" cap = cv2.VideoCapture(url, cv2.CAP_FFMPEG) cap.set(cv2.CAP_PROP_FFMPEG_PARAM,'-strict -2') ret, frame = cap.read() while ret: ret, frame = cap.read() cv2.imshow("frame",frame) if cv2.waitKey(1) & 0xFF == ord('q'): break cv2.destroyAllWindows() cap.release()