Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- VOPATH=/media/data/motion # video output directory
- MPATH=/home/pi/motion # motion log directory
- FFMPEG=/usr/local/bin/ffmpeg # path to ffmpeg
- CAM=1
- pidfile=$MPATH/cam$CAM.pid
- if [ ! -f $pidfile ]; then
- echo "PID file not found."
- else
- echo "PID file exists, killing stale process."
- read pid < $pidfile
- echo "Sending SIGINT to process $pid."
- kill -INT $pid
- echo "Removing PID file $pidfile."
- rm $pidfile
- fi
- filename=$VOPATH/$(date +%F_%R)_$CAM.mp4
- echo "Saving to $filename..."
- # $FFMPEG -rtsp_transport tcp -i rtsp://192.168.0.1:554/user=user_password=password_channel=1_stream=0.sdp -c copy $filename &
- openRTSP -b 250000 -4 rtsp://192.168.0.1:554/user=user_password=password_channel=1_stream=0.sdp >$filename &
- pid=$!
- echo "Started recording process with PID $pid..."
- echo $pid > $pidfile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement