Generate .m3u8 on the fly from .ts files - live-streaming

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

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

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 :)

szatmary is correct.
For your case, being pass protected you can use json or xml feeds and parse it or simply call the m3u8 file and make sure it is done in utf-8 without BOM.
Here is a m3u8 method.
#EXTM3U
#EXTINF:-1,Title Here
http://www.someaddress.com/live/user/pass/file_11223344.m3u8
#EXTINF:-1,Title Here
http://www.someaddress.com/live/user/pass/file_11223345.m3u8
#EXTINF:-1,Title Here
http://www.someaddress.com/live/user/pass/file_11223346.m3u8
Learn about BOM here What's different between UTF-8 and UTF-8 without BOM?

All you have to do is a IPTV website which provide .ts streaming file, If you have subscription then it will be more useful. Just you want to change one address.

Related

yt-dlp : How can I have separate file format for playlists and single videos

I have an urls file where I store all links I want to download. I download from it using yt-dlp -a urls.
For playlists I'd like to put videos into a folder, like it's shown in documentation examples, while for single videos I'd like to keep the separate file format though.
How can I do it with a single configuration file? If it's not possible with a single configuration file, I'd want to have other options in a single common place.
Note: In documentation I saw TYPES: in --output, but I don't know how to use it and if it's applicable to my case.
PS: If it's possible to write a wrapper using yt-dlp as a library, with a hook, it'd be a viable options

How can I get IMSC XML from an HLS manifest?

I am reading about IMSC and the docs say it should be in XML https://developer.mozilla.org/en-US/docs/Related/IMSC
Meanwhile, I have an RTMP stream with embedded caption data from the HLS manifest. When I look at the fragments, it all looks like binary to me rather than XML. I actually checked all network traffic from the browser and only see the manifest and fragment calls. In sample players online I DO see the captions getting built up and displayed, but I'm not sure how they go from Manifest -> XML.
As far as I can tell devs should be using https://developer.mozilla.org/en-US/docs/Related/IMSC/Using_the_imscJS_polyfill if they want to show live captions.
ISMC is carried inside fragmented mp4 files, they are not stand alone text files like WebVTT.

Is it possible to have 2 HTML files on JsFiddle?

I am studying a book here and there is a exercise that needs 2 HTML files and I want to know if its possible to have to HTML files in my JsFidle
I do not believe it is possible. However, You could use Plunker. It's pretty similar, but allows you to create multiple files with your name extension. Was using it the other week to have a CSV as a data source.
Plunker Site here
This should help.
http://doc.jsfiddle.net/use/gist_response.html
Content of the http://gist.github.com/raw/606699/fiddle.response.html will be returned with text/html MIME type if this url will be loaded http://jsfiddle.net/gh/gist/response.html/606699/ using Ajax request.
.

Loading dynamically generated KML into google maps api

I have a bit of an issue with loading a dynamically generated KML into google maps api.
The KML file is generated by oracle and is of the format
http://server/oracleservioce.method?parm1=100&parm2=100
If I try and load that uRL (endcoded or decoded) I always get a KMLLayerStatus as INVALID_DOCUMENT.
If I save the resultant file to a local file with a KML extension it works foine, otherwise I get errors.
I even tried renaming the file to .xml and .dat (arbitrary names) and they all fail. It seems that google api need the file to have a .KML extension. This will not work in the dynamic environment. Can anybody suggest a way forward?
Thanks,
PS: I Need to use google maps API, I can not use openlayers or any other solution. The file needs to be loaded into a google.maps.kmllayer object.
I did this, no matter on the extension, but you have to set the mimetype on the http response: https://developers.google.com/kml/documentation/kml_tut#kml_server

Requesting header information of a file

is there anyway I can request only the header information of any media. For example I just want to request header information of any video file so as to find its video length. I tried using ffmpeg -i {video_url} and did the work but I noticed that it actually downloads the given media in local storage and returns back the header information which obviously increases roundtrip time.
So I would really appreciate if there is any idea for finding the length of media in a fly. BTW I have a ruby on rails application where I need to implement this.
You could try with ffprobe -show_format. ffprobe comes with ffmpeg, and should have been compiled and installed along with it.
You can also try mediainfo. you can download it from: http://mediainfo.sourceforge.net/en.
There is also a wrapper gem for mediainfo but it didn't work well for me. I just used:
response = '#{mediainfo_path} #{source.path} --output=json 2>&1'
and you can then search the response for the properties you want such as "duration" etc.