Advertisement
diggidre

Bash Kamera wieder erreichbar, starte Aufnahme

Dec 10th, 2018
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.26 KB | None | 0 0
  1. #!/bin/sh
  2. # record-ping-reconnect_cam1.sh
  3. # Record IPcam after it was approved to be online again after signal lost
  4. #
  5. # This will print the current date and time in a format appropriate for storage
  6. STARTTIME=$(/bin/date +"%d.%m.%Y")-"("$(/bin/date +"%H").$(/bin/date +"%M")Uhr")"
  7. #
  8. ## IP Camera Names ##
  9. # Creating date stamps for each of the Cameras
  10. CAM1=Cam1_$STARTTIME
  11. #
  12. ## Network and Local Storage Locations  ## #Trailing '/' is necessary here
  13. RCDIR="/home/xxx/camdata/Reconnect/"
  14. #
  15. ## Record Time per File sec ##
  16. LENGTH="86400" # (24h)
  17. #
  18. ## Record Settings ##
  19. #
  20. # -v 0    // Log level = 0
  21. # -i      // Input url
  22. # -vcidec // Set the video codec. This is an alias for "-codec:v".
  23. # -an     // Disable audio recording
  24. # -t      // Stop writing the output after its duration reaches duration
  25. #
  26. # warte 1m bis Kamera wieder vollständig erreichbar ist
  27. sleep 1m
  28. # starte erneut das ping Überwachungsskript für diese Kamera
  29. sudo bash /home/xxx/scripts/record-ping_cam1.sh & echo $! > /home/xxx/camdata/Reconnect/PIDs/ping_cam1.pid
  30. # starte ffmpeg capture für diese Kamera
  31. ffmpeg -v 0 -rtsp_transport tcp -i "rtsp://xxx:xxx@192.168.178.xxx:xxx/11" -vcodec copy -an -t $LENGTH $RCDIR$CAM1.mkv & echo $! > /home/xxx/camdata/Reconnect/PIDs/ffmpeg_cam1.pid
  32. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement