Mediatomb

From Hurlster Wiki
Jump to navigation Jump to search

Building for Ubuntu 9.04

DirecTV HRx recievers only support the following formats:

Audio: wav, lpcm
Video: Mpeg2
Photo: jpeg

Get Dependancies

apt-get build-dep mediatomb

Get Source

cd /usr/local/src/
svn co https://mediatomb.svn.sourceforge.net/svnroot/mediatomb/trunk/mediatomb mediatomb

Compile

autoreconf -iv
./configure --prefix=/usr/local
make
checkinstall -D --install=no --fstrans=no --pkgname=mediatomb-svn --pkgversion "1:0.svn`date +%Y%m%d`-ubuntu" -y)
                                          **italicized options don't work
ldconfig

Setup

mkdir /etc/mediatomb
chmod 755 /etc/mediatomb

Initial Run

This step creates the first "database" and config.xml

mediatomb -m /etc/mediatomb -f ./

Configuration

cd /etc/mediatomb/
cp config.xml config-svn.xml

Edit config.xml to fit DirecTV HRx nano config.xml

Change the following in bold
Add the line <pc-directory upnp-hide="no"/> before </server>
Remove existing extension-mimetypes and add following
        <map from="mp3" to="audio/mpeg"/>
        <map from="ogg" to="application/ogg"/>
        <map from="aac" to="audio/x-aac"/>
        <map from="m4a" to="audio/mp4"/>
        <map from="flac" to="audio/x-flac"/>
        <map from="jpg" to="image/jpeg"/>
        <map from="JPG" to="image/jpeg"/>
        <map from="vob" to="video/mpgv"/>
        <map from="ts" to="video/mpeg"/>
        <map from="mpg" to="video/mpeg"/>
        <map from="wav" to="audio/wav"/>
        <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"/>
Remove existing mimetype-contenttype and add following
        <treat mimetype="audio/mpeg" as="mp3"/>
        <treat mimetype="audio/x-ms-wma" 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="audio/L16" as="pcm"/>
        <treat mimetype="video/x-msvideo" as="avi"/>
        <treat mimetype="video/mp4" as="mp4"/>
        <treat mimetype="audio/mp4" as="mp4"/>
        <treat mimetype="application/x-iso9660" as="dvd"/>
        <treat mimetype="application/x-iso9660-image" as="dvd"/>

import.js

This formats it as a folder structure, must change "builtin" to "js" in config.xml.

function addVideo(obj)
{
    var dir = obj.location.split('/');
    var skip=4;
    var chain = new Array('Video'); 

    if(skip <= dir.length-2)
        for(i=skip;i<=(dir.length-2);i++)
                chain.push(dir[i]); 

    addCdsObject(obj, createContainerChain(chain));
}

Thanks to:

http://wiki.flexion.org/InstallingMediaTomb012.html#4.0
http://mediatomb.cc/dokuwiki/transcoding:transcoding

Samsung BD-5700

Mediatomb's confix.xml file as modified to enable M4V, MKV, MPG and WAV file playback on Samsung BD-C5500. Also the STOP, PAUSE and PLAY buttons work (on remote) plus the <> buttons let you fast forward about 10 seconds at at time (pretty useless). On a side note, whoever posted the thing about using TOOLS (on remote) and then entering the time to jump forward or backward, Thank you. That solves a lot of problems for me.

<?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">
<server>
<ui enabled="yes">
<accounts enabled="yes" session-timeout="15">
<account user="yourusername" password="yourpassword"/>
</accounts>
</ui>
<name>MediaTomb</name>
<udn>uuid:8d4ea50c-8da8-40e0-bf72-f760790e0c83</udn>
<home>/mnt/disk1/mediatomb/config</home>
<webroot>/mnt/disk1/mediatomb/usr/share/mediatomb/web</webroot>
<storage>
<sqlite3 enabled="yes">
<database-file>mediatomb.db</database-file>
</sqlite3>
</storage>
<pc-directory upnp-hide="no"/>
<protocolInfo extend="yes"/>
<custom-http-headers>
<add header="transferMode.dlna.org: Streaming"/>
<add header="contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=0170000000000000 0000000000000000"/>
</custom-http-headers>
</server>
<import hidden-files="no">
<scripting script-charsetnary="UTF-8">
<common-script>/opt/share/mediatomb/js/common.js</common-script>
<playlist-script>/opt/share/mediatomb/js/playlists.js</playlist-script>
<virtual-layout type="builtin">
<import-script>/opt/share/mediatomb/js/import.js</import-script>
</virtual-layout>
</scripting>
<mappings>
<extension-mimetype ignore-unknown="no">
<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"/>
<!-- Added for MKV files -->
<map from="mkv" to="video/x-mkv"/>
<!-- Added for MPG files -->
<map from="mpg" to="video/x-ms-asf"/>
<!-- Added for AVI files but does not work-->
<map from="avi" to="video/avi"/>
</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="audio/L16" as="pcm"/>
<!-- Added for MKV files -->
<treat mimetype="video/x-mkv" as="mp4"/>
<!-- Added for MPG files -->
<treat mimetype="video/x-msvideo" as="asf"/>
</mimetype-contenttype>
</mappings>
</import>
<transcoding enabled="no">
<mimetype-profile-mappings>
<transcode mimetype="video/x-flv" using="vlcmpeg"/>
<transcode mimetype="application/ogg" using="vlcmpeg"/>
<transcode mimetype="application/ogg" using="oggflac2raw"/>
<transcode mimetype="audio/x-flac" using="oggflac2raw"/>
</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>
<profile name="vlcmpeg" enabled="no" type="external">
<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{a ccess=file,mux=ps,dst=%out} vlc:quit"/>
<buffer size="14400000" chunk-size="512000" fill-size="120000"/>
</profile>
</profiles>
</transcoding>
</config>