python+opencv 打開網絡攝像頭


python+opencv 打開網絡攝像頭(手機)(轉)

#以下是最常用的讀取視頻流的方法
import cv2
url = 'rtsp://admin:admin@192.169.5.2:554/'#根據攝像頭設置IP及rtsp端口 @前面是賬號和密碼
cap = cv2.VideoCapture(url)#讀取視頻流
while(cap.isOpened()):
# Capture frame-by-frame
ret, frame = cap.read()
# Display the resulting frame
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()

注:可以下在ip攝像頭App查看
原文鏈接:https://blog.csdn.net/weixin_33595571/article/details/84351476?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-6.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-6.channel_param


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM