Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # record-reboot_e-cam1.sh
- # Record IPcam when it is reachable again after any case of 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
- ECAM1=Cam1_$STARTTIME
- #
- ## Network and Local Storage Locations ## #Trailing '/' is necessary here
- RCDIR="/home/xxx/camdata/Reboot/"
- #
- ## Record Time per File sec ##
- LENGTH="86400" # (24h)
- #
- ## Record Settings ##
- #
- # kill old ffmpeg process and PID file
- pkill -F /home/xxx/PIDs/Reboot/ffmpeg_cam1.pid
- sleep 1s
- rm -f /home/xxx/PIDs/Reboot/ffmpeg_cam1.pid
- # start the ping routine, check if the cam is still alive
- exec /home/xxx/scripts/record-ping-reconnect_cam1.sh &
- sleep 40s
- # start capture this camsource
- ## 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
- #
- ffmpeg -v 0 -rtsp_transport tcp -i "rtsp://address:port" -vcodec copy -an -t $LENGTH $RCDIR$ECAM1.mkv & echo $! > /home/xxx/PIDs/Reboot/ffmpeg_cam1.pid
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement