OpenCV 3.0.0 error with Gstreamer

2020-03-26 18:11发布

问题:

I just installed OpenCV 3.0 following this tutorial: http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/

I didn't encounter any error during the installation process. However, when I tried running the a sample program such as the following,

cd cpp/
./cpp-example-facedetect lena.jpg // (../data/lena.jpg) OpenCV 3.0 beta
./cpp-example-houghlines pic1.png // (../data/pic1.jpg) OpenCV 3.0 beta

I get the following error:

Processing 1 lena.jpg
GStreamer: Error opening bin: Unrecoverable syntax error while parsing pipeline lena.jpg
Capture from AVI didn't work
init done 
opengl support available 
In image read

I'm a complete newbie to computer vision and I don't have a clue as to what the problem could be. Could anyone help me out?

回答1:

I did the same, following the same tutorial. Only difference I made is with Gstreamer, doing this:

  • sudo add-apt-repository ppa:gstreamer-developers/ppa
  • sudo apt-get update
  • sudo apt-get install gstreamer1.0

But another thing that is not clear in your question. The lena.jpg file is not in the same directory, but the data folder (one higher). So the command line in the cpp folder should be:

./cpp-example-facedetect ../data/lena.jpg



回答2:

I got the first part of this error: "GStreamer: Error opening bin: Unrecoverable syntax error while parsing pipeline" with gstreamer installed already. Turns out it was because I was using a "~" in my file path and I forgot that it would not be expanded. Not the most intuitive error message for it not being able to find the file.