add encoder mode parameter validation check

This commit is contained in:
Alfonso Gamboa
2022-06-12 21:04:57 -07:00
parent b59f85e206
commit 6b76e278e1
2 changed files with 32 additions and 16 deletions

View File

@@ -424,13 +424,21 @@ if [[ "$RTSP_HI_RES_ENABLED" == "true" ]]; then
echo "rtsp audio disabled"
fi
if [[ "$RTSP_HI_RES_ENC_PARAMETER" != "" ]]; then
if [[ "$V2" == "true" ]]; then
watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:0:4:$RTSP_HI_RES_ENC_PARAMETER" > /dev/null 2>&1 &
else
watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:44:4:$RTSP_HI_RES_ENC_PARAMETER" > /dev/null 2>&1 &
fi
fi
if [[ "$RTSP_HI_RES_ENC_PARAMETER" != "" ]]; then
if [[ "$V2" == "true" ]]; then
if [[ $RTSP_HI_RES_ENC_PARAMETER =~ "^[1|2|4|8]$" ]]; then
watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:0:4:$RTSP_HI_RES_ENC_PARAMETER" > /dev/null 2>&1 &
else
echo "Invalid encoder value"
fi
else
if [[ $RTSP_HI_RES_ENC_PARAMETER =~ "^[1|2|4|8]$" ]]; then
watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:44:4:$RTSP_HI_RES_ENC_PARAMETER" > /dev/null 2>&1 &
else
echo "Invalid encoder value"
fi
fi
fi
if [[ "$RTSP_HI_RES_MAX_BITRATE" != "" ]]; then
if [[ "$V2" == "true" ]]; then
@@ -493,13 +501,21 @@ if [[ "$RTSP_LOW_RES_ENABLED" == "true" ]]; then
echo "rtsp audio disabled"
fi
if [[ "$RTSP_LOW_RES_ENC_PARAMETER" != "" ]]; then
if [[ "$V2" == "true" ]]; then
watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:0:4:$RTSP_LOW_RES_ENC_PARAMETER" > /dev/null 2>&1 &
else
watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:44:4:$RTSP_LOW_RES_ENC_PARAMETER" > /dev/null 2>&1 &
fi
fi
if [[ "$RTSP_LOW_RES_ENC_PARAMETER" != "" ]]; then
if [[ "$V2" == "true" ]]; then
if [[ $RTSP_LOW_RES_ENC_PARAMETER =~ "^[1|2|4|8]$" ]]; then
watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:0:4:$RTSP_LOW_RES_ENC_PARAMETER" > /dev/null 2>&1 &
else
echo "Invalid encoder value"
fi
else
if [[ $RTSP_LOW_RES_ENC_PARAMETER =~ "^[1|2|4|8]$" ]]; then
watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:44:4:$RTSP_LOW_RES_ENC_PARAMETER" > /dev/null 2>&1 &
else
echo "Invalid encoder value"
fi
fi
fi
if [[ "$RTSP_LOW_RES_MAX_BITRATE" != "" ]]; then
if [[ "$V2" == "true" ]]; then