jayrambhia / Install-OpenCV

shell scripts to install different version of OpenCV in different distributions of Linux
1.04k stars 947 forks source link

OpenCV Error: Unspecified error (GStreamer: your gstreamer installation is missing a required plugin ) #63

Closed asdf2014 closed 5 years ago

asdf2014 commented 8 years ago

After i run "Install-OpenCV/Ubuntu/2.4/opencv2_4_10.sh", i got follow errors when i run jar using opencv.

input

java -cp /opt/data/VideoSynopsis.jar com.video.synopsis.VideoSynopsis /opt/data/video_synopsis/

output

2016-04-10 19:24:20.835 | INFO | Starting getFrames... | com.video.synopsis.BackgroundSubtraction.getFrames | BackgroundSubtraction.java:22 
2016-04-10 19:24:20.837 | INFO | Video is [{}]... | com.video.synopsis.BackgroundSubtraction.getFrames | BackgroundSubtraction.java:23 
OpenCV Error: Unspecified error (GStreamer: your gstreamer installation is missing a required plugin
) in handlemessage, file /home/saudet/projects/bytedeco/javacpp-presets/opencv/cppbuild/linux-x86_64/opencv-2.4.10/modules/highgui/src/cap_gstreamer.cpp, line 1622
Exception in thread "main" java.lang.RuntimeException: /home/saudet/projects/bytedeco/javacpp-presets/opencv/cppbuild/linux-x86_64/opencv-2.4.10/modules/highgui/src/cap_gstreamer.cpp:1622: error: (-2) GStreamer: your gstreamer installation is missing a required plugin
 in function handlemessage

    at org.bytedeco.javacpp.opencv_highgui.cvCreateFileCapture(Native Method)
    at org.bytedeco.javacv.OpenCVFrameGrabber.start(OpenCVFrameGrabber.java:169)
    at com.video.synopsis.BackgroundSubtraction.getFrames(BackgroundSubtraction.java:36)
    at com.video.synopsis.VideoSynopsis.main(VideoSynopsis.java:21)

Please help me to slove it...

asdf2014 commented 8 years ago

I tried ...

sudo add-apt-repository ppa:mc3man/gstffmpeg-keep
sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg

http://askubuntu.com/questions/456072/clementine-wont-play-wma-with-your-gstreamer-installation-is-missing-a-plugi

But, jvm crashed...

hs_err_pid2214.txt

Bahramudin commented 6 years ago

@asdf2014 Hi! Did you solve the problem, I also have the same problem with GWstreamer on CentOS. Thanks!

asdf2014 commented 6 years ago

Hi, @Bahramudin . Sorry, I have no any idea. Already give up...

IamSierraCharlie commented 6 years ago

An old thread, but I hope my update may help someone in future. I've just spend a few days messing around with different builds (from source) for opencv. I was hitting the very same issue and after 10 or 15 builds, I decided to build without gstreamer support. So the option I used was -D WITH_GSTREAMER=OFF to explicitly turn the support for it off. Other support for things like FFMPEG is on by default (I believe). When I disabled gstreamer in this way, I got around this error. Admittedly, you appear to be working in java whereas I was working in python, but the issue presents in the same fashion - same error code, etc. This is how I ended up at this page. I'm not sure if you are actually building opoencv or not either. FYI, For me, this is for opencv 3.4.0 built on Ubuntu 16.04 with CUDA support. I hope this helps someone else as it was a pain in the backside for me for many hours... If someone actually knows how to compile opencv with gstreamer support, I'd love to chat with them about their experiences and how they got to make it work - if you absolutely need gstreamer, then this will only serve as a workaround.