Project

General

Profile

How to? single mux using pipe to process m3u

Added by Daz Egar over 7 years ago

don't understand this pipe:// thing

but is it possible to create a single mux that uses a bash script to iterate over a list of. ts streams given in the m3u, providing each to TVH to create services from.?

how ?

I'm ok with bash, don't understand TVH though

cheers?


Replies (2)

RE: How to? single mux using pipe to process m3u - Added by Sean Micklem over 7 years ago

I get what you are trying to do but you are kind of barking up the wrong tree.

TVHeadend has a definite hierarchy in how it does things. What you really want, your end goal, it to get all your streams to appear as channels. There is a definite relationship here - a mux can contain many channels, but each channel must be mapped as a service, and then each service must be mapped as a channel. So what you would need to do is figure out how to add your mux (easy enough since you can do it in the GUI), then create your services (one for each channel in your stream), then map the services to channels (easy to do from the GUI). This is if you use pipe://, the version of TVHeadend I have isn't new enough to use the other method.

In 4.0.x version of TVHeadend, and in some cases in newer versions, the service files are all stored in a specific place in the directory tree, for example for regular channels they would be in /home/hts/.hts/tvheadend/input/dvb/networks/{long hexadecimal number}/muxes/{long hexadecimal number}/services - if you can figure out which mux is associated with your stream pipe then you could possibly write a program or script to create service files, provided you can figure out TVHeadend's format.

This thread may give you some idea of the complexity of adding a service manually: http://rickcaylor.websitetoolbox.com/post?id=7487484&pid=1287822937#post1287822937

And as the icing on the cake, I have heard that some newer versions of TVHeadend use a database rather than individual files in a directory tree, though I cannot confirm or deny that since the version I use doesn't.

I will note that the names of the files for the muxes, services, etc. appear to just be completely random hexadecimal strings of a particular length; basically they are using such a long string that generating a duplicate filename would be highly unlikely.

Anyway, your challenge would be to generate the service files without scanning each service first, if your version of TVHeadend even uses service files. THEN, after you create your services, you need to create your channels. In the version of TVHeadend that I have, the channel files are in /home/hts/.hts/tvheadend/channel/config

I don't know if you are a programmer, you said you are okay with bash so maybe this is something you could figure out, although I suspect bash may not be the most suitable language (can you call bash a language?) for this. I am not a programmer, other than that I know a little BASIC from way back when. Anyway, you may want to poke around in the directory trees I mentioned above and see if you can figure out the format. Be sure to view the contents of config files when you find them; they often contain the name of the network/mux/service, etc.

I agree with you in principle that you should be able to skip the scan when reading from a .m3u8 file, but in practice there are probably reasons it attempts the scan (maybe an attempt to get the channel name?). However, if the scan is necessary then there should be an option to rate limit it, maybe a "sleep n seconds between each scan" option or something like that. I'm sure you'd rather wait all night, or even a day or two for the scan to complete as long as you don't have to enter everything manually.

RE: How to? single mux using pipe to process m3u - Added by Daz Egar over 7 years ago

agreed
thank you for the explanation
yes, I could work out the fine structure from analysis of source code, but I dint think back door hacking of user function is right.
better its done natively

    (1-2/2)