Cyril

PVR (backend) | Tvheadend

hostname:9981 :: ref_01 :: ref_02 :: ref_03


Installation:

Hardware (capture card):

Fedora:
dnf install tvheadend

openSUSE:
zypper in tvheadend


Post-intallation instructions:

Updating /etc/sysconfig/tvheadend …
==> IMPORTANT: Post configuration tasks;
==> 1. Start the tvheadend service (to create home directory).
==> 2. Run tvheadend_super to set default username and password.
==> 3. Restart tvheadend service.
==>
==>
==> All further configuration is maintained through the web interface:
==>
==> http://localhost:9981/
==>

Grant tcp access to tvheadend ports firewall-cmd --permanent --add-port=9981/tcp
firewall-cmd --permanent --add-port=9982/tcp
firewall-cmd --reload systemctl enable tvheadend
systemctl restart tvheadend

Manual configuration:

/etc/sysconfig/tvheadend:

#Configuration file for the tvheadend service.  
MALLOC_ARENA_MAX=4

OPTIONS="-c /var/lib/tvheadend/config -u tvheadend -g video -6 -C --http_port 9981 --htsp_port 9982"

Run as daemon, and see realtime logging:

!! Must stop the service before changing any config files !!

Notes:

EPG data (other than ota)

tvheadend looks at a grab_file to determine where to get its epg data.

The grab_file may:

looking at it another way:
EPG data from the interwebs is compiled into a xmltv.xml file, which is referenced by the grab_file that tvheadend is pointed to.

installation

  1. setup & test scraper
  2. add (or symbolically link) tv_grab_file to /usr/bin, and configure as needed
  3. systemctl restart tvheadend #to see new tv_grab_file
  4. enable tv_grab_file in tvheadend [ configuration > channel/epg > EPG Grabber Modules ]

tvheadend

  1. Configuration > channel/epg > channels > epg source :: enter/select grab_file_channel
  2. configure frequency
  3. re-run internal epg grabbers

zap2epg

zap2epg setup/guide.

Following the recommended path in the wiki, I did initial setup through kodi (password is in the clear!), tells me access denied.

found github issue instructing to run http://YOUR.IP.ADDRESS:9981/api/mpegts/service/grid

this request was denied until I used a tvheadend account with administrative privilege.

On the kodi device, a successful setup&scan generates settings & configuration files in a userdata folder under:
~/.kodi/userdata/../addon_data
or
~/.var/app/tv.kodi.Kodi/data/userdata/addon_data

Migrating the setup to be managed by a (headless) tvheadend backend/server involves two steps:

  1. Copying the kodi-configured (& tested) addon for tvheadend server usage
    1. Copy the contents of .kodi/addons/script.module.zap2epg (core addon files) to user@serverip:/var/lib/tvheadend/script.module.zap2epg
    2. Copy the contents of .kodi/userdata/../addon_data/script.module.zap2epg (configuration and settings) to user@serverip:/var/lib/tvheadend/script.module.zap2epg
  2. Setting up the tv_grab_file
    1. settings.xml:
      Assuming that <setting id="tvhurl">dubserv</setting> in settings.xml, be sure that dubserv is defined in /etc/hosts, and that the appropriate network range is configured for the kodi user via the tvheadend web interface.
    2. script.module.zap2epg/bin/tv_grab_zap2epg:
      ADDON_HOME & ADDON_DIR: Modify to the actual location of the addon files
      /var/lib/tvheadend
    3. ln -s (or copy) to /usr/bin/
    4. test to verify functionality. Success:=new xmltv.xml generated
      . tv_grab_zap2epg
    5. Systemctl restart tvheadend #make tvheadend notice grabber additions/changes
    6. Enable tv_grab_zap2epg in tvheadend [ configuration > channel/epg > EPG Grabber Modules ]
    7. Edit cron frequency [ configuration > channel/epg > EPG Grabber > Internal Grabber ]

ssh -A -t kodi@kodibox scp -r /home/kodi/.kodi/addons/script.module.zap2epg cyril@192.168.0.13:/home/tvheadend/
ssh -A -t kodi@kodibox scp -r /home/kodi/.kodi/userdata/profiles/kids/addon_data/script.module.zap2epg/* cyril@192.168.0.13:/home/tvheadend/script.module.zap2epg/

userdata/profiles/kids/addon_data/script.module.zap2epg/*

schedules direct

Seems nice

First, from web-interface:

configuration > channel/epg > epg grabber modules

on left side, lots of red circles, look for:

internal: XMLTV: Schedules Direct JSON API

present? then check the parameters for the grab_file path, grab some terminal:

sudo -u tvheadend /path/to/tv_grab_zz_sdjson –configure

follow the prompts, then restart tvheadend

systemctl restart tvheadend

go back to the web-interface > modules menu, disable the OTA module, enable the appropriate schedules direct JSON, [save], profit.

Icons?

try the %C thing :: ref_01 :: ref_02 :: ref_03

works:

Configuration > General > Base

great source of logo png (& svg) images:
https://logos.fandom.com/wiki/