gstreamer-1.0 and opencv, is it broken? (or is it me?)

Thiago Santos ts.santos at sisa.samsung.com
Sat May 10 09:56:50 PDT 2014


On 05/09/2014 09:09 PM, Luis Alberto Zarrabeitia wrote:
> I'm trying to use gstreamer to read a video file for processing in
> opencv (opencv fails to read it, gstreamer works perfectly). However,
> it seems there is a problem, at least in my system, if I try to use
> the opencv UI functions (so far, cv::namedWindow and cv::waitKey),
> subsequent gstreamer calls fail. They work with gstreamer-0.10, but
> not with 1.0, which leads me to think the problem is in the gstreamer
> side or in my local insallation. Or maybe I missed a difference
> between 0.10 and 1.0.
>
> I'm attaching an minimalist example. I added one opencv call to the
> basic tutorial 1. Compiling & running it with gstreamer 1.0:
>
> $ g++ main.cpp `pkg-config --cflags --libs opencv gstreamer-1.0`
>
> fails with
>
> $ ./a.out
> (video:28781): GLib-GObject-WARNING **: cannot register existing type
> `GstObject'
> (video:28781): GLib-CRITICAL **: g_once_init_leave: assertion `result
> != 0' failed
> (video:28781): GLib-GObject-CRITICAL **: g_type_register_static:
> assertion `parent_type > 0' failed
> (video:28781): GLib-CRITICAL **: g_once_init_leave: assertion `result
> != 0' failed
> (video:28781): GStreamer-CRITICAL **:
> gst_pad_set_activatepush_function: assertion `GST_IS_PAD (pad)' failed
> [it gets stuck here, attaching the GST_DEBUG=4 output]
>
> Compiling with 0.10
>
> $ g++ main.cpp `pkg-config --cflags --libs opencv gstreamer-0.10`
>
> it works perfectly. It also works perfectly with both versions if I
> comment out the cv::namedWindow line.
>
> Any idea of how can I work around that? I just need to be able to
> connect an appsink to the pipeline, or an analogous way to extract
> frames, to feed them to my existing program. So far, even connecting
> the video and audio to a fakesink results in the same error.
I just quickly tried your main.cpp tried with upstream gstreamer
and it seems to work. So it might have been fixed in some newer
version but I don't remember anything being fixed in this regard
recently. What version are you using? Did you do anything unusual
in your gstreamer setup?

You can run your app in gdb with G_DEBUG=fatal_warnings
and you will have it break on those assertions so you can check the
backtrace to know where the error is coming from.

>
> Thanks,
>
> Luis
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


-- 
Thiago Sousa Santos
Senior Multimedia Engineer, Open Source Group
Samsung Research America - Silicon Valley

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140510/0ae3c59d/attachment.html>


More information about the gstreamer-devel mailing list