From 805dd062ee8f1178b81de586a520913e460e3e54 Mon Sep 17 00:00:00 2001 From: LongHairedHacker Date: Fri, 6 Jun 2014 22:31:27 +0200 Subject: [PATCH] Added network streaming to controling laptop --- scripts/network2screen | 2 ++ scripts/output2network | 47 ------------------------------------------ scripts/output2screen | 14 +++++++++++-- 3 files changed, 14 insertions(+), 49 deletions(-) create mode 100644 scripts/network2screen delete mode 100755 scripts/output2network diff --git a/scripts/network2screen b/scripts/network2screen new file mode 100644 index 0000000..b3b723e --- /dev/null +++ b/scripts/network2screen @@ -0,0 +1,2 @@ +#!/bin/bash +gst-launch-0.10 -v udpsrc port=9998 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG, payload=(int)96" ! rtpjpegdepay ! jpegdec ! videoscale ! xvimagesink diff --git a/scripts/output2network b/scripts/output2network deleted file mode 100755 index 3162714..0000000 --- a/scripts/output2network +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# Deliver mixer1 output to screen. -# Taken from the original snowmix sources - -tmpfile=/tmp/output2screen.tmp.$$ -echo 'system info' | nc 127.0.0.1 9999 >$tmpfile -geometry=`grep 'STAT: System geometry' $tmpfile |cut -f3 -d: |cut -f2 -d' '|tr 'x' ' '` -framerate=`grep 'STAT: Frame rate' $tmpfile |cut -f3 -d: |cut -f2 -d' '` -ctrsocket=`grep 'STAT: Output ctr socket' $tmpfile |cut -f3 -d: |cut -f2 -d' '` - -rm $tmpfile - -VIDEOCONVERT="ffmpegcolorspace ! x264enc ! rtph264pay" -VIDEO=video/x-raw-rgb -AUDIO=audio/x-raw-int - - -frameratefraction() -{ - echo $1 | awk '{ rate=$1 ; - factor=1; - intrate=int(rate); - while (factor*rate > intrate) { - factor = factor * 10; - intrate = int(rate*factor); - } - printf("%d/%d\n",intrate,factor); - }' -} -ratefraction=`frameratefraction $framerate` - -width=`echo $geometry |cut -f1 -d' '` -height=`echo $geometry |cut -f2 -d' '` - -MIXERFORMAT=$VIDEO', bpp=(int)32, depth=(int)32, endianness=(int)4321, format=(fourcc)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)'$width', height=(int)'$height', framerate=(fraction)'$ratefraction', pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false' -OUTPUTFORMAT=$VIDEO', width=1024, height=768' - - -while true ; do - gst-launch-0.10 -v shmsrc socket-path=$ctrsocket do-timestamp=true is-live=true ! \ - $MIXERFORMAT ! \ - videoscale ! \ - $OUTPUTFORMAT ! \ - $VIDEOCONVERT ! \ - udpsink host=laptop port=5000 - sleep 2 -done diff --git a/scripts/output2screen b/scripts/output2screen index f4d2a60..36919f2 100755 --- a/scripts/output2screen +++ b/scripts/output2screen @@ -38,10 +38,20 @@ OUTPUTFORMAT=$VIDEO', width=1024, height=768' while true ; do gst-launch-0.10 -v shmsrc socket-path=$ctrsocket do-timestamp=true is-live=true ! \ - $MIXERFORMAT ! \ + $MIXERFORMAT ! \ videoscale ! \ $OUTPUTFORMAT ! \ $VIDEOCONVERT ! \ - ximagesink + tee name=atee ! \ + queue ! \ + ximagesink \ + atee. !\ + queue !\ + timeoverlay !\ + ffmpegcolorspace !\ + 'video/x-raw-yuv' !\ + jpegenc !\ + rtpjpegpay !\ + udpsink host=192.168.11.90 port=9998 sync=true sleep 2 done