Ask Your Question
0

Built OpenCV highgui without GSTREAMER support but with PvAPI support fails, adapting cmake doesn't work

asked 2014-10-09 07:23:28 -0600

updated 2014-10-09 08:04:01 -0600

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;
edit retag flag offensive close merge delete

Comments

1

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.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-10-09 07:48:03 -0600 )edit

"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); ?

berak gravatar imageberak ( 2014-10-09 07:57:59 -0600 )edit

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.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-10-09 08:02:03 -0600 )edit
1

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.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-10-09 08:31:08 -0600 )edit

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 ...

StevenPuttemans gravatar imageStevenPuttemans ( 2014-10-09 08:57:43 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-10-13 05:00:57 -0600

@berak, after fixing the capture api when building without gstreamer, i found out that when you have multiple capture systems, you need to indeed specifiy which one to use with the VideoCapture(id + CAP_PVAPI); However documentation mentions that nowhere sadly...

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-10-09 07:23:28 -0600

Seen: 2,545 times

Last updated: Oct 09 '14