queue pipeline and bin setup question

mattes effemm at mykmk.com
Fri Dec 21 12:29:11 PST 2012


I have the following that works with gst-launch:

 v4l2src ! videorate ! queue !x264enc name=venc  \
 alsasrc ! queue ! audioconvert ! faac name=aenc \
 qtmux name=mux ! filesink location=media.mp4    \
 aenc. ! mux. venc. ! mux.

I managed to get this running with the following code:

  gst_bin_add_many(GST_BIN(pipeline),
                    vsourcE, vcapsE, vqueuE, vencE,
                    nqueuE, asourcE, aqueuE, aconvertE, aencE,
                    mqueuE, muxerE, sinkE, NULL);

  gst_element_link_many( vsourcE, vcapsE, vqueuE, vencE, muxerE, NULL );
  gst_element_link_many( asourcE, aqueuE, aconvertE, aencE, muxerE, NULL );
  gst_element_link( muxerE, sinkE );

I checked with the Gstreamer manual and read about bin, pipeline and some
questions arise.

---
What is the advantage having the video chain (v4l2src -> video encoder)
and the audio chain (alsasrc -> audio encoder) to run inside a bin?
(sorry 'chain' might not be the correct term !!)
Are there performance advantages?

---
I was struggeling to express this  "aenc. ! mux. venc. ! mux." 
into c-code until I came to realize that the above C-lines just do fine.
Is that the correct way linking the audio and video chain?
Even though it seems to work, are there any advantages doing it differently? 

---
Do the above c lines automatically setup a 'queue' for each 
chain (video, audio and muxer) ?
I was search for examples and I found decoding examples, suggesting this:
  gst_element_link_many(audio_queue, audio_dec, audio_sink, NULL );

Trying this myself:
  gst_element_link_many( nqueuE,asourcE,aqueuE,aconvertE,aencE,muxerE,NULL);
and I get an error false returned. 
Can't you use a queue element in front of a source element?

Sorry, lots of questions

Mat




More information about the gstreamer-devel mailing list