• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2#
3# A simple RTP server
4#  sends the output of autoaudiosrc as alaw encoded RTP on port 5002, RTCP is sent on
5#  port 5003. The destination is 127.0.0.1.
6#  the receiver RTCP reports are received on port 5007
7#
8# .--------.    .-------.    .-------.      .----------.     .-------.
9# |audiosrc|    |alawenc|    |pcmapay|      | rtpbin   |     |udpsink|  RTP
10# |       src->sink    src->sink    src->send_rtp send_rtp->sink     | port=5002
11# '--------'    '-------'    '-------'      |          |     '-------'
12#                                           |          |
13#                                           |          |     .-------.
14#                                           |          |     |udpsink|  RTCP
15#                                           |    send_rtcp->sink     | port=5003
16#                            .-------.      |          |     '-------' sync=false
17#                 RTCP       |udpsrc |      |          |               async=false
18#               port=5007    |     src->recv_rtcp      |
19#                            '-------'      '----------'
20
21# change this to send the RTP data and RTCP to another host
22DEST=127.0.0.1
23
24#AELEM=autoaudiosrc
25AELEM=audiotestsrc
26
27# PCMA encode from an the source
28ASOURCE="$AELEM ! audioconvert"
29AENC="alawenc ! rtppcmapay"
30
31gst-launch-1.0 -v rtpbin name=rtpbin \
32     $ASOURCE ! $AENC ! rtpbin.send_rtp_sink_0  \
33            rtpbin.send_rtp_src_0 ! udpsink port=5002 host=$DEST                      \
34            rtpbin.send_rtcp_src_0 ! udpsink port=5003 host=$DEST sync=false async=false \
35         udpsrc port=5007 ! rtpbin.recv_rtcp_sink_0
36