openipcamera / openipc-firmware

OpenIPC Firmware for Wyze Cameras
https://openip.cam
886 stars 127 forks source link

RTSP does not start after Config RTSP! #18

Open hapas opened 6 years ago

hapas commented 6 years ago

All other scripts are running, but not the rtsp. I press start rtsp in the plugins page, but does not start and remains orange.

ghost commented 6 years ago

Same problem here, after initial installation it was running, then I changed the port (-P 556), rebooted and it won't start.

Removed -P 556 so it was back to default, still won't start.

The script appears to have been modified incorrectly after the change of parameters.

After changing port and then returning to default via web interface, 20-rtsp-server looked like this:

#!/bin/sh
PIDFILE="/var/run/rtsp-server.pid"

status()
{
  pid="$(cat "$PIDFILE" 2>/dev/null)"
  if [ "$pid" ]; then
    kill -0 "$pid" >/dev/null && echo "PID: $pid" || return 1
  fi
}

start()
{
  LOG=/dev/null
  echo "Starting RTSP server..."
  snx_rtsp_server -W 1920 -H 1080 -Q 10 -b 4096 >$LOG 2>&1 &
snx_isp_ctl --mfset-mode 0
  sleep 1
  snx_rtsp_server -W 1920 -H 1080 -Q 10 -b 4096 >$LOG 2>&1 &
}

stop()
{
  pid="$(cat "$PIDFILE" 2>/dev/null)"
  if [ "$pid" ]; then
     kill $pid ||  rm "$PIDFILE"
  fi
}

if [ $# -eq 0 ]; then
  start
else
  case $1 in start|stop|status)
    $1
    ;;
  esac
fi

Logged in via SSH, edited it back to default and it started immediately.

openipcamera commented 6 years ago

Noted