Skip to content

Instantly share code, notes, and snippets.

@AJ-7885
Last active January 24, 2024 12:44
Show Gist options
  • Save AJ-7885/c4d4c7ba1055b12261c178db1c1036b2 to your computer and use it in GitHub Desktop.
Save AJ-7885/c4d4c7ba1055b12261c178db1c1036b2 to your computer and use it in GitHub Desktop.
Convert m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4

Alt text

Example final command

ffmpeg -i "http://host/folder/file.m3u8" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 file.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment