|
|
@@ -1,78 +0,0 @@
|
|
|
-#!/bin/bash
|
|
|
-#
|
|
|
-# IMPORTANT >>>>>You need to get port, ip and feed_id right<<<<<
|
|
|
-if [ "X$SNOWMIX" = X ] ; then
|
|
|
- echo "You need to set the SNOWMIX environment variable"
|
|
|
- exit 1
|
|
|
-fi
|
|
|
-if [ "X$SNOWMIX_PORT" = X ] ; then export SNOWMIX_PORT=9999 ;fi
|
|
|
-if [ "X$SNOWMIX_IP" = X ] ; then export SNOWMIX_IP=127.0.0.1 ;fi
|
|
|
-
|
|
|
-if [ $# -lt 1 ] ; then
|
|
|
- echo "Missing argument\nUsage $0 <feed id> [<audio feed id> [<input file>]"
|
|
|
- echo "Setting audio feed to 0 disables audio"
|
|
|
- exit 1
|
|
|
-fi
|
|
|
-
|
|
|
-# Set video feed and audio feed id
|
|
|
-feed_id=$1
|
|
|
-audio_feed_id=0 #DISABLE AUDIO
|
|
|
-
|
|
|
-# Load the Snowmix and GStreamer settings
|
|
|
-. $SNOWMIX/scripts/gstreamer-settings
|
|
|
-. $SNOWMIX/scripts/snowmix-settings
|
|
|
-# This will set
|
|
|
-# a) feed_rate
|
|
|
-# b) feed_channels
|
|
|
-# c) feed_control_pipe
|
|
|
-# d) feed_width
|
|
|
-# e) feed_height
|
|
|
-# f) ctrsocket
|
|
|
-# g) system_width
|
|
|
-# h) system_height
|
|
|
-# i) ratefraction
|
|
|
-# j) snowmix
|
|
|
-# k) channels
|
|
|
-# l) rate
|
|
|
-
|
|
|
-
|
|
|
-if [ X$feed_control_pipe = X -o X$system_width = X -o X$system_height = X ] ; then
|
|
|
- echo Failed to get control pipe or width or height from running snowmix
|
|
|
- exit 1
|
|
|
-fi
|
|
|
-
|
|
|
-#echo "Snowmix Geometry : $system_width x $system_height"
|
|
|
-#echo "Snowmix control socket : $ctrsocket"
|
|
|
-echo "Video feed geometry : $feed_width x $feed_height"
|
|
|
-echo "Video control socket : $feed_control_pipe"
|
|
|
-echo "Video and audio feed id : $feed_id $audio_feed_id"
|
|
|
-
|
|
|
-if [ X$feed_rate = X -o X$feed_channels = X ] ; then
|
|
|
- echo Failed to get rate or channels from running snowmix
|
|
|
- echo Disabling audio
|
|
|
-else
|
|
|
- echo "Audio rate and channels : $feed_rate $feed_channels"
|
|
|
-fi
|
|
|
-
|
|
|
-SHMSIZE='shm-size='`echo "$feed_width * $feed_height * 4 * 26"|bc`
|
|
|
-SHMOPTION="wait-for-connection=1 sync=true"
|
|
|
-SHMSINK1="shmsink socket-path=$feed_control_pipe $SHMSIZE $SHMOPTION"
|
|
|
-#AUDIOFORMAT="$AUDIOS16LE"', rate='$feed_rate', channels='$feed_channels
|
|
|
-VIDEOFORMAT=$VIDEOBGRA', width='$feed_width', height='$feed_height', framerate=30/1'
|
|
|
-SRC="udpsrc port=5002 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtpjpegdepay ! jpegdec"
|
|
|
-
|
|
|
-#gst-launch-1.0 -v udpsrc port=5002 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! ! videoconvert ! videorate !
|
|
|
-#videoscale ! videoconvert ! video/x-raw,format=BGRA,pixel-aspect-ratio=1/1,interlace-mode=progressive, width=800, height=600,
|
|
|
-#framerate=30/1 ! queue ! shmsink socket-path=/tmp/feed2-control-pipe shm-size=81788928 wait-for-connection=1 sync=true
|
|
|
-
|
|
|
-while true ; do
|
|
|
- # Remove the named pipe if it exist
|
|
|
- rm -f $feed_control_pipe
|
|
|
- com="gst-launch-1.0 -v $SRC ! videoconvert ! videorate ! videoscale ! videoconvert ! $VIDEOFORMAT ! queue ! $SHMSINK1"
|
|
|
-
|
|
|
- echo "#####################"
|
|
|
- echo $com;
|
|
|
- echo "#####################"
|
|
|
- eval $com
|
|
|
- sleep 2
|
|
|
-done
|