How to create an m3u8 playlist from a list of mp4 files?

I have a bunch of mp4 files from which I want to prepare an m3u8 playlist, is there any way to do it using FFmpeg?

You accomplish your task using a single FFmpeg command in which you can read all the files and combine all the streams from different files using a filter, and output m3u8 using segment format from FFmpeg but it would be hacky and prone to errors.

Can you please provide me the command you said in the comment, I think you forgot to write it down.

Here is the solution of your problem just follow the steps given below:
• Just combine all the mp4 files into a single mp4 file using FFmpeg Concat filter.
• Run the highlighted command (segment format) which takes the mp4 file as input and provides m3u8 as output.

Thanks for your response it works for me!