Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate .m3u8 on the fly from .ts files

I have a list of .ts file segments that follow this pattern

http://www.someaddress.com/file_11223344.ts
http://www.someaddress.com/file_11223345.ts
http://www.someaddress.com/file_11223346.ts
...

Since I need a m3u8 file in order to open this videos, is there a way to generate this m3u8 manually (from ts segments) in .php for example. Original m3u8 is protected and generated only if I have user/pass id etc. This is live stream that is always updated and generated based on a timestamp

like image 959
Bojan VukasovicTest Avatar asked Sep 18 '25 17:09

Bojan VukasovicTest


2 Answers

Yes there is a way. You just generate it. The m3u8 spec is very simple and fully documented. https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-19

like image 193
szatmary Avatar answered Sep 23 '25 07:09

szatmary


if you have the main file, let's say : http://www.someaddress.com/file_11223344.ts you don't have to convert anything. just change the end of the URL from .ts to .m3u8 that's it :)

like image 42
korchix Avatar answered Sep 23 '25 07:09

korchix