Skip to content

Instantly share code, notes, and snippets.

@shokinn
Created September 10, 2018 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shokinn/553d917fdee74db46bfaec4885e9ebd8 to your computer and use it in GitHub Desktop.
Save shokinn/553d917fdee74db46bfaec4885e9ebd8 to your computer and use it in GitHub Desktop.
Record Livestream
#!/bin/bash
die () {
echo -e >&2 "$@"
exit 1
}
if screen -list | grep -q "rec"; then
screen -S rec -X stuff "q"
fi
[ "$#" -eq "1" ] || die "URL to m3u8 playlist file needed!\n\nRun:\t'$0 \"<URL>\"'\ne.g.:\t'$0 \"https://domain.tld/playlist.m3u\"'"
screen -dmS rec ffmpeg -re -i "$1" -c copy -bsf:a aac_adtstoasc ~/rec/recording_$(date "+%d-%m-%y_%H-%M-%S").mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment