Statistics
| Branch: | Tag: | Revision:

streamers-build / scripts / start_source_unitn.sh @ 09bb9d06

History | View | Annotate | Download (1.5 KB)

1
#!/bin/bash
2

    
3
#default values
4
FILE=/dev/stdin
5

    
6
VIDEO_BPS=500000
7
AUDIO_BPS=64000
8
VIDEO_CODEC=mpeg4
9
AUDIO_CODEC=libmp3lame
10
IPC_PORT=7777
11

    
12
PORT=6676
13
SOURCE_COPIES=3
14

    
15
# Usage: set paramters in this script (after the usage function), then run it with the command line option below
16
function usage () {
17
   echo "Usage: $0 [options]"
18
   echo "  options (and default values)"
19
   echo "  -f file: media file to stream ($FILE)"
20
   echo "  -v rate: video encoding rate in bps ($VIDEO_BPS)"
21
   echo "  -a rate: audio encoding rate in bps ($AUDIO_BPS)"
22
   echo "  -V codec: video encoder ($VIDEO_CODEC)"
23
   echo "  -A codec: audio encoder ($AUDIO_CODEC)"
24
   echo "  -l : the stream is a live source with its own timing"
25
   echo "  -p port: UDP port used by the streamer ($PORT)"
26
   echo "  -m copies: copies of the stream sent out directly by the source ($SOURCE_COPIES)"
27
   exit $1
28
}
29

    
30
while getopts "f:v:a:V:A:lp:m:h" opt; do
31
   case $opt in
32

    
33
   f )  FILE=$OPTARG ;;
34
   v )  VIDEO_BPS=$OPTARG ;;
35
   a )  AUDIO_BPS=$OPTARG ;;
36
   V )  VIDEO_CODEC=$OPTARG ;;
37
   A )  AUDIO_CODEC=$OPTARG ;;
38
   l )  CHUNKER_XTRA+=" -l" ;;
39
   p )  PORT=$OPTARG ;;
40
   m )  SOURCE_COPIES=$OPTARG ;;
41
   h )  usage 0 ;;
42
   \?)  usage 1 ;;
43
   esac
44
done
45

    
46

    
47
# start the chunker
48
#./chunker_streamer -i $FILE -a $AUDIO_BPS -v $VIDEO_BPS -A $AUDIO_CODEC -V $VIDEO_CODEC -F tcp://127.0.0.1:$IPC_PORT $CHUNKER_XTRA  2>chunker_streamer.err 1>chunker_streamer.log &
49

    
50
# start a streamer as well
51
./streamer-ml-monl-chunkstream-static -P $PORT -f tcp://0.0.0.0:7777 -m $SOURCE_COPIES
52

    
53

    
54

    
55