Friday, July 4, 2008

MythTV - a dream become true ...

MythTV is next generation of watching TV aside from Video on Demand. With MythTV you can pause, rewind, forward and more what you are watching. And that's all possible because MythTV records everything you are watching. It's your personal digital video recorder. For this you need a fast PC and a lot of free space on your hard disk. I have 2,0 GHz and somethings the video jitter. Watching HDTV is impossible.


Installation

Installing the program with ./configure && make && make install took a while til i had installed all need libraries and header files. The program files are installed into /usr/local which is not a default location on Fedora and so you start MythTV, it won't find the libraries.

Solution 1: Run ./configure --prefix=/usr
Solution 2: Create a new file named mythtv.conf in /etc/ld.so.conf.d and put in it where the libraries are, usually /usr/local/lib, run ldconf to apply the changes.

And do your eyes a favor: Install the additional themes package.


Tip 1: MySQL

MythTV uses MySQL to store its configuration and data. If you run mythbackend and mythfrondend on one PC, MySQL can run with a small configuration to save memory and disk space. Disable innodb (see skip-innodb), MythTV doesn't used it and with the default configuration it uses 10MB of your hard disk.

[mysqld]
#port = 3306
#datadir=/home/jorg/.mythtv/db
#socket=/home/jorg/.mythtv/db/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K

server-id = 1

skip-bdb
skip-innodb

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 8M
sort_buffer_size = 8M

[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout

After a restart of the mysql server you can remove the innodb files from your mysql data directory to free up the disk.


mythtv-setup

Configure MythTV the first time with mythtv-setup is hard, if you do not know what you are doing:

2. Capture Cards
Here you define your TV card.
3. Video Sources
Here you define where MythTV can find the program information for the EPG.
With DVB-S the "Transmitted guide only" is a good choice.
4. Input connections
Here you say Capture Card x can find his program information at video source y.

Scan for channels: That's a torture. Every time you do a Full Scan (Tuned) you have to reenter all the data. And with this type only a few data(?) channels are found. But i got the transponder list. And with a Full Scan of Existing Transports i got my channels. The first times i run it, i had the feeling the program hang up because no screen update for a long time and error messages in the log file. Go and get a cup of tea, the scan took longer than the dvbscan, about 10-20 minutes.

The next step is to download the channel logos, only if you like. I think, this tool is buggy. When you choose a logo for a channel from a list of choices, the logo get downloaded, but the channel is not updated, so you have to enter the filename by hand. If the program choose automatic a logo because there is only one, the channel will get updated. For the filename you have to enter the full path, e.g. /home/bob/.mythtv/channels/logo.jpg


Tip 2: Edit channels

If you are to lazy, like me, to install MythWeb there is another smart way to edit the channel list:
Export the channels into channels.csv:
$ mysql -u mythtv -p mythconverg -e "SELECT * FROM channel" > channels.csv
And you get a tabulator separated file, import it with e.g. OpenOffice.org Calc. Edit the channels, save and import it back:
$ sed -e "s/\"NULL\"/NULL/g" channels.csv > channel.csv
$ mysqlimport -u mythtv -p mythconverg --columns=`sed -n -e "y/\t/,/" -e "s/\"//g" -e P -e q channel.csv` --ignore-lines=1 --local --delete --fields-optionally-enclosed-by=\" channel.csv
You need the parameter --columns for the case, you changed the order of the columns.

The commands explained:

sed -e "s/\"NULL\"/NULL/g" channels.csv > channel.csv
Replace "NULL" with NULL, save into channel.csv
sed -n -e "y/\t/,/" -e "s/\"//g" -e P -e q channel.csv
Returns the first line which contains the column names, replace the tabulator with "," , replace the field separator " with nothing.



Tip 3: EPG

Be patient. The EPG needs its time. And it only collects the EIT information when the LiveTV is not running. Well, if you don't trust the program, run only the backend with

$ mythbackend -v eit

and do nothing, wait one minute (default setting, to change run mythtv-setup, go to General, Page EIT)


If you followed the install instruction correctly, you will be ready for the next generation of watching TV.
Have a lot of fun ...

No comments: