• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2#
3# A simple RTP receiver with retransmission
4#
5#  receives H264 encoded RTP video on port 5000, RTCP is received on  port 5001.
6#  the receiver RTCP reports are sent to port 5005
7#
8#             .-------.      .----------.     .---------.   .-------.   .-----------.
9#  RTP        |udpsrc |      | rtpbin   |     |h264depay|   |h264dec|   |xvimagesink|
10#  port=5000  |      src->recv_rtp recv_rtp->sink     src->sink   src->sink         |
11#             '-------'      |          |     '---------'   '-------'   '-----------'
12#                            |          |
13#                            |          |     .-------.
14#                            |          |     |udpsink|  RTCP
15#                            |    send_rtcp->sink     | port=5005
16#             .-------.      |          |     '-------' sync=false
17#  RTCP       |udpsrc |      |          |               async=false
18#  port=5001  |     src->recv_rtcp      |
19#             '-------'      '----------'
20
21
22# the caps of the sender RTP stream. This is usually negotiated out of band with
23# SDP or RTSP. normally these caps will also include SPS and PPS but we don't
24# have a mechanism to get this from the sender with a -launch line.
25VIDEO_CAPS="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264"
26
27VIDEO_DEC="rtph264depay ! avdec_h264"
28
29VIDEO_SINK="videoconvert ! autovideosink"
30
31# the destination machine to send RTCP to. This is the address of the sender and
32# is used to send back the RTCP reports of this receiver. If the data is sent
33# from another machine, change this address.
34DEST=127.0.0.1
35
36LATENCY=200
37
38gst-launch-1.0 -v rtpbin name=rtpbin rtp-profile=avpf latency=$LATENCY do-retransmission=1 \
39    udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0                      \
40      rtpbin. ! $VIDEO_DEC ! $VIDEO_SINK                                            \
41    udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0                                      \
42      rtpbin.send_rtcp_src_0 ! udpsink port=5005 host=$DEST sync=false async=false
43