diff options
Diffstat (limited to 'scripts/sydra-receiver.sh')
-rwxr-xr-x | scripts/sydra-receiver.sh | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/scripts/sydra-receiver.sh b/scripts/sydra-receiver.sh deleted file mode 100755 index 7d2a3e6..0000000 --- a/scripts/sydra-receiver.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/bash -############################ - -ROOT_D="$1" -TAG="$2" -NUM="$3" - -SYDRA_RTP="/home/equinox/spreadspace/sydra/src/sydra-rtp" -SYDRA_LAUNCH="/home/equinox/spreadspace/sydra/src/sydra-launch" -MAIN_STAT_FILE="sydra-receiver.main" - -############################ - -printUsage() { - echo "Usage: $0 <basedir> (overview|main <id>)" -} - -if [ -z "$ROOT_D" ] || [ -z "$TAG" ]; then - printUsage - exit 1 -fi -if [ ! -d "$ROOT_D" ]; then - echo "ERROR: can't change to non-existent directory: $ROOT_D" - exit 2 -fi - -. ./include.sh - -start_rtp_overview() { - ID="$1" - TITLE="$2" - PORT_BASE="$3" - REF_PORT_BASE=$((PORT_BASE + 1000)) - RECORD_D="$ROOT_D/recordings/$ID" - mkdir -p "$RECORD_D" - - herbstclient rule once title="overview-$ID" tag="overview" - exec $SYDRA_RTP -n "overview-$ID" -D --log stdout:3 --mode receiver -O $PORT_BASE --rtp-host-reflector localhost --rtp-port-base-reflector $REF_PORT_BASE \ - --sink "videoconvert name=videosink ! textoverlay text=\"$TITLE\" shaded-background=true font-desc=\"Sans 18\" ! videoscale add-borders=true ! xvimagesink fakesink name=audiosink" \ - --rec-mux matroskamux --rec-name-format "$RECORD_D/%Y-%m-%d_%H-%M-%S.mkv" --rec-video-encoder jpegenc \ - --rec-audio-encoder "audioconvert ! vorbisenc" -} - -start_test_overview() { - ID="$1" - TITLE="$2" - - herbstclient rule once title="overview-$ID" tag="overview" - exec $SYDRA_LAUNCH -n "overview-$ID" -D --log stdout:3 -p "videotestsrc ! video/x-raw,width=864,height=480,framerate=25/1 ! textoverlay text=\"$TITLE\" shaded-background=true font-desc=\"Sans 18\" ! videoscale add-borders=true ! xvimagesink" -} - -start_rtp_main() { - ID="$1" - TITLE="$2" - PORT_BASE="$3" - - herbstclient rule once title="main-$ID" tag="main" - exec $SYDRA_RTP -n "main-$ID" -D --log stdout:3 --mode receiver -A localhost -O $PORT_BASE \ - --sink "videoconvert name=videosink ! videoscale add-borders=true ! xvimagesink audioconvert name=audiosink ! audioresample ! autoaudiosink" -} - -start_test_main() { - ID="$1" - TITLE="$2" - - herbstclient rule once title="main-$ID" tag="main" - exec $SYDRA_LAUNCH -n "main-$ID" -D --log stdout:3 -p "videotestsrc ! video/x-raw,width=864,height=480,framerate=25/1 ! textoverlay text=\"$TITLE\" shaded-background=true font-desc=\"Sans 18\" ! videoscale add-borders=true ! xvimagesink" -} - -cd $ROOT_D -case "$TAG" in - overview) - if [ -z "$NUM" ]; then - printUsage - exit 1 - fi - - get_id_title_and_port "$NUM" - if [ -z "$ID" ]; then - echo "invalid process number: $NUM" - exit 3 - fi - [ -n "$SYDRA_TEST" ] || start_rtp_overview "$ID" "$TITLE" $PORT_BASE - [ -n "$SYDRA_TEST" ] && start_test_overview "$ID" "$TITLE" $PORT_BASE - ;; - main) - read NUM < "$MAIN_STAT_FILE" - get_id_title_and_port "$NUM" - if [ -z "$ID" ]; then - echo "$ROOT_D/show-stream.current contains an invalid process number: $NUM" - exit 3 - fi - [ -n "$SYDRA_TEST" ] || start_rtp_main "$ID" "$TITLE" $((PORT_BASE + 1000)) - [ -n "$SYDRA_TEST" ] && start_test_main "$ID" "$TITLE" $((PORT_BASE + 1000)) - ;; - *) - printUsage - exit 1 - ;; -esac - -############################ -exit 3 |