gst_parse_launch from /dev/video*

Tim Müller tim at centricular.com
Sun Aug 3 03:08:46 PDT 2014


On Sat, 2014-08-02 at 14:43 -0700, meuchel wrote:

Hi,

> I'm using GStreamer Core Library version 0.10.36 with ubuntu 14.04.

You should really us GStreamer 1.x, which is readily available in ubuntu
14.04. 0.10 is not maintained any longer.

> I have a web cam as video source and when I call gst-launch as below the
> stream will be displayed:
> $ gst-launch v4l2src device=/dev/video0 !
> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
> 
> Now I would like to know how to manage streaming from /dev/video* source
> from a C-program (with gst_parse_launch?) and not via gst-launch.
> Any hint?
> 
> I tried to modify basic-tutorial-1.c in different ways e.g.:
> pipeline = gst_parse_launch ("v4l2src device=/dev/video0 !
> 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink", NULL);
>   
> and got this:
> 
> $ ./basic-tutorial-1
> (basic-tutorial-1:11641): GStreamer-CRITICAL **: gst_element_set_state:
> assertion `GST_IS_ELEMENT (element)' failed
> (basic-tutorial-1:11641): GStreamer-CRITICAL **: gst_element_get_bus:
> assertion `GST_IS_ELEMENT (element)' failed
> (basic-tutorial-1:11641): GStreamer-CRITICAL **: gst_bus_timed_pop_filtered:
> assertion `GST_IS_BUS (bus)' failed
> (basic-tutorial-1:11641): GStreamer-CRITICAL **: gst_object_unref: assertion
> `object != NULL' failed
> (basic-tutorial-1:11641): GStreamer-CRITICAL **: gst_element_set_state:
> assertion `GST_IS_ELEMENT (element)' failed
> (basic-tutorial-1:11641): GStreamer-CRITICAL **: gst_object_unref: assertion
> `object != NULL' failed
> 
> I also tried different other syntaxes for gst_parse_launch but with no
> success.
> I'm very new regarding Gstreaming and any help would be fine.

My guess is that gst_parse_launch() returns NULL. Probably because of a
problem parsing the pipeline string you pass or a missing element. Since
it works in gst-launch, it's likely a syntax issue. In this case I
suspect it trips over the apostrophes, which are only needed for the
shell, but not gst_parse_launch().

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com



More information about the gstreamer-devel mailing list