fstream/client/broadcast-voice
2022-11-01 20:53:08 +01:00

31 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# USER SETTINGS
BITRATE="8k"
FST_IP="fier.me:61920"
FST_USER="user"
FST_PASSWORD="123"
FST_CHANNEL="default"
FST_CHANNELPASS="456"
PYTHON="python3"
# LINUX:
ARGS_INPUT="-f pulse -i 1"
# WINDOWS:
# ARGS_INPUT="-f gdigrab -framerate "$FRAMERATE" -i desktop"
ARGS_ENCODING="-c:a libopus -ac 1 -vbr off -application lowdelay -mapping_family 0"
ARGS_OUTPUT="-f mpegts"
# APPLY PROPERTIES
ARGS_ENCODING="$ARGS_ENCODING -b:a $BITRATE"
# HACKS - LOWER DELAY
ARGS_INPUT="-strict experimental -avioflags direct -thread_queue_size 1 -hwaccel auto -probesize 32 -fflags nobuffer -flags low_delay -flags2 fast $ARGS_INPUT"
ARGS_ENCODING="-max_probe_packets 0 -max_delay 0 -flags2 fast $ARGS_ENCODING -x264opts intra-refresh=1"
ARGS_OUTPUT="-flags2 fast $ARGS_OUTPUT -flags2 fast -muxdelay 0 -muxpreload 0 -max_delay 0 -flush_packets 1"
ffmpeg $FLAGS_INPUT $ARGS_INPUT $ARGS_ENCODING $ARGS_OUTPUT - | "$PYTHON" fstream.py "$FST_IP" "broadcast,user=$FST_USER,user-password=$FST_PASSWORD,channel=$FST_CHANNEL,channel-password=$FST_CHANNELPASS"