Forums » Tutorial and setups »
IPTV & tvheadend, m3u, playlist, channel scan
Added by jody gugelhop almost 8 years ago
Hi all,
I have tvh 4.1-2415~ge5f5a4278 on arch 4.8.13-1-ARCH running.
I have a subscription with an IPTV provider that delivers the list in m3u format. I can have only one connection from my ip to the provider so scan, watch or tune only one channel at a time.
I download the m3u file and save it in a location on my computer as follows: /home/hts/tv-tvh.m3u
TvH is configured as such:
DVBinputs-->Networks-->added here a new "network"
I have set there:
Maximum # input streams: 1
URL: file:///home/hts/tv-tvh.m3u
Scan after creation: unticked box, as not desired
Maximum timeout (seconds): 5
I choose 5 seconds because this way when a channel does not work, which is the case with quite a bit of them, it will not wait for 30 seconds to move on, this way it will complete the whole list of 5000+ entires in 7-8 hours, so a good night sleep.
Skip initial scan: ticked box, cux desired
Idle scan muxes: unticked box, as not desired
after this I apply & save, then I hit "force scan" and it starts scanning, after 7-8 hours done, I can go to "services" tab and "map all channels" and they appear in channels list and in my clients and everything works.
At the moment I have a cron job running that downloads the m3u list for me every 48 hours and saves/replaces the aforementioned /home/hts/tv-tvh.m3u file which I have mentioned as the "URL" for my IPTV network in tvh settings.
How often does tvh read that file, every so many hours or only when starting the tvh services or only once when the network is added?
Would there be a way to trigger tvh to read that file every e.g. 48 hours and update the services automatically and automatically map all services to channels (rather then having to replicate these steps manually each time)?
Or as most channels keep the same in the list, but sometime the source URL for the stream info changes slightly, so if the services that were mapped to channels could stay in the list and only the stream url info-bit is updated that would already save a lot of time.
In another machine where i use dvb-s, with an older version of tvh I'm able to create the chans entries in the hts directories directly myself (via cli in the directly, i know very crude but did the trick for me, see here https://tvheadend.org/boards/4/topics/9251?r=9273#message-9273). I tried to do the same here but in this version of tvh, tvh seems to use database entries as channel entries so my workaround does not work for my other scenario.
thank you for any help or suggestions in advance :)
There are also other ppl with same issues, e.g. https://tvheadend.org/issues/4174 or threat https://tvheadend.org/boards/4/topics/23265?r=24360#message-24360
Replies (33)
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Bert Haverkamp over 7 years ago
Hello Jody,
Thanks for adding your experience with this topic.
It seems you gotten a bit further than I ever have: a working stream on a client!
Even so. One of my issues is that even if you specify you don't want to scan after creation, it still goes through the channels and scans them.
7-8 hours is pretty good. but it means you can't watch any of the channels in that time and my experience is that if you still try, tvheadend doesn't prevent it and my provider just locked me out for trying two simulaneous streams.
My preference is that tvheadend simply adds all the channels in the m3u as-is, blindly so to speak. This should take only minutes.
Regards,
Bert
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by jody gugelhop over 7 years ago
Hi Bert,
update to latest version, because it will not scan after creation if you untick the box as I described but of course you will need to scan the file at least once at some point because it will require at least one scan in order to identify the streams as muxes, add them as services, so they can be selected to be mapped and appear as channels in tvheadend and your end client.
Correct that you can't watch anything else during those 7-8 hours of scan, that is why I was mentioning a good night sleep, so to do it at times one will not use any stream anyhow. Also if you follow my earlier instructions and set maximum input stream you will never be locked out from your provider for simultaneous streams because tvh will make sure to only have one connection to the source at any point in time. So e.g when tvh is scanning and you switch on a station on your tvh end client, tvh will stop the scan and then connect to the chan.
The problem that I'm running into in regards to this point is actually with my provider, because I connect to a new stream every 5 seconds for 7-8 hours, the provider servers seem to think I'm "hammering" their server, so my ip gets blocked, then I need to send a msg to get it unblocked again and re-start the scan. Very annoying and makes it almost impossible to finish the scan for the list. Anyhow, another suggestion is to change the provider file. I wrote a script that downloads the file and sorts around 1000 channels out of it that I want in my favourites, those I load into tvh first, then the rest.
All this being said, I absolutely agree with you my preference would be the same as yours:
simply adds all the channels in the m3u as-is, blindly so to speak
I don't think there is currently a way to do this in tvh, but anybody please show us the opposite
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Robert Cameron over 7 years ago
Another thing to keep a note of: if you are using the Automatic IPTV Network type, when it is noted that the M3U file has been modified/changed, any changed streams in the playlist file are marked as new muxes, and the services that associated with the changed/removed stream from the playlist are removed. This means that the muxes will need to be rescanned, and the services remapped, each time a change in the playlist file is identified.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Jack Lion over 7 years ago
Hi guys,
I have some issues to config IPTV in TVH. After creating network, despite I can see all channels in muxes tab, the services tab is empty. During the muxes scan it finds always 0 services and 0 channels. The m3u list works properly in others programs, so how I can fix this problem?
Could someone help me please?
Many thanks.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Robert Cameron over 7 years ago
Jack Lion wrote:
Hi guys,
I have some issues to config IPTV in TVH. After creating network, despite I can see all channels in muxes tab, the services tab is empty. During the muxes scan it finds always 0 services and 0 channels. The m3u list works properly in others programs, so how I can fix this problem?
Could someone help me please?
Many thanks.
Are your streams MPEG-TS? IIRC, IPTV inputs must be transport streams. If they're not, you most likely need to use a pipe:// and ffmpeg to put them into an MPEG transport stream.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Jack Lion over 7 years ago
Hi, first thanks for your reply.
The url I'm using is in this form:
http://v-iptv.xxxxxxxxxx.com:8000/get.php?username=xxxxxx&password=xxxxxx&type=m3u&output=ts
How can I use this link with TVH?
Thanks again for your support.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by jody gugelhop over 7 years ago
Hi Jack,
those links should work, pretty much same format as mine. Can you paste the first few lines from the playlist? I had the same problem the first line was missing in mine "#EXTM3U" once that was added it all worked.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Jack Lion over 7 years ago
Hi Jody,
the playlist's lines are in this form:
#EXTM3U#EXTINF:-1,Rai 1 HD
http://v-iptv.xxxxxx.xxx:8000/live/xxxxxxxxxxx/xxxxxxxxxx/869.ts
#EXTINF:-1,Rai 2 HD
http://v-iptv.xxxxxx.xxx:8000/live/xxxxxxxxxxx/xxxxxxxxxx/5.ts
#EXTINF:-1,Rai 3 HD
http://v-iptv.xxxxxx.xxx:8000/live/xxxxxxxxxxx/xxxxxxxxxx/6.ts
Seems the first line is complete..so how can I fix this issue?
Many thanks for your reply.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Jack Lion over 7 years ago
Sorry guys,
I need a clarification on the difference between putting the Url file in form of Http, rather than file://xxx.m3u.
I mean, maybe my TVH doesn't work because I put the url in http form...
Let me know and thanks a lot for the support.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Robert Cameron over 7 years ago
Jack Lion wrote:
Sorry guys,
I need a clarification on the difference between putting the Url file in form of Http, rather than file://xxx.m3u.
I mean, maybe my TVH doesn't work because I put the url in http form...
Let me know and thanks a lot for the support.
If you are directly accessing the file from a remote source, use http://
. This uses the HTTP protocol to access the file, the exact same way you would from a web browser. If you are accessing a local file, then you use the file://
protocol.
If you are going to use the file://
protocol, it is necessary to use the full path. So, if your file is located in your Downloads
folder in your user's home directory, then the URI would be file:///home/[user]/Downloads/playlist.m3u
. Note the third slash in the beginning, since the full path begins from the root, it must start with a slash, hence 3 slashes at the beginning. (The [user]
would be replaced with your username.)
To see what the proper file://
URI would be, the easiest thing to do would be to open a terminal/command prompt in the directory where your file is located, and type pwd
. This command will output your present working directory, including the leading slash; just insert this string between file://
and the filename in the URL field in Tvheadend.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Jack Lion over 7 years ago
Ok, now I'm sure that the problem is about that my streams are MPEG-TS.
So I can use pipe and ffmpeg with LibreElec? I'm not sure that ffmpeg works on LE. Thanks guys.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by jody gugelhop over 7 years ago
Jack Lion wrote:
Hi Jody,
the playlist's lines are in this form:#EXTM3U#EXTINF:-1,Rai 1 HD
http://v-iptv.xxxxxx.xxx:8000/live/xxxxxxxxxxx/xxxxxxxxxx/869.ts
#EXTINF:-1,Rai 2 HD
http://v-iptv.xxxxxx.xxx:8000/live/xxxxxxxxxxx/xxxxxxxxxx/5.ts
#EXTINF:-1,Rai 3 HD
http://v-iptv.xxxxxx.xxx:8000/live/xxxxxxxxxxx/xxxxxxxxxx/6.tsSeems the first line is complete..so how can I fix this issue?
Many thanks for your reply.
I have same type of links as you and mpeg-ts, try to have in your fist line only "#EXTM3U" so:
#EXTM3U
#EXTINF:-1 tvg-id="" tvg-name="CNN" tvg-logo="" group-title="USA",CNN USA
http://url/live/Ndfseo3v/z2pqOJwerwi/14328.ts
also as you can see from above I use not the http as direct source but the downloaded file URL: file:///home/hts/tv-tvh.m3u
should work for you too, good luck
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by jody gugelhop over 7 years ago
Jack Lion wrote:
Ok, now I'm sure that the problem is about that my streams are MPEG-TS.
So I can use pipe and ffmpeg with LibreElec? I'm not sure that ffmpeg works on LE. Thanks guys.
btw I suppose you are running libreelec on a raspberry pi? then you might need to buy the mpeg licence to be able to properly play the mpeg streams, see here: http://www.raspberrypi.com/mpeg-2-license-key/ at least I needed to do that for a different setup that i have with dvb-s where the streams are mpeg and they didn't work or were extremely choppy without the licence on pi
you could test this if this is the case by opening the stream from you current tvh setup on a non pi device to see if the streams work or not, if they work then you know it's a license thing, which leaves you with 3 options, 1. don't use a pi 2. buy licence and 3. transcode the stuff for pi
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Jack Lion over 7 years ago
jody gugelhop wrote:
btw I suppose you are running libreelec on a raspberry pi? then you might need to buy the mpeg licence to be able to properly play the mpeg streams, see here: http://www.raspberrypi.com/mpeg-2-license-key/ at least I needed to do that for a different setup that i have with dvb-s where the streams are mpeg and they didn't work or were extremely choppy without the licence on pi
you could test this if this is the case by opening the stream from you current tvh setup on a non pi device to see if the streams work or not, if they work then you know it's a license thing, which leaves you with 3 options, 1. don't use a pi 2. buy licence and 3. transcode the stuff for pi
Hi Jody,
many thanks for your help. No, I don't use raspberry, but I'm running libreelec on a PC that I'd like use as a Server.
The problem is that I can't test the streams on TVH PC server because it doesn't find any channels/services linked to the muxes.
So, meanwhile I'll try to use, in URL field, the file .m3u instead that http. I hope to resolve in this way.
Thanks again.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Robert Cameron over 7 years ago
Jack Lion wrote:
jody gugelhop wrote:
btw I suppose you are running libreelec on a raspberry pi? then you might need to buy the mpeg licence to be able to properly play the mpeg streams, see here: http://www.raspberrypi.com/mpeg-2-license-key/ at least I needed to do that for a different setup that i have with dvb-s where the streams are mpeg and they didn't work or were extremely choppy without the licence on pi
you could test this if this is the case by opening the stream from you current tvh setup on a non pi device to see if the streams work or not, if they work then you know it's a license thing, which leaves you with 3 options, 1. don't use a pi 2. buy licence and 3. transcode the stuff for piHi Jody,
many thanks for your help. No, I don't use raspberry, but I'm running libreelec on a PC that I'd like use as a Server.
The problem is that I can't test the streams on TVH PC server because it doesn't find any channels/services linked to the muxes.
So, meanwhile I'll try to use, in URL field, the file .m3u instead that http. I hope to resolve in this way.
Thanks again.
I would recommend against using LE as the base for a server. It is not a complete OS and only has limited support for running anything other than Kodi. If you want to run a server, use an OS made for servers. Most any Linux or BSD will work, but OpenELEC and LibreELEC are not complete Linux systems; from their own documentation they describe their OS as the bare minimum needed for running Kodi.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Jack Lion over 7 years ago
Robert Cameron wrote:
I would recommend against using LE as the base for a server. It is not a complete OS and only has limited support for running anything other than Kodi. If you want to run a server, use an OS made for servers. Most any Linux or BSD will work, but OpenELEC and LibreELEC are not complete Linux systems; from their own documentation they describe their OS as the bare minimum needed for running Kodi.
Hi Robert,
so you are suggesting me to use a linux based server..my goal is to have a iptv server that allow me streaming iptv (through a m3u list like above) and libraries in all my home. I thought that using LE was the easier and faster way to get my goal (expecially in terms of stream speed; I've tried Emby, but was too slow in booting and in zapping). So, what do you suggest me?
Thanks a lot.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by jody gugelhop over 7 years ago
Hi Jack,
emby is no OS, just an application. The advise would depend a little on your hardware, maybe you have old hardware and that's why you were using libreelec? Also not sure about your level of linux knowledge, but I will assume it is on beginner level, in this case i would recommend you to install ubuntu as OS (or a derivative) tvh can easily be installed under ubuntu. I have personally tried emby and plex and at this moment I would recommend to go for plex if any of the 2.
btw why go for streaming from main server to other clients(also it seems you don't plan to have the server running all time as you speak about slow boot), why not have the other clients in your home use the m3u directly from local file?
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Robert Cameron over 7 years ago
I think that in order to get any useful advice you should list what it is exactly that you are trying to do. Without any clear specs about what your goals are every user responding will interpret them in their own way, and you'll end up with 10 different scenarios having 10 different solutions, and none of them being what you actually wanted.
So, how about a bullet list of what your needs and goals are. Also, what hardware are you working with, and what is your network topology like?
It's rather difficult to offer aid or advice without all of the details.
Also, please don't hijack threads. If you have a question if your own, start a new thread, especially if your new question/thread is different from the OP.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Jack Lion over 7 years ago
jody gugelhop wrote:
Hi Jack,
emby is no OS, just an application. The advise would depend a little on your hardware, maybe you have old hardware and that's why you were using libreelec? Also not sure about your level of linux knowledge, but I will assume it is on beginner level, in this case i would recommend you to install ubuntu as OS (or a derivative) tvh can easily be installed under ubuntu. I have personally tried emby and plex and at this moment I would recommend to go for plex if any of the 2.
btw why go for streaming from main server to other clients(also it seems you don't plan to have the server running all time as you speak about slow boot), why not have the other clients in your home use the m3u directly from local file?
Hi Jody,
unfortunately I'can't run the m3u in different clients concurrently, but just one at a time; instead using a server I'm able to run playlist on multiple devices. So, this is why. Yes, you're right, I'm a beginner in Linux, but I don't find it difficult. The hardware on my server is as follow: CPU Intel e6420 @2.13ghz (4mb cache), Ram ddr2 4gb Corsair, video card ati 4870 (1 gb ram). With Plex I've the same problem, it doesn't recognize the m3u list.
So, what I'm trying to do is:
- config a server that streams the m3u playlist as above;
- use a client (mainly kodi) where I can view the playlist and that allow me timeshifting and recording;
- use the pc server above to share my contents with other devices.
Thanks.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Jack Lion over 7 years ago
I'm starting to think that the problem is the latest version of TVH (4.2).
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Giuseppe Sicilia over 7 years ago
It's not an TVH4.2 issue. Now i have two m3u-Link-Files. The old one works pretty well, either on tvh-4.1 or on tvh-4.3.
With the new m3u i get hundreds of muxes but no services. I think, there are issues with iptv-servers.
Best one would be to add links without any scans or somthing other tests...
Its regarding this known bug:
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by jody gugelhop over 7 years ago
Jack Lion wrote:
jody gugelhop wrote:
Hi Jack,
emby is no OS, just an application. The advise would depend a little on your hardware, maybe you have old hardware and that's why you were using libreelec? Also not sure about your level of linux knowledge, but I will assume it is on beginner level, in this case i would recommend you to install ubuntu as OS (or a derivative) tvh can easily be installed under ubuntu. I have personally tried emby and plex and at this moment I would recommend to go for plex if any of the 2.
btw why go for streaming from main server to other clients(also it seems you don't plan to have the server running all time as you speak about slow boot), why not have the other clients in your home use the m3u directly from local file?Hi Jody,
unfortunately I'can't run the m3u in different clients concurrently, but just one at a time; instead using a server I'm able to run playlist on multiple devices. So, this is why. Yes, you're right, I'm a beginner in Linux, but I don't find it difficult. The hardware on my server is as follow: CPU Intel e6420 @2.13ghz (4mb cache), Ram ddr2 4gb Corsair, video card ati 4870 (1 gb ram). With Plex I've the same problem, it doesn't recognize the m3u list.
So, what I'm trying to do is:
- config a server that streams the m3u playlist as above;
- use a client (mainly kodi) where I can view the playlist and that allow me timeshifting and recording;
- use the pc server above to share my contents with other devices.
Thanks.
I totally agree with Robert, please start another threat and don't hijack mine, thanks!
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by jody gugelhop over 7 years ago
Giuseppe Sicilia wrote:
It's not an TVH4.2 issue. Now i have two m3u-Link-Files. The old one works pretty well, either on tvh-4.1 or on tvh-4.3.
With the new m3u i get hundreds of muxes but no services. I think, there are issues with iptv-servers.Best one would be to add links without any scans or somthing other tests...
Its regarding this known bug:
I have tested several iptv providers, most work well with tvh but the issue is, as described in my first post, indeed the adding of services in tvh requires to scan (so tunes into each channel) for the services. If you have a provider with many stations that is going to take 1. super long (my current new provider has +15000 chans) and 2. the provider will ban your ip as it will appear as "hammering" their server when tvh scan (so switches stations) every x seconds (depending on what you set, default is 30 seconds).
Another issue I ran into is indeed as described in the link that you sent, some iptv providers provide links with different content, albeit the link looks the same/very similar the content it gets is built different as you will see when indeed using tcpdump or wireshark to compare the different providers, you will not notice a difference in e.g. vlc.
Also noticed that the ones that work well with tvh, don't work so well with the kodi plugin "simple iptv", thought the ones that don't work with tvh work excellent with the simple iptv plugin for kodi.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Jack Lion over 7 years ago
Giuseppe Sicilia wrote:
It's not an TVH4.2 issue. Now i have two m3u-Link-Files. The old one works pretty well, either on tvh-4.1 or on tvh-4.3.
With the new m3u i get hundreds of muxes but no services. I think, there are issues with iptv-servers.Best one would be to add links without any scans or somthing other tests...
Its regarding this known bug:
Thanks for your response Giuseppe.
So what do you suggest me? Can I contact you privately?
Many thanks.
RE: IPTV & tvheadend, m3u, playlist, channel scan - Added by Giuseppe Sicilia over 7 years ago
Main-Topic:
We could set a feature-request: "add iptv streams without scans". Does someone know where to do this?
@lion:
I cannot help regarding 'mux without services'. I changed from my new provider back to my old one... Its a bug and nobody know where its coming from.