Project

General

Profile

Locast interface (appliance)

Added by G Kazaroth 5 months ago

TVHeadend-Locast version 0.7.5c (3/29/2021)
Product is called cabernet for (Cable Network)

https://github.com/rocky4546/tvheadend-locast/releases
Working on getting a service that will take the Locast server stream, clean it and feed it into TVHeadend and other DVRs (Also tested on Emby and should work on Plex). It works on the subscription and free versions. Also it runs on Linux and Windows as a service. Windows has a installer. Once installed, setup is easy with TVHeadend.
1) Setup the automatic IPTV network

Make sure to set the number of tuners to 1. Locast does not like the speed of channel changes during initial scanning. Doing a force scan will create the mux and service values.
2) Next you can setup the grabber. I use a URL grabber which is an extremely small file

Have the grabber run and populate the EPG data into the EPG Grabber Channels tab.
3) In the Channel view, select Map all channels.

This will tie the services, EPG and channels together, automatically. After this, re-grab the EPG data. This will populate the EPG tab with shows. I also updated the Number column with the channel number, but is not required.
4) Display the TVGUIDE. This appliance has special features which maps the tvheadend genre, giving colors on tvguides. It also has enhanced guide descriptions and optional additional channel notations if you use many streams. Below is the Kodi tvguide using the pvr.hts plugin.


Replies (43)

RE: Locast interface (appliance) - Added by G Kazaroth 17 days ago

Thanks for giving it a shot. cryptography module is not required unless you want to not have the passwords in the clear. The message is a warning if you have the "use_encryption" setting set to true. The load PIP module warning is similar. Basically, because your python install does not have pip module loaded, the program cannot auto load the crypto module either. So the end result is if you want to use encrypted passwords in the config file, then install pip.

I have been cleaning up the code today. 0.7.5a hung some python processes when the app was terminated. (I found 2 python3 process still running) Fixed this and a host of Windows OS process issues. Also made it simple for the config.ini. On a new install, the config.ini at the top folder just needs
[main]
locast_username = [username]
locast_password = [password]

Everything else is auto populated in the config file, if missing, so it should be easier to get started.

End result is, recommend moving to 0.7.5c.

@AlistairRuckus. Make sure you are using the new internalproxy setting to not use ffmpeg. It is much more stable.

RE: Locast interface (appliance) - Added by C Island 17 days ago

K Shea,

If you want to remove that warning message you can install the pip and cryptography modules. I think they are only needed if you want to tvheadend-locast to encrypt your clear text password in the config.ini file

I think the way to install pip and cryptography for Python 3 on Ubuntu 20.04 is to run the following commands as root or sudo user in your terminal:

   $ sudo apt update
   $ sudo apt install python3-pip
   $ pip3 install cryptography

RE: Locast interface (appliance) - Added by G Kazaroth 17 days ago

In regard to tuners sometimes not working, make sure to have tvheadend set to half of the available tuners. So if tvheadend is set to 2, then set the app to 4. tvheadend will turn off the first tuner AFTER the next tuner starts. This causes twice the tuners to be used, per locast. Since the maximum tuners for locast is 4, the recommendation is to use 2 for tvheadend and 4 for the app. This is NOT an issue when recording the next show on the SAME channel. tvheadend is smart enough to use the same stream for both recordings, so locast only sees one stream.

RE: Locast interface (appliance) - Added by Sean Micklem 16 days ago

Well I followed your instructions and got it working with no problems that I can see. I do see issues with certain specific channels but I'm sure that's Locast's problems in getting good reception on all area channels. So anyway I just wanted to say thank you for the program and for the very complete instructions!

RE: Locast interface (appliance) - Added by G Kazaroth 16 days ago

I too have seen pixelation on specific channels. Most of the time it is on VHF frequencies which seem to have more issues. In one case, ABC has been on VHF forever, and the only major network on VHF. They recently added a high-def subchannel on UHF that is the same stream. That fixed everything and my normal antenna receives a strong signal on UHF, but Locast has not yet picked up the UHF stream, so the locast main channel still has pixelation every so often. At the rate Locast is adding major cities is probably keeping them very busy, so going back and adjusting the channels available is something that is not happening very often.

