Advertisement
Guest User

Untitled

a guest
Sep 5th, 2015
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. VOPATH=/media/data/motion # video output directory
  4. MPATH=/home/pi/motion # motion log directory
  5. FFMPEG=/usr/local/bin/ffmpeg # path to ffmpeg
  6. CAM=1
  7.  
  8. pidfile=$MPATH/cam$CAM.pid
  9. if [ ! -f $pidfile ]; then
  10. echo "PID file not found."
  11. else
  12. echo "PID file exists, killing stale process."
  13. read pid < $pidfile
  14. echo "Sending SIGINT to process $pid."
  15. kill -INT $pid
  16. echo "Removing PID file $pidfile."
  17. rm $pidfile
  18. fi
  19. filename=$VOPATH/$(date +%F_%R)_$CAM.mp4
  20. echo "Saving to $filename..."
  21. # $FFMPEG -rtsp_transport tcp -i rtsp://192.168.0.1:554/user=user_password=password_channel=1_stream=0.sdp -c copy $filename &
  22. openRTSP -b 250000 -4 rtsp://192.168.0.1:554/user=user_password=password_channel=1_stream=0.sdp >$filename &
  23. pid=$!
  24. echo "Started recording process with PID $pid..."
  25. echo $pid > $pidfile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement