Error in setting up gstreamer pipeline in OpenCV Capture function

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error in setting up gstreamer pipeline in OpenCV Capture function

991 Views
abhijeet_ghodga
Contributor III

I am using Ubuntu 14.04. The cmake version being used is 2.4 and gstreamer-1.0 is used.

1. When this command is run through command line,
gst-launch-1.0 autovideosrc ! autovideosink


The video is observed on the display with following message in the terminal,


Setting pipeline to PAUSED ...
ERROR: v4l2 capture: unsupported ioctrl!
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

2. When the cross-compiled application (using CMake) is run through opencv application on the cross platform,


VideoCapture cap("gst-launch-1.0 autovideosrc ! autovideosink");
ERROR: Error opening video stream or file

3. Following is the code:


#include "opencv2/opencv.hpp"
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
 VideoCapture cap("gst-launch-1.0 autovideosrc ! autovideosink");
  //cap.open(3);
 //VideoCapture cap(VIDIOC_ENUM_FMT);
  // Check if camera opened successfully
 if(!cap.isOpened())
 {
  cout << "Error opening video stream or file" << endl;
  return -1;
  }

4. Where is the issue?

bhupeshpatil

Labels (1)
Tags (1)
0 Kudos
1 Reply

842 Views
igorpadykov
NXP Employee
NXP Employee

Hi Abhijeet

one can look at gstreamer pipelines examples on

VAR-SOM-MX6 GSTREAM FSLC - Variscite Wiki 

on in Linux Guide in nxp linux documentation i.MX Software | NXP 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos