Download - Installing MythTV 0.20 on Ubuntu Gutsy 7.10
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 1/46
Page 1 of 46
Installing MythTV 0.20 on Ubuntu Gutsy 7.10
Document Purpose
The purpose of this document is to guide the reader through the installation of MythTV0.20 on Ubuntu Gutsy 7.10. After completing this guide the reader will have a fullyfunctional MythTV Linux box that is capable of recording and playing digital television
as well as hosting your DVD and music collection, or streaming those media collectionsto other MythTV front-end machines elsewhere around your house and wider networks,even allowing access to your recordings via the web from outside of your home if desired.
Requirements
The following requirements are prerequisites for using this installation guide.
1. Ubuntu Gutsy 7.10 desktop CD (available from www.ubuntu.net)2. Hardware that is identical or comparable to that specified below
Example HardwareI used the hardware specified below. If you use the exact same hardware then your installation will work perfectly provided that you follow the instructions here accurately.However, if you use different hardware (such as a different model of TV tuner or graphicscard) then you should do some research first to check that the hardware you have chosenis compatible with Ubuntu Gutsy 7.10 and that it is it compatible with MythTV. Thesafest option for a stressful install is to use the hardware I’ve written this guide around.
Processor : AMD Athlon 64 X2 dual core processor
Motherboard : nFORCE 4M-A ATX
Memory : 2GB DDR2 RAM chip
Graphics Card : nVidia GeForce 7200 SeriesMedia Drives : LG DVD/CD re-writer internal drive
Tuner Card : Hauppauge WinTV Nova T-500 dual tuner
Network : Devolo Highspeed Ethernet Starter Kit (better than using Wireless)
Remotes : iPhone/iTouch, or use the remote that accompanied the Tuner
I wanted to point out a couple of things regarding my hardware setup. You will notice thatI’ve got video built into the motherboard, yet I also opted to install a separate graphicscard as well. The reason is that the separate graphics card will provide DVI output andhas a higher specification that the built-in one, which is important given that I need thegraphics card to deliver a clean crisp video image to the accompanying television.
Secondly, rather than installing a Wireless card I opted to use the built-in Ethernet portand connect it to a Devolo Ethernet adaptor that plugs into a power socket in the wall.These adaptors allow an 85mbps network connection to be established across the power circuit in your home. One adapter connects the network from the router to the mainscircuit and the other adaptor connects the mains circuit to your MythTV computer. This isespecially useful because Linux still has problems natively supporting many wirelesscards and this approach will give you a consistent fast network connection that will better facilitate streaming your media to other MythTV front-end PCs around your home.
One final point - get a lot of memory (1GB per TV channel you wish to be able to recordin parallel) and a large hard-disk. I fitted a 500GB hard-disk and was surprised how
quickly it filled up when I loaded on my DVD collection and started recording TV. Youcan never have enough memory and never have enough hard-disk space available to you!
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 2/46
Installing MythTV on Gutsy www.daviddn.com
Page 2 of 46
In order to help you identify the hardware I used, please find below the details and boxes.All these hardware products are compatible with Ubuntu Linux 7.10 and with MythTV.
MotherboardnFORCE 4M-A ATX
(purchased in PC World)
Tuner Card
Hauppauge WinTV Nova T-500 dual tuner (purchased in PC World)
etwork
Devolo Highspeed Ethernet Starter Kit
(purchased in PC World)
Processor
AMD Athlon 64 X2 dual core processor
(purchased in PC World)
Graphics Card
nVidia GeForce 7200 Series
(purchased in Maplins)
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 3/46
Installing MythTV on Gutsy www.daviddn.com
Page 3 of 46
Table of Contents
ISTALLIG MYTHTV 0.20 O UBUTU GUTSY 7.10 1
DOCUMET PURPOSE 1 R EQUIREMETS 1 EXAMPLE HARDWARE 1 TABLE OF COTETS 3
ISTALLIG THE BASE SYSTEM 5
ISTALLIG UBUTU 5 EABLIG THE R OOT USER 6 COFIGURIG THE ETWORK 7 UPDATIG APTITUDE 8 ISTALLIG A SSH SERVER 9
ISTALLIG THE GEERIC SERVICES AD TOOLS 9 ISTALLIG A ETWORK TIME PROTOCOL SERVER 9
ISTALLIG THE FILE SERVER COMPOETS 10
CREATIG USER ACCOUTS 10 ISTALLIG SAMBA FILE SHARIG DAEMO 10
COFIGURIG THE VIDEO HARDWARE 11
ISTALLIG THE
VIDIA G
RAPHICSD
RIVERS11 ISTALLIG FIRMWARE FOR THE HAUPPAUGE WITV OVA-T 500 12
TESTIG THE HAUPPAUGE WITV OVA-T 500 13
ISTALLIG MYTHTV 15
ISTALLIG MYTHTV SERVER 15 COFIGURIG MYTHTV BACKED 15 COFIGURIG MYTHTV FROTED 21 ISTALLIG MYTHTV PLUGIS 25 COPYIG OVER YOUR MEDIA FILES TO MYTHTV 26
COFIGURE THE HAUPPAUGE R EMOTE COTROL 27
ADDIG THE FIISHIG TOUCHES 28
COFIGURIG THE DESKTOP USER ITERFACE 28 COFIGURIG AUTOMATIC LOGI AD START UP OF MYTHTV FROT-ED 29 ADDIG SUPPORT FOR DVD PLAYBACK AD R ESTRICTED FORMATS 30 SECURE APACHE2 WITH SSL 30 ISTALLIG FFMPEG WITH FULL MP4 SUPPORT 33 ISTALLIG HADBRAKE 34 ISTALLIG FS 34
ISTALLIG PHPMYADMI 35 SCRIPTS FOR ECODIG R ECORDIGS TO IPHOE/ITOUCH FORMAT 36
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 4/46
Installing MythTV on Gutsy www.daviddn.com
Page 4 of 46
APPEDIX A – COFIGURATIO FILES 38
/USR /LOCAL/BI/MYTHECODE.SH 38 /USR /LOCAL/BI/MYTHCLEA.SH 40 /USR /LOCAL/BI/RIPDVD 41 /ETC/LIRC/HARDWARE.COF 42
/ETC/LIRC/LIRCD.COF 43 /HOME/MYTHTV/.LIRCRC 44
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 5/46
Installing MythTV on Gutsy www.daviddn.com
Page 5 of 46
Installing the base System
Installing Ubuntu
1. Install the hardware, insert the Ubuntu Gutsy CD into the DVD-drive and boot the PC
2. Highlight “Start or Install Ubuntu” and press F6 (Other Options)
3. Add “noapic” to the Boot Options. This is required to work around an issue withAMD 64 X2 processors hanging the OS. You may not need to include this step if youare using an alternative processor. If you are unsure you should add this option.
4. Run the Install program from the Ubuntu Desktop and follow the pictures below.
5. Select the language and region options for the installation
6. The partitioner will start up. When asked how you would like to partition your disk you should select manual . I created a 40GB partition for my root filesystem, a 10GB
swap partition, an optional 50GB partition for my network share and all the rest of myspace for my /var/ partition. The /var/ partition needs to be big because this is whereMythTV stores your media files by default. I installed a 500GB hard disk, so after losing 100GB for my root, swap and share partitions I had 400GB left for /var/.
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 6/46
Installing MythTV on Gutsy www.daviddn.com
Page 6 of 46
When creating the /var/ partition I used a JFS file system. This is a journalled filesystem and is also very efficient at handling large data files, such as media content.
7. Next provide your name and password details for the main account. We will besetting up a mythtv account later on, so for now just create an account in your own
name. You should also provide a name for your computer; I used mythtv as the name.
8. The installation of the core Ubuntu operating system will then commence. Go andgrab yourself a cup of tea and after a while you will be prompted to reboot your PC.
Enabling the Root User
1. First we need to enable the root user account. This is the account that we will be usingto install all the core services under. Root is considered to be a specially privilegedaccount, so be careful when issuing the commands in this installation guide.
sudo passwd root[sudo] password for username: [enter password ]Enter new UNIX password: [enter password ]Retype new UNIX password: [enter password again]passwd: password updated successfully
suPassword: [enter the password you selected above]
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 7/46
Installing MythTV on Gutsy www.daviddn.com
Page 7 of 46
Configuring the Network
1. You should now be logged in as the root user and therefore have the required privileges to change the system settings and install services and programs.
2. The first thing we need to configure is the networking so it uses a static IP address.
This is useful because you will need to know the IP address of this server in order toaccess it from other PCs (such as other MythTV Front-ends) or from the Internet.
vi /etc/network/interfaces
Enter the following, which will give you a static IP of 192.168.2.100:
auto loiface lo inet loopback
auto eth0
iface eth0 inet staticaddress 192.168.2.100netmask 255.255.255.0network 192.168.2.0broadcast 192.168.2.255gateway 192.168.2.1
Restart the networking service (the grey text is the response you will get from Linux):
/etc/init.d/networking restart* Reconfiguring network interfaces… [OK]
3. We will now set a hostname for the PC. This should be the full URL that you will useto access the PC remotely. I have a dynamic IP for my machine, so I use a domainname that I can manage the DNS for with ZoneEdit (http://dynamic.zoneedit.com)
vi /etc/hosts
Ensure the first three lines are as follows (I use www.davos.co.uk as my domain):
127.0.0.1 localhost127.0.1.1 mythtv192.168.2.100 www.davos.co.uk
Now set the hostname for the machine
echo www.davos.co.uk > /etc/hostname/bin/hostname –F /etc/hostname
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 8/46
Installing MythTV on Gutsy www.daviddn.com
Page 8 of 46
Updating Aptitude
1. We now need to change the Aptitude Repositories used by Ubuntu. These are the places that Ubuntu looks when installing applications and services. I typically disablethe CD-ROM as a source (ensuring we always look on the web for the most recent)and I add a couple of the core repositories that are needed later on in this guide.
vi /etc/apt/sources.list
# Main Gutsy Repositories
deb http://gb.archive.ubuntu.com/ubuntu/ gutsy main restricteddeb-src http://gb.archive.ubuntu.com/ubuntu/ gutsy main restricted
# Major Bug Fixes
deb http://gb.archive.ubuntu.com/ubuntu/ gutsy-updates main restricteddeb-src http://gb.archive.ubuntu.com/ubuntu/ gutsy-updates main restricted
# Universe Repositories
deb http://gb.archive.ubuntu.com/ubuntu/ gutsy universedeb-src http://gb.archive.ubuntu.com/ubuntu/ gutsy universedeb http://gb.archive.ubuntu.com/ubuntu/ gutsy-updates universedeb-src http://gb.archive.ubuntu.com/ubuntu/ gutsy-updates universe
# Unsupported Multiverse
deb http://gb.archive.ubuntu.com/ubuntu/ gutsy multiversedeb-src http://gb.archive.ubuntu.com/ubuntu/ gutsy multiversedeb http://gb.archive.ubuntu.com/ubuntu/ gutsy-updates multiversedeb-src http://gb.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse
# Backports
deb http://gb.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiversedeb-src http://gb.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
# Canonical's Partner repository
deb http://archive.canonical.com/ubuntu gutsy partnerdeb-src http://archive.canonical.com/ubuntu gutsy partner
# Restricted Security Repositories
deb http://security.ubuntu.com/ubuntu gutsy-security main restricteddeb-src http://security.ubuntu.com/ubuntu gutsy-security main restricteddeb http://security.ubuntu.com/ubuntu gutsy-security universedeb-src http://security.ubuntu.com/ubuntu gutsy-security universedeb http://security.ubuntu.com/ubuntu gutsy-security multiversedeb-src http://security.ubuntu.com/ubuntu gutsy-security multiverse
2. Save the changes that you have made above, update the repository list and upgradethe base components currently installed on your system by typing the following. Theupgrade option can take a while depending on how old your original Ubuntu CD was.
sudo apt-get updatesudo apt-get –y upgrade
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 9/46
Installing MythTV on Gutsy www.daviddn.com
Page 9 of 46
Installing an SSH Server
1. Install an SSH server so that you can use a SSH client to access the PC:
sudo apt-get –y install ssh
Installing the Generic Services and Tools
1. Install additional generic software that will be required during this installation bytyping the command line below into your terminal. The applications being added hereinclude useful programs for compressing and uncompressing data (unzip and zip), for fetching data from web pages (curl) or mail servers (fetchmail), for compiling code(gcc and make) and for converting DOS files into UNIX files (apt-file and sysutils).
sudo apt-get –y install unzip zip curl fetchmail libarchive-zip-perl zlib1g-dev
libpopt-dev nmap openssl lynx gcc flex make ncftp libdb4.3-dev rar wput apt-filesysutils
2. Remove some of the inet services that are not required on a MythTV server:
update-inetd --remove daytimeupdate-inetd --remove telnetupdate-inetd --remove timeupdate-inetd --remove fingerupdate-inetd --remove talkupdate-inetd --remove ntalkupdate-inetd --remove ftpupdate-inetd --remove discard
Installing a Network Time Protocol Server
1. Install ntpdate to enable your clock to be automatically synchronised with an InternetTime server using NTP (Network Time Protocol). It is important for your clock to becorrect for timed recordings, otherwise you may miss programs you want to record.
sudo apt-get –y install ntpdate/etc/network/if-up.d/ntpdate
2. Add the ntpdate check to the weekly schedule:
touch /etc/cron.weekly/setclock.cronchmod +x /etc/cron.weekly/setclock.cronvi /etc/cron.weekly/setclock.cron
#!/bin/bash
clock=clock.psu.edu/usr/sbin/ntpdate -u $clock >& /dev/null
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 10/46
Installing MythTV on Gutsy www.daviddn.com
Page 10 of 46
Installing the File Server Components
Creating User Accounts
1.
As well as using the PC as a MythTV back-end, I also use the PC as a network fileserver too. Therefore, it may be useful to have additional user accounts set up on the
machine. We already have one account setup for the main user, but you can add anadditional one by following the following steps (repeat as many times as necessary):
adduser [username]
Installing Samba File Sharing Daemon
1. Samba allows you to create shares on your Ubuntu server that are visible fromWindows PCs on your network. We plan to install Samba for two reasons; (1) so that
the recordings made by MythTV can be made easily available across the network toWindows PCs that are not running a MythTV Front-end, and (2) so that we can usethe server as a standard file server for holding work files. Below I show how to installSamba and create accounts for two users that I intend giving access to. The passwordsthat are created are for the Samba accounts only, and do not need to be the same
passwords that are used on the accounts for accessing the Ubuntu machine.
sudo apt-get -y install samba samba-doc smbclient smbfs
smbpasswd -a david
New SMB password: [enter password]Retype new SMB password: [re-enter password]
smbpasswd -a niamhNew SMB password: [enter password]Retype new SMB password: [re-enter password]
vi /etc/samba/smb.conf
Under the Share Definitions section, add the following definition. This will create awritable share under the path /shared/ on your Ubuntu server. We will need to createthis directory and set the permissions so that users can read and write appropriately.
[share]comment = Shared Network Drivewritable = yespath = /sharedpublic = yes
mkdir –p /shared/davidmkdir –p /shared/niamhchown david:david /shared/davidchown niamh:niamh /shared/niamh
/etc/init.d/samba restart
Test that you can connect to the server from Windows using \\192.168.2.100\share\
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 11/46
Installing MythTV on Gutsy www.daviddn.com
Page 11 of 46
Configuring the Video Hardware
Installing the NVIDIA Graphics Drivers
1.
The next step is to install the NVIDIA graphics drivers for Ubuntu Linux. The easiestway to do this is to use the Envy script, which is an automated detection and
compilation script for NVIDIA and ATI drivers. The Envy script comes highlyrecommended by me. The project is maintained at http://albertomilone.com/ and thescript provides a very quick and pain-free installation of the NVIDIA graphics driver.
2. Follow the steps below to install the drivers for your NVIDIA card. Also, note thatwhen you upgrade your kernel you will need to reinstall the NVIDIA driver again.
Install the dependencies:
apt-get install html2text po-debconf debhelper dh-make dpatch fakeroot libstdc++5
module-assistant xserver-xorg-dev gettext intltool-debian gcc-3.3-base
Download and run Envy:
cd ~/wget http://albertomilone.com/ubuntu/nvidia/scripts/legacy/envy_0.9.10-0ubuntu6_all.debdpkg -i envy_0.9.10-0ubuntu6_all.debenvy -t
+-----------------------------------------------------------+| Envy Menu ver.0.9.10 || || 1 - Install the NVIDIA driver || |
| 2 - Uninstall the NVIDIA driver || || 3 - Install the ATI driver || || 4 - Uninstall the ATI driver || || 5 - Install the ATI/NVIDIA driver Manually || || 6 - Clean the Installation of any Nvidia driver || || 7 - Restart the Xserver || || 8 - Restart your computer || || 9 - Exit || || NOTE: IF THE SCREEN TURNS BLACK, PLEASE TYPE ALT+F1 |+-----------------------------------------------------------+
Please select one of the activities displayed above and press ENTER:
[1]
Do you want your xorg.conf to be automatically configured? (y/n) \ "y" is the default answer[Y]
Do you want to restart your computer now (Recommended)? (y/n) \ "y" is the default answer[Y]
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 12/46
Installing MythTV on Gutsy www.daviddn.com
Page 12 of 46
Installing Firmware for the Hauppauge WinTV Nova-T 500
1. Unfortunately the Hauppauge WinTV Nova-T 500 PCI Card does not work out of the box with Ubuntu Gutsy, you will need to install a revised version of the firmware to
get it operational. Firstly, prepare Aptitude by running the following commands:
sudo apt-get updatesudo apt-get upgradesudo apt-get dist-upgrade
2. Now download the latest version of the firmware from the website below and place itinto the /lib/firmware directory on your Ubuntu server (also available with this guide).
wget http://www.wi-bw.tfh-wildau.de/~pboettch/home/linux-dvb-firmware/dvb-usb-dib0700-1.10.fwcp dvb-usb-dib0700-1.10.fw /lib/firmware
3. Install the packages to build the Kernel modules:
apt-get -y install linux-headers-$(uname -r) build-essentialapt-get -y install mercurial
4. Download the Linux source (I’m using 2.6.22, but your version might be different):
apt-get -y install linux-sourcecd /usr/src/tar -xjvf linux-source-2.6.22.tar.bz2ln -s /usr/src/linux-source-2.6.22 /lib/modules/$(uname -r)/source
5.
Install the Video for Linux DVB drivers:
cd ~/hg clone http://linuxtv.org/hg/v4l-dvbcd v4l-dvb
apt-get -y install ncurses-devmake menuconfig
When the configuration screen appears you should disable the ACI mixer in the
Audio Devices for Multimedia section because this can sometimes cause errors in theaci.c module when you compile the source code.
makemake install
6. Enable the onboard amplifier (if not already done) to prevent poor reception:
vi /etc/modprobe.d/options
{add}
options dvb-usb-dib0700 force_lna_activation=1
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 13/46
Installing MythTV on Gutsy www.daviddn.com
Page 13 of 46
7. Load the modules and reboot the machine
make loadmodprobe dvb-usb-dib0700shutdown –h now
8. Check that the Tuner card loaded the firmware successfully. Type the following andlook for a line that says that the Hauppauge Nova-T 500 was successfully initialised.
dmesg | grep dvb[ 12.972000] dvb-usb: found a 'Hauppauge Nova-T 500 Dual DVB-T' in cold state, will try to load a firmware[ 13.044000] dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.10.fw'[ 13.780000] dvb-usb: found a 'Hauppauge Nova-T 500 Dual DVB-T' in warm state.[ 13.780000] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.[ 14.392000] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.[ 14.960000] dvb-usb: schedule remote query interval to 150 msecs.[ 14.960000] dvb-usb: Hauppauge Nova-T 500 Dual DVB-T successfully initialized and connected.[ 14.960000] usbcore: registered new interface driver dvb_usb_dib0700
9. You may also want to check for similar success with the Infrared receiver:
dmesg | grep DVB[ 12.972000] dvb-usb: found a 'Hauppauge Nova-T 500 Dual DVB-T' in cold state, will try to load a firmware[ 13.780000] dvb-usb: found a 'Hauppauge Nova-T 500 Dual DVB-T' in warm state.[ 13.780000] DVB: registering new adapter (Hauppauge Nova-T 500 Dual DVB-T)[ 13.892000] DVB: registering frontend 0 (DiBcom 3000MC/P)...[ 14.392000] DVB: registering new adapter (Hauppauge Nova-T 500 Dual DVB-T)[ 14.400000] DVB: registering frontend 1 (DiBcom 3000MC/P)...[ 14.960000] input: IR-receiver inside an USB DVB receiver as /class/input/input4[ 14.960000] dvb-usb: Hauppauge Nova-T 500 Dual DVB-T successfully initialized and connected.
Testing the Hauppauge WinTV Nova-T 500
1. MPLAYER and Xine can be used by MythTV to play media content that is not
natively supported. For example, they can play MP4 files whereas MythTV currentlycannot. They can also be used to test that the Tuner card is operating correctly beforewe install MythTV. Follow the instructions below to install these packages:
sudo apt-get upgradesudo apt-get install dvb-utils dvbstreamsudo apt-get install xine-ui mplayer
2. We now need to tune the TV Tuner card in to pick up the local DVB channels. I livenear to London in the UK so I use the Crystal Palace UK DVB-T configuration file because it is able to detect my DVB channels well. You may need to use a different
settings file from that directory depending on which country/town you are nearest to.
cd ~/mkdir /root/.tzap
cd /usr/share/doc/dvb-utils/examples/scan/dvb-tscan uk-CrystalPalace > /root/.tzap/channels.conf
0x6000 0x6a00: pmt_pid 0x03f0 Channel 4 TV -- Film4 (running)0x6000 0x6780: pmt_pid 0x0402 BBC -- BBC World Sv. (running)0x6000 0x6a80: pmt_pid 0x03f2 Camelot Group plc -- Lottery Xtra (running)Network Name 'Crystal Palace'dumping lists (104 services)Done.
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 14/46
Installing MythTV on Gutsy www.daviddn.com
Page 14 of 46
3. From one terminal I now tune in to BBC One and leave it running:
tzap –r "BBC ONE"
4. From another terminal I launch the DVB stream into one of the media players I
installed (either MPLAYER or XINE). Both commands should be run from the localmachine, they will fail if you run the commands remotely from an SSH terminal.
dvbstream -o -ps 600 601 -qam 16 -cr 3_4 | mplayer –
or
dvbstream -o -ps 600 601 -qam 16 -cr 3_4 | gxine stdin://mpeg2
You should now see the channel you selected above playing on your Linux machine.
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 15/46
Installing MythTV on Gutsy www.daviddn.com
Page 15 of 46
Installing MythTV
Installing MythTV Server
1.
To install MythTV follow the instructions below. If you get errors when trying toinstall MythTV via Aptitude then you may need to go back to the section entitledUpdating Aptitude and enable all the repositories that are listed and then try again.
sudo apt-get updatesudo apt-get install mythtv mythtv-themes
2. During the installation you will be prompted to provide a root password for MySQL(this is the database server that gets installed for MythTV to store its information into).Pick a memorable password and write it down because you will need it later on.
3. You will also be asked if you would like to enable Remote Connections from other MythTV front-ends on your network. Since you may want other machines on your network to connect to your server for the purposes of watching television or films Iwould advise you select yes for this option. Your broadband router should by defaultnot allow computers that are external (such as those on the Internet) to connect in.
4. After the installation completes, make sure that the Myth Backend is running:
/etc/init.d/mythtv-backend start
Configuring MythTV Backend
1. This process was documented during the installation of MythTV 0.20. However, the process for MythTV 0.21 is almost identical and you should be able to use the guide below equally well for MythTV 0.21 (although some options are on different screens).
2. From the desktop menu, select System / Administration / MythTV Backend Setup
3. You will be asked the following question; “You must be a member of the mythtv group before starting any mythtv applications. Would you like to automatically beadded to the group?” Select OK, you will be encouraged to log out and back in again.
4. Once logged back in again, run the following command from the terminal:
sudo dpkg-reconfigure mythtv-database
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 16/46
Installing MythTV on Gutsy www.daviddn.com
Page 16 of 46
5. Enter the following responses for the questions below:
Question Response
MySQL Server localhost
MySQL Administration Account root
Will you be using other computers running MythTV? Yes
6. Next run the following command from the terminal:
sudo dpkg-reconfigure mythtv-common
7. Enter the following responses for the questions below:
Question Response
What database should be used to hold MythTV data? mythconverg
What username should MythTV use? mythtv
What password should MythTV use? [use password in /etc/mythtv/mysql.txt]
On what host does the MySQL server reside? localhost
8. From the desktop menu, select System / Administration / MythTV Backend Setup.You will be told that Mythbackend must be closed before continuing. You should
select OK and then the MythTV Language Configuration screen will appear:
Question Response
Select your preferred language English (British)
9. The next screen allows you to configure the Database. Fill in the details as below:
Question Response
Host name localhost
Database mythconverg
User: mythtv
Password: [use password in /etc/mythtv/mysql.txt]
Database Type MySQL
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 17/46
Installing MythTV on Gutsy www.daviddn.com
Page 17 of 46
10. The MythTV Backend configuration will start. You need to follow the instructions below to detect and configure the TV Tuners cards, and to configure the TV sources.Only the key configuration changes are included, the rest can be left as default.
Main Menu
Select General from the main menu
Host Address Backend Setup
IP address for Host: 192.168.2.100
Port Server runs on: 6543
Port Server status: 6544
Master Server IP: 192.168.2.100
Port Master Server: 6543
Host-specific Backend Setup
Directory to hold recordings : /var/lib/mythtv/recordings
Global Backend Setup
TV Format: PAL (I’m in the UK)
VBI Format: None
Channel Frequency: Europe-west
Time offset for listings: None
EIT Scanner Options
Time offset for EIT listings: Auto
EIT Transport Timeout (mins): 5
Cross Source EIT: [Unchecked ]
Backend Idle Before EIT Crawl: 60
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 18/46
Installing MythTV on Gutsy www.daviddn.com
Page 18 of 46
Job Queue (Host-specific)
Maximum simultaneous jobs: 1
Job Queue Check Frequency: 60
Job Queue Start Time: 00:00
Job Queue End Time: 23:59
CPU Usage: Medium
Job Queue (Global):
Run Jobs only on original host: [Unchecked ]
Start Auto-commercial flagging: [Unchecked ]
Commercial Flagger command: mythcommflag
Transcoder command: mythtranscode
Job Queue (Job Commands):
User Job #1 Description: User Job #1
User Job #1 Command: [blank ]
We will be setting the details for User Job #1 later on…
Main Menu
Select Capture Cards from the main menu
Capture Cards
Select (New Capture Card)
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 19/46
Installing MythTV on Gutsy www.daviddn.com
Page 19 of 46
Capture Card Setup
Card Type: DVB DTV capture card
DVB Card Number: 0 (the first on the Dual)
Repeat the above process for the second Tuner on the Hauppauge
DVB-T 500 tuner card by specifying 1 as the DVB Card Number
Capture Cards
Your Capture Card screen should now look as shown on the left,
with two DVB cards selected - DVB:0 and DVB:1
Main Menu
Select Video Sources from the main menu
Video Source
Select New Video Source
Video Source Setup
Video Source Name: TV
Listings Grabber: Transmitted EIT
Channel frequency table: Europe-west
The channel frequency table and the listings grabber that you
select will typically depend on where you like, I live near London
in the UK so the settings above are appropriate for me.
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 20/46
Installing MythTV on Gutsy www.daviddn.com
Page 20 of 46
Video Sources
Your finished Video Sources screen should look like this.
Main Menu
Select Input Connections from the Main Menu, this option allows
you to link a Capture Card to a Video Source. My configuration
has two Capture Cards, and I will link both to the TV video
source that I defined above.
Input Connections
Select the first Input Connection to configure it.
Connect Source to Input
Select the TV video source and then click on Scan for Channels
Scan Type
Select Full Scan and the country that you live in (I live in the
United Kingdom), then click on Next
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 21/46
Installing MythTV on Gutsy www.daviddn.com
Page 21 of 46
Scanning
Wait patiently whilst the scan takes place, this can take up to 5
minutes on some systems depending on your computer
performance and on the strength of your TV signal.
Input Connections
When complete you should have assigned both your DVB
capture cards to the TV video source (see image on the left)
11. After finishing with the settings you will be prompted if you would like to runmythfilldatabase. You should select OK to this option and let the database be updated.You may be asked for your root password during this process also.
Configuring MythTV Frontend
1. From a terminal enter the following to reset the mythtv account password:
sudo passwd mythtvEnter new UNIX password: [enter a password ]Retype new UNIX password: [enter a password ]passwd: password updated successfully
2. Edit /etc/group and add mythtv to the following groups:
admadmin
powerdev
3. Log out and then log in as the mythtv user to complete the following steps
4. From the desktop menu select Applications / Sound & Video / MythTV Frontend
5. The MythTV Frontend configuration will start. You now need to follow theinstructions below to configure the various components in order to watch TV. Again,only the key configuration changes are shown below, the others can be left as default.
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 22/46
Installing MythTV on Gutsy www.daviddn.com
Page 22 of 46
Main Menu
Select Utilities / Setup from the main menu and then select Setup
from the Utilities menu. You will be then shown the screen below
Setup Menu
Select General from the Setup menu
Database Configuration (1/2)
Host name: localhost
Database: mythconverg
User: mythtv
Password: [password from /etc/mythtv/mysql.txt]
Database Type: MySQL
Audio
Audo output device: ALSA: default
Passthrough device: Default
Use Internal volume: [checked ]
Mixer Device: /dev/mixer
Mixer Controls: PCM
Master Mixer Volume: 90
PCM Mixer Volume: 100
General
System Exit Key: ESC (or you may want to disable it)
Confirm Exit: [checked ]
Enable Network Remote: [checked ]
Network Remote Port: 6546
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 23/46
Installing MythTV on Gutsy www.daviddn.com
Page 23 of 46
General
Require Setup PIN: [unchecked ]
Setup Pin Code: [blank ]
Monitor CD/DVD: [unchecked ]
Enable Xbox hardware: [unchecked ]
Myth Database Logging
Log MythTV events: [unchecked ]
Maximum Entries: 100
Setup Menu
Select Appearance and press Enter
Theme
Theme: MythCenter-wide (my preference)
Paint Engine: Qt
Qt Style: Desktop style
Font size: default
Menu theme: classic
Screen Settings
Configure the screen settings to match your TV output. I use the
defaults shown on the left. You should only change them if your
TV doesn’t line up the display correctly.
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 24/46
Installing MythTV on Gutsy www.daviddn.com
Page 24 of 46
Video Mode Settings
Uncheck the option on this screen and click on Next
Localisation
Language: English (British)
Guide Language#1: English
Guide Language#2: English
Data Format: Fri 7 Mar
Short Date Format: 07/03
Time Format: 11:42 PM
QT
Small Font: 12
Medium Font: 16
Big Font: 25
Use Transparent Boxes: [unchecked ]
Background Shading: Fill
Use Line Edit Virtual: [unchecked ]
LCD Device Display
Enable LCD device: [unchecked ]
MythTV Main Menu
MythTV will restart and the main menu should appear.
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 25/46
Installing MythTV on Gutsy www.daviddn.com
Page 25 of 46
Installing MythTV Plugins
1. Install the MythTV plugins package by following the instructions below. As part of the installation you will be prompted whether or not you wish to password-protectMythWeb. I would recommend that you do (we will also look at SSL security later).
sudo apt-get -y install mythplugins
2. Restart your web server for the changes to be picked up in MythWeb:
/etc/init.d/apache2 restart
3. Test the MythWeb installation by navigating to http://192.168.2.100/mythweb/
4. Place an empty index.html file into /var/www/ to prevent browsing your web-root:
touch /var/www/index.html
5. Configure MythVideo by following starting MythTV Frontend, navigating to Setup /Video Settings / General Settings and then entering the information shown below:
General Settings (1/2)
Directory that holds videos: /var/lib/mythtv/videos
Directory that holds posters: /var/lib/mythtv/videos-posters
Default View: Gallery
General Settings (2/2)
Show Unknown File Types: [unchecked ]
Video Browser browses files: [unchecked ]
Video Gallery browses files: [unchecked ]
Video List browses files: [unchecked ]
Newly scanned are browsable: [checked ]
Sorting ignores case: [checked ]
6. We now need to set the correct permissions on the directories we are referencing:
mkdir -p /var/lib/mythtv/videosmkdir -p /var/lib/mythtv/videos-posterschown mythtv:mythtv /var/lib/mythtv/videoschown mythtv:mythtv /var/lib/mythtv/videos-posterschmod 775 /var/lib/mythtv/videoschmod 775 /var/lib/mythtv/videos-posters
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 26/46
Installing MythTV on Gutsy www.daviddn.com
Page 26 of 46
Copying over your Media Files to MythTV
1. You will no doubt have media files that you have encoded into MPG or MP4 formaton your computer that you now want to view on your TV using MythTV. To be ableto access this content via MythTV you will need to follow the steps outlined below:
2.
Firstly copy all the video media files into the directory /var/lib/mythtv/videos
cp *.mpg /var/lib/mythtv/videoschown mythtv:mythtv /var/lib/mythtv/videos/*
3. Now follow these steps to load in the metadata and images for the videos from IMDB
MythTV Main Menu
Select Videos, then select Video Manager
Video Manager
The list of all the media you copied over should now appear in
the list. Click I (for Information) and the Action menu will appear
Action Menu
Select Search IMDB from the Action menu. You can
alternatively enter the IMDB number manually if you know it.
Action Menu
MythTV will search the IMDB and bring back a list of all the
possible matches for the video file. You should then select the
correct one from that list. If no match is found then you can
always input the IMDB number manually if you know it.
Next time you enter the Video Gallery the poster and the details
for your movie files will be available for browsing.
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 27/46
Installing MythTV on Gutsy www.daviddn.com
Page 27 of 46
Configure the Hauppauge Remote Control
1. To use the Hauppauge Remote Control that came with your tuner card you shouldfollow the steps below. Make sure that the remote receiver is plugged into the back of your computer and that the remote control is within line-of-sight of the receiver.
cat /proc/bus/input/devices
2. Look for the entry for your remote control (it should look like that shown below):
I: Bus=0003 Vendor=2040 Product=9950 Version=0100N: Name="IR-receiver inside an USB DVB receiver"P: Phys=usb-0000:01:08.2-1/ir0S: Sysfs=/class/input/input4H: Handlers=kbd event4B: EV=3B: KEY=14afc336 284284d 0 0 0 4 80058000 2190 40000801 9e96c0 0 900200 ffd
3. Make a note of the Handlers line and the event (the input device the remote control isusing). My IR receiver uses event4. This can be tested by running the followingcommand and pressing some buttons on the remote control. Please note not to hit thePower button on your remote because by default this will shut your machine down.
sudo evtest /dev/input/event4
4. Install the required components for integrating MythTV with your remote control:
apt-get updateapt-get install lirc
5. Copy over the following files from Appendix A of this document
/etc/lirc/hardware.conf /etc/lirc/lircd.conf
/home/mythtv/.lircrc
6. Some of the settings from .lircrc require certain keyboard shortcuts to exist inMythTV (for example ALT+H to jump to the Home Screen). You will need to
configure these in the Edit Keys section of the MythTV Settings menu.
7. Start the LIRC daemon and test the remote control keys:
sudo /etc/init.d/lirc startirw
8. Link the .lircrc file to the MythTV lircrc file and then start the Front-end to test:
ln -s /home/mythtv/.lircrc /home/mythtv/.mythtv/lircrc
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 28/46
Installing MythTV on Gutsy www.daviddn.com
Page 28 of 46
Adding the Finishing Touches
Configuring the Desktop User Interface
1. The purpose of this section is to configure the MythTV server so that it allows you to play back video and TV without being interrupted by system sounds, screen savers
and other alerts commonplace on a computer that could spoil your viewing pleasure.These steps should all be completed whilst logged in as the mythtv user.
2. From the Desktop menu select System / Preferences / Power Management . On the ACPower Tab, slide the two sliders to the far right (the word ever appears as below).
This will prevent the display turning off when you a watching a long TV program andwill prevent the computer sleeping and becoming unresponsive during TV playback.
3. On the General tab select Shutdown as the action for when the user presses the Power button and Do othing as the action for when the user presses the Suspend button.
4. From the Desktop menu select System / Preferences / Removable Media. Uncheck allthe auto-mount and auto-play features so that inserting a DVD or a removable hard-
disk into your MythTV server doesn’t cause the TV player to be disrupted.
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 29/46
Installing MythTV on Gutsy www.daviddn.com
Page 29 of 46
5. From the Desktop menu select System / Preferences / Sound Preferences. Ensure that o Sound is selected against each of the system sounds that are listed on the screen.
Configuring Automatic Login and Start up of MythTV Front-end
1. It is nice to have the MythTV Frontend run automatically when you power on your MythTV server. In order to do this you will need to automate the log in of the mythtv
user. Follow the steps below to have the mythtv user automatically log in at boot:
vi /etc/gdm/gdm.conf-custom
{add under the daemon section}
[daemon]AutomaticLoginEnable=trueAutomaticLogin=mythtv
2. Now, to ensure MythTV Front-end runs when the mythtv user logs in:
touch /home/mythtv/.gnomercchmod 755 /home/mythtv/.gnomercvi /home/mythtv/.gnomerc
sleep 5 && mythfrontend > /tmp/mythfrontend.log 2>&1 &
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 30/46
Installing MythTV on Gutsy www.daviddn.com
Page 30 of 46
Adding Support for DVD Playback and Restricted Formats
1. Some of your media may be in formats that are not natively supported under Linux.Follow these steps to include support for CSS encrypted DVDs and Windows codecs.First add the Medibuntu sources to Aptitude by issuing the following commands:
wget http://www.medibuntu.org/sources.list.d/gutsy.list -O /etc/apt/sources.list.d/medibuntu.list
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update
2. Now install the components for DVD playback and the common Windows codecs
sudo apt-get -y install ubuntu-restricted-extrassudo apt-get –y install libdvdcss2sudo apt-get –y install w32codecs
Secure Apache2 with SSL
1. You may wish to secure some of the URLs on your web server with SSL encryption
so that information passed over the internet between your client PC and the MythTVserver (such as passwords) cannot be read or intercepted. This would be particularly
useful to help secure MythWeb. Follow the steps below to install and configure SSL.
sudo apt-get install opensslsudo apt-get install ssl-cert
2. Now create an SSL certificate for your website:
make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/certname.pem
Country Name: GBState or Province: LondonLocality: LondonOrganisation: DavOSOrganisational Unit Name: DavOSHost Name: www.davos.co.ukEmail Address: [email protected]
a2enmod sslModule ssl installed; run /etc/init.d/apache2 force-reload to enable.
3. Edit the ports configuration file so Apache listens for SSL connections on port 443:
vi /etc/apache2/ports.conf
Listen 80<IfModule mod_ssl.c>
Listen 443</IfModule>
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 31/46
Installing MythTV on Gutsy www.daviddn.com
Page 31 of 46
4. Copy the default configuration file so that it can be edited for the SSL configuration:
cp /etc/apache2/sites-available/default /etc/apache2/sites-available/sslln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/sslsudo a2ensite ssl
5. We now add rewrites to force certain URLs (on port 80) to use an SSL connection:
vi /etc/apache2/sites-available/default
NameVirtualHost *:80<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
RewriteEngine OnRewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}RewriteRule (/mythweb/*) https://%{HTTP_HOST}%{REQUEST_URI}
<Directory />Options FollowSymLinksAllowOverride None
</Directory><Directory /var/www/>
Options Indexes FollowSymLinks MultiViewsAllowOverride NoneOrder allow,denyallow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/<Directory "/usr/lib/cgi-bin">
AllowOverride NoneOptions +ExecCGI -MultiViews +SymLinksIfOwnerMatchOrder allow,denyAllow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combinedServerSignature On
Alias /doc/ "/usr/share/doc/"<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinksAllowOverride None
Order deny,allowDeny from allAllow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 32/46
Installing MythTV on Gutsy www.daviddn.com
Page 32 of 46
6. We now edit the SSL configuration to specify the certificate we will be using:
vi /etc/apache2/sites-available/ssl
NameVirtualHost *:443
<VirtualHost *:443>ServerAdmin webmaster@localhost
DocumentRoot /var/www/
SSLEngine OnSSLCertificateFile /etc/ssl/private/certname.pem
<Directory />Options FollowSymLinksAllowOverride None
</Directory><Directory /var/www/>
Options Indexes FollowSymLinks MultiViewsAllowOverride NoneOrder allow,denyallow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/<Directory "/usr/lib/cgi-bin">
AllowOverride NoneOptions +ExecCGI -MultiViews +SymLinksIfOwnerMatchOrder allow,denyAllow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combinedServerSignature On
Alias /doc/ "/usr/share/doc/"<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinksAllowOverride NoneOrder deny,allowDeny from allAllow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
7. Finally, reload Apache. You should be able to test the above configuration by
navigating to MythWeb on your MythTV server. A certificate will be displayed andyou will be redirected to use an HTTPS (SSL) connection instead of standard HTTP.
sudo /etc/init.d/apache2 force-reload
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 33/46
Installing MythTV on Gutsy www.daviddn.com
Page 33 of 46
Installing FFMPEG with full MP4 support
1. The version of FFMPEG that comes as standard from the Ubuntu repositories has been heavily crippled. In order to install FFMPEG with support for MP4 follow thesteps below. First use Aptitude to download and install the required libraries:
su
apt-get -y build-dep ffmpegapt-get -y install liblame-dev libfaad2-dev libfaac-dev libxvidcore4-dev liba52-0.7.4 liba52-0.7.4-dev libx264-dev checkinstall build-essential subversion
2. Use subversion to check out the latest source code for FFMPEG
cdsvn checkout -r 8998 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
3. Configure and make FFMPEG
cd ffmpeg
./configure --enable-gpl --enable-pp --enable-libvorbis --enable-libogg --enable-liba52 --enable-dc1394 --enable-libgsm --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-xvid --enable-pthreads --enable-x264
make
4. Run checkinstall to configure and install FFMPEG. Make sure your settings arecomparable to the settings below. Please note that you will want to use your own
email address for the maintainer (this package will not be delivered externally).
checkinstall
Should I create a default set of package docs? [y]:This package will be built according to these values:
0 - Maintainer: [ [email protected] ]1 - Summary: [ Package created with checkinstall 1.6.1 ]2 - Name: [ ffmpeg ]3 - Version: [ 3:0.svn20080308 ]4 - Release: [ 1 ]5 - License: [ GPL ]6 - Group: [ checkinstall ]
7 - Architecture: [ i386 ]8 - Source location: [ ffmpeg ]9 - Alternate source location: [ ]10 - Requires: [ ]
ENTER to continue
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 34/46
Installing MythTV on Gutsy www.daviddn.com
Page 34 of 46
Installing Handbrake
1. Handbrake is a superb DVD ripper for Linux. To install it go to the Handbrakewebsite at http://handbrake.fr/ and download the Linux version to your user homedirectory. Now follow the steps below from a Terminal to install it:
tar -xzvf HandBrake-0.9.2_i386.tar.gzsudo cp HandBrakeCLI /usr/local/bin
2. Handbrake requires a relatively long command line to rip DVDs. I have thereforewritten a script to wrap Handbrake and make it easier to rip directly into MythVideo.The script, called /usr/local/bin/ripdvd, can be found in Appendix A of this guide.
Installing NFS
1. NFS will allow you to share the contents of your MythTV video and video-postersdirectories on your local network so that other MythTV Front-ends can access anduse the same media content across the network. To install NFS on the server followthe steps below. When you are asked whether to bind loopback you should say no.
sudo apt-get install nfs-kernel-server nfs-common portmapsudo dpkg-reconfigure portmapsudo /etc/init.d/portmap restart
2. To share the MythTV directory on the network you should do the following:
vi /etc/exports
{ADD}
/var/lib/mythtv *(ro,sync,no_subtree_check)
/etc/init.d/nfs-kernel-server restart
3. Now on the client machines (such as on your MythTV front-ends):
apt-get install portmap nfs-commonsudo vi /etc/fstab
{ADD}
192.168.2.100:/var/lib/mythtv /var/lib/mythtv nfs rw,hard,intr 0 0
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 35/46
Installing MythTV on Gutsy www.daviddn.com
Page 35 of 46
Installing PHPMyAdmin
1. PHPMyAdmin will allow you to configure and manage MythTV directly from thedatabase. To install PHPMyAdmin you will need to visit the PHPMyAdmin websiteat http://www.phpmyadmin.net/ and download the latest all-languages.zip file.
2. Place all-languages.zip into /var/www/ and run the following from a terminal:
cd /var/wwwunzip phpMyAdmin-*-all-languages.zipmv phpMyAdmin-*-all-languages phpmyadminrm phpMyAdmin-*-all-languages.zip
3. Change the PHPMyAdmin configuration file by adding the blowfish secret:
cd /var/www/phpmyadminmv config.sample.inc.php config.inc.php
vi config.inc.php
{CHANGE }
$cfg['blowfish_secret'] = 'hello';
4. You should now be able to log into PHPMyAdmin by entering your MythTV
database username and password into the site http://192.168.2.100/phpmyadmin
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 36/46
Installing MythTV on Gutsy www.daviddn.com
Page 36 of 46
Scripts for Encoding Recordings to iPhone/iTouch format
1. When recordings have finished I use a script to encode those recordings into MP4 andFLV format so that they can be played on my iPhone and on a networked computer.
If you also want this functionality then copy my mythencode.sh script from AppendixA of this document to /usr/local/bin/ and then set the permissions on it as follows:
chmod 755 /usr/local/bin/mythencode.sh
2. Create the directories required for the encoded media files:
mkdir –p /var/www/tv/flvmkdir –p /var/www/tv/iconsmkdir –p /var/www/tv/mp4
chown mythtv:mythtv /var/www/tv/flvchown mythtv:mythtv /var/www/tv/iconschown mythtv:mythtv /var/www/tv/mp4
chmod 775 /var/www/tv/flvchmod 775 /var/www/tv/iconschmod 775 /var/www/tv/mp4
3. Create soft links from the shared directory to the MP4 directory:
mkdir -p /shared/mediachown mythtv:mythtv /shared/mediachmod 775 /shared/media
ln –s /var/www/tv/mp4 /shared/media/tv
4. We now need to add mythencode.sh as a User Job in MythTV so that it runs bydefault after a recording finishes. The script will then encode that recording into MP4and FLV format and publish the files onto the shared drive and onto the web server.When adding a User Job to MythTV you can use any of the following variables:
Parameter Description
%DIR% The directory component of the recording's filename
%FILE% The filename component of the recording's filename
%TITLE% The title of the recording (e.g., name of the series)%SUBTITLE% The subtitle of the recording (e.g., name of the episode)
%DESCRIPTION% The description text for the recording (from guide data)
%HOSTNAME% The backend making the recording
%CATEGORY% The category of the recording (from guide data)
%RECGROUP% The recording group
%CHANID% The MythTV channel ID making the recording
%STARTTIME% The recording start time (YYYYMMDDhhmmss)
%ENDTIME% The recording end time (YYYYMMDDhhmmss)
%PROGSTART% The recording's start time (from guide data)
%PROGEND% The recording's end time (from guide data)
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 37/46
Installing MythTV on Gutsy www.daviddn.com
Page 37 of 46
5. Run MythTV-Backend and select General, then on the Job Queue (Host-specific)settings screen check the box that says Allow User #1 Jobs. Click ext two times andthen enter the following in the User Job #1 Description and Command boxes:
/usr/local/bin/mythencode.sh "%FILE%" "%TITLE%" "%STARTTIME%"
6. Go to MythWeb (http://192.168.2.100/mythweb/), then go to the Setting page andclick MythTV Settings Table. Now enter the following information into the table:
Setting Value
AutoCommercialFlag 0
AutoExpireDefault 1
AutoExpireExtraSpace 1
AutoExpireLiveTVMaxAge 1
AutoRunUserJob1 1
AutoTranscode 0
7. Now save your settings and close MythWeb.
8. The standard MythTV recordings will auto-delete themselves when disk space isrequired, however the MP4 and FLV encoded versions will not. Therefore you willneed to use a script to delete old media to ensure that these files don’t fill up your filesystem. The mythclean script in Appendix A is written by me for this purpose. Copy
it over to /usr/local/bin/ and then use the cron to schedule it to run every 24 hours.
chmod 755 /usr/local/bin/mythclean
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 38/46
Installing MythTV on Gutsy www.daviddn.com
Page 38 of 46
APPENDIX A – Configuration Files
This appendix contains configuration and script files for key components referencedthroughout the main MythTV Installation guide. The filename for each configurationfile is shown above each listing. To install these configuration files and scripts simply
copy the contents of the listing into the filename specified.
/usr/local/bin/mythencode.sh
This script is called by MythTV User Job 1 after it completes recording a television program. It will encode the recording into MP4 and FLV format, and place those
resulting media files onto the network file server and onto the web server.
#!/bin/bash
####################################################################################### Encode MythTV Recording for iPod and FLV for Streaming
## author: David de Niese## /usr/local/bin/mythencode.sh "%DIR%/%FILE%" "%TITLE%" "%STARTTIME%"######################################################################################
# Grab File Title and Start Time
file=$1;title=$2;starttime=$3;
# Grab Log Reference
LOG=/tmp/mythencode.log
# Inform Log
echo `date` - INF - Starting Encoding Job >> $LOG
# Check Parameters
if [ "$title" == "" ]then
echo `date` - ERR - Script called incorrectly - No Title >> $LOGexit 1
fi
if [ "$file" == "" ]then
echo `date` - ERR - Script called incorrectly - No Filename >> $LOGexit 1
fi
if [ "$starttime" == "" ]then
echo `date` - ERR - Script called incorrectly - No Start Time >> $LOGexit 1
fi
# Check File Exists
if [ ! -r $file ]then
echo `date` - ERR - Failed to read source file $file >> $LOGexit 1;
fi
# Inform Log
echo `date` - INF - Encoding $file >> $LOGecho `date` - INF - Title is $title >> $LOG
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 39/46
Installing MythTV on Gutsy www.daviddn.com
Page 39 of 46
# Calculate MP4 Destination Filename
tmpmp4target=/tmp/mythenc.`basename $file`.mp4tmpflvtarget=/tmp/mythenc.`basename $file`.flv
mp4lantarget=$(echo "/var/www/tv/mp4/$starttime - $title.mp4" | tr "? " _ )flvlantarget=$(echo "/var/www/tv/flv/$starttime - $title.flv" | tr "? " _ )
# Check Destination isnt already there
if [ -r $tmpmp4target ]
then
rm -f $tmpmp4target
if [ $? -ne 0 ]then
echo `date` - ERR - Could not delete file $tmpmp4target >> $LOGexit 1
fi
fi
if [ -r $tmpflvtarget ]then
rm -f $tmpflvtarget
if [ $? -ne 0 ]then
echo `date` - ERR - Could not delete file $tmpflvtarget >> $LOGexit 1
fi
fi
# Inform Log and Start MP4 Encoding
echo `date` - INF - Performing MP4 Encoding >> $LOG
ffmpeg -y -async 12 -i "$file" -ac 2 -ar 22050 -ab 128k -s 320x240 -vcodec mpeg4 -b 120k-flags +aic+mv4+trell -mbd 2 -cmp 2 -subcmp 2 -g 250 -maxrate 512k -bufsize 2M -title "$title""$tmpmp4target" 2> /tmp/mythencode.ffmpeg.log
if [ $? -ne 0 ]then
# Inform on Error
echo `date` - ERR - Failed MP4 Encoding >> $LOGcat /tmp/mythencode.ffmpeg.log >> $LOG
if [ -f "$tmpmp4target" ]then
rm -f "$tmpmp4target"
fi
else
# Move File Successfully
mv -f $tmpmp4target $mp4lantargetchmod 664 $mp4lantargetchown mythtv:www-data $mp4lantargetecho `date` - INF - Performing MP4 Encoding Complete >> $LOG
# Create Thumbnail
thumbfile=`basename $mp4lantarget | cut -d . -f 1`echo `date` - INF - Creating Thumbnail $thumbfile.jpg >> $LOGgnome-video-thumbnailer -s 100 "$mp4lantarget" "/var/www/tv/icons/$thumbfile.png"echo `date` - INF - Creating Thumbnail Complete >> $LOG
fi
# Inform Log and Start FLV Encoding
echo `date` - INF - Performing FLV Encoding >> $LOG
ffmpeg -y -async 12 -i $file -ac 2 -r 20 -s 320x240 -deinterlace -ar 22050 -aspect 4:3 -b 100k$tmpflvtarget 2> /tmp/mythencode.ffmpeg.log
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 40/46
Installing MythTV on Gutsy www.daviddn.com
Page 40 of 46
if [ $? -ne 0 ]then
# Inform on Error
echo `date` - ERR - Could not Encode to FLV >> $LOGcat /tmp/mythencode.ffmpeg.log >> $LOG
# Delete File
if [ -f "$tmpflvtarget" ]
then
rm -f "$tmpflvtarget"
fi
else
# Move File Successfully
mv -f $tmpflvtarget $flvlantargetchmod 664 $flvlantargetchown mythtv:www-data $flvlantargetecho `date` - INF - Performing FLV Encoding Complete >> $LOG
fi
/usr/local/bin/mythclean.sh
This script is called daily by cron and will delete the files created by mythencode (see
above) after they become more than 7 days old. The FLV and MP4 files are encodedversions of the original recordings, and the PNG files are the video thumbnails.
#!/bin/bash
####################################################################################### Clean MythTV Recordings for iPod and FLV## author: David de Niese
######################################################################################
# Set Correct Ownership on Media Files and Delete those over 7 days old
chown mythtv:www-data /var/www/tv/flv/*.flv 2> /dev/nullchmod 664 /var/www/tv/flv/*.flv 2> /dev/nullfind /var/www/tv/flv/*.flv -type f -mtime +7 -exec rm {} \; 2> /dev/null
chown david:www-data /var/www/tv/mp4/*.mp4 2> /dev/nullchmod 664 /var/www/tv/mp4/*.mp4 2> /dev/nullfind /var/www/tv/mp4/*.mp4 -type f -mtime +7 -exec rm {} \; 2> /dev/null
chown david:www-data /var/www/tv/icons/*.png 2> /dev/nullchmod 664 /var/www/tv/icons/*.png 2> /dev/nullfind /var/www/tv/icons/*.png -type f -mtime +7 -exec rm {} \; 2> /dev/null
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 41/46
Installing MythTV on Gutsy www.daviddn.com
Page 41 of 46
/usr/local/bin/ripdvd
This script is used to wrap the functionality of Handbrake. It can be called from thecommand line and will rip the DVD mounted from the DVD drive into MP4 formatand place it into the MythVideo directory (ready for it to be used by MythTV). If youcall this script with the parameter scan it will list the DVD titles available for ripping.
Otherwise you can call this script with the numeric title that you wish to rip.
/usr/local/bin/ripdvd scan # Will list the titles available/usr/local/bin/ripdvd 2 # Will rip title 2 from the DVD
#!/bin/bash
####################################################################################### Rip DVD## author: David de Niese#
#####################################################################################
# Check for Scan Parameter
HB=/usr/local/bin/HandBrakeCLI
if [ "$1" == "scan" ]then
$HB -i /media/cdrom -t 0exit
fi
TITLE = 0
if [ "$1" != "" ]then
echo $1 | grep -q [^[:digit:]]
if [ $? -eq 1 ]then
if [ $1 -lt 10 ]then
if [ $1 -gt 0 ]then
TITLE=$1echo Setting Title as $1
fi
fi
fi
fi
# Grab File Title
echo Enter name of Movie:read moviename
# Check Parameters
if [ "$moviename" == "" ]then
echo `date` - ERR - Invalid Movie Nameexit 1
fi
moviename=$(echo "$moviename" | tr ' ' _)outputfile=/var/lib/mythtv/videos/$moviename.mp4echo $outputfile
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 42/46
Installing MythTV on Gutsy www.daviddn.com
Page 42 of 46
# Check if it Exists
if [ -r $outputfile ]then
echo `date` - ERR - Output file already existsexit 1
fi
# Encode into MP4 Format
if [ $TITLE -ne 0 ]then
$HB -t $TITLE -i /media/cdrom -o $outputfile --preset "iPhone"
else
$HB -i /media/cdrom -o $outputfile --preset "iPhone"
fi
# Encode Down to MPG at 1Mbps
ffmpeg -y -i "$outputfile" -b 1000k "/var/lib/mythtv/videos/$moviename.mpg"
if [ $? –ne 0 ]then
# Remove Original MP4
rm –f "$outputfile”
fi
/etc/lirc/hardware.conf
This configuration file tells LIRC which device the Remote Control is using.
LIRCD_ARGS=""START_LIRCMD=falseLOAD_MODULES=trueDRIVER="dev/input"DEVICE="/dev/input/event4"MODULES=""LIRCD_CONF=""LIRCMD_CONF=""
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 43/46
Installing MythTV on Gutsy www.daviddn.com
Page 43 of 46
/etc/lirc/lircd.conf
This configuration file maps the data values coming from the Hauppauge WinTVDVB T-500 remote control to button names that can be used with LIRC.
begin remote
name hauppauge_nova_t_ukbits 16eps 30aeps 100
one 0 0zero 0 0pre_data_bits 16pre_data 0x8001gap 135803toggle_bit 0
begin codesGo 0x0162Power 0x0074TV 0x0179
Videos 0x0189Music 0x0188Pictures 0x00E2Guide 0x016DRadio 0x0181ArrowUp 0x0067ArrowLeft 0x0069OK 0x0160ArrowRight 0x006AArrowDown 0x006CBackExit 0x009EMenu 0x008BVolumeUp 0x0073VolumeDown 0x0072PrevCh 0x016BMute 0x0071ChannelUp 0x0192ChannelDown 0x0193Record 0x00A7
Rewind 0x00A8SkipBack 0x0195Play 0x00CFPause 0x0077Stop 0x0080Fwdwind 0x00D0SkipFwd 0x01971 0x00022 0x00033 0x00044 0x00055 0x00066 0x00077 0x00088 0x00099 0x000AStar 0x00370 0x000B# 0x0029
Red 0x018EGreen 0x018FYellow 0x0190Blue 0x0191
end codes
end remote
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 44/46
Installing MythTV on Gutsy www.daviddn.com
Page 44 of 46
/home/mythtv/.lircrc
This configuration file converts the buttons from the remote to commands in MythTV
beginprog = mythtvbutton = Go
config = ALT+Hend
beginprog = mythtvbutton = TVconfig = ALT+T
end
beginprog = mythtvbutton = Videosconfig = ALT+V
end
beginprog = mythtvbutton = Guideconfig = s
end
begin
prog = mythtvbutton = ArrowUprepeat = 3config = Up
end
beginprog = mythtvbutton = ArrowLeftrepeat = 3config = Left
end
beginprog = mythtvbutton = ArrowRightrepeat = 3config = Right
end
beginprog = mythtvbutton = ArrowDownrepeat = 3config = Down
end
beginprog = mythtvbutton = 1config = 1
end
beginprog = mythtvbutton = 2config = 2
end
beginprog = mythtvbutton = 3
config = 3end
beginprog = mythtvbutton = 4config = 4
end
beginprog = mythtvbutton = 5config = 5
end
beginprog = mythtvbutton = 6config = 6
end
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 45/46
Installing MythTV on Gutsy www.daviddn.com
Page 45 of 46
beginprog = mythtvbutton = 7config = 7
end
beginprog = mythtvbutton = 8config = 8
end
beginprog = mythtvbutton = 9config = 9
end
beginprog = mythtvbutton = BackExitconfig = Esc
end
beginprog = mythtvbutton = 0config = 0
end
beginprog = mythtvbutton = VolumeUprepeat = 3config = F11
end
beginprog = mythtvbutton = VolumeDownrepeat = 3config = F10
end
beginprog = mythtvbutton = OKconfig = Return
end
beginprog = mythtvbutton = Muteconfig = F9
end
beginprog = mythtvbutton = ChannelUpconfig = Up
end
beginprog = mythtvbutton = ChannelDownconfig = Down
end
beginprog = mythtvbutton = Recordconfig = R
end
beginprog = mythtv
button = Rewindconfig = Leftend
beginprog = mythtvbutton = SkipBackconfig = PgUp
end
beginprog = mythtvbutton = Playconfig = P
end
8/14/2019 Installing MythTV 0.20 on Ubuntu Gutsy 7.10
http://slidepdf.com/reader/full/installing-mythtv-020-on-ubuntu-gutsy-710 46/46
Installing MythTV on Gutsy www.daviddn.com
beginprog = mythtvbutton = Pauseconfig = P
end
beginprog = mythtvbutton = Stopconfig = Esc
end
beginprog = mythtvbutton = Fwdwindconfig = Right
end
beginprog = mythtvbutton = SkipFwdconfig = PgDown
end