Last active
January 13, 2019 18:50
-
-
Save hnaderi/ebd16c059a3e931c7dfd47f920f2fb60 to your computer and use it in GitHub Desktop.
stream all m3u8 playlist files to mp4 files using ffmpeg
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 | |
mkdir output; | |
for f in $2; do | |
output=$(echo $f| sed "s/.m3u8/.mp4/"); | |
echo "streaming '$f' to '$output' ..." | |
echo from $(cat "$f" | grep -A 1 -i "$1" | tail -n 1); | |
ffmpeg -i "$f" -bsf:a aac_adtstoasc -vcodec copy -c copy output/"$output"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
usage example:
./stream-to-file.sh "1280x720" "*.m3u8"