At this point, the software works well in getting the Locast stream to tvheadend. It does also work with many other DVR systems with configuration changes. So, my plan is to work on implementation of the plugin design pattern and make the application more robust.

RE: Locast interface (appliance) - Added by K Shea 15 days ago

C Island wrote:

K Shea,

If you want to remove that warning message you can install the pip and cryptography modules. I think they are only needed if you want to tvheadend-locast to encrypt your clear text password in the config.ini file

I think the way to install pip and cryptography for Python 3 on Ubuntu 20.04 is to run the following commands as root or sudo user in your terminal:

[...]

Thanks for the explanation. No, I don't really care if the password is encrypted on my local system. I nevertheless thought about installing python3-pip, until I saw how many additional packages it wanted to install. It seems to me that installing pip gives a rogue script or program another avenue to install additional software you might not want on your system, so the security implications are about equal either way, and I have a good firewall.

RE: Locast interface (appliance) - Added by K Shea 15 days ago

First of all I want to say that this is a great piece of software. Many many many thanks to the author!!!!!

I have a bit of a technical question. In the first post in this thread it shows how to use a channels.m3u file as the source, but that brings in all the channels. In my case, I only wanted to import certain selected channels, not every single crap and low-quality channel. I wonder how hard it would be to have a page that lets you see all the channels available and enable or disable each one, and then it would build a custom_channels.m3u file or something like that, with only the channels you want. Also, I store high quality channel icons for use by Kodi, so I don't need the channel logo image links.

Right now the only way I have found to specify individual channels is to create a separate mux for each channel I want, and in the Mux name field put the channel name as I want it to display in Kodi, and in the URL field use something like this:

pipe:///usr/local/bin/ffmpeg -loglevel fatal -i http://192.168.1.130:5004/watch/[channel_identifier] -c copy -strict -2 -metadata service_provider=Channel_Name -metadata service_name=Channel_Name -f mpegts pipe:1

The http link is taken from the channels.m3u file. This gives me a lot more control over how it appears in Kodi but what I don't understand is why it only works if I pipe it through ffmpeg. I did not create the above "recipe" for bringing in a single stream as a mux - it is something I found posted online many years ago and originally used it to bring some streaming channels into Tvheadend, but unfortunately such services tend to change URLs from time to time so it has become rather useless for that. It has always seemed to me that there should be a way to bring in a single stream into Tvheadend without involving ffmpeg, but if there is I don't know about it. Doing it this way works quite well, but seems overly complicated.

If I could build a custom m3u file, what I'd really want to be able to specify, in addition to which channels appear, is the channel name to use (I like to have both the network name and the station call letters appear in Kodi) and possibly the channel number so it doesn't conflict with existing channels on my system, although the latter can be changed manually in Tvheadend's Channels tab. And I'd definitely omit the links that pull in channel icons from an online source, since those sometimes tend to be lower quality icons, and I prefer to store them locally anyway.

This would not be such a big deal if I were not using it on an existing system that already has channels ordered in a certain specific way. If I was creating a new Tvheadend from scratch I'd probably simply use the channels.m3u file and then disable the channels I don't want in the Channels tab and be done with it. Still, I really feel like I am making things overly complicated by doing it this way, and especially by piping the stream through ffmpeg. Am I missing something obvious?

But anyway it is working and for now I have the channels I want coming in, so thank your again for all your effort on this!

RE: Locast interface (appliance) - Added by G Kazaroth 15 days ago

Thank you for your questions. As you are aware, this project is still early although the locast to tvheadend part is working fine. The ability to customize the channels.m3u and xmltv.xml file is something that is in the future, but not near future. Once the project is modularized, then those types of things will be able to happen. I have around 117 channels that I feed into Kodi. On Leia, it would freeze when All Channels were selected. The way I filter the list is through TVHeadend's channel tags. They work every well with Kodi, and I have 11 different tags to provide different views. This is what I recommend and is easy to maintain.

