Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I include all ts files ffmpeg generates in the m3u8 playlist?

I have the latest ffmpeg version 2.5 and I am trying to convert a mp4 file into HLS files. From what I understand ffmpeg can generate ts and m3u8 playlist. When ffmpeg finishes, the playlist just contains last few ts files generated. It appears it's being overwritten. What parameters must I pass to ffmpeg to generate a complete m3u8 list of all the ts files?

final m3u8 generated:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:9
#EXT-X-MEDIA-SEQUENCE:50
#EXTINF:9.000000,
480x27050.ts
#EXTINF:9.000000,
480x27051.ts
#EXTINF:9.000000,
480x27052.ts
#EXTINF:9.000000,
480x27053.ts
#EXTINF:0.466667,
480x27054.ts
#EXT-X-ENDLIST

ffmpeg arguments:

ffmpeg -i test_2.mp4 -c:a aac -strict experimental -ac 2 -ar 48k -ab 64k -c:v libx264 -s 480x270 -aspect 16:9 -b:v 400k -r 15 -g 45 -profile:v baseline -level 3.0 -f hls -hls_time 9 480x270.m3u8
like image 362
Pobre Avatar asked Sep 16 '25 16:09

Pobre


1 Answers

I had to add

-hls_list_size 0 

This will write all the ts files generated to the m3u8.

Thanks

like image 136
Pobre Avatar answered Sep 19 '25 06:09

Pobre