• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2#
3# A simple RTP server
4#  sends the output of videotestsrc as h263+ encoded RTP on port 5000, RTCP is sent on
5#  port 5001. The destination is 127.0.0.1.
6#  the video receiver RTCP reports are received on port 5005
7#
8# .-------.    .-------.    .-------.      .----------.     .-------.
9# |vts    |    |h263enc|    |h263pay|      | rtpbin   |     |udpsink|  RTP
10# |      src->sink    src->sink    src->send_rtp send_rtp->sink     | port=5000
11# '-------'    '-------'    '-------'      |          |     '-------'
12#                                          |          |
13#                                          |          |     .-------.
14#                                          |          |     |udpsink|  RTCP
15#                                          |    send_rtcp->sink     | port=5001
16#                           .-------.      |          |     '-------' sync=false
17#                RTCP       |udpsrc |      |          |               async=false
18#              port=5005    |     src->recv_rtcp      |
19#                           '-------'      '----------'
20#
21
22# change this to send the RTP data and RTCP to another host
23DEST=127.0.0.1
24
25# tuning parameters to make the sender send the streams out of sync. Can be used
26# ot test the client RTCP synchronisation.
27#VOFFSET=900000000
28VOFFSET=0
29AOFFSET=0
30
31# H263+ encode from the source
32VELEM="videotestsrc is-live=1"
33VCAPS="video/x-raw,width=352,height=288,framerate=15/1"
34VSOURCE="$VELEM ! $VCAPS"
35VENC="avenc_h263p ! rtph263ppay"
36
37VRTPSINK="udpsink port=5000 host=$DEST ts-offset=$VOFFSET name=vrtpsink"
38VRTCPSINK="udpsink port=5001 host=$DEST sync=false async=false name=vrtcpsink"
39VRTCPSRC="udpsrc port=5005 name=vrtpsrc"
40
41PIPELINE="rtpbin name=rtpbin
42            $VSOURCE ! $VENC ! rtpbin.send_rtp_sink_2
43	      rtpbin.send_rtp_src_2 ! $VRTPSINK
44              rtpbin.send_rtcp_src_2 ! $VRTCPSINK
45            $VRTCPSRC ! rtpbin.recv_rtcp_sink_2"
46
47echo $PIPELINE
48
49gst-launch-1.0 -v $PIPELINE
50