Use ffmpeg to download stream from m3u8 file with a particular resolution
7,363
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.
Author by
C.J.
Updated on September 18, 2022Comments
-
C.J. almost 2 years
I recently found how to download 'HLS' from a site and that works.
But one thing I could not find is if a particular site has available video in more than one resolution, say
1280x720
and1920x1080
.How can I tell 'FFMPEG' to download
1280x720
and not1920x1080
?This is the code I tried:
ffmpeg -i "https://hsprepack.akamaized.net/videos/hotstarint/world/kwks6/1_2/master.m3u8?hdnea=st=1540184067~exp=1540185867~acl=/*~hmac=a8945f016b594e1e2e4192ee05e2feaa5811c687d1891f69be1acc9057dd725f" -c copy output.mp4
-
C.J. over 5 yearsthank you very much it worked i had the idea it had something to do with -map but i was lacking knowledge of p that stand for program which ring the bell when i saw the logs
-
Admin almost 2 yearsHow can I download all three resolutions... Besides running this command three times? Ideally I'd like to do them all in one command, so I assume I need multiple MAP params ?