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
Example final command
ffmpeg -i "http://host/folder/file.m3u8" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 file.mp4
@ilyazub
For concurrently downloading you can't just use
ffmpeg
by itself. However, here are 2 things you can try:Option 1
Use
yt-dlp
** oryoutube-dl
witharia2c
as an external downloader. This just makesyt-dlp
leveragearia2c
for media downloading so you get concurrency.Note the args I've set for
aria2c
in the above example. These tell aria2c to continue partial downloads, to use 8 parallel download requests, and to limit each request to 2MB each (-k 2M
). Feel free to try tuning these parameters. For most situations limiting each download to 2M will slow things down but sometimes media hosts (dailymotion) apply traffic policies that allow the first part of a download stream to go very fast, but then they start rate limiting the download as it continues. By restarting each request after 2M you can sometimes subvert these limits.Option 2
Use
yt-dlp
oryoutube-dl
to extract the relevant URLs and then usearia2c
manually for concurrent downloading. Like this:Warning: often a root .m3u8 references other .m3u8 files which then reference the media so you might need to follow the tree of references a few levels deep.
**These days I recommend
yt-dlp
overyoutube-dl
. It's just a fork but it seems more regularly updated and in general succeeds more often for me.