How many .ts files should be there in .m3u8 file for Live streaming?
For Http Live streaming, initially I have added 3开发者_JAVA百科 .ts files in to .m3u8 file it starts playing. In what ways should I append the incoming .ts file into .m3u8 file?
Shall I keep appending?
Shall I replace the older files with new one? If so in what order like, new set of files?
The best method I've seen is where you decide on the amount of "history" you want, for example H = 20 files, and then publish on the last X files in the playlist (if each segment is 10 seconds, then 3 files is a good idea).
you start by publishing movie_000, movie_001, and movie_002. after 10 seconds you publish movie_001, and movie_002 and movie_003 ... and so on until you reach the amount of files you wish to have and then you rewrite older files (this way your hard drive doesn't overflow with data) so after H files X 10 seconds, you will have movie_018, movie_019, movie_000
精彩评论