I am trying to run an OpenCV program that opens a USB cam and streams the video.
The program compiles but when I run it I get the following GStreamer exception (which seems unrelated to OpenCV or the C++ source code):
(TLD:5263): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
OpenCV Error: Unspecified error (GStreamer: cannot link elements
) in CvVideoWriter_GStreamer::open, file /home/odroid/Desktop/middleware/CppLibs/opencv-2.4.13.6/modules/highgui/src/cap_gstreamer.cpp, line 1464
terminate called after throwing an instance of 'cv::Exception'
what(): /home/odroid/Desktop/middleware/CppLibs/opencv-2.4.13.6/modules/highgui/src/cap_gstreamer.cpp:1464: error: (-2) GStreamer: cannot link elements
in function CvVideoWriter_GStreamer::open
I am running on odroid.
Have anybody had the same problem?
I was thinking it is a package dependency problem but I have installed xorg
libgl-gst
libgl1-mesa-*
so I am quite lost at the moment.
EDIT
To be precise it is an older version of OpenCV: it is the 2.4.13.6.
The lines initializing VideoCapture are the following (I reported only the relevant ones):
int main(int argc,char** argv){
string devId;
VideoCapture capture;
if(argc>4)
{
int captureNumber;
string deviceId=argv[1];
captureNumber=atoi(argv[1]);
capture.open(captureNumber);
}
EDIT 2
On OSX the same code works without giving this exception (there were only dynamic libraries problem).