How to reference elements across different bins

Gary Thomas gary at mlbassoc.com
Thu Feb 7 12:21:44 PST 2013


I finally figured out how to make my RTSP client record a video
stream, using this pipeline:
   gst-launch -e -vvv rtspsrc location=rtsp://192.168.1.136:8554/test name=src \
      matroskamux name=av-mux ! filesink location=/tmp/video0.mkv \
      src. ! tee name=v-t \
        v-t. ! queue ! rtph264depay ! h264parse ! ffdec_h264 ! xvimagesink \
        v-t. ! queue ! rtph264depay ! h264parse ! video/x-h264,stream-format=avc,alignment=au,framerate=24/1 ! av-mux. \
      src. ! tee name=a-t \
        a-t. ! queue ! rtpmpadepay ! mpegaudioparse ! flump3dec ! audioconvert ! pulsesink \
        a-t. ! queue ! rtpmpadepay ! mpegaudioparse ! flump3dec ! lamemp3enc ! av-mux.


Now, I'm trying to make the same thing happen in my application.  The
problem with my app is that I don't know a priori if there will be audio
or video or both coming in the stream.  To handle this, I've broken the
pipeline into three chunks:

pipeline:
   gst-launch -e -vvv rtspsrc location=rtsp://192.168.1.136:8554/test name=src \
      matroskamux name=av-mux ! filesink location=/tmp/video0.mkv \

video-bin:
      src. ! tee name=v-t \
        v-t. ! queue ! rtph264depay ! h264parse ! ffdec_h264 ! xvimagesink \
        v-t. ! queue ! rtph264depay ! h264parse ! video/x-h264,stream-format=avc,alignment=au,framerate=24/1 ! av-mux. \

audio-bin:
      src. ! tee name=a-t \
        a-t. ! queue ! rtpmpadepay ! mpegaudioparse ! flump3dec ! audioconvert ! pulsesink \
        a-t. ! queue ! rtpmpadepay ! mpegaudioparse ! flump3dec ! lamemp3enc ! av-mux.

The first chunk is my main pipeline and the other two are kept in separate
'bin' elements and only hooked to the main pipeline if/when they need to
connect to the output of the 'src' element.  This works great until I added
the additional steps to copy the data and mux it into an output file.

The problem I have is that in the video bin, the 'av-mux' is not
defined and I get this error:
   glib.GError: No element named "av-mux" - omitting link

I think I need to add a ghost 'src' pad to my video bin but how do I link
it to the mux?

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


More information about the gstreamer-devel mailing list