Skip to content

Instantly share code, notes, and snippets.

@garethfoote
Last active May 19, 2022 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save garethfoote/529604372203ff6f9c6942e27b797222 to your computer and use it in GitHub Desktop.
Save garethfoote/529604372203ff6f9c6942e27b797222 to your computer and use it in GitHub Desktop.
Convert RTSP stream into 60 second mp4 segments with local machine time as filename: Ymd-HM
if [ -z "$1" ]; then
IP_ADDRESS=10.164.208.102
else
IP_ADDRESS=$1
fi
# FFMPEG command for creating segments from RTSP stream
ffmpeg -i rtsp://@${IP_ADDRESS}:5554/playlist.m3u -c copy -map 0 -f segment -strftime 1 -segment_time 60 -segment_format mp4 "%Y%m%d-%H%M.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment