MythTV, UPnP, and CentOS 6

MythTV is certainly one of the outstanding open source projects available. From MythTV.org:

MythTV is a Free Open Source software digital video recorder (DVR) project distributed under the terms of the GNU GPL. It has been under heavy development since 2002, and now contains most features one would expect from a good DVR (and many new ones that you soon won’t be able to live without).

It is a little tricky to get going, but once you do, you will have both a fantastic and heartbreaking experience with Linux and multimedia. In this space, you will learn why free and open source software is so important, along with what barriers have been put in place to inhibit it.

One exciting aspect about MythTV is its UPnP functionality. I have a Bluray player that understands this protocol, so out of the box, it had instant access to my 0.21 version of MythTV content. This is why open standards are nice!

CentOS 6 ships with QT 4.6.2, but without QtWebKit. A quick search reveals that you can install it via the Extra Packages for Enterprise Linux (or EPEL) repo from Fedora. I tend to shy away from installing random packages from random people, so the first step will be to compile a different version of QT. I started with 4.7.4 from Nokia’s FTP server. The options are pretty simple for the configure script:

sh ./configure                                                          
                --prefix=${PREFIX}                                      
                --libdir=${PREFIX}/lib64

gmake clean
gmake install

Your choice of ${PREFIX} is up to you. Now QT 4.7.4 is installed in ${PREFIX}, with the libraries in ${PREFIX}/lib64. After extracting the MythTV source file, I made the following addition to the settings.pro file:

147a148,149
> EXTRALIBS += -L${PREFIX}/lib64
> 
156a159
> 

I fed the following options to the configure script:


PATH=${PREFIX}/bin:$PATH
export PATH

sh ./configure                                                          
                --prefix=${PREFIX}                                      
                --libdir-name=lib64                                     
                --extra-cflags="$CPPFLAGS"                              
                --extra-cxxflags="$CPPFLAGS"                            
                --extra-ldflags="$LDFLAGS"                              
                --enable-libgsm                                         
                --enable-libmp3lame                                     
                --enable-libvorbis                                      
                --enable-libtheora                                      

Notice I have enabled Ogg Vorbis, Theora, and GSM. These libraries are required if you want to be able to play those media types. The libraries are stuffed in the -L${PREFIX}/lib64 area mentioned above.

After extracting the plugins source file, I made the following addition to the settings.pro file:

63,65c63
< EXTRALIBS += -L${PREFIX}/lib64
< 
< EXTRA_LIBS += -lfreetype -lmp3lame $$EXTRALIBS
---
> EXTRA_LIBS += -lfreetype -lmp3lame

To build and install the plugins, I ran the above configure script without the –enable lines. After the build is complete, all I have to do is add ${PREFIX}/bin to my PATH, along with ${PREFIX}/lib64 to my LD_LIBRARY_PATH. I normally set the runtime library search path to point to ${PREFIX}/lib64 so LD_LIBRARY_PATH is not needed, but somewhere the LDFLAGS variable gets lost in the qmake build.

After upgrading my 0.21 MythTV MySQL database to the 0.24 MythTV Schema (and thus starting the backend), the mythfrontend can now invoke:

MythTV 0.24.1 Initial Screen

MythTV is one of the many successes of Open Source software!

Comments are closed.