Pipeline implementation question

Florian Lier fl0 at icram.de
Mon Jun 6 07:26:33 PDT 2011


On 06/03/2011 05:24 PM, Nathanael D. Noblet wrote:
> 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
>
> gst_element_link_many(v4l2src,queue,xvimagesink)
> gst_element_link_many(pulsesrc,queue2,pulsesink)
>
> 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.
Thank you I will try that! BTW: Do you guys have any HowTos or "best
practices" on Audio-Video sync? Like xvimagesink sync="true" / queues
and so on?

Cheers,
Florian



More information about the gstreamer-devel mailing list