summaryrefslogtreecommitdiff
path: root/scripts/client/sydra-sender.sh
blob: 19f849588b67d0b4512c406fd0969fb35ebc83ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
############################

ROOT_D="$1"

SYDRA_RTP="/home/equinox/spreadspace/sydra/src/sydra-rtp"
SYDRA_LAUNCH="/home/equinox/spreadspace/sydra/src/sydra-launch"

############################

printUsage() {
  echo "Usage: $0 <basedir>"
}

if [ -z "$ROOT_D" ]; 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() {
  RECORD_D="$ROOT_D/recordings"
  mkdir -p "$RECORD_D"

  exec $SYDRA_RTP -n "sender" -D --log stdout:3 --mode sender -a $RTP_HOST -o $RECV_PORT_BASE -O 6000 \
    --previewsink "textoverlay text=\"local\" shaded-background=true font-desc=\"Sans 18\" ! videoscale add-borders=true ! xvimagesink" \
    --rec-mux matroskamux --rec-name-format "$RECORD_D/%Y-%m-%d_%H-%M-%S.mkv" --rec-audio-encoder "audioconvert ! vorbisenc"
}

start_test() {
  exec $SYDRA_LAUNCH -n "sender" -D --log stdout:3 -p "videotestsrc ! video/x-raw,width=864,height=480,framerate=25/1 ! textoverlay text=\"local\" shaded-background=true font-desc=\"Sans 18\" ! videoscale add-borders=true ! xvimagesink"
}

cd $ROOT_D
[ -n "$SYDRA_TEST" ] || start_rtp
[ -n "$SYDRA_TEST" ] && start_test