3 # A simple RTP receiver
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 # receives alaw encoded RTP audio on port 5002, RTCP is received on port 5003.
8 # the receiver RTCP reports are sent to port 5007
10 # .-------. .----------. .---------. .-------. .-----------.
11 # RTP |udpsrc | | rtpbin | |h264depay| |h264dec| |xvimagesink|
12 # port=5000 | src->recv_rtp recv_rtp->sink src->sink src->sink |
13 # '-------' | | '---------' '-------' '-----------'
17 # | send_rtcp->sink | port=5005
18 # .-------. | | '-------' sync=false
19 # RTCP |udpsrc | | | async=false
20 # port=5001 | src->recv_rtcp |
23 # .-------. | | .---------. .-------. .-------------.
24 # RTP |udpsrc | | rtpbin | |pcmadepay| |alawdec| |autoaudiosink|
25 # port=5002 | src->recv_rtp recv_rtp->sink src->sink src->sink |
26 # '-------' | | '---------' '-------' '-------------'
30 # | send_rtcp->sink | port=5007
31 # .-------. | | '-------' sync=false
32 # RTCP |udpsrc | | | async=false
33 # port=5003 | src->recv_rtcp |
34 # '-------' '----------'
36 # the destination machine to send RTCP to. This is the address of the sender and
37 # is used to send back the RTCP reports of this receiver. If the data is sent
38 # from another machine, change this address.
41 # this adjusts the latency in the receiver
44 # the caps of the sender RTP stream. This is usually negotiated out of band with
45 # SDP or RTSP. normally these caps will also include SPS and PPS but we don't
46 # have a mechanism to get this from the sender with a -launch line.
47 VIDEO_CAPS="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264"
48 AUDIO_CAPS="application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-name=(string)PCMA"
50 VIDEO_DEC="rtph264depay ! ffdec_h264"
51 AUDIO_DEC="rtppcmadepay ! alawdec"
53 VIDEO_SINK="ffmpegcolorspace ! autovideosink"
54 AUDIO_SINK="audioconvert ! audioresample ! autoaudiosink"
56 gst-launch -v gstrtpbin name=rtpbin latency=$LATENCY \
57 udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \
58 rtpbin. ! $VIDEO_DEC ! $VIDEO_SINK \
59 udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \
60 rtpbin.send_rtcp_src_0 ! udpsink port=5005 host=$DEST sync=false async=false \
61 udpsrc caps=$AUDIO_CAPS port=5002 ! rtpbin.recv_rtp_sink_1 \
62 rtpbin. ! $AUDIO_DEC ! $AUDIO_SINK \
63 udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \
64 rtpbin.send_rtcp_src_1 ! udpsink port=5007 host=$DEST sync=false async=false