Configurando o MediaTomb no Ubuntu Server 12.04

  • Post author:
  • Post category:Geral

O MediaTomb é um ótimo servidor de media UPNP. Ele é compatível com diversos dispositivos e é um ótimo servidor de mídia caso queira usar em conjunto com sua Smart TV ou PS3.

Veja abaixo como configurar o MediaTomb no Ubuntu Server 12.04

Conteúdo em inglês
MediaTomb UPnP Media Server
“MediaTomb is an open source (GPL) UPnP MediaServer with a nice web user interface, it allows you to stream your digital media through your home network and listen to/watch it on a variety of UPnP compatible devices.”


Installation Instructions
If you are using Ubuntu 8.04 (Hardy Heron) or later, install the ”mediatomb” package from the Universe repository using the previous link or your preferred package manager (e.g. Synaptic Package Manager, apt-get, etc.). If you are using an earlier version of Ubuntu, you should follow the instructions on the MediaTomb website to add the MediaTomb repository to your software sources.

Depending on the UPnP client you will be using to play media from your MediaTomb UPnP server, you may need to edit the MediaTomb configuration file. The following terminal command will open the configuration file for editing on Ubuntu, Kubuntu, or Xubuntu.

sudo nano /etc/mediatomb/config.xml
Alternatively, you can use a GUI text editor.

Ubuntu (gedit)
gksudo gedit /etc/mediatomb/config.xml
Kubuntu (kate)
kdesudo kate /etc/mediatomb/config.xml
Xubuntu (mousepad)
gksudo mousepad /etc/mediatomb/config.xml
To uncomment XML code, remove the “” from before and after the commented text. The following code is shown as it would appear after the necessary edits.

Enabling Web Interface
MediaTomb provides a web interface to help with configuration. To enable:
With any changes to the configuration file, the MediaTomb service will need to be restarted for them to take effect.

Allowing Accounts
As of version 0.12.1 to be able to ‘Login’, it appears like having accounts enabled now is mandatory. To do this change:
to yes. Here you can change the password too. However since MediaTomb only runs on a local network you may want to consider whether privacy is an issue. Default login/password is: mediatomb/mediatomb.

Playstation 3 (PS3) Compatibility



D-Link Media Player Compatibility


ZyXEL DMA-1000 Compatibility


Getting Started With MediaTomb Running MediaTomb as a Service MediaTomb will by default run as a service at boot. You can start and stop the service manually from the terminal using the following commands:

Stop the MediaTomb service

sudo service mediatomb stop
Start the MediaTomb service

sudo service mediatomb start
Restart the MediaTomb service

sudo service mediatomb restart
Running MediaTomb Manually
You may run MediaTomb manually, but you must first remove the service using the following terminal commands.

sudo mv /etc/init.d/mediatomb /etc/init.d/mediatomb.backup
sudo update-rc.d mediatomb remove
Once the service is removed, you may run MediaTomb using the following command in the terminal.

Defining MediaTomb Shared Media
MediaTomb uses a web-based interface for setting your shared media directories. By default MediaTomb will select a free port starting with 49152, however you can specify a port of your choice in the configuration file. You may access the interface by directing your web browser to the URL “http://localhost:49152” (or the port currently in use by MediaTomb if you have changed the port in the configuration file, or 49152 was already in use by another application). Installing MediaTomb through the Ubuntu repositories will add a launcher in the Applications menu that will open the MediaTomb web interface in your browser.

Sharing Media

To share media files, first open the MediaTomb web interface. In the left column, select “Filesystem”, and navigate to the directory containing the media you want to share. Your media files will be shown on the right. Click the plus sign (“+”) to the right of the media file or directory to share the directory using the default settings, or the plus sign surrounded by the circular arrows to set advanced sharing options.

Editing or Removing Shared Media

You can view your shared media by selecting “Database” in the left column.

To edit or remove media, select “PC Directory” and navigate to the directory containing the media files you want to edit or remove. Click the X to the right of the file or directory to remove it from MediaTomb’s media database. Click the edit icon to the right of a media file to edit the description or mime type used when sharing the media. Click the plus sign surrounded by circular arrows to the right of a directory to change the advanced sharing options.

MediaTomb supports on-the-fly transcoding using external encoders such as ffmpeg and mencoder. Complete documentation on transcoding with MediaTomb can be found at the MediaTomb website.

Modelo de arquivo de configuração config.xml

<?xml version=”1.0″ encoding=”UTF-8″?>
<config version=”2″ xmlns=”″ xmlns:xsi=”” xsi:schemaLocation=””>
<ui enabled=”yes” show-tooltips=”yes”>
<accounts enabled=”no” session-timeout=”30″>
<account user=”mediatomb” password=”mediatomb”/>
<storage caching=”yes”>
<sqlite3 enabled=”yes”>
<mysql enabled=”no”>
<protocolInfo extend=”yes”/>
<ffmpegthumbnailer enabled=”no”>
<mark-played-items enabled=”no” suppress-cds-updates=”yes”>
<string mode=”prepend”>*</string>
<import hidden-files=”no”>
<scripting script-charset=”UTF-8″>
<virtual-layout type=”builtin”>
<extension-mimetype ignore-unknown=”no”>
<map from=”mp3″ to=”audio/mpeg”/>
<map from=”wmv” to=”video/transcode”/>
<map from=”flv” to=”video/transcode”/>
<map from=”mkv” to=”video/transcode”/>
<map from=”rm”  to=”video/transcode”/>
<map from=”iso” to=”video/transcode”/>
<map from=”ogm” to=”video/transcode”/>
<map from=”mp4″ to=”video/transcode”/>
<map from=”avi” to=”video/transcode”/>
<map from=”audio/*” to=”object.item.audioItem.musicTrack”/>
<map from=”video/*” to=”object.item.videoItem”/>
<map from=”image/*” to=”object.item.imageItem”/>
<treat mimetype=”audio/mpeg” as=”mp3″/>
<treat mimetype=”video/transcode” as=”mpg”/>
<YouTube enabled=”yes” format=”mp4″ hd=”no” refresh=”28800″ update-at-start=”yes” purge-after=”604800″ racy-content=”exclude”>
<uploads user=”MuppetsStudio”/>
<favorites user=”MyOwnYTUser”/>
<transcoding enabled=”yes”>
<transcode mimetype=”video/transcode” using=”multifunctional”/>
<profile name=”multifunctional” enabled=”yes” type=”external”>
<agent command=”/usr/local/bin/” arguments=”%in %out”/>
<buffer size=”102400″ chunk-size=”51200″ fill-size=”20480″/>

Mais informações a respeito do MediaTomb