Created
September 10, 2018 18:01
-
-
Save shokinn/553d917fdee74db46bfaec4885e9ebd8 to your computer and use it in GitHub Desktop.
Record Livestream
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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