summaryrefslogtreecommitdiffstats
path: root/tests/examples
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-09-04 18:30:22 +0000
committerWim Taymans <wim.taymans@gmail.com>2007-09-04 18:30:22 +0000
commitec68d41d6984e0d5d0560edef81e8c54dd641495 (patch)
tree5d6302a33f9889a541c22ddd09b1e2f27aa9b0cc /tests/examples
parentb4e5796a04dd2ba7c176024d9bf5d51dd3ee917b (diff)
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.
Diffstat (limited to 'tests/examples')
-rw-r--r--tests/examples/Makefile.am4
-rw-r--r--tests/examples/rtp/Makefile.am12
-rwxr-xr-xtests/examples/rtp/client-H263p-AMR.sh17
-rw-r--r--tests/examples/rtp/client-H263p-PCMA.sdp12
-rwxr-xr-xtests/examples/rtp/client-H263p-PCMA.sh17
-rw-r--r--tests/examples/rtp/client-H264-PCMA.sdp12
-rwxr-xr-xtests/examples/rtp/client-H264-PCMA.sh17
-rwxr-xr-xtests/examples/rtp/client-PCMA.sh12
-rwxr-xr-xtests/examples/rtp/server-VTS-H263p-ATS-PCMA.sh16
-rwxr-xr-xtests/examples/rtp/server-alsasrc-PCMA.sh10
-rwxr-xr-xtests/examples/rtp/server-v4l2-H263p-alsasrc-AMR.sh22
-rwxr-xr-xtests/examples/rtp/server-v4l2-H264-alsasrc-PCMA.sh26
12 files changed, 175 insertions, 2 deletions
diff --git a/tests/examples/Makefile.am b/tests/examples/Makefile.am
index 2c5f67a5..b5530f12 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 00000000..f0b033bd
--- /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 00000000..59647745
--- /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 00000000..125e04db
--- /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 00000000..298111e4
--- /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 00000000..fa2722ee
--- /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 00000000..ce49efa2
--- /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 00000000..f4da1528
--- /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 00000000..ff2614db
--- /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 00000000..202e156a
--- /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 00000000..96928eb6
--- /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 00000000..7ac8e5dd
--- /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