diff options
Diffstat (limited to 'example-scripts')
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 |