-
Notifications
You must be signed in to change notification settings - Fork 417
/
Copy pathmiracle-vlc
executable file
·69 lines (58 loc) · 1.17 KB
/
miracle-vlc
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
function help {
local scriptname="$(basename $0)"
cat >&2 <<EOF
$scriptname [options]
play rtp stream with vlc
Options:
-r Resolution
-s <Width>x<height> Scale
-d <level> Log level for gst
-p <port> Port for stream
-a Enables audio
-h Show this help
Examples:
# play stream on port 7236
$ $scriptname -p 7236
EOF
}
DEBUG='0'
AUDIO='0'
SCALE='0'
while getopts "r:d:as:p:h" optname
do
case "$optname" in
"h")
help
exit 0
;;
"d")
DEBUG=`echo ${OPTARG} | tr -d ' '`
;;
"r")
RESOLUTION=`echo ${OPTARG} | tr -d ' '`
;;
"a")
AUDIO='1'
;;
"p")
PORT=`echo ${OPTARG} | tr -d ' '`
;;
"s")
SCALE='1'
WIDTH=`echo ${OPTARG} | tr -d ' ' | cut -dx -f 1`
HEIGHT=`echo ${OPTARG} | tr -d ' ' | cut -dx -f 2`
;;
"?")
echo "Unknown option $OPTARG"
;;
*)
echo "Unknown parameter $OPTARG"
help
exit 1
;;
esac
done
RUN="vlc rtp://@:$PORT"
echo "running: $RUN"
exec ${RUN}