Combining Gstreamer with other camera capture API's (Bug #3953)
Description
I have the following CMAKE setting on the latest 2.4 branch combined with these two fixes
1) https://github.com/Itseez/opencv/pull/3310
2) https://github.com/Itseez/opencv/pull/3322
General configuration for OpenCV 2.4.10 ===================================== Version control: 2.4.6.1-2093-ged20a2c-dirty Platform: Host: Linux 3.13.0-37-generic x86_64 CMake: 2.8.12.2 CMake generator: Unix Makefiles CMake build tool: /usr/bin/make Configuration: RELEASE C/C++: Built as dynamic libs?: YES C++ Compiler: /usr/bin/c++ (ver 4.8.2) C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG -DNDEBUG C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG C Compiler: /usr/bin/cc C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -O3 -DNDEBUG -DNDEBUG C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG Linker flags (Release): Linker flags (Debug): Precompiled headers: YES OpenCV modules: To be built: core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu ocl nonfree contrib python stitching superres ts videostab Disabled: world Disabled by dependency: - Unavailable: androidcamera dynamicuda java viz GUI: QT 5.x: YES (ver 5.3.0) QT OpenGL support: YES (Qt5::OpenGL 5.3.0) OpenGL support: YES (/usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/libGL.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so) VTK support: NO Media I/O: ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8) JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver ) PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.50) TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 4.0.3) JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1) OpenEXR: /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 1.6.1) Video I/O: DC1394 1.x: NO DC1394 2.x: YES (ver 2.2.1) FFMPEG: YES codec: YES (ver 54.35.0) format: YES (ver 54.20.4) util: YES (ver 52.3.0) swscale: YES (ver 2.1.1) gentoo-style: YES GStreamer: base: YES (ver 0.10.36) video: YES (ver 0.10.36) app: YES (ver 0.10.36) riff: YES (ver 0.10.36) pbutils: YES (ver 0.10.36) OpenNI: NO OpenNI PrimeSensor Modules: NO PvAPI: NO GigEVisionSDK: NO UniCap: NO UniCap ucil: NO V4L/V4L2: Using libv4l1 (ver 1.0.1) / libv4l2 (ver 1.0.1) XIMEA: NO Xine: NO Other third-party libraries: Use IPP: NO Use Eigen: YES (ver 3.2.2) Use TBB: YES (ver 4.2 interface 7000) Use OpenMP: NO Use GCD NO Use Concurrency NO Use C=: NO Use Cuda: YES (ver 6.0) Use OpenCL: YES NVIDIA CUDA Use CUFFT: YES Use CUBLAS: YES USE NVCUVID: NO NVIDIA GPU arch: 30 NVIDIA PTX archs: 30 Use fast math: NO OpenCL: Version: dynamic Include path: /home/spu/Documents/github/opencv/3rdparty/include/opencl/1.2 Use AMD FFT: NO Use AMD BLAS: NO Python: Interpreter: /usr/bin/python2 (ver 2.7.6) Libraries: /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.6) numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.8.2) packages path: lib/python2.7/dist-packages Java: ant: NO JNI: /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include Java tests: NO Documentation: Build Documentation: YES Sphinx: /usr/local/bin/sphinx-build (ver 1.2.2) PdfLaTeX compiler: /usr/bin/pdflatex Tests and samples: Tests: YES Performance tests: YES C/C++ Examples: YES Install path: /usr/local cvconfig.h is in: /home/spu/Documents/github/opencv/build -----------------------------------------------------------------
Code snippet I use to test:
#include <iostream> #include "opencv2/opencv.hpp" using namespace std; using namespace cv; int main() { VideoCapture camera(0); Mat frame; while(true){ camera >> frame; imshow("test", frame); int key = waitKey(10); if(key == 27){ break; } } return 0; }
When firing up the camera interface and trying to connect to it using the default interface, I get the following error.
GStreamer Plugin: Embedded video playback halted; module v4l2src0 reported: Cannot identify device '/dev/video0'. OpenCV Error: Unspecified error (GStreamer: unable to start pipeline ) in icvStartPipeline, file /home/spu/Documents/github/opencv/modules/highgui/src/cap_gstreamer.cpp, line 383 terminate called after throwing an instance of 'cv::Exception' what(): /home/spu/Documents/github/opencv/modules/highgui/src/cap_gstreamer.cpp:383: error: (-2) GStreamer: unable to start pipeline in function icvStartPipeline
If I built OpenCV without Gstreamer support, the samples works perfectly like seen here:
So basically I think there is a Gstreamer error thinking that the PvAPI Manta camera is in fact a Gstreamer supported device.
Anyone knows how to fix this?
Associated revisions
Merge pull request #3953 from ilya-lavrenov:cuda_unused
History
Updated by Steven Puttemans over 10 years ago
And the image didn't get through
Updated by Steven Puttemans over 10 years ago
I can cancel this. Not that there is any mention of this in docs, but if you specify
VideoCapture camera(0 + CV_CAP_PVAPI);
Then the initialization starts. However one way or the other, it doesn't fix the problem of not capturing yet.
Updated by Steven Puttemans over 10 years ago
I can cancel this bug, adding the extra parameter does the trick.
Had a faulty CMAKE config.
Will add a sample on how to use it for future users, since this is not very clear.
- Status changed from Open to Cancelled