As for the channel names, that is a little more complex since we need to specify that in the xmltv.xml file, the channels.m3u file and the stream ATSC packets. Your ffmpeg restream command updates the ATSC protocol inside the stream used by TVHeadend. We also update the stream with Locast as the provider and the channel number/name as the service. There are two configuration items that will help. They are called [epg][epg_prefix] and [epg][epg_suffix]. Currently a static string, but will either append a string or prepend a string to the channel number. I personally like the suffix "L" to note the channels from Locast versus the antenna (with the same channel number). Give that a shot and see if that will do something for you, for now.

As for ordering channels, Kodi will use the Channels Number field in TVHeadend to list the channels in a specific order, if you are looking for a uniquely ordered list. The old version of the M3U file did contain an ordered number, but most of the new DVR clients do not support it (including TVHeadend).

Then you mentioned the icons. I use my personal icons for some of the channels as you are correct that the ones provided are normally not as good. Currently, that means updating the channel icons in the Channels tab in TVHeadend. It works fine for me, but it would be nicer if it were simplified.

Most of the items you listed are future enhancements, but there are a number of critical pieces that must be in place before that can happen. I am working on the infrastructure for addons. Plan is to allow for addons in the client interface, GUI interface and provider interface, and once enabled should be extensible to include other areas.

RE: Locast interface (appliance) - Added by K Shea 15 days ago

Thanks, I do understand that this is a work in progress. The main functionality seems to be working great and that is what is important. I can live with the method I am using now indefinitely, ffmpeg in copy mode is so fast that there's no discernible impact on performance.

If I were really into it I suppose I could download the m3u file, edit it manually, and load it into Tvheadend using a file:/// link rather than a http:// link. But since I don't fully understand the structure of those .m3u files I'd be likely to screw something up and make it unreadable by Tvheadend. The ffmpeg pipe is something I have used it the past so it was my go-to solution to get the channels I wanted working quickly, it may not be the best way but for now it's fine, and I'm happy with the way it's working. So no rush at all on any of the changes I suggested, I appreciate what you have done so far and would rather see improvements that benefit stability come first anyway. Thanks again!

RE: Locast interface (appliance) - Added by Sean Micklem 13 days ago

Just for the sake of completeness, I wanted to note that while reading a Reddit thread I stumbled across what appears to be a somewhat similar project at https://pypi.org/project/locast2dvr/ and while it is not intended specifically for use with Tvheadend, because it does pretty much the same thing as this tvheadend-locast (and I think both are actually rewrites or forks of locast2plex) I suspect it might also work. I haven't tried it because tvheadend-locast is working fine for what I need but it appears that that one is slightly different and MIGHT offer some additional functionality, though I haven't done a feature-by-feature comparison so can't be certain. The source code is at https://github.com/wouterdebie/locast2dvr so that might be something you'd want to look over.

If anybody tries this software (tvheadend-locast) and also that one (the one linked to in the above paragraph) I'd be interested to know what the differences are, if any. Hopefully anything significant and actually useful could be added to tvheadend-locast, unless there is some reason not to.

P.S. There is also another project I ran across called fHDHR which apparently sort of emulates a HDHomeRun device (but is not in any way connected with Silicon Dust) which I suspect means that Tvheadend would see it as a HDHomeRun device on the network and use it as a source. It uses plugins to obtain "channels" from various sources, and there is a Locast plugin but there are also plugins for a few other services that stream "channels". This holds very little interest for me because it seems much too complicated to install and use, and if you just want to have Locast then there's really no advantage that I can see to using it over tvheadend-locast, but again I just mention that it exists.

Locast interface (appliance) - Added by G Kazaroth 12 days ago

