Toybrick

计算棒调用python-opencv加载网络摄像头出错

SodrSnne

中级会员

积分
249
楼主
发表于 2019-12-12 10:58:13    查看: 7233|回复: 1 | [复制链接]    打印 | 只看该作者
想尝试调试计算棒主动开发模式硬解码rtsp摄像头,用opencv连接调试时报错下面是代码

root@192.168.180.8:/ts_rpf# python3
Python 3.6.8 (default, Mar 21 2019, 09:31:25)
[GCC 8.3.1 20190223 (Red Hat 8.3.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> path = "rtsp://admin:tensorsight666@192.168.1.55:554/h264/ch1/main/av_stream"
>>> camera =cv2.VideoCapture(path)
VIDEOIO ERROR: V4L: device rtsp://admin:tensorsight666@192. ... ch1/main/av_stream: Unable to query number of channels
OpenCV(3.4.1) Error: Unspecified error (GStreamer: your gstreamer installation is missing a required plugin
) in handlemessage, file /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp, line 1869
VIDEOIO(cvCreateCapture_GStreamer (CV_CAP_GSTREAMER_FILE, filename)): raised OpenCV exception:

OpenCV(3.4.1) /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp:1869: error: (-2) GStreamer: your gstreamer installation is missing a required plugin
in function handlemessage



请问这个问题怎么解决。是要安装缺少的软件吗
回复

使用道具 举报

appleUncle

中级会员

积分
440
沙发
发表于 2019-12-27 10:25:02 | 只看该作者
1,安装gstreamer
sudo dnf install https://download1.rpmfusion.org/ ... usion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install gstreamer1-libav
试一下,不行再重装opencv
2,重装opencv,不要用dnf install opencv,源码安装解决一切bug
https://blog.csdn.net/sac761/article/details/103726065
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表