Prepending data to a stream

Peter Maersk-Moller pmaersk at gmail.com
Sun Jun 8 02:12:44 PDT 2014


Is there a method/mechanism by which one can prepend data to the beginning
of a data stream? Currently I use a shell script with unnamed pipes, but
that has limitations and can affect packet boundaries. Here is one example:

(
  echo SOMETHING_TO_PREPEND
  gst-launch -v audiotestsrc is-live=true !\
    queue !\
    fdsink fd=3 3>&1 1>&2
) | nc $host $port

Usually the above example works nicely, but in some cases, where the audio
source may include decoding audio and assuming format=S16LE and channels=2,
there is no guarantee that nc receives in ONE chunck a number of audio
bytes dividable by 4 due to the unnamed pipe feeding nc.

It would be nicer and predictable/controllable if one could do something
like this:

  gst-launch -v audiotestsrc is-live=true !\
    queue !\
    tcpclientsink prepend-data=SOMETHING_TO_PREPEND host=$host port=$port

In fact it could be useful if all (probably non videosinks) datasinks could
be prepended and appended (when closing) data.

Is there currently a way to prepend data for a stream?

Thanks in advance
Peter Maersk-Moller
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140608/eb0424c6/attachment.html>


More information about the gstreamer-devel mailing list