From Lyceum
Jump to: navigation, search

Configuring MediaTomb

Here are some links on configuring Mediatomb:

For Mediatomb streaming to PS3 and transcoding edits to config.xml: http://forums.fedoraforum.org/showthread.php?p=924980 and http://forums.fedoraforum.org/showthread.php?t=175744 and http://www.linuxconfig.org/linux-mediatomb-installation-and-setup-for-ps3

And the Gentoo Wiki page here

Other transcoding links:

http://mediatomb.cc/pages/transcoding

http://ubuntuforums.org/showthread.php?t=830268&page=2

Other links:

http://mediatomb.cc/pages/userinterface

Projects Available

Good comparison of various DLNA and UPnP media servers:

http://www.rbgrn.net/content/21-how-to-choose-dlna-media-server-windows-mac-os-x-or-linux

http://elinux.org/DLNA_Open_Source_Projects

My working, transcoding MediaTomb ~/.mediatomb/config.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<config version="1" xmlns="http://mediatomb.cc/config/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mediatomb.cc/config/1 http://mediatomb.cc/config/1.xsd">

<!-- This config file is from 
http://ubuntuforums.org/showthread.php?t=830268
-->


  <server>

	<port>49153</port>  

    <ui enabled="yes">
      <accounts enabled="no" session-timeout="30">
        <account user="mediatomb" password="mediatomb"/>
      </accounts>
    </ui>

    <name>MediaTomb</name>
    <udn>uuid:ca39658b-8187-45c5-aca2-bb91151935cb</udn>
    <!-- <home>/var/lib/mediatomb</home> -->
    <home>/home/paracelsus/.mediatomb</home>
    <webroot>/usr/share/mediatomb/web</webroot>

    <storage>
      <sqlite3 enabled="no">
        <database-file>sqlite3.db</database-file>
      </sqlite3>
      <mysql enabled="yes">
        <host>localhost</host>
	<port>3006</port>
        <username>mediatomb</username>
	<!-- <password>mediatomb</password> -->
        <database>mediatomb</database>
      </mysql>
    </storage>

<!-- PS3 requires "yes" -->
    <protocolInfo extend="yes"/>

  </server>


  <import hidden-files="no">

	<autoscan use-inotify="auto">
		<directory location="/Videos" mode="inotify" recursive="yes" hidden-files="no" />
		<directory location="/Music" mode="inotify" recursive="yes" hidden-files="no" />
		<directory location="/Pictures" mode="inotify" recursive="yes" hidden-files="no" />
	</autoscan>

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

<!-- Only show PC Directory -->
      <virtual-layout type="disabled">

        <import-script>/usr/share/mediatomb/js/import.js</import-script>
      </virtual-layout>
    </scripting>


    <mappings>

<!-- Don't import anything not listed here since it's pointless -->

<!--      <extension-mimetype ignore-unknown="yes"> -->
<extension-mimetype ignore-unknown="no"> 
<map from="avi" to="video/x-divx"/>
<map from="vob" to="video/mpeg"/>
        <map from="mp3" to="audio/mpeg"/>
        <map from="ogg" to="application/ogg"/>
        <map from="asf" to="video/x-ms-asf"/>
        <map from="asx" to="video/x-ms-asf"/>
        <map from="wma" to="audio/x-ms-wma"/>
        <map from="wax" to="audio/x-ms-wax"/>
        <map from="wmv" to="video/x-ms-wmv"/>
        <map from="wvx" to="video/x-ms-wvx"/>
        <map from="wm" to="video/x-ms-wm"/>
        <map from="wmx" to="video/x-ms-wmx"/>
        <map from="m3u" to="audio/x-mpegurl"/>
        <map from="pls" to="audio/x-scpls"/>
        <map from="flv" to="video/x-flv"/>

<!-- List images so they get imported -->
	<map from="jpg" to="image/jpeg" />
	<map from="jpeg" to="image/jpeg" />
	<map from="png" to="image/png" />
	<map from="svg" to="image/svg" />

