Fix stuff lol

This commit is contained in:
Fierelier 2023-12-06 06:15:06 +01:00
parent aab1a6c3f2
commit 8a02ea306e
2 changed files with 26 additions and 39 deletions

View File

@ -2,7 +2,7 @@
cd "$(dirname "$(realpath "$BASH_SOURCE")")"
sys_python="python3"
function setUser() {
export fstream_arg_user="user"
export fstream_arg_user="fier"
export fstream_arg_user_password="123"
}
function setChannel() {
@ -11,7 +11,7 @@ function setChannel() {
}
export fstream_arg_bufsize="4096"
aes_password="789"
fstream_aespass=""
enc_resolution="480"
enc_framerate="15"
@ -62,7 +62,7 @@ while :; do
setChannel
if ! [ "$fstream_aespass" == "" ]; then
"${enc_cmd[@]}" | fstream_aespass="$aes_password" fstream_aesbuffer="$(($fstream_arg_bufsize - 16))" "$sys_python" fstream-util-pipe_to_aes.py | "$sys_python" fstream.py "fier.me:61920" broadcast
"${enc_cmd[@]}" | fstream_aespass="$fstream_aespass" fstream_aesbuffer="$(($fstream_arg_bufsize - 16))" "$sys_python" fstream-util-pipe_to_aes.py | "$sys_python" fstream.py "fier.me:61920" broadcast
else
"${enc_cmd[@]}" | "$sys_python" fstream.py "fier.me:61920" broadcast
fi

View File

@ -1,44 +1,31 @@
#!/usr/bin/env bash
cd "$(dirname "$(realpath "$BASH_SOURCE")")"
function getValue() {
var="$1"
if ! [ "${!var}" == "" ]; then
return
fi
if [ "$3" == "fail" ]; then
echo "ERROR: $1 is not defined."
exit 1
fi
declare -g "$1"="$2"
sys_python="python3"
function setServer() {
export fstream_arg_user="fier"
export fstream_arg_channel="default"
export fstream_arg_channel_password="456"
}
# USER SETTINGS
getValue fstream_profile "profile_watch.sh"
source "$fstream_profile"
getValue fstream_ip "fier.me:61920" fail
getValue fstream_user "user" fail
getValue fstream_channel "default"
getValue fstream_channelpass ""
getValue fstream_python "python3"
export fstream_arg_bufsize="4096"
fstream_aespass=""
getValue fstream_aespass ""
getValue fstream_aesbuffer "4096"
fstream_decodercmd=(
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 -
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
-
)
fstream_clientarg="watch,user=$fstream_user,channel=$fstream_channel,channel-password=$fstream_channelpass"
fstream_clientcmd=(
"$fstream_python" fstream.py
"$fstream_ip"
"$fstream_clientarg"
)
if [ "$fstream_aespass" == "" ]; then
"${fstream_clientcmd[@]}" | "${fstream_decodercmd[@]}"
else
"${fstream_clientcmd[@]}" | fstream_aespass="$fstream_aespass" fstream_aesbuffer="$fstream_aesbuffer" "$fstream_python" fstream-util-aes_to_pipe.py | "${fstream_decodercmd[@]}"
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