首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在respberry pi 4上使用opencv4.1.0-openvino打开ip摄像机

无法在respberry pi 4上使用opencv4.1.0-openvino打开ip摄像机
EN

Stack Overflow用户
提问于 2019-07-15 21:25:20
回答 2查看 619关注 0票数 1

我需要使用我的树莓派4访问AXIS M1125网络摄像头的视频流。

我有一个可以在我的笔记本电脑和raspberry pi 3上运行的代码,我使用的是opencv 4.1,它是raspbian的openvino发行版。

代码语言:javascript
复制
camera = cv2.VideoCapture('http://192.168.1.38/axis-cgi/jpg/image.cgi')

当我运行代码并调试OPENCV_VIDEOCAPTURE_DEBUG时,输出是:

代码语言:javascript
复制
[ WARN:0] VIDEOIO(FFMPEG): trying capture filename='http://192.168.1.38/mjpg/1/video.mjpg' ...
[ WARN:0] VIDEOIO(FFMPEG): backend is not available (plugin is missing, or can't be loaded due dependencies or it is not compatible)
[ WARN:0] VIDEOIO(GSTREAMER): trying capture filename='http://192.168.1.38/mjpg/1/video.mjpg' ...
(python3:6939): GStreamer-CRITICAL **: 14:32:38.521: 
Trying to dispose element appsink0, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.
...
[ WARN:0] VIDEOIO(GSTREAMER): can't create capture
[ WARN:0] VIDEOIO(V4L2): trying capture filename='http://192.168.1.38/mjpg/1/video.mjpg' ...
[ WARN:0] VIDEOIO(V4L2): can't create capture
[ WARN:0] VIDEOIO(CV_IMAGES): trying capture filename='http://192.168.1.38/mjpg/1/video.mjpg' ...
[ WARN:0] VIDEOIO(CV_IMAGES): created, isOpened=0
[ WARN:0] VIDEOIO(CV_MJPEG): trying capture filename='http://192.168.1.38/mjpg/1/video.mjpg' ...
[ WARN:0] VIDEOIO(CV_MJPEG): can't create capture

Cv2.getBuildInformation()的输出:

代码语言:javascript
复制
Platform:
    Timestamp:                   2019-03-19T16:11:44Z
    Host:                        Linux 4.13.0-45-generic x86_64
    Target:                      Linux 1 arm
    CMake:                       3.7.2
    CMake generator:             Ninja
    CMake build tool:            /usr/bin/ninja
    Configuration:               Release

Video I/O:
    FFMPEG:                      YES
      avcodec:                   YES (57.64.101)
      avformat:                  YES (57.56.101)
      avutil:                    YES (55.34.101)
      swscale:                   YES (4.2.100)
      avresample:                NO
    GStreamer:                   YES (1.10.4)
    v4l/v4l2:                    YES (linux/videodev2.h)
EN

回答 2

Stack Overflow用户

发布于 2019-07-17 16:51:29

您是否完成了所有依赖项的安装?在/opt/intel/openvino/install_dependencies下。我还建议检查是否正在运行演示应用程序,如果它正在运行,但仍然存在问题。

票数 1
EN

Stack Overflow用户

发布于 2019-08-23 16:31:39

无论OpenVINO的功能如何,它都可以由OpenCV处理。

代码语言:javascript
复制
import cv2
cap = cv2.VideoCapture("http://username:password@xxx.xxx.xxx.xxx:port/xxxx")
#cap = cv2.VideoCapture("http://username:password@xxx.xxx.xxx.xxx:port")
while(True):
ret, frame = cap.read()
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()

请参考https://software.intel.com/en-us/forums/computer-vision/topic/801714

希望这能有所帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57040760

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档