调用手机摄像头

import cv2
url = "rtsp://admin:[email protected]:8554/live"
cap = cv2.VideoCapture(url)#读取视频流
while(cap.isOpened()):
    ret, frame = cap.read()
    print('success')
    cv2.imshow('frame',frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
cap.release()
cv2.destroyAllWindows()

你可能感兴趣的:(笔记)