Skip to content

Instantly share code, notes, and snippets.

@boverby
Created May 6, 2019 18:26
Show Gist options
  • Save boverby/cd0dffebce8870c42a3e4ff2ff97332e to your computer and use it in GitHub Desktop.
Save boverby/cd0dffebce8870c42a3e4ff2ff97332e to your computer and use it in GitHub Desktop.
#!/bin/sh
NASMOUNT=/system/media/nas
HOST=`hostname`
FILE="${HOST}-`date +%Y-%m-%d_%H.%M.%S.mp4`"
DEST=${NASMOUNT}/`date +%Y-%m`
if [ "$1" == "on" ]; then
mkdir -m 0777 -p ${DEST}
CMD="/system/sdcard/bin/avconv -v quiet -probesize 2M -analyzeduration 2M -rtsp_transport tcp -y -i rtsp://0.0.0.0:8554/unicast -vcodec copy -an -strict experimental -t 5 ${DEST}/${FILE} "
busybox nohup $CMD &
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment