From e5b79c15abbbd7483de3ca0a76418a808f14b45f Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Wed, 1 Mar 2017 21:30:50 +0100 Subject: Add sample scrtipts to both display+send webcam feed. --- .../gstreamer/source-video0-as-monitor-and-cam4.sh | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 example-scripts/gstreamer/source-video0-as-monitor-and-cam4.sh (limited to 'example-scripts/gstreamer/source-video0-as-monitor-and-cam4.sh') 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 -- cgit v1.2.3