2007-09-04 18:30:22 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2011-02-22 12:50:59 +00:00
|
|
|
# A simple RTP server
|
2009-09-30 16:45:17 +00:00
|
|
|
# sends the output of autoaudiosrc as alaw encoded RTP on port 5002, RTCP is sent on
|
2008-04-25 07:56:12 +00:00
|
|
|
# port 5003. The destination is 127.0.0.1.
|
|
|
|
# the receiver RTCP reports are received on port 5007
|
2007-09-04 18:30:22 +00:00
|
|
|
#
|
2011-02-22 12:50:59 +00:00
|
|
|
# .--------. .-------. .-------. .----------. .-------.
|
|
|
|
# |audiosrc| |alawenc| |pcmapay| | rtpbin | |udpsink| RTP
|
|
|
|
# | src->sink src->sink src->send_rtp send_rtp->sink | port=5002
|
|
|
|
# '--------' '-------' '-------' | | '-------'
|
|
|
|
# | |
|
|
|
|
# | | .-------.
|
|
|
|
# | | |udpsink| RTCP
|
|
|
|
# | send_rtcp->sink | port=5003
|
|
|
|
# .-------. | | '-------' sync=false
|
|
|
|
# RTCP |udpsrc | | | async=false
|
|
|
|
# port=5007 | src->recv_rtcp |
|
|
|
|
# '-------' '----------'
|
2008-04-25 07:56:12 +00:00
|
|
|
|
|
|
|
# change this to send the RTP data and RTCP to another host
|
|
|
|
DEST=127.0.0.1
|
|
|
|
|
2009-09-30 16:45:17 +00:00
|
|
|
#AELEM=autoaudiosrc
|
2008-04-25 07:56:12 +00:00
|
|
|
AELEM=audiotestsrc
|
|
|
|
|
|
|
|
# PCMA encode from an the source
|
|
|
|
ASOURCE="$AELEM ! audioconvert"
|
|
|
|
AENC="alawenc ! rtppcmapay"
|
2007-09-04 18:30:22 +00:00
|
|
|
|
2012-08-26 21:39:55 +00:00
|
|
|
gst-launch-1.0 -v gstrtpbin name=rtpbin \
|
2008-04-25 07:56:12 +00:00
|
|
|
$ASOURCE ! $AENC ! rtpbin.send_rtp_sink_0 \
|
|
|
|
rtpbin.send_rtp_src_0 ! udpsink port=5002 host=$DEST \
|
|
|
|
rtpbin.send_rtcp_src_0 ! udpsink port=5003 host=$DEST sync=false async=false \
|
|
|
|
udpsrc port=5007 ! rtpbin.recv_rtcp_sink_0
|