Opencv程序运行时错误Gstreamer插件丢失

时间:2016-06-16 06:51:20

标签: c++ opencv

我是非root用户运行centos-6最近我已经将Opencv-3.0.0安装到我的前缀中。 为了测试Opencv,我制作了一个小样本程序,它成功编译并在运行时发出以下错误

> libdc1394 error: Failed to initialize libdc1394 
> OpenCV Error:Unspecified error (GStreamer: your gstreamer installation is missing a
> required plugin ) in handlemessage, file
> /home/internal/evol/sskadam/Bharath/opencv-3.0.0/modules/videoio/src/cap_gstreamer.cpp,
> line 1622 terminate called after throwing an instance of
> 'cv::Exception'   what(): 
> /home/internal/evol/sskadam/Bharath/opencv-3.0.0/modules/videoio/src/cap_gstreamer.cpp:1622:
> error: (-2) GStreamer: your gstreamer installation is missing a
> required plugin  in function handlemessage
> 
> Aborted (core dumped)

这是我用于编译的命令

  

g ++ -o test test.cpp -lopencv_imgproc -lopencv_highgui -lopencv_ml   -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_stitching

这是我的代码

#include <opencv2/opencv.hpp>
#include <time.h>
#include <vector>
#include <stdlib.h>
#include <string>
#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/core/types_c.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/video/background_segm.hpp>
#include <stdio.h>
#include <opencv2/videoio/videoio.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/video/video.hpp>
#include <opencv2/imgcodecs.hpp>

using namespace std;
using namespace cv;

int main()
{
   VideoCapture cap("sample1.avi");
   cout << cap.get(5);
   return 0;
}

应该安装什么插件来解决这个问题,或者更确切地说是什么问题以及它是如何解决的?

0 个答案:

没有答案