EPG/EIT generator

    eit-stream converts XMLTV files into MPEG-TS stream with event information tables (EIT) for broadcasting networks like DVB, ATSC, ISDB.

    Installation

    Just download single binary file:

    curl -Lo /usr/bin/eit-stream http://cesbo.com/and/eit-stream
    chmod +x /usr/bin/eit-stream

    Configuration

    Create a configuration file /etc/eit-stream.conf

    xmltv = /opt/xmltv.xml
    output = udp://lo@232.0.0.1:1234
    onid = 8000
    codepage = 5
    eit-days = 1
    eit-rate = 1500
    
    [tdt-tot]
    country = EST
    offset = +120
    
    # First multiplex
    
    [multiplex]
    tsid = 1
    
    [multiplex/service]
    pnr = 101
    xmltv-id = discovery
    
    [multiplex/service]
    pnr = 102
    xmltv-id = history
    
    # Second multiplex
    
    [multiplex]
    tsid = 2
    xmltv = /opt/xmltv-2.xml
    
    [multiplex/service]
    pnr = 201
    xmltv-id = euronews

    Line started with symbol # is a comment and ignored by parser.

    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 address
    • onid - original network identifier
    • codepage - codepage.This option could be redefined in [multiplex] or in [multiplex/service]. Allowed values:
      • 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
    • eit-days - number of days in epg. default is 3
    • eit-rate - bitrate in kbit/s. default 15 kbit/s per each service

    Time and date options in section [tdt-tot]

    • country - country code in format ISO 3166-1 alpha-3
    • offset - the signed time offset in minutes from GMT. for example +120 is GMT+2 or -300 is GMT-5

    Multiplex options in section [multiplex]

    • tsid - multiplex transport stream identifier
    • name - optional field to describe multiplex

    Service options in section [multiplex/service]

    • pnr - channel number/pnr
    • xmltv-id - channel id in xmltv

    Systemd

    To start service in background and automatically on system startup register it in systemd. Create file: /etc/systemd/system/eit-stream.service:

    [Unit]
    Description=eit-stream service
    After=network-online.target
    
    [Service]
    Type=simple
    ExecStart=/usr/bin/eit-stream /etc/eit-stream.conf
    KillMode=process
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target

    Next 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

    To restart service once at night append next line into /etc/crontab:

    0   2   *   *   *   root systemctl restart eit-stream