python - openCV 连接并处理网络摄像机流(rtsp 协议)
问题描述
我正在尝试连接和处理来自我的网络摄像机的视频流,我正在使用 360Eye(s) 摄像机。
这是我试图连接的代码:
import cv2
cap = cv2.VideoCapture('rtsp://admin:123456@192.168.0.333')
while True:
ret, img = cap.read()
if ret == True:
cv2.imshow('video output', img)
k = cv2.waitKey(10)& 0xff
if k == 27:
break
cap.release()
cv2.destroyAllWindows()
而且我从不进入 if 语句
更多信息:iv'e 通过 VLC 和 Onvif 设备管理器播放流,这也是我的 opencv 道具:
Video I/O:
DC1394: NO
FFMPEG: YES (prebuilt binaries)
avcodec: YES (58.54.100)
avformat: YES (58.29.100)
avutil: YES (56.31.100)
swscale: YES (5.5.100)
avresample: YES (4.0.0)
GStreamer: NO
DirectShow: YES
Media Foundation: YES
DXVA: NO
解决方案
推荐阅读
- javascript - 为什么异步等待函数返回一个值,而承诺函数返回一个未定义?
- ios - 如果条件 Swift,RealmSwift.Object 布尔值始终为 false
- cplex - 在 CPLEX C# 版本中,我可以在主运行时停用输出吗?
- go - 没有任何 goroutine 但仍然得到“所有 goroutines 都在睡觉 - 死锁”
- c++ - 将函数返回值存储到变量中
- date - 谷歌表格公式
- javascript - 为什么我的 doSomething 参数没有传入
- python - Python - 如果在类中使用未声明的变量,则强制出错
- python - MATLAB 的 imgaborfilt 和 imgaussfilt 函数的 python 版本是什么?
- php - 如何修复图像名称