I was downloading video from a hls m3u8 stream using the ffmpeg command in php:
exec('ffmpeg -hide_banner -loglevel verbose -n -i https://example.com/playlist.m3u8 -acodec copy -bsf:a aac_adtstoasc -vcodec copy file.mp4 1> log.txt 2>&1', $output, $var);
But I was having problems downloading speed and the problem was not the internet.
So I installed and used the livestreamer.io OR streamlink.github.io/ and also slowed down the download.
So I made use of the hls-segment-threads=5
option according to the API document:
The size of the thread pool used to download segments.
This solved the problem, is there any equivalent option in the FFMPEG? Or have something I can do with PHP + FFMPEG to get this result that this hls-segment-threads option provides?
Most shared servers come with FFMPEG installed but the same does not fit with livestreamer or streamlink so I need a solution that works for everyone.
*I do not understand python do not know what this option exactly does