Search code examples
androiddownloadandroid-download-managerm3u8m3u

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.


Solution

  • You got the steps correct. But this will include a huge effort to implement on your own. Better to go for some available libraries.

    I got a great one here with sample project: https://github.com/nichucs/ffmpeg-android-java-master Original repo: http://writingminds.github.io/ffmpeg-android-java/