usage() {
cat <<EOF
-Usage: ${0##*/} [OPTIONS] [sysops|tech|staff]
-3 mountpoints: fsf-sysops (default, public), fsf (all staff), fsf-tech (tech team)
+Usage: ${0##*/} [OPTIONS] [sysops|tech|staff|test]
+
+arg is icecast mountpoint suffix, except staff removes suffix.
-d debug.
-r RESOLUTION_TYPE
full: full screen even high resolution.
tall (default): half screen.
quarter: self evident
+-l loud/listen. Start unmuted. Usually for testing.
-u Undelayed. Removes 5 second video delay, and about 4 second audio delay.
-w do not launch watch of stream
delay=true
loglevel=fatal
watch=true
+volume=0
fullscreen=false
tall=true
-temp=$(getopt -l help hdr:uw "$@") || usage 1
+temp=$(getopt -l help hdlr:uw "$@") || usage 1
eval set -- "$temp"
while true; do
case $1 in
loglevel=info
ffp_args+=(-d)
;;
+ -l)
+ volume=1
+ ;;
-r)
case $2 in
tall)
done
mount_suffix=-sysops
-case $1 in
- sysops|tech)
- mount_suffix=-$1
- ;;&
- tech)
- delay=false
- ;;
- staff)
- mount_suffix=
- ;;
-esac
+if [[ $1 ]]; then
+ case $1 in
+ sysops|tech)
+ mount_suffix=-$1
+ ;;&
+ tech)
+ delay=false
+ ;;
+ staff)
+ mount_suffix=
+ ;;
+ *)
+ echo "error: unexpected \$1: $1" >&2
+ exit 1
+ ;;
+ esac
+ ffp_args+=($1)
+fi
if $delay; then
# 2500 gets us around a 4 second delay, up from 1.5s.
#
# man page say zmq url default includes "localhost", but specifying a
# localhost url caused an error for me.
- -filter_complex "[0]azmq,volume=precision=fixed: volume=0 [vol0];
+ -filter_complex "[0]azmq,volume=precision=fixed: volume=$volume [vol0];
[1]azmq='b=tcp\://127.0.0.1\:5556',volume=precision=fixed: volume=0 [vol1];
[vol0][vol1] amerge=inputs=2;
[2]zmq='b=tcp\://127.0.0.1\:5557',drawbox=color=0x262626,drawtext=fontsize=90: fontcolor=beige: x=40: y=40: text=''${delay_arg}[out]"
touch $HOME/.iank-stream-on
fi
-echo true >$HOME/.iank-stream-muted
+echo $volume >$HOME/.iank-stream-muted
ffmpeg "${opts[@]}" &
if $watch; then