Skip to content

Instantly share code, notes, and snippets.

@duncte123
Forked from tzmartin/m3u8-to-mp4.md
Last active June 16, 2021 10:25
Show Gist options
  • Save duncte123/4ed34c276c7b5d14debdc5fefabe796d to your computer and use it in GitHub Desktop.
Save duncte123/4ed34c276c7b5d14debdc5fefabe796d to your computer and use it in GitHub Desktop.
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 23 file.mp4
@duncte123
Copy link
Author

trying to understand what the options mean

ffmpeg -i "http://host/folder/file.m3u8" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 file.mp4

-bsf:a aac_adtstoasc

-c copy -vcodec copy

-crf 50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment