[gst-devel] RTP audio stream to filesink, issue with packet loss

Thorsten Brendt tbrendt at googlemail.com
Wed Jan 12 22:21:46 CET 2011


Hi!

I'm using Gstreamer to save RTP audio streams to wav files.  This works in
general, however, I need to deal with packet loss and in this case the
pipeline
I'm currently using fails:

  filesrc location=foobar.pcap ! pcapparse
   ! "application/x-rtp, payload=0, clock-rate=8000"
   ! gstrtpjitterbuffer ! rtppcmudepay ! mulawdec ! audioconvert
   ! audioresample ! wavenc ! filesink location=foobar.wav

This produces audio files that are shorter than the original RTP stream,
e.g. for a certain amount of consecutively lost packets a second of audio is
missing from the wav file.  For a real audio sink this doesn't happen as it
plays audio when something is available, the filesink however -- I assume --
writes data sequentially and only when data is actually available.  By the
way: the effect is the same for udpsrc as it is for filesrc+pcapparse.

I tried the above pipeline with filesink's sync property set to true ([1]),
this
didn't make any difference.  I read somewhere in the Gstreamer docs that the
global clock is [usually] dependent on the sink element.  Do I need to
reverse
this and make the sink's clock dependent on the source's clock?

1. <
http://www.gstreamer.net/data/doc/gstreamer/head/gstreamer-libs/html/GstBaseSink.html#gst-base-sink-set-sync
>

Maybe I'm totally off in this regard and there is no implicit way to achieve
what I need.  Ultimately some element in the pipeline needs to produce
"silence/empty/zero data" if its input buffer is empty.  Is there an
explicit
way (helper element/attribute) to do this?

Thorsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110112/58faf7ab/attachment.htm>


More information about the gstreamer-devel mailing list