gstreamer videograbber and highgui, segmentation fault

Hi there

I am trying to use a combo of oxfOpenCv and OpenCv calls. I am also using the gstreamer videograbber so kindly provided by arturo here. I am on Ubuntu 9.04 and Code::Blocks.

I have managed to narrow down my problem and reproduce it in the following way.
If I take the movieGrabber example as provided in the link above it works perfectly with my webcam. If however I add -lhighgui to Build Options … Linker Settings … Other linker options, it stops working.

The message is
‘GstAppSink’ has no property name ‘emit-signals’ and gives a segmentation fault.

If I run this in the debugger it stops in file ofGstUtils in this function.
void ofGstDataLock(ofGstVideoData * data){
pthread_mutex_lock( &(data->buffer_mutex) );
}
on the pthread_mutex_lock call(line 29). There is more info in the call stack. This makes me think something in highgui is messing with the mutex, even though I am not even making any calls to anything in highgui, I don’t even have any headers included, nothing from highgui should be running as I see it. The example is complete unchanged except for the -lhighgui at link time.

Does anybody have any idea how to fix this?

Am I linking in the OpenCv libs correctly?

Any input would be appreciated.

I’ve been able to combine a libdc1394 grabber with highgui on linux successfully before but I haven’t tried the Gstreamer one.

However, in your case perhaps there’s some namespace corruption. Try moving changing the order of the linking…i.e. put -lhighgui right at the end of the linking so that it doesn’t get picked up first.

Thank you grimus, you helped me indirectly.

In my mission to set the link order, I decided to fill the library in the link libraries of the project as highgui rather than as an extra setting in the form of -lhighgui. And now the problem has gone! So it must have been something with the order, I couldn’t see the order in the build messages or build log nor could I find it in the Makefile but since it is working I am not going to mess with it.

Hi,

I have exactly the same problem with pthread_mutex_lock and changing libraries order in gcc link command does not seems to have any effect. I haded -pthread to the compilers flags and -lpthread to the linker flags.

Any clue ?

F.

Hi,

I finally managed to run without segfault when disable highgui… don’t know why linking with highgui cause segfault.

Regards

i try to run opencvExample on ubuntu 10.04 with openframworks on codebloks, i have “segmentation fault”, someone talk about changing the linker, how can i do it. i don’t see build options on main menu.
:frowning:
thanks folks!

Are you using OF from github? 0061 has problems with video in general under ubuntu 10.04 so perhaps thats the problem?

there isn’t some download in the github page, how have it?

ok i find it

Just go to

http://github.com/openframeworks/openFrameworks

And press download source, in the popup that shows up, select tar

:slight_smile: