Skip to content

Plex Media Server plugin that plays live streams (a.k.a. IPTV) from a M3U playlist

Notifications You must be signed in to change notification settings

totalitarian/IPTV.bundle

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plex Media Server plugin that plays live streams (a.k.a. IPTV) from a M3U playlist

by Valdas Vaitiekaitis, also known as Cigaras, version 1.2

  1. Introduction
  2. Installation
  3. Playlist structure and examples
  4. Program guide
  5. Compatible devices and limitations
  6. Supported protocols
  7. Troubleshooting
  8. To do list
  9. Credits and contacts
  10. License

Introduction

Some ISP provide their users IPTV services, that can be watched over VLC on PC or on TV sets, but for TV a Set-top box is usually required that is both expensive and inconvenient because of separate remote. MediaLink, that is pre-installed on most LG TVs, is able to play IPTV streams with the help of Plex Media Server, but it does not has native support for it. One simple solution is to put every single stream url into a separate *.strm file, load them into Plex library as Home Videos and assign logos and descriptions manually. Or, if You are lucky, You might find a Channel with predefined playlist that suits Your needs or even broadcasts IPTV from Your ISP, but as I was not lucky enough, I decided to take matters into my own hands and created this Channel plugin, that allows to watch network streams from a customisable playlist, thus allowing You to watch IPTV without a Set-top box!

Please read further for instructions on how to install and configure this plugin, check compatible devices and supported protocols, and, if You find my work useful, please consider a small donation as a sign of gratitude and support.

Installation

Please refer to ofificial Plex support page How do I manually install a channel?

Playlist structure and examples

Sample playlist is located in IPTV.bundle\Content\Resources\playlist.m3u, you can specify other filename in preferences, but You can not specifify a path outside resources forder because Plex prohibits it. Online playlist is also supported, You just need to specify a direct link to it, with http part included. Playlist should be encoded in UTF-8 without BOM, I recomend using Notepad++ to check and convert if needed.

Included sample playlist is for testing purposes only, some streams might be dead by now, here is a short list of resources to get started, however please keep in mind, I am not associated with them and not responsible for their content, try it at Your own risk:

Playlist supports additional attributes that can be optionally defined inline after #EXTINF:0 and before the name of the media:

  • tvg-id, tvg-name - used to identify channel in XMLTV;
  • tvg-logo, logo - stream logo or icon, can use remote media (url must include http part) or stored images from \IPTV.bundle\Content\Resources folder (filename must include extension);
  • group-title - category name;
  • group-logo - category logo, only usable in first line where specific category is defined, in example if You have two channels with same category name, logo supplied in first line of those two will be used.

A simple example (see included sample playlist for more):

#EXTM3U
#EXTINF:0 tvg-id="Cartoon Network" tvg-logo="icon-default.png" group-title="Cartoons" group-logo="icon-folder.png",Cartoon Network
http://80.87.146.133:1111/udp/230.3.3.112:5678
#EXTINF:-1 tvg-logo="http://www.lyngsat-logo.com/hires/mm/mtv_dance_us.png" group-title="Music",MTV Dance
http://80.87.146.133:1111/udp/230.3.3.115:5678

At the moment this plugin is unable to handle multiple playlists, but it is possible to have multiple instances of this plugin and use different playlist for each, not the prettiest way but it is a solution.

Read further for more information about supported protocols and required configurations.

Program guide

As of version 1.2 and further this plugin supports program guide in XMLTV format, there is a sample located in IPTV.bundle\Content\Resources\guide.xml, you can specify other filename in preferences, but You can not specifify a path outside resources forder because Plex prohibits it. Online guide is also supported (as long as it matches the XMLTV format), You just need to specify a direct link to it, with http part included.

Plugin will try to match the program guide with playlist streams by the stream title, but to make things easier tvg-id atribute might be used to represent the exact XMLTV channel, for example if XMLTV looks something like this:

<tv>
  ...
  <programme start="20160321031000 +0200" stop="20160321040100 +0200" channel="Cartoon Network RSE">
    ...
  </programme>
  ...
</tv>

then previously mentioned playlist should look like this:

#EXTM3U
#EXTINF:0 tvg-id="Cartoon Network RSE" tvg-logo="icon-default.png" group-title="Cartoons",Cartoon Network
http://80.87.146.133:1111/udp/230.3.3.112:5678
...

