Reputation: 1703
I use the tools provided by apple to covert a .mp4 file into a m3u8 file and many .ts files. Then I uploaded those files to my server and use mpmovieplayercontroller to play the .m3u8 file and it worked.
my question is, since there are too many .ts files and this would be difficult to manage on our server, is it possible to combine them into a single file, but it still follows http live streaming? Thank you,
Upvotes: 1
Views: 1783
Reputation: 5256
since there are too many .ts files and this would be difficult to manage on our server, is it possible to combine them into a single file, but it still follows http live streaming?
It is possible. Then you need to also alter the variant playlists so that that they use a byte-range request on the combined TS file. Once you know the byte offsets of each of the original segments into the combined file, this is not particularly hard to do: you need to add a number of #EXT-X-BYTERANGE
tags to the playlist, which point the media player to the byte range to request from the media server.
Note that for #EXT-X-BYTERANGE
to work you need a player that supports HLS version 4 or higher (which is anyway the near totality of iOS devices, and most Android devices).
Upvotes: 3
Reputation: 691
You should use a class of software called "media servers" to do transmuxing, i.e. re-packaging on the fly. You'll be able to keep MP4 on your disk and have media server processing and caching it for all viewers.
Upvotes: 0