Pipeline implementation question

Nathanael D. Noblet nathanael at gnat.ca
Fri Jun 3 08:24:14 PDT 2011

On 06/03/2011 05:23 AM, Florian Lier wrote:
> Hello all,
> I have a problem which is similar to Bernhards (I guess, due to my
> limited GS knowledge) ...
> The best approach to describe my problem maybe is to create a very
> simple example pipeline
> like this one:
> "gst-launch-0.10 v4l2src ! queue ! xvimagesink pulsesrc ! queue ! pulsesink"
> AFAIK one would implement this like the following (*pseudo-code*)
> bin = gst_pipeline_new("Pipeline");
> v4l2src = gst_element_factory_make ("v4l2src", "videosrc");
> queue = gst_element_factory_make ("queue", "queue");
> xvimagesink = gst_element_factory_make ("xvimagesink", "xvimagesink");
> pulsesrc = gst_element_factory_make ("pulsesrc", "audiosrc");
> queue2 = gst_element_factory_make ("queue", "queue2");
> pulsesink = gst_element_factory_make ("pulsesink", "audiosink");
> Now:
> gst_bin_add_many(GST_BIN(bin), v4l2src, queue, xvimagesink, pulsesrc,
> queue2, pulsesink, NULL);
> In the next step one would link the elements and that's when I get
> confused - You don't actually "link" the
> imagesink to the pulsesrc - How do you implement this pipeline?
> gst_element_link_many(v4l2src, queue, xvimagesink, pulsesrc, queue2,
> pulsesink, NULL);
> Doesn't work and produces a SegFault...

Think about what is happening. You have one pipeline with two 'streams' 
you could say, one is audio, one is video. Even though there are two 
streams it is one pipe because you want some synchronization between 
them (audio synced to video etc).

So you are building one pipe, but the audio is one stream that links 
source to output, and video is another that links from source to output.

Also in your particular pipe, I don't think you need queue's. so you 
would do


A few things you need to know about the above, it still may not work 
since the output from a v4l2src may not be compatible with your screens 
etc... Same for audio, So you may have to use ffmpegcolourspace, or 
caps, or audioconvert/resample etc modules in there.
Nathanael d. Noblet
t 403.875.4613

More information about the gstreamer-devel mailing list