首页 > 解决方案 > 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

标签: pythonopencvcameravlcrtsp

解决方案


推荐阅读