[FFmpeg-user] How to download the ts files from .m3u8 playlist

Moritz Barsnick barsnick at gmx.net
Fri Apr 27 18:40:01 EEST 2018

On Fri, Apr 27, 2018 at 14:11:47 +0000, m.kamalasubha m.kamalasubha wrote:
> Basically, I want to extract the audio and video raw files from the ts
> segments of the playlist file. Is it possible to generate the raw files
> from the individual TS segments using FFmpeg?

Ah, that's why it's always good to explain what you actually intend to

ffmpeg can do this, because demuxing actually implies getting the raw
streams out of the video. You don't need the individual segments for
this (unless there's something else you want to do which I don't

You need to identify the desired streams from the output of this:

$ ffmpeg -i https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8

and then extract them, even several at time, by using the copy codec
and a raw output format, somewhat like this:

$ ffmpeg -i https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8 -map 0:12 -c copy -f rawvideo rawfile.rawh264 -map 0:13 -c copy -f rawvideo rawfile.rawaac

There's no "rawaudio" muxer, but I believe "rawvideo" just leaves any
binary stream untouched, and should be correct. The "aac" muxer OTOH
might be incorrect, as it creates an ADTS stream(??). Anyway, I
confirmed that ffplay can play each of the two resulting raw streams.

Please avoid top-posting,

More information about the ffmpeg-user mailing list