Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # record-ping-reconnect_cam1.sh
- # Record IPcam after it was approved to be online again after signal lost
- #
- # This will print the current date and time in a format appropriate for storage
- STARTTIME=$(/bin/date +"%d.%m.%Y")-"("$(/bin/date +"%H").$(/bin/date +"%M")Uhr")"
- #
- ## IP Camera Names ##
- # Creating date stamps for each of the Cameras
- CAM1=Cam1_$STARTTIME
- #
- ## Network and Local Storage Locations ## #Trailing '/' is necessary here
- RCDIR="/home/xxx/camdata/Reconnect/"
- #
- ## Record Time per File sec ##
- LENGTH="86400" # (24h)
- #
- ## Record Settings ##
- #
- # -v 0 // Log level = 0
- # -i // Input url
- # -vcidec // Set the video codec. This is an alias for "-codec:v".
- # -an // Disable audio recording
- # -t // Stop writing the output after its duration reaches duration
- #
- # warte 1m bis Kamera wieder vollständig erreichbar ist
- sleep 1m
- # starte erneut das ping Überwachungsskript für diese Kamera
- sudo bash /home/xxx/scripts/record-ping_cam1.sh & echo $! > /home/xxx/camdata/Reconnect/PIDs/ping_cam1.pid
- # starte ffmpeg capture für diese Kamera
- 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
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement