EIT Stream
EIT Stream is a tool to convert XMLTV files into MPEG-TS stream with Event Information Tables (EIT) for broadcasting networks like DVB, ATSC, ISDB.
Installation
Section titled “Installation”Just download single binary file and set execute permission:
curl -Lo /usr/bin/eit-stream http://cesbo.com/and/eit-streamchmod +x /usr/bin/eit-streamConfiguration
Section titled “Configuration”Create a configuration file /etc/eit-stream.conf with any text editor. Example:
xmltv = /opt/xmltv.xmloutput = udp://lo@239.0.0.1:1234onid = 8000codepage = 5eit-days = 1eit-rate = 1500
[tdt-tot]country = ESToffset = +120
# First multiplex
[multiplex]tsid = 1
[multiplex/service]pnr = 101xmltv-id = discovery
[multiplex/service]pnr = 102xmltv-id = history
# Second multiplex
[multiplex]tsid = 2xmltv = /opt/xmltv-2.xml
[multiplex/service]pnr = 201xmltv-id = euronewsLines started with symbol # is a comment and ignored.
General options
Section titled “General options”xmltv- path to local xmltv file. or http/https link to xmltv or gzip xmltv file. This option could be redefined in[multiplex]or in[multiplex/service]output- destination UDP addressonid- original network identifiercodepage- codepage. This option could be redefined in[multiplex]or in[multiplex/service]eit-days- number of days in epg. default is 3eit-rate- bitrate in kbit/s. default 15 kbit/s per each service
Supported codepages
Section titled “Supported codepages”Next codepages available for text encoding:
0- Default. Latin (ISO 6937)1- Western European (ISO 8859-1)2- Central European (ISO 8859-2)3- South European (ISO 8859-3)4- North European (ISO 8859-4)5- Cyrillic (ISO 8859-5)6- Arabic (ISO 8859-6)7- Greek (ISO 8859-7)8- Hebrew (ISO 8859-8)9- Turkish (ISO 8859-9)10- Nordic (ISO 8859-10)11- Thai (ISO 8859-11)13- Baltic Rim (ISO 8859-13)14- Celtic (ISO 8859-14)15- Western European (ISO 8859-15)21- UTF-8
Time and date options
Section titled “Time and date options”Section [tdt-tot]:
country- country code in format ISO 3166-1 alpha-3offset- the signed time offset in minutes from GMT. For example +120 is GMT+2 or -300 is GMT-5
Multiplex options
Section titled “Multiplex options”Section [multiplex]
tsid- multiplex transport stream identifiername- optional field to describe multiplex
Service options
Section titled “Service options”Section [multiplex/service]
pnr- channel number/pnrxmltv-id- channel id in xmltvparental-rating- age restriction. Value defined in pairs: country and age. For example:parental-rating = EST 16 USA 14. Country code in ISO 3166-1 alpha-3 format (3 letters). Age from 4 to 18 (inclusive), 0 - without restrictions.
Mux stream with EIT to MPTS
Section titled “Mux stream with EIT to MPTS”With Astra you can append UDP stream with EIT to the MPTS.
In the MPTS settings append input and set UDP address, for example in configuration above address is udp://lo@239.0.0.1:1234.
In the MPTS advanced settings turn on option “Pass EIT”.
Use no_eit option on other inputs to disable EIT from other inputs.
Autostart
Section titled “Autostart”Register service in systemd to start service in background and autostart on system startup. Create file /etc/systemd/system/eit-stream.service:
[Unit]Description=eit-stream serviceAfter=network-online.target
[Service]Type=simpleExecStart=/usr/bin/eit-stream /etc/eit-stream.confKillMode=processRestart=on-failure
[Install]WantedBy=multi-user.targetNext command could be used to manage service:
- start service:
systemctl start eit-stream - stop service:
systemctl stop eit-stream - enable auto-start:
systemctl enable eit-stream - disable auto-start:
systemctl disable eit-stream
Reload
Section titled “Reload”To restart service once at night append next line into /etc/crontab:
0 2 * * * root systemctl restart eit-streamXMLTV Format
Section titled “XMLTV Format”XMLTV is an XML-based format for describing TV schedule information. It provides a mechanism to store channel information, programme schedules, and their associated metadata.
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE tv SYSTEM "xmltv.dtd"><tv generator-info-name="Some tv generator"> <channel id="1"> <display-name lang="en">Channel 1</display-name> <icon src="http://site.domain/1.png"/> </channel> <channel id="2"> <display-name lang="en">Channel 2</display-name> <icon src="http://site.domain/2.png"/> </channel> <programme start="20180920140000 +0300" stop="20180920141500 +0300" channel="1"> <title lang="en">Program title 1</title> <desc lang="en">Program description 1</title> <date>Program release date 1</date> <category lang="en">Category 1</category> <category lang="en">Category 2</category> </programme> <programme start="20180920150000 +0300" stop="20180920141600 +0300" channel="1"> <title lang="en">Program title 2</title> <desc lang="en">Program description 2</title> <date>Program release date 2</date> <category lang="en">Category 1</category> </programme> <programme start="20180920143000 +0300" stop="20180920141500 +0300" channel="2"> <title lang="en">Program title 3</title> <desc lang="en">Program description 3</title> <date>Program release date 3</date> <category lang="en">Category 1</category> <category lang="en"> Category 2</category> </programme></tv>