Yes, I am aware of the different projects. Since retired and have lots of time, I thought I would take knitting of sorts. Not wanting to be a support, I decided to create my own. The main difference is that the others will not work with a free locast account, which for me is a big deal. Even if you change their code and remove the blocks, they will fail because the DTS/PTS for the locast commercials are all screwed up. This causes tvheadend to fail the recording. Also, tvheadend has very specific EPG requirements for the genre and I have provided the mappings so that they work correctly. Finally, tvheadend has additional requirements for the services, channels and channels tags that are addressed. Although, I have tested the project with Emby and Plex directly, it is currently focused on tvheadend as a client. I have no issues with anyone using the other projects and believe the competition will only strengthen all the apps. locast2dvr and locast2plex are not actively being updated, although fHDHR is and IMHO is an excellent project. If you were to try one, fHDHR would be my alternative project of choice. One note on fHDHR. It will download a ton of software (primarily from pip), so be aware of this before you try it. tvheadend-locast is being upgraded to support addons using the plugin design pattern. So far, the addon configuration interface looks good.

RE: Locast interface (appliance) - Added by Sean Micklem 10 days ago

Cool, thanks for the explanation. I did look at fHDHR and while I was a bit attracted to the fact that it could also use channels from a few other services, it seemed way too complicated to me. If you are going to support plugins then that is great, I am in no big hurry for them - it's not like I am running short of things to watch - but on the other hand that is something that could be really useful down the road, especially as those free streaming services start to add more content.

I also agree that it is really important that it works with a free Locast account; you really need to be able to test the service for a week or two to see if the quality is sufficient for your needs. If the channel you want to watch constantly cuts out or has audio sync issues or something like that, then it may not be worth it to donate.

As for the guide data I have been using zap2xml to get that; the reason I can't use the Locast data as is, is because I also have a couple of actual HDHomeRun devices connected to an antenna that predate Locast and I can use them to get channels that Locast doesn't carry. As an example if you live in certain places within the Detroit DMA then you can get Canadian channels that Locast doesn't carry, and depending on what part of the DMA you are in you may also be able to get channels from the Flint/Saginaw DMA or the Toledo, Ohio DMA (and maybe the Lansing/Jackson DMA if you are far enough east, not sure about that one). I'm not exactly sure why Locast doesn't carry the Canadian channels; the Canadians are always swiping our channels to put on their cable systems (and I don't think they are subject to retransmission fees either) and several Michigan cable systems carry Canadian channels, but for some reason Locast completely ignores them, which I'm sure doesn't set well among the users who really want to watch Hockey Night in Canada! I don't know where their antennas are so maybe it's just a problem of not being able to get a reliable signal from the Canadian stations but if so that is probably something they really should look into because there are people who would probably donate just to see the hockey games, also the CBC has a lot of original programming. Not that there is anything you or I can do about that, but just saying it's something you might not realize if you couldn't use the free Locast account, and it's also a reason to keep using an antenna even if you do use Locast.

In fact there are several places where people who live near a DMA boundary can receive signals from both places. For example there are plenty of places in southeastern Wisconsin where you can receive both the Milwaukee and Chicago stations, particularly if you are near the Lake Michigan shoreline since TV signals travel great over all that nice flat water, so in places like that people might want to use a HDHomeRun to get one group of channels and Locast for the other. I've even heard of places where people can receive channels from three different DMA's. Anyway in such situations just having only the guide data from Locast isn't really helpful. Again this is not something you can do anything about, just explaining why someone would use zap2xml over the Locast-provided guide data.

Thanks again for all the work you put into this, I still think your software is the easiest to install and get operating, and I do appreciate that you are actively maintaining it!

RE: Locast interface (appliance) - Added by G Kazaroth 10 days ago

