2018-06-02 11:44:55 +03:00
|
|
|
#!/bin/sh -e
|
|
|
|
# /etc/rc.local
|
|
|
|
# This script launches revid-cli at boot time
|
|
|
|
|
|
|
|
REVIDPATH=/home/pi/go/src/bitbucket.org/ausocean/av/cmd/revid-cli
|
|
|
|
|
|
|
|
# kernel settings to improve performance on Raspberry Pi
|
|
|
|
# tell Linux to fork optimistically
|
|
|
|
sudo sysctl -w vm.overcommit_memory=1
|
|
|
|
# minimize swapping, without disabling it completely
|
|
|
|
sudo sysctl -w vm.swappiness=1
|
|
|
|
|
|
|
|
# the following required directories _should_ already exist
|
|
|
|
if [ ! -d /var/log/netsender ]; then
|
|
|
|
sudo mkdir /var/log/netsender
|
|
|
|
chmod guo+rwx /var/log/netsender
|
|
|
|
fi
|
|
|
|
if [ ! -d /var/netsender ]; then
|
|
|
|
sudo mkdir /var/netsender
|
|
|
|
chmod guo+rwx /var/netsender
|
|
|
|
fi
|
|
|
|
|
|
|
|
# capture stdout and stderr to a secondary log file (just in case)
|
|
|
|
exec 2> /var/log/netsender/stream.log
|
|
|
|
exec 1>&2
|
|
|
|
|
2018-06-07 13:52:28 +03:00
|
|
|
# set working dir and run revid-cli
|
|
|
|
cd $REVIDPATH
|
2018-06-07 14:50:57 +03:00
|
|
|
sudo "PATH=$PATH:$REVIDPATH" ./revid-cli -Verbosity=Yes -Input=Raspivid -Output=NativeRtmp -QuantizationMode=QuantizationOff -Bitrate=500000 -Packetization=Flv -NetSender &
|
2018-06-02 11:44:55 +03:00
|
|
|
|
|
|
|
exit 0
|