Masukan script ini kedalam file /rc.local atau /.bashrc

tvservice -c "PAL 4:3"
omxplayer rtmp://ip_address:1935/app_name/stream_name
Script=/home/pi/script.sh

PID=$(ps ax | grep omxplayer.bi[n] | cut -d' ' -f2)

echo "PID = $PID"

##Loop to test if connection is present every 60 seconds
while [ $PID ];
    do
      sleep 60
      PID=$(ps ax | grep omxplayer.bi[n] | cut -d' ' -f2)
    done

#If connection is not found to be present execute this command to retry every 15 seconds

sleep 15

exec $Script