Configurando o MediaTomb no Ubuntu Server 12.04


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
Introduction
“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.”

Website: http://mediatomb.cc/

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.

Setup
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

 

redsonic.com
105

 

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.

mediatomb
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.

Transcoding
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=”http://mediatomb.cc/config/2″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://mediatomb.cc/config/2 http://mediatomb.cc/config/2.xsd”>
  <server>
<interface>eth0</interface>
<port>50000</port>
<ui enabled=”yes” show-tooltips=”yes”>
<accounts enabled=”no” session-timeout=”30″>
<account user=”mediatomb” password=”mediatomb”/>
</accounts>
</ui>
<name>MediaTomb</name>
<udn>uuid:05fb1733-b4bb-449f-9995-xxxx220dxxxx</udn>
<home>/etc/mediatomb</home>
<webroot>/usr/share/mediatomb/web</webroot>
<storage caching=”yes”>
<sqlite3 enabled=”yes”>
<database-file>mediatomb.db</database-file>
</sqlite3>
<mysql enabled=”no”>
<host>localhost</host>
<username>mediatomb</username>
<database>mediatomb</database>
</mysql>
</storage>
<protocolInfo extend=”yes”/>
<extended-runtime-options>
<ffmpegthumbnailer enabled=”no”>
<thumbnail-size>128</thumbnail-size>
<seek-percentage>5</seek-percentage>
<filmstrip-overlay>yes</filmstrip-overlay>
<workaround-bugs>no</workaround-bugs>
</ffmpegthumbnailer>
<mark-played-items enabled=”no” suppress-cds-updates=”yes”>
<string mode=”prepend”>*</string>
</mark-played-items>
</extended-runtime-options>
</server>
<import hidden-files=”no”>
<filesystem-charset>UTF-8</filesystem-charset>
<metadata-charset>ISO-8859-15</metadata-charset>
<scripting script-charset=”UTF-8″>
<common-script>/usr/share/mediatomb/js/common.js</common-script>
<playlist-script>/usr/share/mediatomb/js/playlists.js</playlist-script>
<virtual-layout type=”builtin”>
<import-script>/usr/share/mediatomb/js/import.js</import-script>
<dvd-script>/usr/share/mediatomb/js/import-dvd.js</dvd-script>
</virtual-layout>
</scripting>
<mappings>
<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”/>
</extension-mimetype>
<mimetype-upnpclass>
<map from=”audio/*” to=”object.item.audioItem.musicTrack”/>
<map from=”video/*” to=”object.item.videoItem”/>
<map from=”image/*” to=”object.item.imageItem”/>
</mimetype-upnpclass>
<mimetype-contenttype>
<treat mimetype=”audio/mpeg” as=”mp3″/>
<treat mimetype=”video/transcode” as=”mpg”/>
</mimetype-contenttype>
</mappings>
<online-content>
<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”/>
</YouTube>
</online-content>
</import>
<transcoding enabled=”yes”>
<mimetype-profile-mappings>
<transcode mimetype=”video/transcode” using=”multifunctional”/>
</mimetype-profile-mappings>
<profiles>
<profile name=”multifunctional” enabled=”yes” type=”external”>
<mimetype>video/mpeg</mimetype>
<first-resource>yes</first-resource>
<agent command=”/usr/local/bin/mediatomb-multifunctional.sh” arguments=”%in %out”/>
<buffer size=”102400″ chunk-size=”51200″ fill-size=”20480″/>
</profile>
</profiles>
</transcoding>
</config>

Mais informações a respeito do MediaTomb
https://help.ubuntu.com/community/MediaTomb

https://vanalboom.org/node/14

About the author

By Jaccon

Arquivos

Andre Jaccon Logo