Buddhika Siddhisena is the Co-Founder&CTO of THINKCube Systems which specializes in Collaboration Technologies for the Enterprise by integrating widely used and proven FOSS Technologies. Buddhika Siddhisena obtained his B.Sc (Physical Science) from University of Colombo and is also a Member of the British Computer Society (MBCS). Buddhika has also been involved through theinception of several leading FOSS projects, such as Sahana Disaster Management System and Tarprobane GNU/Linux Distribution. He is an active member of the Lanka Linux User Group, Sri Lankan FOSS Community and does a weekly podcast about FOSS in Sinhala over at sinhalenfoss.org.
 

Setting up a media server the Free & Open Source way

06/29/2009 6:34 am By Buddhika Siddhisena | Articles: 4

If your like me, you got tons of CDs and DVDs containing music, movies, photos and other types of weird media lying around the house. And yet finding that classic movie or vacation photo from among the pile of discs can be a painstaking task. These are times you'd wish if all of your media could be in one large hard drive in an easily accessible in a matter of seconds.

 

Unsurprisingly this is why, more and more people are turning to hard drives as a means of storing their digital media content but that method isn't without its own problems. Today one of the most difficult problem users face with large hard drives is finding misplaced files. Even if you were somewhat organized in the way you create your directory structure, it is easy to loose track of files when your talking about hundreds or thousands of files. To that extent, the hard drive is no better than your home, especially if your the disorganized type.

 

Part of the solution is to setup a good media management software, that understands the content and has built in features to organize media. This type of solution works great on a single computer but what if your like me, with multiple computers, laptops and other media devices then a network based solution is needed. I wanted a solution which enabled me to access my media library while working on my desktop or laptop as well as well as from the comfort of my couch on the TV. Therefore I needed something more than a media player, I need a media server.

 

A media server is a piece of software you run to export media files on to the network. This is different to other more generic file sharing servers such as FTP, HTTP (web) or Windows File sharing (Samba) in that a media server will only export media content and will provide meta data such as the media codec, resolution, album art and preview thumbnail, which a typical file server will not.

 

These days Media servers tend to support open standard protocols for sharing content and UPnP (Universal Plug and Play) is one such popular protocol. With UPnP, a machine running a special client known as a media extender is able to auto discover shared media resources and pull content on demand. UPnP is supported on an array of devices ranging from TVs, game consoles such as the PS3, Xbox 360 and even in some mobile phones. If you don't have such a device, don't despair as we will show you how you can easily setup a software based media extender.

 

The software we'll be using to create a media setup are as follows:

  • Ubuntu Linux (latest version at the time 9.04)
  • MediaTomb
  • XBMC

 

The fist step is to pick out a machine you will use as the media server. Depending on the size of your media library, the main thing you should be concerned in picking the server hardware is how much disk space it should have. Other than that, any machine that could run Ubuntu (or any other Linux distro for that matter) reasonably well and has a 100MBps network card should be sufficient. There is no need for dedicated hardware either and you might as well use the media server as a desktop computer if that is what you fancy.

 

Next, you would need to download and install Ubuntu Linux on the media server hardware. Generally this is as easy as booting off of the Live CD and double-clicking on the install icon but if you have any difficulty then remember that google is your friend.

 

Once installed, login on to the Ubuntu server, and enable the universe and multiverse repositories via the package sources application.

 

Next launch the package manager and search for packages called mediatomb, ubuntu-restricted-extras, and vlc and install it or if you prefer the commandline (good for you), type the following

 

$ sudo apt-get install mediatomb ubuntu-restricted-extras vlc

 

This should install mediatomb, the server software responsible for sharing media content over UPnP. Before you can use mediatomb, you may  need to make a few configuration changes. Go to the commandline and type the following to edit the mediatomb configuration file :

 

$ sudo gedit /etc/mediatomb/config.xml

 

If you have a special device you plan on using as the media extender then you will want to pay attention to comments that will tell you to enable certain settings by uncommenting lines. For instance, if you plan on using a PS3 to play video you will need to look for an entry called :

 

<protocolInfo extend=”yes”/><!– For PS3 support change to “yes” –>

<!– Uncomment the line below for PS3 divx support –>

<map from=”avi” to=”video/divx”/>

 

If you also need to convert between file formats or resolutions to match the capabilities supported by the media extender device, you will need to turn on transcoding by editing the following:

 

<transcoding enabled=”yes”>

<profile name=”vlcmpeg” enabled=”yes” type=”external”>

 

This basically says you want to enable transcoding and use vlc software as the utility tool to accomplish it.

 

Once your done configuring mediatomb, you will need to restart the service by going to the commandline and typing :

 

$ sudo /etc/init.d/mediatomb restart

 

This command will restart the service manually and will not need to be typed next time the computer restarts.

 

Once restarted, you should be able to access the web interface of mediatomb by visiting http://server.ip.address:49152

 

 

There are two modes of operation but I find the “Filesystem” mode to be the easiest when selecting from existing directories. Click on Filesystems and browse and find your media directories using the directory tree. I tend to use separate directories called Music, Videos and Pictures in my home directory to organize my media content and so I just browsed to those locations and clicked on the + with the circle icon to add and specify how I want those directories monitored. Among the available methods inotify is recommended as it is directly supported by the Linux kernel to monitor file changes.

 

If you have a media extender supporting UPnP, your media should now start to appear on the media extender's interface. This may require a search for UPnP devices.

 

Below is a screenshot of the media showing up on my PS3. Notice the MT logo which represents the MediaTomb server.

 

As mentioned above, if you do not have a UPnP supported device, it is easy to build one. All you need is another computer that you can hook up to a TV or VGA monitor. In my case, it was trivial thanks to the VGA input port found on the TV, but if you don't have one and only have composite or S-Video then you will need to add some sort of VGA to composite convertor box. On the other hand if you've got the High definition HDMI port then you will need a VGA card that supports HDMI on the computer you want to hook up to the TV.

 

Once hardware has been sorted out you can install Ubuntu or Windows as the underlying OS and then install the wonderful XMBC software to act as the media extender client. Head on on over to http://xbmc.org for more information on downloading and setting up for your OS of choice.

 

Once setup, you need to run the xbmc client and "Enable UPnP Client" from the network section under settings in XBMC GUI. Then you can use the “Add Source” link to add a network source shared over UPnP.

 

 

With the combination of mediatomb and xbmc, both freely available and Free/Open Source, you can easily pimp your living room experience and impress your friends the next time they come over to your place.

Share/Save
No votes yet

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.