IPTV not working in 4.0.8 - SOLVED

Added by Chris Coen almost 2 years ago

I'm running TVHeadend 4.0.8_2 in FreeBSD (from the port collection), and I'm having some issues getting IPTV working. I have an HDHomeRun for OTA channels which I'm able to view through TVHeadend without issue. Unfortunately, with IPTV, none of the muxes I add on the IPTV network are able to scan successfully. The mux does try to scan for the configured time period before eventually going into a "FAIL" status. This happens for every scan attempt. I am able to view the same stream URLs in VLC on my local windows machine with no issues. I've included the log output from a IPTV mux scan attempt below. The IPTV URL I'm using in the mux configuration is in the following format: http://xxxxxxx.xx:8000/xxxxxxxxxx/index.m3u8

I also have TVHeadEnd 4.1-2346~gc09f704~trusty running on a Ubuntu machine on the same network, and I'm able to add the same stream URLs to an IPTV network on that environment without issue.

Is it possible to get IPTV working under 4.0.8, or would it be possible for me to somehow get 4.1 installed and running on FreeBSD? It would be ideal if I could get TVHeadend fully functional under FreeBSD as that is my central media server running all of my hosting and downloading services, and it would be great to get everything working on one box.

2016-12-11 18:02:56.830 [ DEBUG]:mpegts: IPTV - adding mux Discovery Channel in IPTV to scan queue weight 6 flags 4000
2016-12-11 18:02:56.830 [ DEBUG]:settings: saving to /usr/local/etc/tvheadend/input/iptv/networks/42a544f72103ba1b2dd42154658a45b8/muxes/9486bd03975d8dd08ff6b0306388dd1a/config
2016-12-11 18:02:56.830 [ DEBUG]:mpegts: Discovery Channel in IPTV - add raw service
2016-12-11 18:02:56.830 [ DEBUG]:service: 1: Discovery Channel in IPTV si 0x803084940 <unknown> weight 0 prio 11 error 0
2016-12-11 18:02:56.830 [ INFO]:mpegts: Discovery Channel in IPTV - tuning on IPTV
2016-12-11 18:02:56.948 [ DEBUG]:mpegts: Discovery Channel in IPTV - started
2016-12-11 18:02:56.948 [ DEBUG]:mpegts: Discovery Channel in IPTV - open PID tables subscription [0042/0x8032e1000]
2016-12-11 18:02:56.948 [ INFO]:subscription: 0036: "scan" subscribing to mux "Discovery Channel", weight: 6, adapter: "IPTV", network: "IPTV", service: "Raw PID Subscription"
2016-12-11 18:02:57.097 [ DEBUG]:mpegts: Discovery Channel in IPTV - open PID 0000 (0) [20/0x806159000]
2016-12-11 18:02:57.097 [ DEBUG]:mpegts: Discovery Channel in IPTV - open PID 0001 (1) [16/0x80615b000]
2016-12-11 18:02:57.097 [ DEBUG]:mpegts: Discovery Channel in IPTV - open PID 0010 (16) [16/0x80615d000]
2016-12-11 18:02:57.097 [ DEBUG]:mpegts: Discovery Channel in IPTV - open PID 0011 (17) [20/0x80615f000]
2016-12-11 18:02:57.097 [ DEBUG]:mpegts: Discovery Channel in IPTV - open PID 0011 (17) [16/0x806161000]
2016-12-11 18:03:11.021 [ DEBUG]:service: Discovery Channel in IPTV: Status changed to [Graceperiod expired] [Data timeout]
2016-12-11 18:03:11.021 [ DEBUG]:mpegts: Discovery Channel in IPTV - close PID 0011 (17) [20/0x80615f000]
2016-12-11 18:03:11.021 [ DEBUG]:mpegts: Discovery Channel in IPTV - close PID 0010 (16) [16/0x80615d000]
2016-12-11 18:03:11.021 [ DEBUG]:mpegts: Discovery Channel in IPTV - close PID 0001 (1) [16/0x80615b000]
2016-12-11 18:03:11.021 [ DEBUG]:mpegts: Discovery Channel in IPTV - close PID 0000 (0) [20/0x806159000]
2016-12-11 18:03:11.021 [ INFO]:mpegts: Discovery Channel in IPTV - scan no data, failed
2016-12-11 18:03:11.021 [ INFO]:subscription: 0036: "scan" unsubscribing
2016-12-11 18:03:11.021 [ DEBUG]:mpegts: Discovery Channel in IPTV - close PID tables subscription [0042/0x8032e1000]
2016-12-11 18:03:11.021 [ DEBUG]:mpegts: Discovery Channel in IPTV - stopping mux
2016-12-11 18:03:11.021 [ DEBUG]:mpegts: Discovery Channel in IPTV - close PID 0011 (17) [16/0x806161000]
2016-12-11 18:03:11.021 [ DEBUG]:mpegts: IPTV - removing mux Discovery Channel in IPTV from scan queue
2016-12-11 18:03:11.021 [ DEBUG]:mpegts: IPTV - adding mux Discovery Channel in IPTV to scan queue weight 6 flags 5000
2016-12-11 18:03:11.021 [ DEBUG]:mpegts: IPTV - removing mux Discovery Channel in IPTV from scan queue

muxconfig.PNG - mux configuration (27.4 KB)


