Guide: Watch IPTV in Plex!

by iAmNotorious

It seems many people are unaware of the tvhProxy option to view IPTV natively in Plex. Personally I've found that this is the best option (of Emby or unofficial Plex channels) and will get even better once Plex implements their new grid EPG. The biggest reason I prefer this route is that Plex provides it's own EPG data through Gracenote. Every single IPTV provider I've used (the top 5 or so) have had issues with EPG data being incorrect or missing entirely. Not to mention the fact I'm already using Plex for the majority of my media consumption already nor the fact that Plex can record and automatically remove commercials!

There are two pieces of software you'll need to install:

tvheadend - Sadly I don't believe it is possible to install this on Windows. However there are packages for Debian, Ubuntu, Fedora and CentOS. It was as easy as "apt install tvheadend" for me in Ubuntu.

tvhProxy - This is a fairly simple python script that emulates a HDHomeRun for Plex to find. Just git clone the repo and cp the startup script like the readme shows. You'll need to edit tvhProxy.py to contain the URL including username and password to your tvheadend installation . Make sure you start the service before continuing the guide!

The most difficult part to figure out was tvheadend. It is extremely robust, but the settings are overwhelming with the terminology and options available. Once you have everything installed you should be able to get to your tvheadend configuration panel by going to the URL.

Navigate to Configuration -> DVB Inputs -> Networks -> Add .

Select "IPTV Automatic Network"

Follow these steps :

  1. Enter your provider name (can be anything you want)
  2. Enter the maximum streams your IPTV provider gives you. Generally this is 1 unless you pay for more. Vaders provides 5.
  3. Enter your m3u URL here.
  4. Uncheck "Scan after creation". We don't want tvheadend to try to access all 2000 channels.
  5. Skip startup scan. Again we don't want it to tune to each channel every time tvheadend starts.
  6. Change the Service ID to 1. This will create a service for each channel.
  7. Click create

Now we get to create our channel lineup. I would suggest mimicking a local cable or satellite provider. This will make assigning EPG information easier when we add this into Plex.

Navigate to Configuration -> Channel / EPG -> Channels . Click Add.

Follow these steps :

  1. Name the channel (preferably mimic a local provider's abbreviation)
  2. Number the channel (preferably mimic a local provider's number)
  3. Select the channel from your available services

When you're done it should look something like this . I went a step further an have an OTA for off air locals, but that is for another guide entirely. If you are in the US you may notice that my channel names and numbers match DirecTV. As a quick test you should be able to select the play button on the far left of these channels. This will download a file with a gibberish name. If you open this file in VLC it should play. If it does you've almost to the finish line!

Now navigate to your Plex server settings. Go to Live TV & DVR. Click Set Up Plex DVR . Plex should automatically detect tvhProxy, if not select "Don't see your device? Enter its network address manually." and enter the IP address and port of your server. It should be something like "192.168.1.50:5004". Press continue.

If everything worked correctly Plex should see your channel lineup you created earlier. Select your country and click Continue .

I'm not sure how this works in other countries, but enter your postal code and click continue .

If you followed a local provider this next step should be super easy. Select that provider from the drop down and Plex should automatically map the EPG to your channel lineup . Otherwise go through and manually map the EPG channels to your channel lineup. Once you are done click continue.

And that's really about it. You may want to go into the settings for your tuner and change the quality from Original to High Quality (30fps limit) . This may force transcoding when it's not necessary, but it seems to alleviate a bug I was having where 60fps channels were causing Plex Server to crash.

Once the EPG data is finished downloading you should be able to go into your Program Guide and see all of your channels listed . According to a forum post by one of the Plex devs they are hoping to have the grid EPG we are all use to out sometime Q1 of this year.

If you have any questions I'd be happy to try to answer them. Hope someone finds this useful!

swedlf

Definitely posting for future sadly I'll have to convert my windows plex server to Linux :(

YgroNocOen

Can you setup tvheadend on a raspberry pi?

debainn00b

Can transcoding be fully turned off? A raspberry pi 3 tvheadend setup only works okay without transcoding

spoonsy1480

I know I can set up tvheadend on libreelec but how do I setup tvhproxy on libreelec

blondedre3000

So how long, start to finish, does this take? No server. No prior TVHeadend knowledge. I'm guessing at least weeks to a month.

alegeek

I've done this in the past and it works brilliantly, shame it doesn't work with managed users.

FezVrasta

Just wondering, does the tvhProxy / tvheadend need to stream the video source or it just pass to Plex the URL provided by the M3U playlist?

I wonder if I could run this on a free now.sh instance.

Stokkes

/u/iAmNotorious thanks for the write up.

I can see you're using Vaders which is a great IPTV option.

What are you doing for other channels provided (sports channels, matchmaker, etc.) Do you just not put these in TVHeadend and just don't watch them?

Do you also forego the use of the vaders EPG?

I'm trying to do a very similar setup to yours...

lewazo

I'm pretty sure of the answer but I'll ask anyway.

Is it possible to use Tvheadend without an m3u URL? My provider doesn't provide one, only a stalker portal.

Anyways thanks for that awesome guide.

s--c

Will this work on a seedbox?

segaman1

Is it worth it spending all that time setting it up? How does the guide look compared to kodi and set box like Dreamlink t1+'s DOL2?

jl94x4

For some reason Plex DVR only finds one of my channels, and when pressing Scan it says it cannot connect. I tried the one channel and managed to record one show fine.

Any suggestions?

iRawrz

Until the grid comes out I don't think I'll be using the built in live TV function. I set this all up a while ago and found it to be too much of a pain to browse.

Using an IPTV plugin works way better in my experience.

The only benefit I came across to the built in functionality is that two users can watch the same stream at the same time even if one stream is allowed by the provider since tvheadend doesn't reopen the stream.

EnorMOZ

Followed the guide but when I get to the plex part it doesn't find any channels. On tvhproxy below is the only see the following in the logs.

plex, tvheadend, and tvhproxy are all running in docker containers.

::ffff:172.18.0.7 - - [2018-01-09 16:01:11] "POST /lineup.post?scan=start&source=Cable HTTP/1.0" 200 134 0.000285 ::ffff:172.18.0.7 - - [2018-01-09 16:01:11] "GET /discover.json HTTP/1.0" 200 454 0.000366 ::ffff:172.18.0.7 - - [2018-01-09 16:01:11] "GET /lineup_status.json HTTP/1.0" 200 234 0.000383

jl94x4

Do you notice some of the channels don't parse, and create a transcoder error when trying to record?

For example I'm in the UK, BBC 2 HD gives transcoder error, but when i use BBC (non HD) it records fine.

I have no way of knowing what channels will give the error and what channels won't, or if there is even a way to stop the channels that do error doing it.

Using Vaders, too

The channel plays fine from TVHeadend too.

shindycham

Has anyone tried this on a dedicated server or vps? TVHeadend on my local machine (Ubuntu) works like a charm, but somehow the channels won't play from a vps.
I still don't know why that is.

Flanflanflanflan

Having issues getting all of the channels to load into TVheadend. For example, FXX is not showing in the list of muxes. Any ideas what could be causing the issues?

choakem

When this is all setup - Will my invited friends receive or is it just the Master account and possably home members?

If friends "could" see this - would they need a plex pass as well?

thx for the write up.