added untested linux bash version of the dvr
This commit is contained in:
parent
d59fb83a2b
commit
2fef8364bf
18
Windows DVR/LinuxDVR.sh
Normal file
18
Windows DVR/LinuxDVR.sh
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load variables from the .env file
|
||||
if [ -f .env ]; then
|
||||
export $(grep -v '^#' .env | xargs)
|
||||
else
|
||||
echo ".env file not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if variables are set
|
||||
if [ -z "$OUTPUT_PATH" ] || [ -z "$RTSP_URL" ] || [ -z "$CHUNK_SIZE" ]; then
|
||||
echo "One or more required variables (OUTPUT_PATH, RTSP_URL, CHUNK_SIZE) are not set in the .env file."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Start FFmpeg to record in segments
|
||||
ffmpeg -i "$RTSP_URL" -c copy -f segment -segment_time "$CHUNK_SIZE" -segment_format mp4 -strftime 1 "$OUTPUT_PATH/%Y-%m-%d_%H-%M-%S.mp4"
|
Loading…
Reference in New Issue
Block a user