Built OpenCV highgui without GSTREAMER support but with PvAPI support fails, adapting cmake doesn't work
So basically I want to built OpenCV with only PvAPI support to be sure that it can connect to my AVT Manta camera instead of running through a own created script.
I put explicitly in cmake-gui and in command line all other video supports off, but still GSTREAMER stays on YES.
Video I/O:
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: NO
codec: NO
format: NO
util: NO
swscale: NO
gentoo-style: NO
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: YES
GigEVisionSDK: NO
UniCap: NO
UniCap ucil: NO
V4L/V4L2: NO/NO
XIMEA: NO
Xine: NO
Result is that it first tries to connect to a camera index 0 using the GSTREAMER interface instead of through the PvAPI interface. Can anyone check if they have the same problem with the following extra build parameter
-D WITH_GSTREAMER=OFF
UPDATE 1
Found this part at https://github.com/Itseez/opencv/blob/01a883df0cae0c12acbbdaa2eb5e3a99dd8a3bfa/cmake/OpenCVFindLibsVideo.cmake
# --- GStreamer ---
ocv_clear_vars(HAVE_GSTREAMER)
# try to find gstreamer 1.x first
if(WITH_GSTREAMER AND NOT WITH_GSTREAMER_0_10)
CHECK_MODULE(gstreamer-base-1.0 HAVE_GSTREAMER_BASE)
CHECK_MODULE(gstreamer-video-1.0 HAVE_GSTREAMER_VIDEO)
CHECK_MODULE(gstreamer-app-1.0 HAVE_GSTREAMER_APP)
CHECK_MODULE(gstreamer-riff-1.0 HAVE_GSTREAMER_RIFF)
CHECK_MODULE(gstreamer-pbutils-1.0 HAVE_GSTREAMER_PBUTILS)
if(HAVE_GSTREAMER_BASE AND HAVE_GSTREAMER_VIDEO AND HAVE_GSTREAMER_APP AND HAVE_GSTREAMER_RIFF AND HAVE_GSTREAMER_PBUTILS)
set(HAVE_GSTREAMER TRUE)
set(GSTREAMER_BASE_VERSION ${ALIASOF_gstreamer-base-1.0_VERSION})
set(GSTREAMER_VIDEO_VERSION ${ALIASOF_gstreamer-video-1.0_VERSION})
set(GSTREAMER_APP_VERSION ${ALIASOF_gstreamer-app-1.0_VERSION})
set(GSTREAMER_RIFF_VERSION ${ALIASOF_gstreamer-riff-1.0_VERSION})
set(GSTREAMER_PBUTILS_VERSION ${ALIASOF_gstreamer-pbutils-1.0_VERSION})
endif()
endif(WITH_GSTREAMER AND NOT WITH_GSTREAMER_0_10)
# if gstreamer 1.x was not found, or we specified we wanted 0.10, try to find it
if(WITH_GSTREAMER_0_10 OR NOT HAVE_GSTREAMER)
CHECK_MODULE(gstreamer-base-0.10 HAVE_GSTREAMER_BASE)
CHECK_MODULE(gstreamer-video-0.10 HAVE_GSTREAMER_VIDEO)
CHECK_MODULE(gstreamer-app-0.10 HAVE_GSTREAMER_APP)
CHECK_MODULE(gstreamer-riff-0.10 HAVE_GSTREAMER_RIFF)
CHECK_MODULE(gstreamer-pbutils-0.10 HAVE_GSTREAMER_PBUTILS)
if(HAVE_GSTREAMER_BASE AND HAVE_GSTREAMER_VIDEO AND HAVE_GSTREAMER_APP AND HAVE_GSTREAMER_RIFF AND HAVE_GSTREAMER_PBUTILS)
set(HAVE_GSTREAMER TRUE)
set(GSTREAMER_BASE_VERSION ${ALIASOF_gstreamer-base-0.10_VERSION})
set(GSTREAMER_VIDEO_VERSION ${ALIASOF_gstreamer-video-0.10_VERSION})
set(GSTREAMER_APP_VERSION ${ALIASOF_gstreamer-app-0.10_VERSION})
set(GSTREAMER_RIFF_VERSION ${ALIASOF_gstreamer-riff-0.10_VERSION})
set(GSTREAMER_PBUTILS_VERSION ${ALIASOF_gstreamer-pbutils-0.10_VERSION})
endif()
endif(WITH_GSTREAMER_0_10 OR NOT HAVE_GSTREAMER)
If you look into the CMake configuration there are only two possible solutions, either GSTREAMER 1 OR GSTREAMER 0.1. However there is not a single case where you can decide NOT to use GSTREAMER.
So now I am wondering if there is a reason for that?
EXTRA
Got it to worl but now it cant find the cam, non-opencv interface does however... I think it could be due to the camera not being connected to eth0 interface but eth1. The opening of the capture is not working.
CvCaptureCAM_PvAPI* capture = new CvCaptureCAM_PvAPI;
if ( capture->open( index ))
return capture;
I edited the suggested code to disable GSTREAMER if you ask this, however, the results are far from satisfying and completely not working. I will look further into the matter.
"it first tries to connect to a camera index 0 using the GSTREAMER interface instead of through the PvAPI interface"
just a thought, did you try VideoCapture(id + CAP_PVAPI); ?
Well I got it working by just adding a line in the CMAKE. I will try your tought later on and submit a fix for this. There is clearly a missing case in the CMAKE. As to the rest. I succeeded in building OpenCV only for PvAPI, it then goes into the functionality, but when trying to connect to the cam it doesnt find it, but I can open it using the normal interface. Probably the problem now is that camera is connected to my eth1 card instead of eth0 card and OpenCV doesn't seem to find it ... Will dig deeper after bug submission.
O GOD what have I started. I am not even sure that the complete PvAPI interface is actually correctly working... Already found 4 bugs in the code so far ... Wondering if anyone ever succeeded in using it through videocapture.
For people interested, I will be updating the interface. The complete interface is build for a proscilla series cam ... with hardcoded parameters, which is complete bullocks ...