examples: improve RTP examples

Make the examples use autovideosink and ffmpegcolorspace for better
compàtibility.
Make some more variables for the sink and the decoders.
Set zerolatency tuning on x264enc for better realtime results.
This commit is contained in:
Wim Taymans 2010-11-15 10:52:31 +01:00
parent 7ed250c793
commit fdfe76ac53
7 changed files with 43 additions and 11 deletions

View file

@ -6,12 +6,18 @@
VIDEO_CAPS="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H263-1998"
AUDIO_CAPS="application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-name=(string)AMR,encoding-params=(string)1,octet-align=(string)1"
VIDEO_DEC="rtph263pdepay ! ffdec_h263"
AUDIO_DEC="rtpamrdepay ! amrnbdec"
VIDEO_SINK="ffmpegcolorspace ! autovideosink"
AUDIO_SINK="audioconvert ! audioresample ! autoaudisink"
gst-launch -v gstrtpbin name=rtpbin latency=100 \
udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \
rtpbin. ! rtph263pdepay ! ffdec_h263 ! xvimagesink \
rtpbin. ! $VIDEO_DEC ! $VIDEO_SINK \
udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \
rtpbin.send_rtcp_src_0 ! udpsink port=5005 sync=false async=false \
udpsrc caps=$AUDIO_CAPS port=5002 ! rtpbin.recv_rtp_sink_1 \
rtpbin. ! rtpamrdepay ! amrnbdec ! autoaudiosink slave-method=1 \
rtpbin. ! $AUDIO_DEC ! $AUDIO_SINK \
udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \
rtpbin.send_rtcp_src_1 ! udpsink port=5007 sync=false async=false

View file

@ -9,14 +9,20 @@ AUDIO_CAPS="application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-
#DEST=192.168.1.126
DEST=localhost
VIDEO_DEC="rtph263pdepay ! ffdec_h263"
AUDIO_DEC="rtppcmadepay ! alawdec"
VIDEO_SINK="ffmpegcolorspace ! autovideosink"
AUDIO_SINK="audioconvert ! audioresample ! autoaudisink"
LATENCY=100
gst-launch -v gstrtpbin name=rtpbin latency=$LATENCY \
udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \
rtpbin. ! rtph263pdepay ! ffdec_h263 ! xvimagesink \
rtpbin. ! $VIDEO_DEC ! $VIDEO_SINK \
udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \
rtpbin.send_rtcp_src_0 ! udpsink host=$DEST port=5005 sync=false async=false \
udpsrc caps=$AUDIO_CAPS port=5002 ! rtpbin.recv_rtp_sink_1 \
rtpbin. ! rtppcmadepay ! alawdec ! autoaudiosink buffer-time=10000 \
rtpbin. ! $AUDIO_DEC ! $AUDIO_SINK \
udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \
rtpbin.send_rtcp_src_1 ! udpsink host=$DEST port=5007 sync=false async=false

View file

@ -8,10 +8,14 @@ VIDEO_CAPS="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding
#DEST=192.168.1.126
DEST=localhost
VIDEO_DEC="rtph263pdepay ! ffdec_h263"
VIDEO_SINK="ffmpegcolorspace ! autovideosink"
LATENCY=100
gst-launch -v gstrtpbin name=rtpbin latency=$LATENCY \
udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \
rtpbin. ! rtph263pdepay ! ffdec_h263 ! xvimagesink \
rtpbin. ! $VIDEO_DEC ! $VIDEO_SINK \
udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \
rtpbin.send_rtcp_src_0 ! udpsink host=$DEST port=5005 sync=false async=false

View file

@ -47,12 +47,18 @@ LATENCY=200
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"
VIDEO_DEC="rtph264depay ! ffdec_h264"
AUDIO_DEC="rtppcmadepay ! alawdec"
VIDEO_SINK="ffmpegcolorspace ! autovideosink"
AUDIO_SINK="audioconvert ! audioresample ! autoaudisink"
gst-launch -v gstrtpbin name=rtpbin latency=$LATENCY \
udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \
rtpbin. ! rtph264depay ! ffdec_h264 ! xvimagesink \
rtpbin. ! $VIDEO_DEC ! $VIDEO_SINK \
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 \
rtpbin. ! rtppcmadepay ! alawdec ! audioconvert ! audioresample ! autoaudiosink \
rtpbin. ! $AUDIO_DEC ! $AUDIO_SINK \
udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \
rtpbin.send_rtcp_src_1 ! udpsink port=5007 host=$DEST sync=false async=false

View file

@ -24,13 +24,19 @@
# have a mechanism to get this from the sender with a -launch line.
VIDEO_CAPS="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264"
VIDEO_DEC="rtph264depay ! ffdec_h264"
VIDEO_SINK="ffmpegcolorspace ! autovideosink"
# 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
gst-launch -v gstrtpbin name=rtpbin \
LATENCY=200
gst-launch -v gstrtpbin name=rtpbin latency=$LATENCY \
udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \
rtpbin. ! rtph264depay ! ffdec_h264 ! xvimagesink \
rtpbin. ! $VIDEO_DEC ! $VIDEO_SINK \
udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \
rtpbin.send_rtcp_src_0 ! udpsink port=5005 host=$DEST sync=false async=false

View file

@ -23,6 +23,10 @@
# SDP or RTSP.
AUDIO_CAPS="application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-name=(string)PCMA"
AUDIO_DEC="rtppcmadepay ! alawdec"
AUDIO_SINK="audioconvert ! audioresample ! autoaudisink"
# 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.
@ -30,6 +34,6 @@ DEST=127.0.0.1
gst-launch -v gstrtpbin name=rtpbin \
udpsrc caps=$AUDIO_CAPS port=5002 ! rtpbin.recv_rtp_sink_0 \
rtpbin. ! rtppcmadepay ! alawdec ! audioconvert ! audioresample ! autoaudiosink \
rtpbin. ! $AUDIO_DEC ! $AUDIO_SINK \
udpsrc port=5003 ! rtpbin.recv_rtcp_sink_0 \
rtpbin.send_rtcp_src_0 ! udpsink port=5007 host=$DEST sync=false async=false

View file

@ -51,7 +51,7 @@ VELEM="v4l2src"
#VELEM="videotestsrc is-live=1"
VCAPS="video/x-raw-yuv,width=352,height=288,framerate=15/1"
VSOURCE="$VELEM ! $VCAPS ! queue ! videorate ! ffmpegcolorspace"
VENC="x264enc byte-stream=true bitrate=300 ! rtph264pay"
VENC="x264enc tune=zerolatency byte-stream=true bitrate=300 ! rtph264pay"
VRTPSINK="udpsink port=5000 host=$DEST ts-offset=$VOFFSET name=vrtpsink"
VRTCPSINK="udpsink port=5001 host=$DEST sync=false async=false name=vrtcpsink"