2007-09-04 18:30:22 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2011-02-22 12:50:59 +00:00
|
|
|
# A simple RTP receiver
|
2007-09-04 18:30:22 +00:00
|
|
|
#
|
2008-04-25 07:56:12 +00:00
|
|
|
# receives H264 encoded RTP video on port 5000, RTCP is received on port 5001.
|
2010-09-30 09:33:24 +00:00
|
|
|
# the receiver RTCP reports are sent to port 5005
|
2008-04-25 07:56:12 +00:00
|
|
|
# receives alaw encoded RTP audio on port 5002, RTCP is received on port 5003.
|
|
|
|
# the receiver RTCP reports are sent to port 5007
|
|
|
|
#
|
|
|
|
# .-------. .----------. .---------. .-------. .-----------.
|
|
|
|
# RTP |udpsrc | | rtpbin | |h264depay| |h264dec| |xvimagesink|
|
|
|
|
# port=5000 | src->recv_rtp recv_rtp->sink src->sink src->sink |
|
|
|
|
# '-------' | | '---------' '-------' '-----------'
|
2011-02-22 12:50:59 +00:00
|
|
|
# | |
|
2008-04-25 07:56:12 +00:00
|
|
|
# | | .-------.
|
|
|
|
# | | |udpsink| RTCP
|
|
|
|
# | send_rtcp->sink | port=5005
|
|
|
|
# .-------. | | '-------' sync=false
|
|
|
|
# RTCP |udpsrc | | | async=false
|
2011-02-22 12:50:59 +00:00
|
|
|
# port=5001 | src->recv_rtcp |
|
|
|
|
# '-------' | |
|
2008-04-25 07:56:12 +00:00
|
|
|
# | |
|
2011-02-22 12:50:59 +00:00
|
|
|
# .-------. | | .---------. .-------. .-------------.
|
2009-09-30 16:45:17 +00:00
|
|
|
# RTP |udpsrc | | rtpbin | |pcmadepay| |alawdec| |autoaudiosink|
|
2011-02-22 12:50:59 +00:00
|
|
|
# port=5002 | src->recv_rtp recv_rtp->sink src->sink src->sink |
|
|
|
|
# '-------' | | '---------' '-------' '-------------'
|
|
|
|
# | |
|
2008-04-25 07:56:12 +00:00
|
|
|
# | | .-------.
|
|
|
|
# | | |udpsink| RTCP
|
|
|
|
# | send_rtcp->sink | port=5007
|
|
|
|
# .-------. | | '-------' sync=false
|
|
|
|
# RTCP |udpsrc | | | async=false
|
2011-02-22 12:50:59 +00:00
|
|
|
# port=5003 | src->recv_rtcp |
|
|
|
|
# '-------' '----------'
|
2008-04-25 07:56:12 +00:00
|
|
|
|
|
|
|
# the destination machine to send RTCP to. This is the address of the sender and
|
|
|
|
# is used to send back the RTCP reports of this receiver. If the data is sent
|
|
|
|
# from another machine, change this address.
|
|
|
|
DEST=127.0.0.1
|
|
|
|
|
|
|
|
# this adjusts the latency in the receiver
|
|
|
|
LATENCY=200
|
2007-09-04 18:30:22 +00:00
|
|
|
|
2008-04-25 07:56:12 +00:00
|
|
|
# the caps of the sender RTP stream. This is usually negotiated out of band with
|
|
|
|
# SDP or RTSP. normally these caps will also include SPS and PPS but we don't
|
|
|
|
# have a mechanism to get this from the sender with a -launch line.
|
2007-09-04 18:30:22 +00:00
|
|
|
VIDEO_CAPS="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264"
|
|
|
|
AUDIO_CAPS="application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-name=(string)PCMA"
|
|
|
|
|
2012-10-11 21:36:21 +00:00
|
|
|
VIDEO_DEC="rtph264depay ! avdec_h264"
|
2010-11-15 09:52:31 +00:00
|
|
|
AUDIO_DEC="rtppcmadepay ! alawdec"
|
|
|
|
|
2012-08-26 21:39:55 +00:00
|
|
|
VIDEO_SINK="videoconvert ! autovideosink"
|
2011-01-24 13:39:58 +00:00
|
|
|
AUDIO_SINK="audioconvert ! audioresample ! autoaudiosink"
|
2010-11-15 09:52:31 +00:00
|
|
|
|
2012-10-11 21:36:21 +00:00
|
|
|
gst-launch-1.0 -v rtpbin name=rtpbin latency=$LATENCY \
|
2008-04-25 07:56:12 +00:00
|
|
|
udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \
|
2010-11-15 09:52:31 +00:00
|
|
|
rtpbin. ! $VIDEO_DEC ! $VIDEO_SINK \
|
2008-04-25 07:56:12 +00:00
|
|
|
udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \
|
|
|
|
rtpbin.send_rtcp_src_0 ! udpsink port=5005 host=$DEST sync=false async=false \
|
|
|
|
udpsrc caps=$AUDIO_CAPS port=5002 ! rtpbin.recv_rtp_sink_1 \
|
2010-11-15 09:52:31 +00:00
|
|
|
rtpbin. ! $AUDIO_DEC ! $AUDIO_SINK \
|
2008-04-25 07:56:12 +00:00
|
|
|
udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \
|
|
|
|
rtpbin.send_rtcp_src_1 ! udpsink port=5007 host=$DEST sync=false async=false
|