Skip to content

Instantly share code, notes, and snippets.

@h3ssan
Forked from tzmartin/m3u8-to-mp4.md
Created September 13, 2022 15:50
Show Gist options
  • Save h3ssan/58b3142c1e7e0ce797d323f126b4861e to your computer and use it in GitHub Desktop.
Save h3ssan/58b3142c1e7e0ce797d323f126b4861e 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 50 file.mp4
@h3ssan
Copy link
Author

h3ssan commented Sep 13, 2022

ffmpeg -i "http://host/folder/file.m3u8" -c copy file.mp4

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