Toybrick

标题: 计算棒调用python-opencv加载网络摄像头出错 [打印本页]

作者: SodrSnne    时间: 2019-12-12 10:58
标题: 计算棒调用python-opencv加载网络摄像头出错
想尝试调试计算棒主动开发模式硬解码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    时间: 2019-12-27 10:25
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




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3