Toybrick

标题: rk3399pro无法opencv无法打开摄像头 [打印本页]

作者: jandriux    时间: 2019-11-6 15:09
标题: rk3399pro无法opencv无法打开摄像头
1、rknn-toolkit的版本是1.2.1,opencv版本是3.4.1
2、代码:cap = cv2.VideoCapture(0),之前在rknn-toolkit1.1.0的时候是可以正常使用的,但是现在出现报错:
OpenCV(3.4.1) Error: Unspecified error (GStreamer: unable to start pipeline
) in cvCaptureFromCAM_GStreamer, file /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp, line 890
VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

OpenCV(3.4.1) /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_gstreamer.cpp:890: error: (-2) GStreamer: unable to start pipeline
in function cvCaptureFromCAM_GStreamer

OpenCV(3.4.1) Error: Unspecified error (unicap: failed to get info for device
) in CvCapture_Unicap::initDevice, file /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_unicap.cpp, line 139
VIDEOIO(cvCreateCameraCapture_Unicap(index)): raised OpenCV exception:

OpenCV(3.4.1) /builddir/build/BUILD/opencv-3.4.1/modules/videoio/src/cap_unicap.cpp:139: error: (-2) unicap: failed to get info for device
in function CvCapture_Unicap::initDevice

请问该如何解决这个问题,另外还有一个现象,就是升级了toolkit版本之后,发现每次init runtime都需要等很久,之前版本好像都挺快的

作者: teslawho    时间: 2019-11-15 21:08
碰到了同样的问题,求大佬帮助
作者: teslawho    时间: 2019-11-15 21:12
碰到了同样的问题,求大佬帮助
作者: appleUncle    时间: 2019-12-27 10:26


我遇到了和你们一样的问题,花了2天时间,解决了,分享一下:
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