From ec68d41d6984e0d5d0560edef81e8c54dd641495 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 4 Sep 2007 18:30:22 +0000 Subject: [PATCH] tests/examples/: Added some RTP example scripts for sending and receiving RTP streams. Original commit message from CVS: * tests/examples/Makefile.am: * tests/examples/rtp/Makefile.am: * tests/examples/rtp/client-H263p-AMR.sh: * tests/examples/rtp/client-H263p-PCMA.sdp: * tests/examples/rtp/client-H263p-PCMA.sh: * tests/examples/rtp/client-H264-PCMA.sdp: * tests/examples/rtp/client-H264-PCMA.sh: * tests/examples/rtp/client-PCMA.sh: * tests/examples/rtp/server-VTS-H263p-ATS-PCMA.sh: * tests/examples/rtp/server-alsasrc-PCMA.sh: * tests/examples/rtp/server-v4l2-H263p-alsasrc-AMR.sh: * tests/examples/rtp/server-v4l2-H264-alsasrc-PCMA.sh: Added some RTP example scripts for sending and receiving RTP streams. --- ChangeLog | 16 +++++++++++++ tests/examples/Makefile.am | 4 ++-- tests/examples/rtp/Makefile.am | 12 ++++++++++ tests/examples/rtp/client-H263p-AMR.sh | 17 ++++++++++++++ tests/examples/rtp/client-H263p-PCMA.sdp | 12 ++++++++++ tests/examples/rtp/client-H263p-PCMA.sh | 17 ++++++++++++++ tests/examples/rtp/client-H264-PCMA.sdp | 12 ++++++++++ tests/examples/rtp/client-H264-PCMA.sh | 17 ++++++++++++++ tests/examples/rtp/client-PCMA.sh | 12 ++++++++++ tests/examples/rtp/server-VTS-H263p-ATS-PCMA.sh | 16 +++++++++++++ tests/examples/rtp/server-alsasrc-PCMA.sh | 10 +++++++++ .../examples/rtp/server-v4l2-H263p-alsasrc-AMR.sh | 22 ++++++++++++++++++ .../examples/rtp/server-v4l2-H264-alsasrc-PCMA.sh | 26 ++++++++++++++++++++++ 13 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 tests/examples/rtp/Makefile.am create mode 100755 tests/examples/rtp/client-H263p-AMR.sh create mode 100644 tests/examples/rtp/client-H263p-PCMA.sdp create mode 100755 tests/examples/rtp/client-H263p-PCMA.sh create mode 100644 tests/examples/rtp/client-H264-PCMA.sdp create mode 100755 tests/examples/rtp/client-H264-PCMA.sh create mode 100755 tests/examples/rtp/client-PCMA.sh create mode 100755 tests/examples/rtp/server-VTS-H263p-ATS-PCMA.sh create mode 100755 tests/examples/rtp/server-alsasrc-PCMA.sh create mode 100755 tests/examples/rtp/server-v4l2-H263p-alsasrc-AMR.sh create mode 100755 tests/examples/rtp/server-v4l2-H264-alsasrc-PCMA.sh diff --git a/ChangeLog b/ChangeLog index 9986678..675514b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,21 @@ 2007-09-04 Wim Taymans + * tests/examples/Makefile.am: + * tests/examples/rtp/Makefile.am: + * tests/examples/rtp/client-H263p-AMR.sh: + * tests/examples/rtp/client-H263p-PCMA.sdp: + * tests/examples/rtp/client-H263p-PCMA.sh: + * tests/examples/rtp/client-H264-PCMA.sdp: + * tests/examples/rtp/client-H264-PCMA.sh: + * tests/examples/rtp/client-PCMA.sh: + * tests/examples/rtp/server-VTS-H263p-ATS-PCMA.sh: + * tests/examples/rtp/server-alsasrc-PCMA.sh: + * tests/examples/rtp/server-v4l2-H263p-alsasrc-AMR.sh: + * tests/examples/rtp/server-v4l2-H264-alsasrc-PCMA.sh: + Added some RTP example scripts for sending and receiving RTP streams. + +2007-09-04 Wim Taymans + * sys/v4l2/gstv4l2src.c: (gst_v4l2_get_caps_info), (gst_v4l2src_set_caps), (gst_v4l2src_get_mmap): Restructure the setcaps function so that we can also compute the diff --git a/tests/examples/Makefile.am b/tests/examples/Makefile.am index 2c5f67a..b5530f1 100644 --- a/tests/examples/Makefile.am +++ b/tests/examples/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS = level +SUBDIRS = level rtp -DIST_SUBDIRS = level +DIST_SUBDIRS = level rtp diff --git a/tests/examples/rtp/Makefile.am b/tests/examples/rtp/Makefile.am new file mode 100644 index 0000000..f0b033b --- /dev/null +++ b/tests/examples/rtp/Makefile.am @@ -0,0 +1,12 @@ +noinst_SCRIPTS=client-H263p-AMR.sh \ + client-H263p-PCMA.sh \ + client-H264-PCMA.sh \ + client-PCMA.sh \ + server-alsasrc-PCMA.sh \ + server-v4l2-H263p-alsasrc-AMR.sh \ + server-v4l2-H264-alsasrc-PCMA.sh \ + server-VTS-H263p-ATS-PCMA.sh + +EXTRA_DIST= $(noinst_SCRIPTS) \ + client-H263p-PCMA.sdp \ + client-H264-PCMA.sdp diff --git a/tests/examples/rtp/client-H263p-AMR.sh b/tests/examples/rtp/client-H263p-AMR.sh new file mode 100755 index 0000000..5964774 --- /dev/null +++ b/tests/examples/rtp/client-H263p-AMR.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# +# A simple RTP receiver +# + +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" + +gst-launch -v gstrtpbin name=rtpbin latency=100 \ + udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \ + rtpbin. ! rtph263pdepay ! ffdec_h263 ! xvimagesink \ + 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 ! alsasink slave-method=1 \ + udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \ + rtpbin.send_rtcp_src_1 ! udpsink port=5007 sync=false async=false diff --git a/tests/examples/rtp/client-H263p-PCMA.sdp b/tests/examples/rtp/client-H263p-PCMA.sdp new file mode 100644 index 0000000..125e04d --- /dev/null +++ b/tests/examples/rtp/client-H263p-PCMA.sdp @@ -0,0 +1,12 @@ +v=0 +o=- 1188340656180883 1 IN IP4 192.168.1.110 +s=Session streamed by GStreamer +i=server.sh +t=0 0 +a=tool:GStreamer +a=type:broadcast +m=video 5000 RTP/AVP 96 +c=IN IP4 0.0.0.0 +a=rtpmap:96 H263-1998/90000 +m=audio 5002 RTP/AVP 8 +c=IN IP4 0.0.0.0 diff --git a/tests/examples/rtp/client-H263p-PCMA.sh b/tests/examples/rtp/client-H263p-PCMA.sh new file mode 100755 index 0000000..298111e --- /dev/null +++ b/tests/examples/rtp/client-H263p-PCMA.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# +# A simple RTP receiver +# + +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)PCMA" + +gst-launch -v gstrtpbin name=rtpbin \ + udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \ + rtpbin. ! rtph263pdepay ! ffdec_h263 ! xvimagesink \ + 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. ! rtppcmadepay ! alawdec ! alsasink \ + udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \ + rtpbin.send_rtcp_src_1 ! udpsink port=5007 sync=false async=false diff --git a/tests/examples/rtp/client-H264-PCMA.sdp b/tests/examples/rtp/client-H264-PCMA.sdp new file mode 100644 index 0000000..fa2722e --- /dev/null +++ b/tests/examples/rtp/client-H264-PCMA.sdp @@ -0,0 +1,12 @@ +v=0 +o=- 1188340656180883 1 IN IP4 192.168.1.110 +s=Session streamed by GStreamer +i=server.sh +t=0 0 +a=tool:GStreamer +a=type:broadcast +m=video 5000 RTP/AVP 96 +c=IN IP4 0.0.0.0 +a=rtpmap:96 H264/90000 +m=audio 5002 RTP/AVP 8 +c=IN IP4 0.0.0.0 diff --git a/tests/examples/rtp/client-H264-PCMA.sh b/tests/examples/rtp/client-H264-PCMA.sh new file mode 100755 index 0000000..ce49efa --- /dev/null +++ b/tests/examples/rtp/client-H264-PCMA.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# +# A simple RTP receiver +# + +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" + +gst-launch -v gstrtpbin name=rtpbin latency=100 \ + udpsrc caps=$VIDEO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \ + rtpbin. ! rtph264depay ! ffdec_h264 ! xvimagesink \ + 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. ! rtppcmadepay ! alawdec ! alsasink slave-method=1 \ + udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \ + rtpbin.send_rtcp_src_1 ! udpsink port=5007 sync=false async=false diff --git a/tests/examples/rtp/client-PCMA.sh b/tests/examples/rtp/client-PCMA.sh new file mode 100755 index 0000000..f4da152 --- /dev/null +++ b/tests/examples/rtp/client-PCMA.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# +# A simple RTP receiver +# + +AUDIO_CAPS="application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-name=(string)PCMA" + +gst-launch -v gstrtpbin name=rtpbin \ + udpsrc caps=$AUDIO_CAPS port=5000 ! rtpbin.recv_rtp_sink_0 \ + rtpbin. ! rtppcmadepay ! alawdec ! alsasink \ + udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \ + rtpbin.send_rtcp_src_0 ! udpsink port=5003 sync=false async=false diff --git a/tests/examples/rtp/server-VTS-H263p-ATS-PCMA.sh b/tests/examples/rtp/server-VTS-H263p-ATS-PCMA.sh new file mode 100755 index 0000000..ff2614d --- /dev/null +++ b/tests/examples/rtp/server-VTS-H263p-ATS-PCMA.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# A simple RTP server +# + +VCAPS="video/x-raw-yuv,width=352,height=288,framerate=15/1" + +gst-launch -v gstrtpbin name=rtpbin \ + videotestsrc ! $VCAPS ! ffenc_h263p ! rtph263ppay ! rtpbin.send_rtp_sink_0 \ + rtpbin.send_rtp_src_0 ! udpsink port=5000 \ + rtpbin.send_rtcp_src_0 ! udpsink port=5001 sync=false async=false \ + udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0 \ + audiotestsrc samplesperbuffer=1000 ! alawenc ! rtppcmapay ! rtpbin.send_rtp_sink_1 \ + rtpbin.send_rtp_src_1 ! udpsink port=5002 \ + rtpbin.send_rtcp_src_1 ! udpsink port=5003 sync=false async=false \ + udpsrc port=5007 ! rtpbin.recv_rtcp_sink_1 diff --git a/tests/examples/rtp/server-alsasrc-PCMA.sh b/tests/examples/rtp/server-alsasrc-PCMA.sh new file mode 100755 index 0000000..202e156 --- /dev/null +++ b/tests/examples/rtp/server-alsasrc-PCMA.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# +# A simple RTP server +# + +gst-launch -v gstrtpbin name=rtpbin \ + alsasrc ! alawenc ! rtppcmapay ! rtpbin.send_rtp_sink_0 \ + rtpbin.send_rtp_src_0 ! udpsink port=5000 \ + rtpbin.send_rtcp_src_0 ! udpsink port=5001 sync=false async=false \ + udpsrc port=5003 ! rtpbin.recv_rtcp_sink_0 diff --git a/tests/examples/rtp/server-v4l2-H263p-alsasrc-AMR.sh b/tests/examples/rtp/server-v4l2-H263p-alsasrc-AMR.sh new file mode 100755 index 0000000..96928eb --- /dev/null +++ b/tests/examples/rtp/server-v4l2-H263p-alsasrc-AMR.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# A simple RTP server +# + +# change these to change the server sync. This causes the server to send the +# packets largly out-of-sync, the client should use the RTCP SR packets to +# restore proper lip-sync between the streams. +AOFFSET=0 +VOFFSET=0 + +VCAPS="video/x-raw-yuv,width=352,height=288,framerate=15/1" + +gst-launch -v gstrtpbin name=rtpbin \ + v4l2src ! $VCAPS ! videorate ! ffmpegcolorspace ! ffenc_h263p ! rtph263ppay ! rtpbin.send_rtp_sink_0 \ + rtpbin.send_rtp_src_0 ! queue ! udpsink port=5000 ts-offset=$AOFFSET \ + rtpbin.send_rtcp_src_0 ! udpsink port=5001 sync=false async=false \ + udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0 \ + alsasrc ! audioconvert ! amrnbenc ! rtpamrpay ! rtpbin.send_rtp_sink_1 \ + rtpbin.send_rtp_src_1 ! queue ! udpsink port=5002 ts-offset=$VOFFSET \ + rtpbin.send_rtcp_src_1 ! udpsink port=5003 sync=false async=false \ + udpsrc port=5007 ! rtpbin.recv_rtcp_sink_1 diff --git a/tests/examples/rtp/server-v4l2-H264-alsasrc-PCMA.sh b/tests/examples/rtp/server-v4l2-H264-alsasrc-PCMA.sh new file mode 100755 index 0000000..7ac8e5d --- /dev/null +++ b/tests/examples/rtp/server-v4l2-H264-alsasrc-PCMA.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# +# A simple RTP server +# + +AOFFSET=0 +VOFFSET=0 + +# H264 encode from a v4l2src +VCAPS="video/x-raw-yuv,width=352,height=288,framerate=15/1" +VSOURCE="v4l2src ! $VCAPS ! videorate ! ffmpegcolorspace" +VENC="x264enc byte-stream=true bitrate=300 ! rtph264pay" + +# PCMA encode from an alsasrc +ASOURCE="alsasrc ! audioconvert" +AENC="alawenc ! rtppcmapay" + +gst-launch -v gstrtpbin name=rtpbin \ + $VSOURCE ! $VENC ! rtpbin.send_rtp_sink_0 \ + rtpbin.send_rtp_src_0 ! queue ! udpsink port=5000 ts-offset=$AOFFSET \ + rtpbin.send_rtcp_src_0 ! udpsink port=5001 sync=false async=false \ + udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0 \ + $ASOURCE ! $AENC ! rtpbin.send_rtp_sink_1 \ + rtpbin.send_rtp_src_1 ! queue ! udpsink port=5002 ts-offset=$VOFFSET \ + rtpbin.send_rtcp_src_1 ! udpsink port=5003 sync=false async=false \ + udpsrc port=5007 ! rtpbin.recv_rtcp_sink_1 -- 2.7.4