Recomended software for XMLTV generation would be WebGrab+Plus, please refer to its documentation on how to set it up.

Please note, program guide is quite demanding on resources and I do not recomend using XMLTV file that has more channels than You actualy need and the shorter the period its generated for the better.

Compatible devices and limitations

By default Plex Media Server does not transcode live streams and leaves this job to clients. In some clients it is possible to switch Direct Play and Direct Streaming off and then server will do the heavy lifting, but some clients are out of luck and will only play streams they are able to handle natively.

Here is a bunch of Plex clients and some testing results, keep in mind that apps are beeing updated constantly and folowing list might (and usualy will) be outdated:

You can test your client by putting stream url into a *.strm file and loading it into Plex as Home Video as mentioned above and below.

Also You can try running a dedicated transcoding service and get Your streams in preferable format, VODServer is a good and free example.

One more flaw of this plugin is that it has no control over audio tracks if stream has multiple. Some clients can change the track, some can not, but plugin can not predefine one and I have no solution at the moment.

Read further for specific configuration required for some streaming protocols.

Supported protocols

  1. HTTP should work on most devices natively, no specific configuration required.

  2. RTSP should work on most devices natively, no specific configuration required.

  3. RTMP requires special Framework Flag that makes plugin incompatible with some older devices/clients (like my TV) and is disabled by default. You can enable it in Preferences, but You need to manually uncomment 14th line in Info.plist file for RTMP streams to work: find <!--<string>UseRealRTMP</string>--> and change it to <string>UseRealRTMP</string>.

    As Plex no longer supports webkit players, You can no longer use full RTMP urls like this:

    rtmp://shopnbc.fmsls.entriq.net:443/live/ playpath=live_01@13361 swfurl=http://shopnbc.img.entriq.net/img/ShopNBCLivePlayer/main.swf pageurl=http://www.shopnbc.com/
    

    You can only use single URL address without attributes, for example:

    rtmp://shopnbc.fmsls.entriq.net:443/live/live_01@13361
    

    If Real RTMP option in preferences is disabled, plugin will try to play stream over HTTP protocol, some streams work that way. If Real RTMP option is enabled, but UseRealRTMP flag in Info.plist file is disabled, then Plex will try to use its own hosted SWF player and will fail.

  4. MMS did not work for me on any tested devise, but plugin will try to play MMS videos over HTTP protocol.

Keep in mind that all streams are unique and Plex will not be able to play all of them, but not necessary because of plugins fault (read Compatible devices and limitations). Please try playing stream with VLC and using *.strm file method described above and below before blaming this plugin. If *.strm method works and plugin does not, please contact me.

Troubleshooting

If You encounter errors or some streams do not work please do the following:

  1. Try disabling Direct Play and Direct Stream in Your client settings, this helps 9 of 10 times. However some clients do not have these settings, if You're the unlucky one or this does not help, continue to next step:

  2. Make sure the playlist file is encoded in UTF-8 without BOM;

  3. Try to play the stream in VLC player, if it fails Your stream is invalid and will not play on any device; if it works continue to next step:

  4. Create a new file with notepad, write your desired streams url there and save it with *.strm extension, put it into a folder and load folder into Plex Server as Home Video, try to play it in Plex client (preferably Plex Media Center because Plex Home Theater as of version 1.4.1 does not like *.strm files), if it fails, then usualy Your client is unable to play this stream, try alternative clients; if it works, continue to next step:

  5. Check plugin log file com.plexapp.plugins.iptv.log, refer to official Plex support page Plex Media Server Log Files for log file location.

  6. If You do not have a solution after checking the log file, submit a ticket on GitHub or post on Plex forum with log and playlist files attached and I or other users will try to help You.

To do list

  • Support multiple playlists (for the moments it is possible to make multiple instances of this plugin and use different playlist for each);
  • Improve the program guide;
  • Possibility to predefine audio track, if ever becomes possible.

Credits and contacts

If You have any questions or suggestions, please feel free to contact me via GitHub or Plex forum, or visit my personal blog at cigaras.blogspot.lt, but please keep in mind that I did this plugin voluntary and I have other priorities to do. However if You find my work useful, please consider a small donation as a sign of gratitude and support.

License

Copyright © 2013-2016 Valdas Vaitiekaitis

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

About

Plex Media Server plugin that plays live streams (a.k.a. IPTV) from a M3U playlist

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%