Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Choose download resolution in m3u8 list with ffmpeg

Tags:

ffmpeg

m3u8

I'm trying to download video from a m3u8 playlist using ffmpeg but I do not know how to choose the resolution to download. Currently the command is downloading the highest version

the command I am using is:

/home/user/bin/ffmpeg -user_agent "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0" -i "https://sitevideo.com/list.m3u8" -c copy "/home/file/video.ts"

My list is this

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=400000,NAME="low"
size1.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=800000,NAME="med"
size2.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1900000,NAME="best"
size3.m3u8
like image 315
Bruno Andrade Avatar asked Apr 23 '18 07:04

Bruno Andrade


1 Answers

You have to use the -map option.

ffmpeg ... -i "https://sitevideo.com/list.m3u8" -map p:1 -c copy "/home/file/video.ts"

p:1 refers to the 2nd program (variant playlist, in this case)..

like image 84
Gyan Avatar answered Sep 16 '22 17:09

Gyan