Use ffmpeg to download stream from m3u8 file with a particular resolution

Solution 1:

When you access a HLS master playlist using FFmpeg, all the variants are presented as numbered programs. You need to map the desired program.

So, first run

ffmpeg -i hls-link

to identify the program.

Then run,

ffmpeg -i hls-link -map 0:p:2 -c copy out

to download Program 2.