Home > Computer Hardware, Linux, Networking > Installing MediaTomb on Ubuntu Server 10.04 to stream to DirecTV

Installing MediaTomb on Ubuntu Server 10.04 to stream to DirecTV

So I’ve wanted to build a media machine for quite some time now but just haven’t had the resources to build the one that I really want.  I tried XBMC on the hardware that I have laying around the house but it just couldn’t run well at all.  I think XBMC uses way more video resources than I have on any of my extra PCs.

After much trial and error, I’ve finally settled on installing MediaTomb on an old P4, 1.6GHz computer with 786M of RAM, running Ubuntu Server 10.04 because it’s extremely lightweight while still being remotely accessible.  I’ll be using MediaTomb to stream audio and video to my DirecTV HR22 satellite receiver but you can use it to stream to many different devices.  Just check out MediaTomb’s device list for more information.

OK, let’s get started with our installation.

1.  Download Ubuntu Server. Of course, burn it to CD or DVD with your favorite burner or put it on a USB stick.  I like to use uNetBootin to build my USB sticks but, as an FYI, I’ve found that some computers are very picky about what type of USB stick they’ll boot from (no idea why, yet).

2.  Install Ubuntu Server

a.  When it asks for a name during the installation, make sure to give it something that will easily identify it as your media server, especially if you have quite a few computers on your network.  You might find it easily now but, in my experience, if it’s not easy to find when you install five more computers next year, then you didn’t name it well.

b.  When it asks is you would like to install any software, install only OpenSSH Server.  This will allow you to remotely log into it later, especially if this computer will set somewhere that it won’t be connected to a keyboard and monitor.

3.  Post Ubuntu Server installation cleanup. Now that you have a working Ubuntu server, verified by logging in after the post-installation reboot, let’s do some cleanup before installing MediaTomb.

a.  First, let’s secure your ssh service.  If you’re familiar with SSH, then go ahead and set in place whatever security measures you’re comfortable with but, if you’re not familiar with ssh, then please, at the very least, add AllowUsers yourusername to the end of /etc/ssh/sshd_config.  Of yourse, replace yourusername with the actual username that you created when you installed Ubuntu server.

b.  Next, let’s go ahead and update your Ubuntu server with the most recent software updates.  To do that, enter sudo apt-get update at the prompt and the package manager will pull down the list of most recent updates of available software from the repository.

c.  After that’s complete, enter sudo apt-get upgrade to actually install the updates.  This will probably take a few minutes since the software on the CDs is usually older than what’s currently available.

d.  After that’s complete, reboot the system with a sudo shutdown -r now.

4.  Install MediaTomb

a.  At the command prompt, enter sudo apt-get install mediatomb vlc imagemagick vsftpd ffmpeg.  You may find many directions on the internet that have you doing all types of downloading and compiling but, with the most recent versions of Ubuntu, the repositories carry all of the needed dependencies for MediaTomb to install from this simple command line.  You probably noticed that we’re installing VLC and ImageMagick, too, right?  That’s because VLC does the on-the-fly transcoding as MediaTomb is streaming the video to your device and ImageMagick rescales your photos for viewing.

5.  Configure MediaTomb

a.  I’ll assume at this point that you’ll want to run this as a headless system so MediaTomb will start on its own after any reboots.  To do that, you’ll need to edit the config.xml file in /etc/mediatomb, of course, making a copy of the original first, in case anything happens.

b.  There are many areas that can be changed in the config.xml file to adapt MediaTomb to your needs.  I’m not going to post them all here but I will provide a link to the Wiki that contains the most popular edits – http://mediatomb.cc/dokuwiki/transcoding:transcoding.  Personally, the only thing that I changed for use with my DirecTV box was my  MediaTomb server <name>.

c.  Restart MediaTomb, after making your config.xml changes, with sudo service mediatomb restart.

d.  Make sure it all works by going to http://localhost:49152 in your browser.  If that doesn’t work, take a look at the MediaTomb log file at /var/log/mediatomb.log and verifiy that 49152 is the correct port for your current session.

6.  Add your folders to MediaTomb

This may, or may not, be necessary depending on your configuration.  I found that many of my media files were automagically found.  However, it didn’t scan the second drive, so using the browser, I told MediaTomb to scan that drive automatically, twice a day, for new media.

And, voila!  You now have your very own media server to serve up music, photos and movies to your hearts content!

About these ads
  1. mrahk
    July 6, 2011 at 8:46 AM

    You said: sudo apt-get install mediatomb vlc imagemagick vsftpd ffmpeg
    Can you elaborate on that? I’ve a mediatomb install on my headless server too, but I don’t know how to use it without doing several complicated things.
    I never thought about installing imagemagick and ffmpeg b.t.w.

    • July 6, 2011 at 5:57 PM

      Actually, I should probably change those directions now because I no longer use ffmpeg. At the time, I was using VLC to stream some media (avis) and ffmpeg to stream other media (mpegs). I’ve since found that, if I send the correct VLC stream commands, it actually streams better across my old “G” network. ffmpeg just seemed to be too much of a hog for my small server.

      As far as imagemagick goes, I use it’s “convert” command to rescale my jpeg photos.

      And, of course, I use vsftpd as a lightweight ftp server to make file transfer a little easier for me.

      Hope this helps,
      Kevin

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: