2023-11-01 07:20:12 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
cd "$(dirname "$(realpath "$BASH_SOURCE")")"
|
2023-12-06 05:15:06 +00:00
|
|
|
sys_python="python3"
|
|
|
|
function setServer() {
|
|
|
|
export fstream_arg_user="fier"
|
|
|
|
export fstream_arg_channel="default"
|
|
|
|
export fstream_arg_channel_password="456"
|
2023-11-01 07:20:12 +00:00
|
|
|
}
|
2022-11-01 19:53:08 +00:00
|
|
|
|
2023-12-06 05:15:06 +00:00
|
|
|
export fstream_arg_bufsize="4096"
|
|
|
|
fstream_aespass=""
|
2023-11-01 07:20:12 +00:00
|
|
|
|
2023-12-06 05:15:06 +00:00
|
|
|
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
|
|
|
|
-
|
2023-11-01 07:20:12 +00:00
|
|
|
)
|
|
|
|
|
2023-12-06 05:15:06 +00:00
|
|
|
setServer
|
|
|
|
if [ "$fstream_arg_bufsize" == "" ] || [ "$fstream_arg_bufsize" == "0" ]; then
|
|
|
|
unset fstream_arg_bufsize
|
2023-11-01 07:20:12 +00:00
|
|
|
fi
|
2023-12-06 05:15:06 +00:00
|
|
|
|
|
|
|
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
|