Mar 23
  • Update 27 December 09 – minor changes due to new blog system
  • Update 01 May 09 Referring to the “ffmpegthumbnailer” .. it is not a script. It is a real tool which can be found in gentoo portage or here 🙂
  • Update 09 December 08 As there still people coming to this page, i posted my recent WORKING settings to allow for mkv playback as well as the missing bash script.
  • Update 15 Oktober 08 mediatomb.cc got a nice wiki which has alot more details howto setup different kinds of transcodings. Please check them out.
  • Update 28 July 08 Sony Firmware 2.35 finally fixed that problem.

It took a while, but the software (mediatomb) as well as the client (ps3) are finally able to talk to each other. It works almost out of the box with the recent 0.11.0 release for xvid and divx playback on the PS3.

Mediatomb has now the ability to transcode in realtime, allowing you to play other files like matroska .mkv files as well. Mediatomb can forward the file to play to external applications based on mimetype.

A fine howto to get this stuff going under Gentoo can be found That includes a few external scripts for this transcoding stuff. I am using the ffmpeg version (video) for matroska files.

my config.xml looks like this:>

<?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=”no” session-timeout=”30″>
<account user=”mediatomb” password=”mediatomb”/>
</accounts>
</ui>
<name>MediaTomb</name>
<udn>uuid:eef9e7bf-b63f-4248-8add-a33086ac49d8</udn>
<home>/etc/mediatomb</home>
<webroot>/usr/local/share/mediatomb/web</webroot>
<storage>
<sqlite3 enabled=”no”>
<database-file>mediatomb.db</database-file>
</sqlite3>
<mysql enabled=”yes”>
<host>localhost</host>
<username>mediatomb</username>
<database>mediatomb</database>
<password>YOURPASSWORDHERE</password>
</mysql>
</storage>
<protocolInfo extend=”yes”/><!– For PS3 support change to “yes” –>
<!–
Uncomment the lines below to get rid of jerky avi playback on the
DSM320 or to enable subtitles support on the DSM units
–>
<!–
<custom-http-headers>
<add header=”X-User-Agent: redsonic”/>
</custom-http-headers>
<manufacturerURL>redsonic.com</manufacturerURL>
<modelNumber>105</modelNumber>
–>
<!– Uncomment the line below if you have a Telegent TG100 –>
<!–
<upnp-string-limit>101</upnp-string-limit>
–>
</server>
<import hidden-files=”no”>
<scripting script-charset=”UTF-8″>
<virtual-layout type=”builtin”/>
</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”/>
<map from=”flv” to=”video/x-flv”/>
<!– Uncomment the line below for PS3 divx support –>
<map from=”avi” to=”video/x-divx”/>
<map from=”divx” to=”video/x-divx”/>
<map from=”mkv” to=”video/x-matroska”/>
<map from=”mov” to=”video/quicktime”/>
<map from=”qt” to=”video/quicktime”/>
<map from=”mpg” to=”video/mpeg”/>
<map from=”mpeg” to=”video/mpeg”/>
<!– Uncomment the line below for D-Link DSM / ZyXEL DMA-1000 –>
<!– <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”/>
<treat mimetype=”video/x-msvideo” as=”avi”/>
<treat mimetype=”video/mp4″ as=”mp4″/>
<treat mimetype=”audio/mp4″ as=”mp4″/>
<treat mimetype=”video/x-divx” as=”avi”/>
</mimetype-contenttype>
</mappings>
</import>
<transcoding enabled=”yes”>
<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=”audio-common”/>
<transcode mimetype=”video/x-divx” using=”video-common”/>
<transcode mimetype=”video/x-matroska” using=”video-common”/>
<transcode mimetype=”video/quicktime” using=”video-common”/>
</mimetype-profile-mappings>
<profiles>
<profile name=”oggflac2raw” enabled=”yes” 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=”yes” 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{access=file,mux=ps,dst=%out} vlc:quit”/>
<buffer size=”14400000″ chunk-size=”512000″ fill-size=”120000″/>
</profile>
<profile name=”audio-common” enabled=”yes” type=”external”>
<mimetype>audio/x-wav</mimetype>
<accept-url>yes</accept-url>
<first-resource>yes</first-resource>
<accept-ogg-theora>no</accept-ogg-theora>
<agent command=”mediatomb-transcode-audio” arguments=”%in %out”/>
<buffer size=”1048576″ chunk-size=”131072″ fill-size=”262144″/>
</profile>
<profile name=”video-common” enabled=”yes” 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=”mediatomb-transcode-video-ffmpeg” arguments=”%in %out”/>
<buffer size=”14400000″ chunk-size=”512000″ fill-size=”120000″/>
</profile>
</profiles>
</transcoding>
</config>


# cat /usr/bin/mediatomb-transcode-video-ffmpeg
INPUT="$1"
OUTPUT="$2"
VIDEO_CODEC="mpeg2video"
VIDEO_BITRATE="4096k"
AUDIO_CODEC="mp2"
AUDIO_BITRATE="192k"
AUDIO_SAMPLERATE="48000"
AUDIO_CHANNELS="2"
FORMAT="dvd"
exec /usr/bin/ffmpeg -threads 2 -i "${INPUT}" -vcodec ${VIDEO_CODEC} -b ${VIDEO_BITRATE} \
-acodec ${AUDIO_CODEC} -ab ${AUDIO_BITRATE} -ar ${AUDIO_SAMPLERATE} -ac ${AUDIO_CHANNELS} \
-f ${FORMAT} - > "${OUTPUT}" #2>/dev/null

Hope that helps you guys out there 🙂

One Response to “upnp server mediatomb for divx, xvid and mkv playback on PS3 .”

Leave a Reply

You must be logged in to post a comment.

preload preload preload