Replies (4)

RE: IPTV not working in 4.0.8 - Added by K Shea almost 2 years ago

I would love to know how you find these m3u8 links to various services. Anyway, see if you can get a radio channel working using this article:

https://freetoairamerica.wordpress.com/2015/12/31/how-to-add-noaa-weather-radio-or-another-streaming-radio-station-as-a-radio-channel-in-tvheadend/

If you are successful there, try a video channel using this as the URL (change "http://address.m3u8", "Service_Name", and "Service_Name_Live_Stream" to appropriate values, and use underscores, not spaces):

pipe://ffmpeg -loglevel fatal -i http://address.m3u8 -c copy -flags +global_header -strict -2 -metadata service_provider=Service_Name -metadata service_name=Service_Name_Live_Stream -f mpegts pipe:1

Note that in place of http://address.m3u8 you want to use the full URL, which is whatever you'd use to cause it to play successfully in VLC.

Once you have created the mux this way then hopefully it will scan the channel. Looking at your screenshot, you should disable the EPG scan since there's no EPG available on a streaming service, and then try putting in the URL as shown above. Note that you must have ffmpeg installed for it to work - from the Linux command prompt enter

which ffmpeg

If it comes back with something like /usr/local/bin/ffmpeg (doesn't have to be that exact path) then hopefully it will work. but if no path is shown, that probably means you need to install ffmpeg. There are several ways to install ffmpeg but I used a static build from https://www.johnvansickle.com/ffmpeg/ so you could try that.

(EDITED to use "-c copy" to copy all streams, rather than "-vcodec copy -acodec copy" per suggestion of Robert Cameron in this thread: https://tvheadend.org/boards/4/topics/23265?r=24280)

RE: IPTV not working in 4.0.8 - Added by Chris Coen almost 2 years ago

Thank you! This is EXACTLY what I needed.

After your post I discovered that ffmpeg wasn't installed in my FreeNAS jail. That was a quick install from the FreeBSD port, but the unfortunately the muxes still wouldn't connect using the stream URL in the mux config. After that I tried packaging the stream inside of the pipe:// URL and it worked perfect! Although it was a bit of manual process to configure all my muxes and channels, every channel is coming in perfect!

If you're looking for an IPTV service that provides a .m3u playlist, I would suggest checking out the IPTV Reddit community at www.reddit.com/r/iptv. Combining a reliable IPTV service with TVHeadend and a few Kodi boxes allows me almost replicate the experience of using a normal cable/dvr box which is perfect for my non-technical users.

RE: IPTV not working in 4.0.8 - SOLVED - Added by K Shea almost 2 years ago

You're welcome, glad you got it worked out.

I looked at Reddit but it seems like most of what is there is commercial stuff that you have to pay for, and I have to wonder about the legality of that since they are essentially selling streams that don't belong to them, and that I somehow doubt they have legally licensed. I was hoping there would maybe be a list of streams that came from the actual provider's sites, so there would be no doubt they were legal. Unfortunately the ones I have found so far are fairly uninteresting.

The big problem is that most originator sites that offer live streams seems to use that stupid flash crap, which I refuse to use because it's a big security hole. I don't even have it on my systems. I wish someone would write some kind of "shim" program that could take Flash streams and convert them into some more universal format, at least until some of these sites realize that flash is going the way of the DoDo bird and switch to HTML5 or something more universal. I'd like to know haw the pay services are converting the flash streams to m3u8 or whatever they are using - it seems to me that if they can do it there must be some software that does the conversion, and I'd rather run that myself, not only because I'm too cheap to pay (which I definitely am) but also because I don't trust third party sites that are in all likelihood basing their business on stealing someone else's content - if they are willing to do that, what else are they willing to do, put malware on your computer perhaps? That's why I'd much rather find a way to use streams that come direct from the source network.

I'm not judging anyone who chooses to use the pay services; you gotta do what you gotta do to get TV, especially if you are in a poor reception area. It's the pay services themselves that I don't trust. I would maybe consider using streams that came from an identifiable third party site if they are free (at least then I know they aren't a bunch of total money-grubbers) but I'd kind of like to know that the site is reliable and that they're not trying to find some way to exploit users' systems, and I seriously doubt I'm going to find that anytime soon.

RE: IPTV not working in 4.0.8 - SOLVED - Added by K Shea about 1 year ago

Just wanted to add a couple things for anyone who finds this thread.

First, as of Tvheadend 4.2, it appears you need to explicitly add the path to ffmpeg. Use "which ffmpeg" from a Linux command prompt to find it. So, if "which ffmpeg" returns /usr/local/bin/ffmpeg, then your pipe URL would begin with pipe:///usr/local/bin/ffmpeg - note there are three / characters together after "pipe:" in this case.

Second, ffmpeg versions built prior to September 19, 2017 may not be able to decode some streams that play fine in VLC and similar software. If a stream plays fine in VLC, but gives you errors when you try to pipe it into Tvheadend, try installing the most recent "git" build of ffmpeg from https://johnvansickle.com/ffmpeg/ (note if you have a non-Intel type CPU you may need to wait for the next release build, since they only have git builds for x86_64 and x86, unless you know how to build from source. New release builds come out about every three months or so). This only affects certain types of streams, and may or may not help with any specific stream.

(1-4/4)