Archive:MythTV: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Gamester17
No edit summary
>Gamester17
No edit summary
Line 228: Line 228:
The native MythTV frontend client needs to be used to schedule recordings.
The native MythTV frontend client needs to be used to schedule recordings.


=== MythBox Script (Linux/Mac/Windows) ===
=== MythTV Python Scripts for XBMC ===
 
MythTV Python Scripts for XBMC that provide a python coded GUI for MythTV interface.
====  MythBox Script (Linux/Mac/Windows) ====
[http://code.google.com/p/mythbox/ MythBox] ([http://code.google.com/p/mythbox/wiki/Screenshots screenshots]) was released in late 2008 and is a XBMC script for MythTV that supports:
[http://code.google.com/p/mythbox/ MythBox] ([http://code.google.com/p/mythbox/wiki/Screenshots screenshots]) was released in late 2008 and is a XBMC script for MythTV that supports:
* Watching recordings with commercial skipping
* Watching recordings with commercial skipping
Line 237: Line 238:
* MythTV 0.21 and 0.22 (trunk) backends
* MythTV 0.21 and 0.22 (trunk) backends


The code was forked from the initial xbmcmythtv script.
The code for MythBox was initially forked from the [http://sourceforge.net/projects/xbmcmythtv xbmcmythtv] script.
 
====  Myth2XBMC Script (Xbox) ====
[http://code.google.com/p/myth2xbmc/ Myth2XBMC] heavily based on the original xbmc-mythtv script and is only tested on the Xbox.


=== PVR frontend ===
=== PVR frontend ===

Revision as of 13:08, 11 June 2009

Template:XBMC faq toc Inline

Introduction

XBMC Media Center includes a Source that can be used to interact with a MythTV backend to:

  • List all recorded programs
  • List recorded Movies - in a single list suitable for scanning into the XBMC Video Library
  • List recorded TV shows - grouped by title
  • Play recorded programs with commercial skip - patch available, not in SVN yet (http://trac.xbmc.org/ticket/6279)
  • Watch Live TV - including being able to change up or down channel with a single button press
  • View the electronic program guide (EPG) - one channel at a time

Once the MythTV Source has been added, when it is chosen you will be presented with 5 virtual folders:

  • All Recordings - to watch anything that has been recorded
  • Guide - to view the EPG for a channel
  • Live Channels - to display what is currently being aired
  • Movies - to list the movies that have been recorded (only available in SVN)
  • TV Shows - to list each series of TV shows that have been recorded (only available in SVN)

TODO: Update image for the Movies and TV Shows changes.

MythTV.FolderListing.jpg

What is Myth TV

MythTV is a digital video recorder for watching and recording television. MythTV also contains plugins for viewing other home media, similar to what XBMC Media Center provides. MythTV is like a free open source alternative to Tivo and Windows Media Center.

Some of MythTV's features include:

  • Watch and record analog and/or digital TV, including HDTV.
  • Pause, skip, and rewind live TV shows.
  • Completely automatic commercial detection/skipping, with manual correction via an intuitive cutlist editor.
  • Intelligently schedules recordings to avoid conflicts.
  • Parental controls to keep your kids out of the good shows.
  • Schedule and administer many functions remotely via a web browser.
  • Flexible client/server architecture allows multiple frontend client machines to access content served by one or more backend servers (although the most common installation consists of a single computer running both the client and server together).

This wiki page doesn't contain any information about how to install, setup or configure MythTV. If you need further information about how best to do this, Mythbuntu is a good place to start. Mythbuntu is an community supported add-on for Ubuntu focused upon setting up a standalone MythTV based PVR system.

Setup in XBMC

To communicate with a MythTV backend, add a new Source from the Videos section. This URL needs to be specified manually as many skins don't support the ability to configure a MythTV source. The source should have a URL that looks like:

myth://username:[email protected]

i.p.address is the IP address of the MythTV backend server. A hostname can also be used, but it must be resolvable to an IP address on the XBMC Media Center machine.

username and password are the credentials for a user that has access to the MySQL mythconverg database on the MythTV backend.

The username and password supplied in the URL are used to obtain EPG information from the MythTV database when using the Guide. If the username and password are not supplied a default of mythtv is used for both. The username and password are not used when watching recordings.

Setup in MythTV

If XBMC Media Center and the Myth TV backend are NOT running on the same machine:

  • Check that the IP Address configured in MythTV can be accessed by the XBMC machine. The default IP Address for an installation of MythTV is 127.0.0.1 so must be changed
  1. Run mythtv-setup
  2. Select General
  3. Check that the IP Address in Local Backend section is NOT set to localhost or 127.0.0.1. The IP Address must be resolvable from the XBMC Media Center machine, e.g. 192.168.1.3.
  • Check that the MySQL database being used by MythTV has been configured to allow external connections.
    • Generally this means ensuring that the bind-address is not set to localhost or 127.0.0.1 in /etc/mysql/mysql.cnf or one of the *.cnf files in /etc/mysql/conf.d/.
  • Check that the username configured in the myth:// URL has access to the mythconverg database from external locations.

It is very important that the IP Address is set correctly using mythtv-setup. The Myth Protocol used by XBMC Media Center uses the IP Address configured in the Myth TV backend to determine where to stream the recordings from. So, even if the IP address in the myth:// URL points correctly to the MythTV backend, there can still be playback problems if the correct IP Address isn't also set correctly using mythtv-setup.

If you don't intend on using the Guide or Live Channels then the MySQL related configuration can be omitted. Access to the mythconverg MySQL database is only used to view the Guide and Live Channels.

Watching Recorded Programs

All Recordings

After choosing All Recordings a list of all recorded programs is presented along with the following information:

  • Title of the TV show
  • Channel name and logo
  • Date and time that it was recorded
  • Description
  • Thumbnail

How the information is presented depends on the skin and view being used.

MythTV.AllRecordings.jpg

Standard XBMC functionality can be used to sort by date to see the most recent recordings, or sort by name to get all the shows from a given series grouped together.

Movies

After choosing Movies a list of all the recorded movies is shown.

If not all of the movies are shown, e.g. some still display in the TV Shows section, the Electronic Program Guide (EPG) being used by Myth TV might not be very accurate. The EPG describes which programs are Movies and which are TV Shows.

There is an advanced setting that can be used to help with this problem.

TODO: Quote this XML somehow. <myth> <movielength>0</movielength> </myth>

If a recorded program is longer than movielength minutes it will be considered a movie. 85 minutes, seems to work quite well. Any recorded program shorter than movielength minutes will be considered a TV Show.

TV Shows

After choosing TV Shows a list of all the recorded TV shows grouped by title is shown. This makes it easy to see what TV series or one-off programs have been recorded.

TODO: Update image. File:MythTV.RecordingsByTitle.jpg

After choosing a title, the list of recorded programs with that title is shown.

TODO: Update image. MythTV.RecordingsByTitle.BestOfTopGear.jpg

Please refer to the notes in Movies section if there are Movies appearing in the TV Shows directory.

Skipping Commercial Breaks

NOTE: This functionality hasn't moved from the patch to SVN yet. http://trac.xbmc.org/ticket/6279

Commercial breaks that have been flagged in MythTV can be automatically skipped by turning on Edit Decision List (EDL) support through Settings -> Video -> Player -> Enable edit decision lists. Once EDL support is enabled, commercial breaks are automatically skipped during playback.

Each commercial break is only skipped once so it's possible to go back into any incorrectly flagged commercial break. To help support this, scene markers are put in at the beginning and end of the flagged commercial breaks.

If an incorrectly flagged commercial break is skipped, pressing "Down" (big skip backwards) within 5 seconds will skip back to the start of the commercial break. Additionally, if a commercial break isn't flagged early enough, pressing "Up" arrow (big skip forward) will go to the end of the next flagged commercial break (technically it goes to the start, but then it is automatically skipped).

When you press "i" (to display the information OSD) the "edl: c4s8" portion identifies how many commercial breaks were flagged. "edl: c4s8" means there are 4 commercial breaks and 8 scene markers. If the "edl:" portion is blank then there were no commercial breaks flagged.

Watching Live TV

After choosing Live Channels a listing of channels held within MythTV will be presented along with the following information:

  • Name of the channel and logo
  • Currently playing TV show on that channel
  • Description of that TV show

How the information is presented depends on the skin and view being used.

MythTV.LiveTV.jpg

When a channel is chosen, the currently playing TV show on that channel is shown.

To move up and down channel when playing Live TV press the PageUp or PageDown button. Alternatively, the currently playing channel can be stopped and the new channel then chosen from within the Live Channels listing.

There are future plans for a fully interactive EPG similar to that available within the MythTV frontend.

Viewing the Program Guide

After choosing Guide a listing of channels held within MythTV will be presented.

MythTV.Guide.jpg

When a channel is chosen, the listing of upcoming programs on that channel is displayed.

MythTV.Guide.TV3.jpg

There is a future project to be able to schedule programs to record from the EPG similar to the functionality available in the MythTV frontend.

Adding Recorded Movies to the Video Library

Recorded movies can be added to the XBMC Video Library by setting the Content Type on the Movies directory and then choosing the appropriate Movie scraper.

Once the recorded Movies have been scanned to the Library, you can watch them via the XBMC Video Library.

Trouble Shooting

Recordings Don't Play

For the myth:// protocol to play recordings, XBMC must be able to access the IP Address configured in the MythTV backend using mythtv-setup. This is necessary because of the way the Myth Protocol works. The Myth API gets the IP Address configured in the MythTV backend and uses that to stream recordings.

If a hostname was used in the IP Address configuration for the MythTV Local Backend, either the DNS server on the network needs to be able to resolve the hostname to an IP address, or a static hostname to IP address entry is needed on the XBMC machine. A static IP address mapping can be set in the /etc/hosts file in Linux or Mac OSX, or in the AdvancedSettings.xml file for the original XBox.

Double check that the Local Backend IP Address configured in the MythTV backend is not set to localhost or 127.0.0.1 if the MythTV backend is running on a different machine to XBMC Media Center.

Live TV Doesn't Play

Unconfirmed: from http://forum.xbmc.org/showthread.php?p=283190#post283190

The libcmyth library used for to connect to MythTV from XBMC only enumerates the first 16 tuner devices when looking for available tuners. Trac - CMyth only enumerates 17 tuners

Depending on what was done when the MythTV backend was setup, it's possible that some Tuner ID's are > 17 in the mythconverg database (especially if tuners were added and deleted several times, or if multiplexing is being used for digital terrestrial tuners).

If this is the case, you may be able to see the Guide and all the stations displayed in XBMC, but XBMC may not be able to select a tuner for live TV playback.

This can be resolved by removing all the tuners through mythtv-setup (so they start at 0 when re-added), and then re-adding them, or reducing the number of multiplexed virtual tuners that are created for each physical digital terrestrial tuner.

Guide Doesn't Display Anything

Check that the username and password supplied in the myth:// URL are a username and password that have access to the mythconverg MySQL database. The guide information is obtained directly from the database.

If a username and password have not been supplied in the myth:// URL then the default of 'mythtv' will be used for both.

See Setup in XBMC for more information.

Audio Plays Out of Sync

If CPU utilization is close to 100% on any of the CPU cores then there could be audio sync problems.

Depending on the video card and driver being used, there could be significant CPU utilized when playing H264 video content. The <skiploopfilter> setting in advancedsettings.xml can be used to reduce the CPU utilization by reducing the quality of the output H264 video. Valid values are -16, 0, 8, 16, 32, 48. The larger the number the more h264 content gets discarded in an effort to save CPU cycles.

Try adding <skiploopfilter>48</skiploopfilter> to the advancedsettings.xml file in userdata.

Known Problems

Below is a list of known problems that may be encountered when using the XBMC integration with MythTV.

  • Need to delete a Recording twice for it to be removed from the list if using a MythTV 0.20 backend. Deleting appears to work as expected using a 0.21 Myth TV backend.
  • Seeking (fast forward, rewind skipping forwards or backwards) doesn't work with Live TV. This is related to the way the Myth API streams content. Hopefully this will be resolved in the future.
  • Seeking can take some time if the CPU usage needed to playback a recording is high (typically with H264 content).

History of MythTV support in XBMC

MythTV support in XBMC has been available since ~2004. It started life as a Python script for the original XBox that had functionality added by willing developers over the following years. Eventually the script moved to the current home at Sourceforge, and is now called xbmcmythtv. In late 2008 another script based solution arrived called MythBox.

In 2007 support for communicating with the MythTV backend was added directly to XBMC via a Source using the myth:// protocol. This project uses the cmyth library, which was built to use the network based Myth Protocol supported by MythTV.

In 2009 it is hoped that the Google Summer of Code - Unified PVR Frontend project will be available and provide added functionality to the existing myth:// protocol support. More information about the PVR project can be found in the very large MythTV frontend client built into XBMC forum thread.

xbmcmythtv Script

Support for MythTV in XBMC started with the xbmcmythtv Python script. This project communicated with the MythTV mythconverg MySQL database to get information, and played recordings via a Samba share on the MythTV backend.

The last official release of the Python script was in May 2007 and supported version 0.20 of MythTV and protocol 34. Various unofficial releases were made available by some of the developers of xbmcmythtv, but appears to no longer be supported on an ongoing basis.

Since this project was implemented as a Python script, it is not yet able to be used in the Linux version of XBMC.

myth:// Source

The myth:// source was released in early 2007. This project uses the network based Myth Protocol to communicate with the MythTV backend. It also accesses the MySQL database directly to get Guide information.

Although the myth:// source doesn't support all the functionality that the xbmcmythtv script supported, it is possible to play recordings, which is all many XBMC frontend systems need to support.

The native MythTV frontend client needs to be used to schedule recordings.

MythTV Python Scripts for XBMC

MythTV Python Scripts for XBMC that provide a python coded GUI for MythTV interface.

MythBox Script (Linux/Mac/Windows)

MythBox (screenshots) was released in late 2008 and is a XBMC script for MythTV that supports:

  • Watching recordings with commercial skipping
  • Watching Live TV
  • Scheduling recordings (create and edit)
  • TV Guide
  • MythTV 0.21 and 0.22 (trunk) backends

The code for MythBox was initially forked from the xbmcmythtv script.

Myth2XBMC Script (Xbox)

Myth2XBMC heavily based on the original xbmc-mythtv script and is only tested on the Xbox.

PVR frontend

The future for MythTV support in XBMC is based on the unified PVR frontend support that is envisaged for XBMC Media Center.

Much more information can be found in the Google Summer of Code - Unified PVR Frontend wiki page. MythTV is being used as the first PVR backend that will be supported, with the intention of XBMC being able to communicate with any PVR backend.

Note that the vision does not include XBMC providing native support for digital video recorder (DVR) capabilities. Rather the vision is to leverage the significant amount of existing open source effort that has been put into this area by providing a slick frontend interface.

External Links