<!-- Added for PS3 DiVX support -->
        <map from="divx" to="video/x-divx"/>
	<map from="avi" to="video/x-divx"/> 
      </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="application/ogg" as="ogg"/>
        <treat mimetype="audio/x-flac" as="flac"/>
        <treat mimetype="image/jpeg" as="jpg"/>
        <treat mimetype="audio/x-mpegurl" as="playlist"/>
        <treat mimetype="audio/x-scpls" as="playlist"/>
        <treat mimetype="audio/x-wav" as="pcm"/>
        <treat mimetype="video/x-msvideo" as="avi"/>
        <treat mimetype="video/x-divx" as="avi"/>
      </mimetype-contenttype>

    </mappings>

  </import>

  <transcoding enabled="yes">

    <mimetype-profile-mappings>

<!-- Transcode flash and avi files -->
      <transcode mimetype="video/x-flv" using="vlcmpeg"/>
      <transcode mimetype="video/x-ms-asf" using="vlcmpeg"/>	
      <transcode mimetype="video/x-divx" using="vlcmpeg"/>

<!--  <transcode mimetype="application/ogg" using="vlcmpeg"/>
      <transcode mimetype="application/ogg" using="oggflac2raw"/>
      <transcode mimetype="audio/x-flac" using="oggflac2raw"/>  -->

<!-- Added for PS3 thumbnail support -->
      <transcode mimetype="video/x-divx" using="video-thumbnail"/>
      <transcode mimetype="video/x-avi" using="video-thumbnail"/>
    </mimetype-profile-mappings>

    <profiles>

      <profile name="oggflac2raw" enabled="no" type="external">
        <mimetype>audio/L16</mimetype>
        <accept-url>no</accept-url>
        <first-resource>yes</first-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <agent command="ogg123" arguments="-d raw -f %out %in"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
      </profile>

<!-- Added for PS3 thumbnail support -->
      <profile name="video-thumbnail" enabled="yes" type="external">
        <mimetype>image/jpeg</mimetype>
        <accept-url>yes</accept-url>
        <thumbnail>yes</thumbnail>
        <resolution>128x128</resolution>
        <agent command="ffmpegthumbnailer" arguments="-i %in -o %out -s 128"/>
        <buffer size="524288" chunk-size="512" fill-size="1024"/>
      </profile>

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

<!-- Don't transcode newer avi's which are supported -->
	<avi-fourcc-list mode="ignore">
          <fourcc>DX50</fourcc>
        </avi-fourcc-list>

        <mimetype>video/mpeg</mimetype>
        <accept-url>yes</accept-url>
        <first-resource>yes</first-resource>
        <accept-ogg-theora>yes</accept-ogg-theora>
        <agent command="vlc" arguments="-I dummy %in --sout #transcode{venc=ffmpeg,vcodec=mp2v,vb=4096,fps=25,aenc=ffmpeg,acodec=mpga,ab=192,samplerate=44100,channels=2}:standard{access=file,mux=ps,dst=%out} vlc:quit"/>
        <buffer size="14400000" chunk-size="512000" fill-size="120000"/>
      </profile>

    </profiles>

  </transcoding>

</config>

My working /etc/mediatomb.conf

This is a sambel configuration file for the MediaTomb daemon script
## used on Fedora Core

## By default the configuration will be created in /etc/mediatomb

## Network interface on which the server will run, you need to edit this!
MT_INTERFACE="wlan0"

## User defined command line options that may be passed to the server
MT_OPTIONS=""

## MediaTomb will be started on port 50500
MT_PORT="50500"

## MediaTomb will run as mediatomb
MT_USER="mediatomb"
MT_GROUP="mediatomb"

## Location of the PID file
MT_PIDFILE="/var/run/mediatomb.pid"

## Location of the log file
MT_LOGFILE="/var/log/mediatomb"

## Location of the config file/database
MT_HOME="/etc"
MT_CFGDIR="mediatomb