fstream/client/watch
2023-12-06 06:15:06 +01:00

32 lines
987 B
Bash
Executable File

#!/usr/bin/env bash
cd "$(dirname "$(realpath "$BASH_SOURCE")")"
sys_python="python3"
function setServer() {
export fstream_arg_user="fier"
export fstream_arg_channel="default"
export fstream_arg_channel_password="456"
}
export fstream_arg_bufsize="4096"
fstream_aespass=""
dec_cmd=(
ffplay
-avioflags direct -strict experimental -analyzeduration 0 -sync ext -probesize 32 -fflags nobuffer -flags low_delay -max_delay 0 -max_probe_packets 0 -x264opts intra-refresh=1 -fflags discardcorrupt -vf setpts=0 # delay hack
-
)
setServer
if [ "$fstream_arg_bufsize" == "" ] || [ "$fstream_arg_bufsize" == "0" ]; then
unset fstream_arg_bufsize
fi
while :; do
if ! [ "$fstream_aespass" == "" ]; then
"$sys_python" fstream.py "fier.me:61920" watch | fstream_aespass="$fstream_aespass" fstream_aesbuffer="$(($fstream_arg_bufsize - 16))" "$sys_python" fstream-util-aes_to_pipe.py | "${dec_cmd[@]}"
else
"$sys_python" fstream.py "fier.me:61920" watch | "${dec_cmd[@]}"
fi
sleep 1
done