HUB
Sign inSign up

nthumann/iptv-restream

By nthumann

•Updated about 3 years ago

An app to forward source specific multicast streams via HTTP

Image
3

10K+

nthumann/iptv-restream repository overview

⁠IPTV-ReStream

This app allows remotely viewing source-specific multicast RTP streams (e.g. Deutsche Telekom MagentaTV), by forwarding it using HTTP.

Status Page Stations Page

⁠Features

  • lightweight: there is no de- or encoding happening, the stream is simply forwarded
  • simple Dashboard with Statistics
  • Station List with Images
  • VLC-ready playlist included
  • automatic running program detection (from MPEG-TS stream)

⁠Installation

  1. Install Node.js⁠ (v13.1 or higher)
  2. Clone this Repo: git clone https://github.com/n-thumann/IPTV-ReStream or click 'Download'
  3. Install dependencies npm install and transpile npm run build
  4. Download this list⁠ of stations (by iptv.blog⁠) and place it in the data directory
  5. Export environment variables (see below), if necessary
  6. Run npm start

Or with Docker (Linux only):

  1. Install⁠ Docker
  2. run docker run -d --network host --restart always --name IPTV-ReStream [-e HOST="127.0.0.1" | -e PORT=3000 | -e MCAST_IF="0.0.0.0" -e XSPF_PROTOCOL="https" | -e XSPF_HOST="my.server.com:8080" | -e XSPF_PATH_PREFIX="/iptv" | -e ALLOW_UNKNOWN="false" | -e DEBUG="iptv-restream:*"] nthumann/iptv-restream:latest (parameters in brackets are optional)
⁠Configuration

It's highly recommended running this application behind a Reverse Proxy (nginx⁠ or Apache httpd⁠) that enforces authentication (and encryption). When using a reverse proxy it's probably mandatory to adjust environment variables XSPF_PROTOCOL, XSPF_HOST and XSPF_PATH_PREFIX, otherwise the application may generate an invalid VLC XSPF-Playlist. For example, if the application is reachable over a Reverse Proxy via https://my.server.com:8080/iptv⁠, then run export XSPF_PROTOCOL=https XSPF_HOST=my.server.com:8080 XSPF_PATH_PREFIX=/iptv. Also, if the clients real IP and Port should be visible on the Dashboard, make sure to pass HTTP Headers X-Real-IP and X-Real-Port from the Reverse Proxy to the Application.

⁠Environment Variables
VariableDescription
HOSTWebinterface Listen Host (default 127.0.0.1)
PORTWebinterface Listen Port (default 3000)
MCAST_IFjoins the multicast group using this interface (default 0.0.0.0, lets OS choose automatically)
XSPF_PROTOCOLProtocol (http/https) for generating XSPF
XSPF_HOSTHost and Port for generating XSPF
XSPF_PATH_PREFIXPath Prefix for generating XSPF
ALLOW_UNKNOWNAllow forwarding streams that are not in the station list (default 0/false)
DEBUGEnable Debug Logging (iptv-restream:*)
⁠Usage

Open the webinterface and navigate to Stations, then download the XSPF Playlist for VLC and open it. Done!

It is also possible to access the source-specific multicast streams directly by opening /live/mcast_source@mcast_group:mcast_port (e.g. /live/[email protected]:10000 for Das Erste HD) or by using the shortcut at /live/station/station_title (e.g. /live/station/ZDFSD for ZDF SD). Please note that running on Windows only supports streaming one program. For streaming multiple programs concurrently use Linux.

⁠Under the hood

For example MagentaTV delivers the H.264 video stream via MPEG-TS, wrapped into RTP packets over source specific multicast. Therefore, it is not possible to access this stream when connected to a non-MagentaTV line. This app is proxying the video stream: It receives it, just as usual, at your Telekom line at home and re-streams it over HTTP to your other devices. This concept is inspired by udpxy⁠.

Tag summary

Content type

Image

Digest

sha256:b9bd029f4…

Size

80.5 MB

Last updated

about 3 years ago

docker pull nthumann/iptv-restream