diff --git a/src/static/static/home/yi-hack/script/system.sh b/src/static/static/home/yi-hack/script/system.sh index 06b5127..9dec73f 100755 --- a/src/static/static/home/yi-hack/script/system.sh +++ b/src/static/static/home/yi-hack/script/system.sh @@ -120,8 +120,6 @@ if [[ $(get_config DISABLE_CLOUD) == "no" ]] ; then if [ $(get_config SPEAKER_AUDIO) != "no" ]; then touch /tmp/audio_in_fifo.requested fi - touch /tmp/audio_fifo.requested - touch /tmp/audio_in_fifo.requested cd /home/app LD_LIBRARY_PATH="/home/yi-hack/lib:/lib:/usr/lib:/home/lib:/home/qigan/lib:/home/app/locallib" ./rmm & sleep 6 @@ -215,7 +213,12 @@ if [[ $(get_config ONVIF_WM_SNAPSHOT) == "yes" ]] ; then fi if [[ $(get_config RTSP) == "yes" ]] ; then - RRTSP_RES=$(get_config RTSP_STREAM) RRTSP_AUDIO=$(get_config RTSP_AUDIO) RRTSP_PORT=$RTSP_PORT RRTSP_USER=$USERNAME RRTSP_PWD=$PASSWORD rRTSPServer & + RTSP_AUDIO_COMPRESSION=$(get_config RTSP_AUDIO) + if [[ "$RTSP_AUDIO_COMPRESSION" == "none" ]] ; then + RTSP_AUDIO_COMPRESSION="no" + fi + + RRTSP_RES=$(get_config RTSP_STREAM) RRTSP_AUDIO=$RTSP_AUDIO_COMPRESSION RRTSP_PORT=$RTSP_PORT RRTSP_USER=$USERNAME RRTSP_PWD=$PASSWORD rRTSPServer & if [[ $(get_config RTSP_STREAM) == "low" ]]; then ONVIF_PROFILE_1="--name Profile_1 --width 640 --height 360 --url rtsp://%s$D_RTSP_PORT/ch0_1.h264 --snapurl http://%s$D_HTTPD_PORT/cgi-bin/snapshot.sh?res=low$WATERMARK --type H264" fi diff --git a/src/static/static/home/yi-hack/script/wd_rtsp.sh b/src/static/static/home/yi-hack/script/wd_rtsp.sh index d3dae53..f91392b 100755 --- a/src/static/static/home/yi-hack/script/wd_rtsp.sh +++ b/src/static/static/home/yi-hack/script/wd_rtsp.sh @@ -19,7 +19,7 @@ get_config() restart_rtsp() { - RRTSP_RES=$(get_config RTSP_STREAM) RRTSP_AUDIO=$(get_config RTSP_AUDIO) RRTSP_PORT=$RTSP_PORT RRTSP_USER=$USERNAME RRTSP_PWD=$PASSWORD rRTSPServer & + RRTSP_RES=$(get_config RTSP_STREAM) RRTSP_AUDIO=$RTSP_AUDIO_COMPRESSION RRTSP_PORT=$RTSP_PORT RRTSP_USER=$USERNAME RRTSP_PWD=$PASSWORD rRTSPServer & } check_rtsp() @@ -76,6 +76,11 @@ case $(get_config RTSP_PORT) in *) RTSP_PORT=$(get_config RTSP_PORT) ;; esac +RTSP_AUDIO_COMPRESSION=$(get_config RTSP_AUDIO) +if [[ "$RTSP_AUDIO_COMPRESSION" == "none" ]] ; then + RTSP_AUDIO_COMPRESSION="no" +fi + echo "$(date +'%Y-%m-%d %H:%M:%S') - Starting RTSP watchdog..." >> $LOG_FILE while true diff --git a/src/www/httpd/cgi-bin/service.sh b/src/www/httpd/cgi-bin/service.sh index f7cbc95..764d3eb 100755 --- a/src/www/httpd/cgi-bin/service.sh +++ b/src/www/httpd/cgi-bin/service.sh @@ -47,11 +47,25 @@ init_config() if [[ $HTTPD_PORT != "80" ]] ; then D_HTTPD_PORT=:$HTTPD_PORT fi + + if [[ $(get_config RTSP) == "yes" ]] ; then + RTSP_AUDIO_COMPRESSION=$(get_config RTSP_AUDIO) + if [[ "$RTSP_AUDIO_COMPRESSION" == "none" ]]; then + RTSP_AUDIO_COMPRESSION="no" + fi + fi } start_rtsp() { - RRTSP_RES=$1 RRTSP_PORT=$RTSP_PORT RRTSP_USER=$USERNAME RRTSP_PWD=$PASSWORD rRTSPServer >/dev/null & + if [ ! -z $1 ]; then + RTSP_RES=$1 + fi + if [ ! -z $2 ]; then + RTSP_AUDIO_COMPRESSION=$2 + fi + + RRTSP_RES=$RTSP_RES RRTSP_PORT=$RTSP_PORT RRTSP_USER=$USERNAME RRTSP_PWD=$PASSWORD RRTSP_AUDIO=$RTSP_AUDIO_COMPRESSION rRTSPServer >/dev/null & $YI_HACK_PREFIX/script/wd_rtsp.sh >/dev/null & } @@ -153,7 +167,7 @@ init_config if [ "$ACTION" == "start" ] ; then if [ "$NAME" == "rtsp" ]; then - start_rtsp $PARAM1 + start_rtsp $PARAM1 $PARAM2 elif [ "$NAME" == "onvif" ]; then start_onvif $PARAM1 $PARAM2 elif [ "$NAME" == "wsdd" ]; then