Reverse Engineer RTP Parameters
Sebastian de Castelberg
sebu at kpricorn.org
Wed Sep 28 15:39:58 PDT 2011
hi Ole,
thanks for your reply. I added the is-live parameter to the
audiotestsrc. The audio output on the device is still chopped and a
network trace does not show any change in the rtp stream.
In the meantime I've found out how to set a more specific timing on
the RTP stream by passing the following parameters to rtpL16pay:
gst-launch-0.10 audiotestsrc is-live=TRUE ! audioconvert \
! audio/x-raw-int,depth=16,rate=8000 ! rtpL16pay pt=98 mtu=172
seqnum-offset=0 timestamp-offset=0 timestamp-offset=80 \
! udpsink host=232.0.2.2 port=49253
this results in the following RTP dump:
23:22:29.874071 IP 192.168.0.30.56674 > 232.0.2.2.49253: UDP, length 172
23:22:29.883607 IP 192.168.0.30.56674 > 232.0.2.2.49253: UDP, length 172
23:22:29.893871 IP 192.168.0.30.56674 > 232.0.2.2.49253: UDP, length 172
...
The timing and packet size seem to match the expectations from the
original dump. The Sequence number is being incremented, the Timestamp
increased by 80 and the time difference between two packets is ~0.01s.
Nonetheless, the sound is still choppy (peak, silence, ... , silence,
peak, ...).
To me, it seems that the payload is somehow broken. (encoding, timing,
...). Any advices on how to analyze the whole pipeline?
Here's a gst-launch -v output for the two pipes:
### working: device -> desktop ###
gst-launch-0.10 -v udpsrc multicast-group=232.0.2.1
auto-multicast=true port=49253 multicast-iface="eth0" ! capsfilter
caps="application/x-rtp,
media=(string)audio,clock-rate=(int)8000,encoding-name=(string)L16,payload=(int)98"
! rtpL16depay ! audioconvert ! audioresample ! audio/x-raw-int,
rate=8000 ! alsasink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps =
application/x-rtp, media=(string)audio, clock-rate=(int)8000,
encoding-name=(string)L16, payload=(int)98
/GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0.GstPad:src: caps =
audio/x-raw-int, endianness=(int)4321, signed=(boolean)true,
width=(int)16, depth=(int)16, rate=(int)8000, channels=(int)1,
channel-positions=(GstAudioChannelPosition)<
GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >
/GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0.GstPad:sink: caps =
application/x-rtp, media=(string)audio, clock-rate=(int)8000,
encoding-name=(string)L16, payload=(int)98
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src: caps
= audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1,
channel-positions=(GstAudioChannelPosition)<
GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink: caps
= audio/x-raw-int, endianness=(int)4321, signed=(boolean)true,
width=(int)16, depth=(int)16, rate=(int)8000, channels=(int)1,
channel-positions=(GstAudioChannelPosition)<
GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >
/GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:src:
caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1,
channel-positions=(GstAudioChannelPosition)<
GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >
/GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:sink:
caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1,
channel-positions=(GstAudioChannelPosition)<
GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps =
audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1,
channel-positions=(GstAudioChannelPosition)<
GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps =
audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1,
channel-positions=(GstAudioChannelPosition)<
GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >
/GstPipeline:pipeline0/GstAlsaSink:alsasink0.GstPad:sink: caps =
audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1,
channel-positions=(GstAudioChannelPosition)<
GST_AUDIO_CHANNEL_POSITION_FRONT_MONO >
### not working: desktop -> device (noisy/tinny chunks) ###
akureyri :: ~ > gst-launch-0.10 -v audiotestsrc is-live=TRUE !
audio/x-raw-int,rate=8000,channels=1 ! audioresample ! audioconvert !
rtpL16pay pt=98 mtu=172 seqnum-offset=0 timestamp-offset=0
timestamp-offset=80 ! udpsink host=232.0.2.2 port=49253
Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0.GstPad:src: caps
= audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps =
audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps =
audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1
/GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:src:
caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1
/GstPipeline:pipeline0/GstAudioResample:audioresample0.GstPad:sink:
caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:src: caps
= audio/x-raw-int, endianness=(int)4321, signed=(boolean)true,
width=(int)16, depth=(int)16, rate=(int)8000, channels=(int)1
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0.GstPad:sink: caps
= audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)32, depth=(int)32, rate=(int)8000, channels=(int)1
/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0.GstPad:src: caps =
application/x-rtp, media=(string)audio, clock-rate=(int)8000,
encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1,
payload=(int)98, ssrc=(uint)3298703621, clock-base=(uint)80,
seqnum-base=(uint)0
/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0.GstPad:sink: caps =
audio/x-raw-int, endianness=(int)4321, signed=(boolean)true,
width=(int)16, depth=(int)16, rate=(int)8000, channels=(int)1
/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0: timestamp = 80
/GstPipeline:pipeline0/GstRtpL16Pay:rtpl16pay0: seqnum = 0
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps =
application/x-rtp, media=(string)audio, clock-rate=(int)8000,
encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1,
payload=(int)98, ssrc=(uint)3298703621, clock-base=(uint)80,
seqnum-base=(uint)0
Thanks
Sebastian
On Wed, Sep 28, 2011 at 10:12 PM, Ole André Vadla Ravnås
<oleavr at gmail.com> wrote:
> On Wednesday, September 28, 2011, Sebastian de Castelberg
> <sebu at kpricorn.org> wrote:
> (snip)
>> I haven't yet found a gstreamer setup for the opposite way, streaming
>> to the device. The following pipeline just produced a crackling noise
>> on the device:
>>
>> # 'server' pipeline
>> gst-launch-0.10 audiotestsrc ! audioconvert ! \
>> audio/x-raw-int,depth=16,rate=8000 ! rtpL16pay ! udpsink
>> host=232.0.2.2 port=49253
>
> Add "is-live=TRUE" right after audiotestsrc, otherwise you'll be flooding
> your device with packets.
>
> Cheers,
> Ole André
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
More information about the gstreamer-devel
mailing list