I have the same setup using HDHomeRun and Locast with three HDHomerun tuners on top of that I have 2 antennas matrixed across the HDHomerun tuners to provide maximum signal quality. I have zap2it on the HDHomeRun tuners and the Locast EPG on Locast (for testing). If you want similar capabilities from zap2it, I have the scripts needed for TVHeadend located at
https://github.com/rocky4546/script.xmltv.tvheadend.
The category_filter.pl is the magic that turns the xmltv.xml into a tvheadend version. I am assuming you are using the zap2xml.pl from awardspace that is no longer available. I have the last version from their archive. You can try the installer, but if you have been doing this for years, then take a look at zap2xml.sh to see how the category_filter.pl is plugged in.

Locast interface (appliance) - Added by G Kazaroth 8 days ago

No new version, but updated the main branch with the config updates. This helps the Docker installs, moves all dynamic data into the ./data/ folder and static data into the ./lib/resources/ folder. So no more ./cache/ at the top level. Added an issue item to discuss the Docker configuration and usage. Version on the main branch is set to 0.8.0-alpha as the plugin design pattern is implemented.

RE: Locast interface (appliance) - Added by Sean Micklem 7 days ago

G Kazaroth wrote:

The category_filter.pl is the magic that turns the xmltv.xml into a tvheadend version. I am assuming you are using the zap2xml.pl from awardspace that is no longer available. I have the last version from their archive. You can try the installer, but if you have been doing this for years, then take a look at zap2xml.sh to see how the category_filter.pl is plugged in.

Yes I am using the zap2xml.pl from awardspace that is no longer available (except via the Wayback Machine at https://web.archive.org/web/20200426004001/http://zap2xml.awardspace.info/), but I found out that it's pointless for me to use category filters because the Kodi skin I prefer doesn't support colorization of the guide data, which as far as I can tell is the only real benefit of running the category filters. I'm still using the previous version of Kodi anyway until more Kodi addons have been converted to use Python 3, so I'm in no big hurry to mess with that.

RE: Locast interface (appliance) - Added by G Kazaroth 7 days ago

NEWS on similar apps... The locast2dvr app has been refactored into one of the new programming languages called Rust. The language appeared when Oracle caused all the issues with new Java licensing along with Google Go around 2009. Rust was created by Mozilla and is faster than Go, but harder to learn. I have no plans to migrate to the latest greatest language since I am looking for stability and simplification as compared to performance. My view, with the decades of experience, is that, these languages are transitory and will probably merge into a new one.

locast2dvr is now called locast2tuner and is located under the same developer at
https://github.com/wouterdebie/locast2tuner
In the past, he had issues with the locast2dvr title. People kept thinking it was a dvr as well, so his new name should not be as big an issue. Have not tried it, but the issues list indicates it is still going through bug fixes from the refactor.

RE: Locast interface (appliance) - Added by G Kazaroth 7 days ago

NEWS on similar apps... The locast2dvr app has been refactored into one of the new programming languages called Rust. The language appeared when Oracle caused all the issues with new Java licensing along with Google Go around 2009. Rust was created by Mozilla and is faster than Go, but harder to learn. I have no plans to migrate to the latest greatest language since I am looking for stability and simplification as compared to performance. My view, with the decades of experience, is that, these languages are transitory and will probably merge into a new one.

locast2dvr is now called locast2tuner and is located under the same developer at
https://github.com/wouterdebie/locast2tuner
In the past, he had issues with the locast2dvr title. People kept thinking it was a dvr as well, so his new name should not be as big an issue. Have not tried it, but the issues list indicates it is still going through bug fixes from the refactor.

RE: Locast interface (appliance) - Added by G Kazaroth 1 day ago

More Updates: version 0.8.0-alpha. Started migration to use plugins. No release at this time; all source is on main branch. No new modules are required. Changes include:
  • Fixed config to work with plugins
  • Restructured lib files
  • Added use of sqlite to improve memory use and multiprocessing
  • Added plugins folder at top level

Wiki has been updated to include manual Docker installs. I did quite a bit of testing, so it should be pretty stable. Continuing to migrate Locast to a plugin.
Note: There has been a degradation for weak stations from Locast, in that, either audio or video streams are not present. This is new and the hope is Locast will fix the issue.

(26-43/43)