Test set Jibri resolution from installer.

This commit is contained in:
Luis Guzmán 2021-06-28 01:39:32 -05:00
parent 848f69908a
commit 57232b1408
2 changed files with 44 additions and 3 deletions

View File

@ -46,8 +46,8 @@ MJS_USER=TBD
MJS_USER_PASS=TBD MJS_USER_PASS=TBD
THIS_SRV_DIST=$(lsb_release -sc) THIS_SRV_DIST=$(lsb_release -sc)
JITSI_REPO=$(apt-cache policy | awk '/jitsi/&&/stable/{print$3}' | awk -F / 'NR==1{print$1}') JITSI_REPO=$(apt-cache policy | awk '/jitsi/&&/stable/{print$3}' | awk -F / 'NR==1{print$1}')
START=0 JIBRI_RES_CONF=TBD
LAST=TBD JIBRI_RES_XORG_CONF=TBD
JIBRI_CONF="/etc/jitsi/jibri/jibri.conf" JIBRI_CONF="/etc/jitsi/jibri/jibri.conf"
DIR_RECORD="/var/jbrecord" DIR_RECORD="/var/jbrecord"
REC_DIR="/home/jibri/finalize_recording.sh" REC_DIR="/home/jibri/finalize_recording.sh"

View File

@ -471,6 +471,7 @@ MJS_RAND_TAIL="$(tr -dc "a-zA-Z0-9" < /dev/urandom | fold -w 4 | head -n1)"
MJS_USER="jbsync_$MJS_RAND_TAIL" MJS_USER="jbsync_$MJS_RAND_TAIL"
MJS_USER_PASS="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 32 | head -n1)" MJS_USER_PASS="$(tr -dc "a-zA-Z0-9#_*=" < /dev/urandom | fold -w 32 | head -n1)"
FQDN_HOST="fqdn" FQDN_HOST="fqdn"
JIBRI_XORG_CONF="/etc/jitsi/jibri/xorg-video-dummy.conf"
# Rename hostname for jitsi server # Rename hostname for jitsi server
while [[ "$FQDN_HOST" != "yes" && "$FQDN_HOST" != "no" && ! -z "$FQDN_HOST" ]] while [[ "$FQDN_HOST" != "yes" && "$FQDN_HOST" != "no" && ! -z "$FQDN_HOST" ]]
@ -573,6 +574,7 @@ do
fi fi
done done
# Set authentication method
echo " echo "
> Jitsi Meet Auth Method selection. > Jitsi Meet Auth Method selection.
" "
@ -599,6 +601,39 @@ do
esac esac
done done
# Set jibris default resolution
echo "
> What jibri resolution should be the default for this and all the following jibri nodes?
"
PS3='The more resolution the more resources jibri will require to record properly: '
jib_res=("HD 720" "FHD 1080")
select res in "${jib_res[@]}"
do
case $res in
"HD 720")
echo -e "\n > HD (1280x720) is good enough for most cases, and requires a moderate high hw requirements.\n"
JIBRI_RES="720"
break
;;
"FHD 1080")
echo -e "\n > Full HD (1920x1080) is the best resolution available, it also requires high hw requirements.\n"
JIBRI_RES="1080"
break
;;
*) echo "Invalid option «$REPLY», choose 1 or 2";;
esac
done
if [ "$JIB_RES" = "720" ]; then
JIBRI_RES_CONF="\"1280x720\""
JIBRI_RES_XORG_CONF="1280 720"
fi
if [ "$JIB_RES" = "1080" ]; then
JIBRI_RES_CONF="\"1920x1080\""
JIBRI_RES_XORG_CONF="1920 1080"
fi
#Jibri Records Access (JRA) via Nextcloud #Jibri Records Access (JRA) via Nextcloud
while [[ "$ENABLE_NC_ACCESS" != "yes" && "$ENABLE_NC_ACCESS" != "no" ]] while [[ "$ENABLE_NC_ACCESS" != "yes" && "$ENABLE_NC_ACCESS" != "no" ]]
do do
@ -848,7 +883,7 @@ jibri {
] ]
} }
ffmpeg { ffmpeg {
resolution = "1920x1080" resolution = $JIBRI_RES_CONF
} }
chrome { chrome {
// The flags which will be passed to chromium when launching // The flags which will be passed to chromium when launching
@ -946,6 +981,10 @@ jibri {
} }
} }
NEW_CONF NEW_CONF
#Jibri xorg resolution
sed "s|[[:space:]]Virtual .*|Virtual $JIBRI_RES_XORG_CONF|" $JIBRI_XORG_CONF
#Create receiver user #Create receiver user
useradd -m -g jibri $MJS_USER useradd -m -g jibri $MJS_USER
echo "$MJS_USER:$MJS_USER_PASS" | chpasswd echo "$MJS_USER:$MJS_USER_PASS" | chpasswd
@ -966,6 +1005,8 @@ sed -i "s|JB_AUTH_PASS=.*|JB_AUTH_PASS=\"$JB_AUTH_PASS\"|" add-jibri-node.sh
sed -i "s|JB_REC_PASS=.*|JB_REC_PASS=\"$JB_REC_PASS\"|" add-jibri-node.sh sed -i "s|JB_REC_PASS=.*|JB_REC_PASS=\"$JB_REC_PASS\"|" add-jibri-node.sh
sed -i "s|MJS_USER=.*|MJS_USER=\"$MJS_USER\"|" add-jibri-node.sh sed -i "s|MJS_USER=.*|MJS_USER=\"$MJS_USER\"|" add-jibri-node.sh
sed -i "s|MJS_USER_PASS=.*|MJS_USER_PASS=\"$MJS_USER_PASS\"|" add-jibri-node.sh sed -i "s|MJS_USER_PASS=.*|MJS_USER_PASS=\"$MJS_USER_PASS\"|" add-jibri-node.sh
sed -i "s|JIBRI_RES_CONF=.*|JIBRI_RES_CONF=\"$JIBRI_RES_CONF\"|" add-jibri-node.sh
sed -i "s|JIBRI_RES_XORG_CONF=.*|JIBRI_RES_XORG_CONF=\"$JIBRI_RES_XORG_CONF\"|" add-jibri-node.sh
sed -i "$(var_dlim 0_LAST),$(var_dlim 1_LAST){s|LETS: .*|LETS: $(date -R)|}" add-jibri-node.sh sed -i "$(var_dlim 0_LAST),$(var_dlim 1_LAST){s|LETS: .*|LETS: $(date -R)|}" add-jibri-node.sh
echo "Last file edition at: $(grep "LETS:" add-jibri-node.sh|head -n1|awk -F'LETS:' '{print$2}')" echo "Last file edition at: $(grep "LETS:" add-jibri-node.sh|head -n1|awk -F'LETS:' '{print$2}')"