简体   繁体   中英

Access Ip camera using python

instructions to stream IP Camera video utilizing just python in windows OS

import numpy as np
import cv2

cap = cv2.VideoCapture('http://admin:*****@198.168.1.***')

while(True):

    ret, frame = cap.read()
    cv2.imshow('Stream IP Camera OpenCV',frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()

This error means that cap.read() does not capture the video/frame. The problem is most likely on line cap = cv2.VideoCapture(' http://admin :*****@198.168.1.***'). Make sure the ip address of camera and ip address of your computer are properly configured according to documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM