python - 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()
在此先感谢,我真的很感激任何帮助!
解决方案
这就是它最终的工作方式:cap_1 = cv2.VideoCapture('http://169.254.5.128:581/cgi-bin/camera')
. 在这里您可以查看需要在链接中使用哪些扩展来访问您的网络摄像机:https ://www.ispyconnect.com/
推荐阅读
- django - 通过 Django 管理应用程序激活帐户时向用户发送电子邮件
- asp.net - 如何使用 SQL Server 将本机应用程序与 ASP.NET Web 服务连接起来?
- selenium-webdriver - Capybara点击方法传递参数导致不是key修饰符错误
- sql - 创建主列表的智能方法(避免交叉连接)
- python - 如何检查某个连续子数组的总和是否等于 N?
- wso2 - WSO2 Integrator:如何设置 FIX 发起程序故障转移?
- xcode - 控制到达 xcode 中非 void 函数的末尾
- r - 如何在 R 中绘制矩形/边界框?
- javascript - JQuery.Validate 只验证第一个字段
- c# - offzip 未检测到 Zlib 标头