From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. Please help out by expanding it - how to get started.

MythTV is a powerful media center and video recording software system. The distributed architecture allows analog and digital media to be captured, organized, and streamed over the network to other MythTV instances or network attached devices.


MythTV is a complex and capable system and during the first install can be a little daunting to configure if there is no familiarity with the software. Once the backend has been set up properly and configured with recording devices/sources (DVB or analog capture etc.), there is usually little maintenance in the future.


Depending on how MythTV is going to be configured, there may be options in the kernel that need to be enabled. If support is required for recording media from DVB devices or controlling with a remote control, the relevant devices need to be enabled in the kernel before MythTV or any other applications will be able to access them.

KERNEL Example enabling support for DVB devices
Device Drivers  --->
    <*> Multimedia Support  --->
        [*] Analog TV Support # Depends upon the hardware, some devices are not shown if this is disabled.
        [*] Digital TV Support
        [*] Remote Controller support # Enable this if the device has IR even if it's not going to be used.
        [*] Media USB Adapters  --->
            <M> Support for various USB DVB devices
                (select devices here)
            <M> Support for various USB DVB devices v2
                (select devices here, eg.)
                <M> ITE IT913X DVB-T USB2.0 Support
        [*] Media PCI Adapters  --->
                (select devices here)

USE flags

MythTV has quite a few USE flags to customize configuration according to hardware specification and software requirements.

USE flags for media-tv/mythtv Open Source DVR and media center hub

X Add support for X11
alsa Allows MythTV to directly output sound to ALSA devices
asi Support for DVEO ASI recorder
autostart Use a custom autostart configuration
cdda Add Compact Disk Digital Audio (Standard Audio CD) support
cdr Add support for CD writer hardware
cec Allows control of CEC enabled TVs via HDMI
ceton Ceton InfiniTV 4 a CableCARD-enabled tuner support
debug Instructs Qt to use the 'debug' target
dvb Add support for DVB (Digital Video Broadcasting)
dvd Add support for DVDs
exif Add support for reading EXIF headers from JPEG and TIFF images
fftw Support visualizations via sci-libs/fftw
hdhomerun Silicondust USA tuner support
ieee1394 Firewire enabled Cable boxe support
jack Allows MythTV to use JACK as your sound output device
java BD-J support for Blu-ray discs
lame Prefer using LAME libraries for MP3 encoding support
lcd Enable use of app-misc/lcdproc data display
libass SRT/SSA/ASS (SubRip / SubStation Alpha) subtitle support
lirc LIRC remote control device support
nvdec Enable NVDEC (NVCUVID) hardware accelerated video decoding
opengl Add support for OpenGL (3D graphics)
oss Add support for OSS (Open Sound System)
perl Build the perl bindings for MythTV
pulseaudio Add sound server support via media-libs/libpulse (may be PulseAudio or PipeWire)
python Add optional support/bindings for the Python language
raw Add support for raw image formats
systemd Enable use of systemd-specific libraries and features like socket activation or session tracking
v4l Enable support for video4linux (using linux-headers or userspace libv4l libraries)
vaapi Enable Video Acceleration API for hardware decoding
vbox V@Box Communications network-attached tuner devices support
vdpau Enable the Video Decode and Presentation API for Unix acceleration interface
vpx Enable VP8/VP9 support for media-libs/libvpx
wrapper Use Ubuntu mythtfrontend wrapper
x264 Enable h264 encoding using x264
x265 Enable h265 encoding using x265
xml Add support for XML files
xmltv Support media-tv/xmltv TV listing - not used by Schedules Direct]
xvid Add support for's open-source mpeg-4 codec
zeroconf Support for DNS Service Discovery (DNS-SD)


root #emerge --ask media-tv/mythtv


MythTV includes a mythbackend server which handles recordings and manages databases of media, this has to be configured and running before the a client, mythfrontend, or other media player can interact with the MythTV system. MythTV also requires a running MySQL compatible database server such as MySQL or MariaDB to function, this is handled through the database modules of Qt.

User mythtv

A daemon user named mythtv for mythbackend is created and maintained by acct-user/mythtv.

Some existing installations also use mythtv user with mythfrontend which works, but can cause problems. An actual non-root user should be used with mythfrontend.

Old installations that use a modified mythtv user may either need updating or a local acct-user/mythtv overlay to prevent undesired changes to the mythtv user. After acct-user/mythtv is successfully emerged restore the mythtv user. It will remain at its restored state until acct-user/mythtv is forced/updated. Installing the MythTV package media-tv/mythtv depends on acct-user/mythtv and does not install it again on subsequent updates.


A database will need to be set up before the MythTV backend can be started. The emerge command should have already pulled in MySQL or MariaDB but the database server may not have been configured yet, if this is the case please refer to MySQL or MariaDB for information. The following command will set up the MythTV database using the emerge config phase, this will require a root user and password for the database.

root #emerge --config media-tv/mythtv

Starting with MythTV version 0.26, the time zone tables must be loaded in MySQL. The mythtv wiki has additional details. For the time being, the following can be used to check if the timezone data is already in the running mysql instance:


The result should output a datetime value, or a TIMESTAMP.

If the output, instead, shows 'NULL', then the timezone information needs to be loaded into the "mysql" database using the "mysql_tzinfo_to_sql" script:

user $mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql

MythTV backend configuration

MythTV backend is configured by a GUI that can stop mythbackend when configuring. Run mythtv-setup GUI to setup MythTV before starting mythfrontend on a new installation. It is not normally used in daily operation once the system is configured for your setup/hardware. This GUI can setup:

* Connection to the database
* Setup TV tuners and scan channels
* Setup media storage locations
* Setup Program Guide Provider
* Multiple MythTV backend configuration

Execute the setup program to configure MythTV. The documentation for MythTV is a good reference at this point.

root #mythtv-setup

Mythbackend daemon

At least one backend must be running to use MythTV, this can be on the same host as the frontend or a different host on the network.

Start the MythTV backend on the chosen host(s) and add it to the default runlevel.

root #/etc/init.d/mythbackend start
root #rc-update add mythbackend default


Once the database is set up and mythtv-setup has been completed, and the mythbackend started. General use is through the included mythfrontend.


MythTV frontend

The mythfrontend application is the frontend process of MythTV with a graphical user interface for the MythTV system. It can select TV shows to record/watch, play media, select GUI theme, show the status of MythTV, and configure playback display/audio.

user $mythfrontend




This may remove user mythtv, but the home directory will remain. If user mythtv was modified the changes may be lost. Much of the documentation suggests using mythtv as the user for autostart. This is no longer considered good practice because the mythtv user is created as a daemon for mythbackend and has access to groups not needed when running mythfrontend.

Removal can be as simple as running:

root #emerge --ask --depclean --verbose media-tv/mythtv

No media, recordings, database, or configuration setup is deleted.

See also

  • XmlTV - Gather television listings from various countries for MythTV database.
  • MythTV/MythPlugins - Plugins for MythTV handling games, news, weather, etc.
  • MythTV/MythWeb - Web application for allowing control of MythTV from a web browser.
  • Kodi — an open source home theater application.

External resources