Reputation: 579
I have generated hls videos using FFmpeg. But I forgot to put -hls_list_size 0
. Now it contains only the last 4 files. Is there any way to generate only the .m3u8 playlist file using all *.ts files inside the folder?
Upvotes: 2
Views: 2406
Reputation: 607
Assuming you do not have the source or you do not want to re-construct the whole playlist, write a bash script to pick the duration of each segment using the command
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 ts_files/sample_000.ts
Once you have the segment lengths, it should be quite simple IMHO.
Of-course, you'd want the bash to iterate through the *.ts
files in a sorted order (by name/created at).
While the above may do the job, go through this and this once.
Upvotes: 2