首页 > 解决方案 > Python:使用 OpenCV 无法识别 Panasonic 网络流

问题描述

我正在尝试使用 Python 和 openCV 从 Panasonic 网络摄像机(WV SFV481)读取流。cap.isOpened()但是,自从返回后,似乎无法识别该流False。这是我尝试过的(关闭的行是我尝试捕获流的不同地址):

import cv2

#cap = cv2.VideoCapture('http://169.254.5.128:581/1')
#cap = cv2.VideoCapture('admin:12345@169.254.5.128:581/1')
#cap = cv2.VideoCapture('admin:12345@http://169.254.5.128:581/1')
#cap = cv2.VideoCapture('http://169.254.5.128:581/live/index.html?Language=9')
#cap = cv2.VideoCapture('admin:12345@169.254.5.128:581/live/index.html?Language=9')
#cap = cv2.VideoCapture('admin:12345@http://169.254.5.128:581/live/index.html?Language=9')

if cap.isOpened() == False:
    print("Error File Not Found")
while cap.isOpened():
    ret, frame = cap.read()
    
    if ret == True:
        cv2.imshow('frame',frame)
    
        if cv2.waitKey(1) & 0xFF ==ord('q'):
            break
        
    else:
        break
cap.release()
cv2.destroyAllWindows()

在此先感谢,我真的很感激任何帮助!

标签: pythonopencvnetworkingstreamstreaming

解决方案


这就是它最终的工作方式:cap_1 = cv2.VideoCapture('http://169.254.5.128:581/cgi-bin/camera'). 在这里您可以查看需要在链接中使用哪些扩展来访问您的网络摄像机:https ://www.ispyconnect.com/


推荐阅读