Skip to content

Instantly share code, notes, and snippets.

@PlushBeaver
Created May 28, 2019 19:05
Show Gist options
  • Save PlushBeaver/dcc29e22ce74b8e7f4dd797ebe064b31 to your computer and use it in GitHub Desktop.
Save PlushBeaver/dcc29e22ce74b8e7f4dd797ebe064b31 to your computer and use it in GitHub Desktop.
Record video from remote PTZ camera into chunks
# Adjust parameters in CAPS to your needs.
SEGMENT_HOURS=6
RECORD_DAYS=7
exec ffmpeg \
-y -hide_banner -nostats -loglevel info \
-i 'http://IP:PORT/videostream.cgi?user=USERNAME&pwd=PASSWORD' \
-f segment -segment_time $((SEGMENT_HOURS*60*60)) -segment_wrap $((RECORD_DAYS * 24 / SEGMENT_HOURS)) -segment_atclocktime 1 \
-strftime 1 \
"recording_%Y-%m-%d_%H-%M.webm"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment