Will TVH pull channel numbers from this .m3u file?
Added by Reggie Burnett over 7 years ago
I am using HDHR primes and I have 2 .m3u files I am using to create my muxes. Each channel has the format like below in the m3u file:
#EXTINF:7,CSPAN 0007 CSPA
http://192.168.1.145:5004/auto/v7
The 7 in the first line is the channel number but TVH isn't pulling that in . All my channel # are zero. I tried the network setting "use service provider id as channel" but that didnt' seem to help. is there a setting to cause TVH to pull in that channel # into the muxes?
Thanks!
Replies (9)
RE: Will TVH pull channel numbers from this .m3u file? - Added by Robert Cameron over 7 years ago
Yes you can. Format your m3u as:
#EXTINF:-1 tvh-chnum="7",CSPAN http://1.2.3.4:5004/auto/v7
The first number of the EXTINF should always be "-1", as that is the duration of the stream/file; "-1" means indeterminate/indefinite. The text following the comma will be used to assign the service name in Tvheadend.
RE: Will TVH pull channel numbers from this .m3u file? - Added by Robert Cameron over 7 years ago
Based on the stream address you're using, it appears that you're setting up an HDHomeRun Prime. While it takes a little more configuration, I have a small patch that allows you to use Tvheadend's native HDHR driver to tune the Prime. The disadvantage to this is that there is no automatic adding of muxes, but instead you must manually create a mux for each channel you wish to tune. Also, service names are not detected, so the only reference when mapping channels and assigning EPG channels is based upon the cable channel number. Also, streaming over HTSP only seems to work when you use a transcode profile to wrap the stream in an MPEG-TS container.
Even though those seem like quite a few negatives, there is one big advantage: UDP/RTP streaming. This means that streams from the Prime to Tvheadend are streamed over UDP, which is much better suited than HTTP streaming over TCP. With TCP, every packet must be confirmed, which means that packets are not guaranteed to arrive in order; this can lead to quite a few continuity errors, especially when recording multiple streams.
Another benefit to using the HDHR driver is that Tvheadend will receive live information about the stream, such as your signal status and signal quality, which otherwise you can only view from web interface of the Prime itself. Additionally, if you have multiple Primes, you can reuse the same network; if you set up the Prime as an IPTV network, each device must be configured as a completely new and separate network because of the streaming addresses, whereas reusing an existing network means you just need to tell your additional Primes which existing network that they should use.
RE: Will TVH pull channel numbers from this .m3u file? - Added by Reggie Burnett over 7 years ago
That's very interesting. Would you say that your patch creates a better system? Is it worth it to go to the trouble of setting it up? I suppose the answer is yet or you would not have mentioned it?
RE: Will TVH pull channel numbers from this .m3u file? - Added by Reggie Burnett over 7 years ago
Robert Cameron wrote:
Yes you can. Format your m3u as:
[...]
The first number of the EXTINF should always be "-1", as that is the duration of the stream/file; "-1" means indeterminate/indefinite. The text following the comma will be used to assign the service name in Tvheadend.
Thanks for the info. If I stay with the m3u files maybe I'll fix them up like this to make it easier to setup tvheadend.
RE: Will TVH pull channel numbers from this .m3u file? - Added by Robert Cameron over 7 years ago
Reggie Burnett wrote:
That's very interesting. Would you say that your patch creates a better system? Is it worth it to go to the trouble of setting it up? I suppose the answer is yet or you would not have mentioned it?
For me, yes. Even though all my tuners, NAS and machine running Tvheadend are all GbE wired, I was still have many continuity issues when recording, especially if recording multiple programs. Having Tvheadend handle the streaming and not caring about skipped/dropped packets has made quite a big difference for the better here.
My situation may not be the same as yours, though. I run 3 Primes, and I'm one of those who was affected by the ethernet firmware bug that a few Prime users were struck with that seemed to exacerbate he problem for me.
If you're going the M3U route, setup for multiple units can almost be automated by running a series of scripts/sed/awk against a spreadsheet of desired channels, which is what I originally did.
RE: Will TVH pull channel numbers from this .m3u file? - Added by Reggie Burnett over 7 years ago
So I assume it's a code patch. What version is it against? have you submitted a pull request? Was it rejected? How do I get this patch so i can try it out?
RE: Will TVH pull channel numbers from this .m3u file? - Added by Robert Cameron over 7 years ago
Yes, it's a patch. It only patches the HDHomeRun files (tvhdhomerun.c
and tvhdhomerun_frontend.c
), which have not been modified in over a year. As far as I know, it will work for 4.0.9, any of the 4.2 series, and the current 4.3 development branch.
I haven't submitted a PR, because this is definitely a hack. Essentially you create an ATSC-C network, and this is what you use for your Prime. When you create a mux, give it a frequency matching the cable channel you want to tune: channel 812 is 812MHz, channel 704 is 704MHz, &c. When you assign a network to your HDHR device, click on the device first to set its network type to ATSC-C if it isn't already—part of this patch is to default the Prime to this network type when it is detected. Then, just scan the muxes for services. Each mux should only present one service, even though there are others present on the frequency.
If you're still interested, I'll post the patch. However I'm not at my computer right now, so I can't at this moment.
RE: Will TVH pull channel numbers from this .m3u file? - Added by Reggie Burnett over 7 years ago
Yes I'm interested. I'm running tvheadend 4.2.1 in a docker container and have a bit of instability where the container wants to restart every day or so. I am only doing IPTV so I may try your patch to see if it fixes the issue.
RE: Will TVH pull channel numbers from this .m3u file? - Added by Robert Cameron over 7 years ago
Reggie Burnett wrote:
Yes I'm interested. I'm running tvheadend 4.2.1 in a docker container and have a bit of instability where the container wants to restart every day or so. I am only doing IPTV so I may try your patch to see if it fixes the issue.
Here's the patch as a unified diff. However, not sure your stability issues are related to the streaming from the Prime.
prime.patch (2.73 KB) prime.patch |