aboutsummaryrefslogtreecommitdiff
path: root/example-scripts/gstreamer
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-03-01 21:30:50 +0100
committerJonas Smedegaard <dr@jones.dk>2017-03-01 21:30:50 +0100
commite5b79c15abbbd7483de3ca0a76418a808f14b45f (patch)
tree075c4f245be278b65809d5206c90a529c23a2639 /example-scripts/gstreamer
parent02a2ed296bbf25563f2649a8de1ecadc31106247 (diff)
Add sample scrtipts to both display+send webcam feed.HEADmaster
Diffstat (limited to 'example-scripts/gstreamer')
-rwxr-xr-xexample-scripts/gstreamer/source-video0-as-monitor-and-cam1.sh42
-rwxr-xr-xexample-scripts/gstreamer/source-video0-as-monitor-and-cam2.sh42
-rwxr-xr-xexample-scripts/gstreamer/source-video0-as-monitor-and-cam3.sh42
-rwxr-xr-xexample-scripts/gstreamer/source-video0-as-monitor-and-cam4.sh42
4 files changed, 168 insertions, 0 deletions
diff --git a/example-scripts/gstreamer/source-video0-as-monitor-and-cam1.sh b/example-scripts/gstreamer/source-video0-as-monitor-and-cam1.sh
new file mode 100755
index 0000000..444081a
--- /dev/null
+++ b/example-scripts/gstreamer/source-video0-as-monitor-and-cam1.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+confdir="`dirname "$0"`/../"
+. $confdir/default-config.sh
+if [ -f $confdir/config.sh ]; then
+ . $confdir/config.sh
+fi
+
+VSOURCECAPS="video/x-raw, format=I420, width=640, height=360, pixel-aspect-ratio=1/1, interlace-mode=progressive, framerate=30/1"
+VSOURCE="v4l2src device=/dev/video0 ! $VSOURCECAPS"
+VOVERLAY="clockoverlay halignment=right valignment=top time-format=\"%Y/%m/%d %H:%M:%S\""
+#VOVERLAY="timeoverlay halignment=right valignment=top ! clockoverlay halignment=left valignment=top time-format=\"%Y/%m/%d %H:%M:%S\""
+ASOURCE="audiotestsrc freq=440"
+
+LOCALWIDTH=$(cat /sys/class/graphics/fb0/virtual_size | cut -d, -f1)
+LOCALHEIGHT=$(cat /sys/class/graphics/fb0/virtual_size | cut -d, -f2)
+LOCALVCAPS="video/x-raw, width=$LOCALWIDTH, height=$LOCALHEIGHT"
+LOCALVTRANSFORM="videoscale ! videoconvert ! $LOCALVCAPS"
+LOCALVSINK="fbdevsink sync=false"
+
+REMOTEVCAPS="video/x-raw, format=I420, width=$WIDTH, height=$HEIGHT, pixel-aspect-ratio=1/1, interlace-mode=progressive, framerate=$FRAMERATE/1"
+REMOTEVTRANSFORM="videorate ! videoscale ! videoconvert ! $REMOTEVCAPS"
+REMOTEACAPS="audio/x-raw,format=S16LE,channels=$AUDIOCHANNELS,layout=interleaved,rate=$AUDIORATE"
+REMOTEATRANSFORM="$REMOTEACAPS"
+REMOTEMUX="matroskamux streamable=true"
+REMOTESINK="tcpclientsink host=$MIXHOST port=10000"
+
+gst-launch-1.0 \
+ $VSOURCE !\
+ $VOVERLAY !\
+ tee name=videolayers \
+ videolayers. ! queue !\
+ $LOCALVTRANSFORM !\
+ $LOCALVSINK \
+ videolayers. ! queue !\
+ $REMOTEVTRANSFORM !\
+ remotemux. \
+ $ASOURCE !\
+ $REMOTEATRANSFORM !\
+ remotemux. \
+ $REMOTEMUX name=remotemux !\
+ $REMOTESINK
diff --git a/example-scripts/gstreamer/source-video0-as-monitor-and-cam2.sh b/example-scripts/gstreamer/source-video0-as-monitor-and-cam2.sh
new file mode 100755
index 0000000..b9a68c8
--- /dev/null
+++ b/example-scripts/gstreamer/source-video0-as-monitor-and-cam2.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+confdir="`dirname "$0"`/../"
+. $confdir/default-config.sh
+if [ -f $confdir/config.sh ]; then
+ . $confdir/config.sh
+fi
+
+VSOURCECAPS="video/x-raw, format=I420, width=640, height=360, pixel-aspect-ratio=1/1, interlace-mode=progressive, framerate=30/1"
+VSOURCE="v4l2src device=/dev/video0 ! $VSOURCECAPS"
+VOVERLAY="clockoverlay halignment=right valignment=top time-format=\"%Y/%m/%d %H:%M:%S\""
+#VOVERLAY="timeoverlay halignment=right valignment=top ! clockoverlay halignment=left valignment=top time-format=\"%Y/%m/%d %H:%M:%S\""
+ASOURCE="audiotestsrc freq=550"
+
+LOCALWIDTH=$(cat /sys/class/graphics/fb0/virtual_size | cut -d, -f1)
+LOCALHEIGHT=$(cat /sys/class/graphics/fb0/virtual_size | cut -d, -f2)
+LOCALVCAPS="video/x-raw, width=$LOCALWIDTH, height=$LOCALHEIGHT"
+LOCALVTRANSFORM="videoscale ! videoconvert ! $LOCALVCAPS"
+LOCALVSINK="fbdevsink sync=false"
+
+REMOTEVCAPS="video/x-raw, format=I420, width=$WIDTH, height=$HEIGHT, pixel-aspect-ratio=1/1, interlace-mode=progressive, framerate=$FRAMERATE/1"
+REMOTEVTRANSFORM="videorate ! videoscale ! videoconvert ! $REMOTEVCAPS"
+REMOTEACAPS="audio/x-raw,format=S16LE,channels=$AUDIOCHANNELS,layout=interleaved,rate=$AUDIORATE"
+REMOTEATRANSFORM="$REMOTEACAPS"
+REMOTEMUX="matroskamux streamable=true"
+REMOTESINK="tcpclientsink host=$MIXHOST port=10001"
+
+gst-launch-1.0 \
+ $VSOURCE !\
+ $VOVERLAY !\
+ tee name=videolayers \
+ videolayers. ! queue !\
+ $LOCALVTRANSFORM !\
+ $LOCALVSINK \
+ videolayers. ! queue !\
+ $REMOTEVTRANSFORM !\
+ remotemux. \
+ $ASOURCE !\
+ $REMOTEATRANSFORM !\
+ remotemux. \
+ $REMOTEMUX name=remotemux !\
+ $REMOTESINK
diff --git a/example-scripts/gstreamer/source-video0-as-monitor-and-cam3.sh b/example-scripts/gstreamer/source-video0-as-monitor-and-cam3.sh
new file mode 100755
index 0000000..9d81309
--- /dev/null
+++ b/example-scripts/gstreamer/source-video0-as-monitor-and-cam3.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+confdir="`dirname "$0"`/../"
+. $confdir/default-config.sh
+if [ -f $confdir/config.sh ]; then
+ . $confdir/config.sh
+fi
+
+VSOURCECAPS="video/x-raw, format=I420, width=640, height=360, pixel-aspect-ratio=1/1, interlace-mode=progressive, framerate=30/1"
+VSOURCE="v4l2src device=/dev/video0 ! $VSOURCECAPS"
+VOVERLAY="clockoverlay halignment=right valignment=top time-format=\"%Y/%m/%d %H:%M:%S\""
+#VOVERLAY="timeoverlay halignment=right valignment=top ! clockoverlay halignment=left valignment=top time-format=\"%Y/%m/%d %H:%M:%S\""
+ASOURCE="audiotestsrc freq=660"
+
+LOCALWIDTH=$(cat /sys/class/graphics/fb0/virtual_size | cut -d, -f1)
+LOCALHEIGHT=$(cat /sys/class/graphics/fb0/virtual_size | cut -d, -f2)
+LOCALVCAPS="video/x-raw, width=$LOCALWIDTH, height=$LOCALHEIGHT"
+LOCALVTRANSFORM="videoscale ! videoconvert ! $LOCALVCAPS"
+LOCALVSINK="fbdevsink sync=false"
+
+REMOTEVCAPS="video/x-raw, format=I420, width=$WIDTH, height=$HEIGHT, pixel-aspect-ratio=1/1, interlace-mode=progressive, framerate=$FRAMERATE/1"
+REMOTEVTRANSFORM="videorate ! videoscale ! videoconvert ! $REMOTEVCAPS"
+REMOTEACAPS="audio/x-raw,format=S16LE,channels=$AUDIOCHANNELS,layout=interleaved,rate=$AUDIORATE"
+REMOTEATRANSFORM="$REMOTEACAPS"
+REMOTEMUX="matroskamux streamable=true"
+REMOTESINK="tcpclientsink host=$MIXHOST port=10002"
+
+gst-launch-1.0 \
+ $VSOURCE !\
+ $VOVERLAY !\
+ tee name=videolayers \
+ videolayers. ! queue !\
+ $LOCALVTRANSFORM !\
+ $LOCALVSINK \
+ videolayers. ! queue !\
+ $REMOTEVTRANSFORM !\
+ remotemux. \
+ $ASOURCE !\
+ $REMOTEATRANSFORM !\
+ remotemux. \
+ $REMOTEMUX name=remotemux !\
+ $REMOTESINK
diff --git a/example-scripts/gstreamer/source-video0-as-monitor-and-cam4.sh b/example-scripts/gstreamer/source-video0-as-monitor-and-cam4.sh
new file mode 100755
index 0000000..5330755
--- /dev/null
+++ b/example-scripts/gstreamer/source-video0-as-monitor-and-cam4.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+confdir="`dirname "$0"`/../"
+. $confdir/default-config.sh
+if [ -f $confdir/config.sh ]; then
+ . $confdir/config.sh
+fi
+
+VSOURCECAPS="video/x-raw, format=I420, width=640, height=360, pixel-aspect-ratio=1/1, interlace-mode=progressive, framerate=30/1"
+VSOURCE="v4l2src device=/dev/video0 ! $VSOURCECAPS"
+VOVERLAY="clockoverlay halignment=right valignment=top time-format=\"%Y/%m/%d %H:%M:%S\""
+#VOVERLAY="timeoverlay halignment=right valignment=top ! clockoverlay halignment=left valignment=top time-format=\"%Y/%m/%d %H:%M:%S\""
+ASOURCE="audiotestsrc freq=770"
+
+LOCALWIDTH=$(cat /sys/class/graphics/fb0/virtual_size | cut -d, -f1)
+LOCALHEIGHT=$(cat /sys/class/graphics/fb0/virtual_size | cut -d, -f2)
+LOCALVCAPS="video/x-raw, width=$LOCALWIDTH, height=$LOCALHEIGHT"
+LOCALVTRANSFORM="videoscale ! videoconvert ! $LOCALVCAPS"
+LOCALVSINK="fbdevsink sync=false"
+
+REMOTEVCAPS="video/x-raw, format=I420, width=$WIDTH, height=$HEIGHT, pixel-aspect-ratio=1/1, interlace-mode=progressive, framerate=$FRAMERATE/1"
+REMOTEVTRANSFORM="videorate ! videoscale ! videoconvert ! $REMOTEVCAPS"
+REMOTEACAPS="audio/x-raw,format=S16LE,channels=$AUDIOCHANNELS,layout=interleaved,rate=$AUDIORATE"
+REMOTEATRANSFORM="$REMOTEACAPS"
+REMOTEMUX="matroskamux streamable=true"
+REMOTESINK="tcpclientsink host=$MIXHOST port=10003"
+
+gst-launch-1.0 \
+ $VSOURCE !\
+ $VOVERLAY !\
+ tee name=videolayers \
+ videolayers. ! queue !\
+ $LOCALVTRANSFORM !\
+ $LOCALVSINK \
+ videolayers. ! queue !\
+ $REMOTEVTRANSFORM !\
+ remotemux. \
+ $ASOURCE !\
+ $REMOTEATRANSFORM !\
+ remotemux. \
+ $REMOTEMUX name=remotemux !\
+ $REMOTESINK