ffmpeghttp-live-streamingm3u8

Create m3u8 file from list of ts files


I want to create 'm3u8' file from the list of ts files. How can I do it?

I did search in google & read documentation of ffmpeg but I didn't find anything.


Solution

  • It's not clear which of the following cases you're asking about, so here's a quick answer for both:

    1. If you're starting with a single file that contains your content This is the most common case. In general, there are three steps to creating a playable HlS stream from source material.

    FFMpeg can do all three of these.

    1. If you're starting with a collection of .ts files If you really are starting with a collection of .ts files, you could either hand-build an m3u8 file as described in the previous answer, or you could write a script to do it.

    In either case, there are some considerations for the .ts files:

    When you've built your m3u8 file, it helps to run it through a validator to find any problems.This is a lot easier than scratching your head wondering why an HLS stream plays poorly or inconsistently across players/browsers.