Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download m3u8 format media file in Android

I need to parse an m3u8 media file, which is a playlist, and download the actual media content.
As per my understanding, the following are the process involved:

  • Parse the m3u8 file and get the '.TS' chunks
  • Once all the chunks has been retrieved, merge as a single file
  • Convert the merged TS file to mp4 format.

Unfortunately, I couldn't find any lib/module to perform the above-mentioned steps. Can anyone provide a better approach or working sample to process and download the m3u8 file?

Any help is much appreciated.

like image 324
Nizam Avatar asked Jan 24 '17 06:01

Nizam


1 Answers

Here is my solution: https://github.com/nichucs/HLS2MP4 With 3 simple java classes, you can do this.

Disadvantage of the previous one is, it has around 20MB size.

like image 113
Nizam Avatar answered Sep 27 '22 02:09

Nizam