Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved]MediaTomb for PS3 - ac3, video previews, CR2 Raws!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1248
Location: Adelaide/Australia

PostPosted: Sun Jan 17, 2010 11:28 am    Post subject: [Solved]MediaTomb for PS3 - ac3, video previews, CR2 Raws! Reply with quote

I have installed MediaTomb and use it with my PS3.

It's great.

I have a couple of things I would like to achieve that I thought people on this forum may be able to assist with.

1. I have ripped all my CD's as aac format (.m4a) and these don't play
2. I would like my .avi files to show a preview picture

If someone has a config that works, would they be kind enough to post it?

Whilst I eagerly await someones config, I will continue to research http://mediatomb.cc/pages/transcoding, which is referenced from http://en.gentoo-wiki.com/wiki/MediaTomb#Select_the_Transcoder
_________________
...Lyall


Last edited by lyallp on Tue Jan 19, 2010 2:19 pm; edited 1 time in total
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1248
Location: Adelaide/Australia

PostPosted: Sun Jan 17, 2010 1:34 pm    Post subject: Reply with quote

I have video preview working, exactly as described in the wiki, (link in the initial post) - see config file below.

According to the wiki entry, transcoding of aac/m4a files will not work until 0.12 is released (apparenly available via Subversion).
Worst comes to the worst, I may have to look into tracking down or hacking up an ebuild for 0.12.

Code:

<?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="#######"/>
      </accounts>
    </ui>
    <name>Lyalls Media</name>
    <udn>uuid:####</udn>
    <home>/var/lib/mediatomb</home>
    <webroot>/usr/share/mediatomb/web</webroot>
    <storage>
      <sqlite3 enabled="no">
        <database-file>mediatomb.db</database-file>
      </sqlite3>
      <mysql enabled="yes">
        <host>localhost</host>
        <database>mediatomb</database>
        <username>#######</username>
        <password>#######</password>
      </mysql>
    </storage>
    <protocolInfo extend="yes"/>
  </server>
  <import hidden-files="no">
    <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>
      </virtual-layout>
    </scripting>
    <mappings>
      <extension-mimetype ignore-unknown="no">
        <map from="mp3" to="audio/mpeg"/>
        <map from="m4a" to="audio/mp4a-latm"/>
        <map from="m4v" to="video/x-m4v"/>
        <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"/>
        <map from="avi" to="video/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="audio/m4a-latm"    as="m4a"/>
        <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/divx"       as="avi"/>
      </mimetype-contenttype>
    </mappings>
  </import>
  <transcoding enabled="yes">
    <mimetype-profile-mappings>
      <transcode mimetype="application/ogg" using="audio2pcm"/>
      <transcode mimetype="application/ogg" using="video2mpeg"/>
      <transcode mimetype="audio/x-flac"    using="audio2pcm"/>
      <transcode mimetype="audio/m4a-latm"  using="audio2pcm"/>
      <transcode mimetype="video/x-flv"     using="video2mpeg"/>
      <transcode mimetype="video/quicktime" using="video2mpeg"/>
      <transcode mimetype="video/x-flv"     using="video2jpeg"/>
      <transcode mimetype="video/quicktime" using="video2jpeg"/>
      <transcode mimetype="video/divx"      using="video2jpeg"/>
      <transcode mimetype="video/x-ms-asf"  using="video2jpeg"/>
      <transcode mimetype="video/x-ms-wmf"  using="video2jpeg"/>
    </mimetype-profile-mappings>
    <profiles>
      <profile name="audio2pcm" enabled="yes" type="external">
        <mimetype>audio/L16</mimetype>
        <accept-url>yes</accept-url>
        <first-resource>yes</first-resource>
        <hide-original-resource>yes</hide-original-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <agent command="/usr/local/bin/mediatomb-audio2pcm.sh" arguments="%in %out"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
      </profile>
      <profile name="video2mpeg" enabled="yes" type="external">
        <mimetype>video/mpeg</mimetype>
        <accept-url>yes</accept-url>
        <first-resource>yes</first-resource>
        <hide-original-resource>yes</hide-original-resource>
        <accept-ogg-theora>yes</accept-ogg-theora>
        <agent command="/usr/local/bin/mediatomb-video2mpeg.sh" arguments="%in %out"/>
        <buffer size="10485760" chunk-size="262144" fill-size="524288"/>
      </profile>
      <profile name="video2jpeg" enabled="yes" type="external">
        <mimetype>image/jpeg</mimetype>
        <accept-url>no</accept-url>
        <thumbnail>yes</thumbnail>
        <resolution>160x160</resolution>
        <agent command="ffmpegthumbnailer" arguments="-i %in -o %out -s 160"/>
        <buffer size="524288" chunk-size="512" fill-size="1024"/>
      </profile>
    </profiles>
  </transcoding>
</config>

_________________
...Lyall
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Sun Jan 17, 2010 2:17 pm    Post subject: Reply with quote

There is a SVN ebuild in gentoo bugzilla. Works great.

No use talking about the previews until you get that since it has thumbnail support is built in and no thumbnail profile is needed.
Back to top
View user's profile Send private message
BT
Apprentice
Apprentice


Joined: 13 Jun 2004
Posts: 247

PostPosted: Mon Jan 18, 2010 12:55 am    Post subject: Reply with quote

lyallp,

I can see from your config that you used the audio/mp4a-latm mimetype for your m4a files. This is incorrect and won't work. You need to use the following mimetype mappings for m4a and m4v files.
Code:
<map from="m4a" to="audio/mp4"/>
<map from="m4v" to="video/mp4"/>

Make sure you remove the following line to turn transcoding off for m4a files.
Code:
<transcode mimetype="audio/m4a-latm"  using="audio2pcm"/>

You should also remove the following line since it does nothing.
Code:
<treat mimetype="audio/m4a-latm"    as="m4a"/

Now you need to restart MediaTomb and re-import all your m4a and m4v files since the mimetypes are only set during import.

It is strange that the mimetypes for your m4a files weren't detected correctly. What mimetype do you get when you run: file -i /path/to/m4a/file . On my system it returned video/mp4 which is definitely wrong and probably explains why m4a files didn't work for you.

Regarding video thumbnails. MediaTomb 0.11.0 needs a transcoding profile as you have discovered from the wiki. MediaTomb 0.12.0 (SVN) has video thumbnail support built-in via the ffmpegthumbnailer library as Headrush mentioned.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1248
Location: Adelaide/Australia

PostPosted: Tue Jan 19, 2010 2:18 pm    Post subject: Reply with quote

Well, I found the ebuild for subversion of MediaTomb in BugZilla - as suggested above.
I have installed that.
I can now play my aac (m4a) files on the PS3.
I have video preview (after following instructions in the wiki)
I can look at my jpg images.
I can even look at my Canon RAW CR2 images - at least to see what they contain - but not in their high detail glory - as it's faster to simply extract out the thumbnail than it is to convert the images, on the fly. You don't want to be sitting waiting for your images to be converted - on my PC, it was taking around 20 seconds per image!

So, here is my final config.

/usr/local/bin/mediatomb-tiff2jpeg.sh - which uses media-gfx/dcraw and convert from media-gfx/imagemagick

Code:
#!/bin/bash
action="$1"
shift
in="$1"
shift
out="$1"
if [ "${action}" = "pic" ]
then
    dcraw -c -e "$in"  "${out}"
else
    dcraw -c -e "$in" | convert - -geometry 160x160 "${out}"
fi


/usr/local/bin/mediatomb-audio2pcm.sh
Code:
#!/bin/bash

VLC_PATH="/usr/bin/vlc"
INPUT="$1"
OUTPUT="$2"
AUDIO_CODEC="s16b"
AUDIO_BITRATE="192"
AUDIO_SAMPLERATE="44100"
AUDIO_CHANNELS="2"
FORMAT="raw"

exec "${VLC_PATH}" "${INPUT}" -I dummy --sout="#transcode{acodec=${AUDIO_CODEC},\
ab=${AUDIO_BITRATE},samplerate=${AUDIO_SAMPLERATE},channels=${AUDIO_CHANNELS}}:\
standard{access=file,mux=${FORMAT},dst=${OUTPUT}}" vlc://quit


/usr/local/bin/medaitomb-video2mpeg.sh
Code:
#!/bin/bash

VLC_PATH="/usr/bin/vlc"
INPUT="$1"
OUTPUT="$2"
VIDEO_CODEC="mp2v"
VIDEO_BITRATE="4096"
VIDEO_FRAMERATE="25"
AUDIO_CODEC="mpga"
AUDIO_BITRATE="192"
AUDIO_SAMPLERATE="48000"
AUDIO_CHANNELS="2"
FORMAT="ps"

exec "${VLC_PATH}" "${INPUT}" -I dummy --sout="#transcode{vcodec=${VIDEO_CODEC},\
vb=${VIDEO_BITRATE},fps=${VIDEO_FRAMERATE},acodec=${AUDIO_CODEC},ab=${AUDIO_BITRATE},\
samplerate=${AUDIO_SAMPLERATE},channels=${AUDIO_CHANNELS},audio-sync,soverlay}:\
standard{access=file,mux=${FORMAT},dst=${OUTPUT}}" vlc://quit


My MediaTomb config file looks like this...
Code:
<?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="####" password="####"/>
      </accounts>
    </ui>
    <name>Lyalls Media</name>
    <udn>uuid:####</udn>
    <home>/var/lib/mediatomb</home>
    <webroot>/usr/share/mediatomb/web</webroot>
    <storage>
      <sqlite3 enabled="no">
        <database-file>mediatomb.db</database-file>
      </sqlite3>
      <mysql enabled="yes">
        <host>localhost</host>
        <database>####</database>
        <username>####</username>
        <password>####</password>
      </mysql>
    </storage>
    <protocolInfo extend="yes"/>
  </server>
  <import hidden-files="no">
    <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>
      </virtual-layout>
    </scripting>
    <mappings>
      <extension-mimetype ignore-unknown="no">
        <map from="mp3" to="audio/mpeg"/>
        <map from="m4a" to="audio/mp4"/>
        <map from="m4v" to="video/mp4"/>
        <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"/>
        <map from="avi" to="video/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="audio/L16"       as="pcm"/>
        <treat mimetype="video/x-msvideo"   as="avi"/>
   <treat mimetype="video/divx"       as="avi"/>
      </mimetype-contenttype>
    </mappings>
  </import>
  <transcoding enabled="yes">
    <mimetype-profile-mappings>
      <transcode mimetype="application/ogg" using="audio2pcm"/>
      <transcode mimetype="application/ogg" using="video2mpeg"/>
      <transcode mimetype="audio/x-flac"    using="audio2pcm"/>
      <transcode mimetype="video/x-flv"     using="video2mpeg"/>
      <transcode mimetype="video/quicktime" using="video2mpeg"/>
      <transcode mimetype="video/x-flv"     using="video2jpeg"/>
      <transcode mimetype="video/quicktime" using="video2jpeg"/>
      <transcode mimetype="video/divx"      using="video2jpeg"/>
      <transcode mimetype="video/x-ms-asf"  using="video2jpeg"/>
      <transcode mimetype="video/x-ms-wmf"  using="video2jpeg"/>
      <transcode mimetype="image/tiff"      using="tiff2jpeg"/>
    </mimetype-profile-mappings>
    <profiles>
      <profile name="audio2pcm" enabled="yes" type="external">
        <mimetype>audio/L16</mimetype>
        <accept-url>yes</accept-url>
        <first-resource>yes</first-resource>
        <hide-original-resource>yes</hide-original-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <agent command="/usr/local/bin/mediatomb-audio2pcm.sh" arguments="%in %out"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
      </profile>
      <profile name="video2mpeg" enabled="yes" type="external">
        <mimetype>video/mpeg</mimetype>
        <accept-url>yes</accept-url>
        <first-resource>yes</first-resource>
        <hide-original-resource>yes</hide-original-resource>
        <accept-ogg-theora>yes</accept-ogg-theora>
        <agent command="/usr/local/bin/mediatomb-video2mpeg.sh" arguments="%in %out"/>
        <buffer size="10485760" chunk-size="262144" fill-size="524288"/>
      </profile>
      <profile name="video2jpeg" enabled="yes" type="external">
        <mimetype>image/jpeg</mimetype>
        <accept-url>no</accept-url>
        <thumbnail>yes</thumbnail>
        <resolution>160x160</resolution>
        <agent command="ffmpegthumbnailer" arguments="-i %in -o %out -s 160"/>
        <buffer size="524288" chunk-size="512" fill-size="1024"/>
      </profile>
      <profile name="tiff2jpeg" enabled="yes" type="external">
        <mimetype>image/jpeg</mimetype>
        <accept-url>no</accept-url>
        <first-resource>yes</first-resource>
        <hide-original-resource>yes</hide-original-resource>
        <resolution>800x600</resolution>
        <agent command="/usr/local/bin/mediatomb-tiff2jpeg.sh" arguments="pic %in %out"/>
        <buffer size="524288" chunk-size="512" fill-size="1024"/>
      </profile>
      <profile name="tiff2jpeg" enabled="yes" type="external">
        <mimetype>image/jpeg</mimetype>
        <accept-url>no</accept-url>
        <first-resource>yes</first-resource>
        <hide-original-resource>yes</hide-original-resource>
        <thumbnail>yes</thumbnail>
        <resolution>160x160</resolution>
        <agent command="/usr/local/bin/mediatomb-tiff2jpeg.sh" arguments="thumb %in %out"/>
        <buffer size="524288" chunk-size="512" fill-size="1024"/>
      </profile>
    </profiles>
  </transcoding>
</config>

_________________
...Lyall
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Thu Jan 21, 2010 11:31 am    Post subject: Reply with quote

lyallp,

When you grabbed the SVN ebuild did you also grab the updated config.xml also or have you removed parts of config.xml?

You seem to be missing a block from the <server></server> section that includes the builtin thumbnail support.
Code:
    <pc-directory upnp-hide="no"/>
    <extended-runtime-options>
      <ffmpegthumbnailer enabled="yes">
        <thumbnail-size>160</thumbnail-size>
        <seek-percentage>10</seek-percentage>
        <filmstrip-overlay>no</filmstrip-overlay>
        <workaround-bugs>no</workaround-bugs>
        <image-quality>8</image-quality>
      </ffmpegthumbnailer>
      <mark-played-items enabled="no" suppress-cds-updates="yes">
        <string mode="prepend">*</string>
      </mark-played-items>
      <lastfm enabled="no">
        <username>username</username>
        <password>password</password>
      </lastfm>
    </extended-runtime-options>


P.S. Although I prefer mediatomb, there is also Fuppes in gentoo bugzilla which has some support for using dcraw built in I believe.
Doesn't hurt to have a second option to test and both can run side by side without any problems.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1248
Location: Adelaide/Australia

PostPosted: Fri Jan 22, 2010 2:01 pm    Post subject: Reply with quote

I will have to investigate this, video thumbnail support works fine, as I have setup.
I will fiddle with the built in setup.
Thanks for the heads up, though. :)

Edit: I have removed my video thumbnailing and inserted the 'default' values, works a treat.

My new Config file is as follows (my old video thumbnailing commented out for those that are not using the SubVersion version).

Code:
<?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="###" password="###"/>
      </accounts>
    </ui>
    <name>Lyalls Media</name>
    <udn>uuid:####</udn>
    <home>/var/lib/mediatomb</home>
    <webroot>/usr/share/mediatomb/web</webroot>
    <storage>
      <sqlite3 enabled="no">
        <database-file>mediatomb.db</database-file>
      </sqlite3>
      <mysql enabled="yes">
        <host>localhost</host>
        <database>###</database>
        <username>###</username>
        <password>###</password>
      </mysql>
    </storage>
    <protocolInfo extend="yes"/>
    <pc-directory upnp-hide="no"/>
    <extended-runtime-options>
      <ffmpegthumbnailer enabled="yes">
        <thumbnail-size>160</thumbnail-size>
        <seek-percentage>10</seek-percentage>
        <filmstrip-overlay>no</filmstrip-overlay>
        <workaround-bugs>no</workaround-bugs>
        <image-quality>8</image-quality>
      </ffmpegthumbnailer>
      <mark-played-items enabled="no" suppress-cds-updates="yes">
        <string mode="prepend">*</string>
      </mark-played-items>
      <lastfm enabled="no">
        <username>username</username>
        <password>password</password>
      </lastfm>
    </extended-runtime-options>   </server>
  <import hidden-files="no">
    <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>
      </virtual-layout>
    </scripting>
    <mappings>
      <extension-mimetype ignore-unknown="no">
        <map from="mp3" to="audio/mpeg"/>
        <map from="m4a" to="audio/mp4"/>
        <map from="m4v" to="video/mp4"/>
        <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"/>
        <map from="avi" to="video/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="audio/L16"       as="pcm"/>
        <treat mimetype="video/x-msvideo"   as="avi"/>
   <treat mimetype="video/divx"       as="avi"/>
      </mimetype-contenttype>
    </mappings>
  </import>
  <transcoding enabled="yes">
    <mimetype-profile-mappings>
      <transcode mimetype="application/ogg" using="audio2pcm"/>
      <transcode mimetype="application/ogg" using="video2mpeg"/>
      <transcode mimetype="audio/x-flac"    using="audio2pcm"/>
      <transcode mimetype="video/x-flv"     using="video2mpeg"/>
      <transcode mimetype="video/quicktime" using="video2mpeg"/>
      <transcode mimetype="video/x-flv"     using="video2jpeg"/>
      <transcode mimetype="video/quicktime" using="video2jpeg"/>
      <transcode mimetype="video/divx"      using="video2jpeg"/>
      <transcode mimetype="video/x-ms-asf"  using="video2jpeg"/>
      <transcode mimetype="video/x-ms-wmf"  using="video2jpeg"/>
      <transcode mimetype="image/tiff"      using="tiff2jpeg"/>
    </mimetype-profile-mappings>
    <profiles>
      <profile name="audio2pcm" enabled="yes" type="external">
        <mimetype>audio/L16</mimetype>
        <accept-url>yes</accept-url>
        <first-resource>yes</first-resource>
        <hide-original-resource>yes</hide-original-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <agent command="/usr/local/bin/mediatomb-audio2pcm.sh" arguments="%in %out"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
      </profile>
      <profile name="video2mpeg" enabled="yes" type="external">
        <mimetype>video/mpeg</mimetype>
        <accept-url>yes</accept-url>
        <first-resource>yes</first-resource>
        <hide-original-resource>yes</hide-original-resource>
        <accept-ogg-theora>yes</accept-ogg-theora>
        <agent command="/usr/local/bin/mediatomb-video2mpeg.sh" arguments="%in %out"/>
        <buffer size="10485760" chunk-size="262144" fill-size="524288"/>
      </profile>
<!--
      <profile name="video2jpeg" enabled="yes" type="external">
        <mimetype>image/jpeg</mimetype>
        <accept-url>no</accept-url>
        <thumbnail>yes</thumbnail>
        <resolution>160x160</resolution>
        <agent command="ffmpegthumbnailer" arguments="-i %in -o %out -s 160"/>
        <buffer size="524288" chunk-size="512" fill-size="1024"/>
      </profile>
-->
      <profile name="tiff2jpeg" enabled="yes" type="external">
        <mimetype>image/jpeg</mimetype>
        <accept-url>no</accept-url>
        <first-resource>yes</first-resource>
        <hide-original-resource>yes</hide-original-resource>
        <resolution>800x600</resolution>
        <agent command="/usr/local/bin/mediatomb-tiff2jpeg.sh" arguments="pic %in %out"/>
        <buffer size="524288" chunk-size="512" fill-size="1024"/>
      </profile>
      <profile name="tiff2jpeg" enabled="yes" type="external">
        <mimetype>image/jpeg</mimetype>
        <accept-url>no</accept-url>
        <first-resource>yes</first-resource>
        <hide-original-resource>yes</hide-original-resource>
        <thumbnail>yes</thumbnail>
        <resolution>160x160</resolution>
        <agent command="/usr/local/bin/mediatomb-tiff2jpeg.sh" arguments="thumb %in %out"/>
        <buffer size="524288" chunk-size="512" fill-size="1024"/>
      </profile>
    </profiles>
  </transcoding>
</config>

_________________
...Lyall
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1248
Location: Adelaide/Australia

PostPosted: Sun Jan 24, 2010 5:15 am    Post subject: Reply with quote

I updated the MediaTomb wiki article to include my stuff. http://en.gentoo-wiki.com/wiki/MediaTomb
_________________
...Lyall
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Sun Jan 24, 2010 3:19 pm    Post subject: Reply with quote

lyallp wrote:
I updated the MediaTomb wiki article to include my stuff. http://en.gentoo-wiki.com/wiki/MediaTomb


You just forget to remove the info in the 0.11 section I added previously about SVN having the built in thumbnail suppport. :wink:

I erased it since yours is more complete but I was having trouble adding the link to the actual bugzilla bug for the SVN ebuild.
Back to top
View user's profile Send private message
BT
Apprentice
Apprentice


Joined: 13 Jun 2004
Posts: 247

PostPosted: Mon Jan 25, 2010 3:21 am    Post subject: Reply with quote

lyallp,

Thanks for your contribution. I tested your raw image config but it didn't work. It would lock the PS3 navigation and only a MediaTomb restart would unlock it. I replaced your config and script with known working ones that I helped create for Funtoo. It's much simpler and doesn't need ImageMagick. I tested with CR2 and NEF images and it worked perfectly.

Your mediatomb-tiff2jpeg.sh script also has some issues. Firstly, it's missing exec statements before the dcraw commands. Without them MediaTomb will have no way of killing the dcraw process which is launched for each image. If you check your process list you will probably have a bunch of them still running! Secondly, when dcraw is called for the "pic" action it fails because it's missing a redirect (>). This is probably why it never worked for me. You also don't need to generate thumbnails for images so the second tiff2jpeg profile is redundant.

I also cleaned up the thumbnail section. Since the config for 0.12.0 comes with a thumbnail section, you don't need to add anything to the config. You just need to enable it.

Another thing I want to mention is the "Complete Working Setup" section you posted. I think it's a good idea but it could be done better. The wiki will get bloated very quickly if users started posted their configs and scripts directly to the wiki. Maybe users should post their configs and scripts in pastebins or personal pages and link to them via the wiki?

Headrush,

I added a link to the SVN ebuild at the top of the page in the first note. I think the reason you couldn't get the link working is because you need to escape the "=" character with the relevant HTML code. I had this problem when I first started with the page.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1248
Location: Adelaide/Australia

PostPosted: Mon Jan 25, 2010 5:18 am    Post subject: Reply with quote

BT wrote:


Thanks for your contribution. I tested your raw image config but it didn't work. It would lock the PS3 navigation and only a MediaTomb restart would unlock it. I replaced your config and script with known working ones that I helped create for Funtoo. It's much simpler and doesn't need ImageMagick. I tested with CR2 and NEF images and it worked perfectly.

Your mediatomb-tiff2jpeg.sh script also has some issues. Firstly, it's missing exec statements before the dcraw commands. Without them MediaTomb will have no way of killing the dcraw process which is launched for each image. If you check your process list you will probably have a bunch of them still running! Secondly, when dcraw is called for the "pic" action it fails because it's missing a redirect (>). This is probably why it never worked for me. You also don't need to generate thumbnails for images so the second tiff2jpeg profile is redundant.


I see where I went wrong with regard to '>' - I must have accidentally left the '-c' in - it should not be in the 'pic' extract.

The reason I used ImageMagick was that using dcraw to convert a CR2 raw (12 MB+), on the fly would take 20 seconds per image, on my quad core Intel 2.6ghz Gentoo Linux box, whereas the dcraw -e (extract thumbnail) was virtually instant but gave images which are bigger than the thumbnail size that I was under the impression was required (160x160) - so I simply shrunk the embedded CR2 Thumbnail to suite, using 'convert'.
Yes, I understand the 'exec' bit, I will fix that when I get home.


BT wrote:

I also cleaned up the thumbnail section. Since the config for 0.12.0 comes with a thumbnail section, you don't need to add anything to the config. You just need to enable it.

Cool, will also do that when I get home.

BT wrote:

Another thing I want to mention is the "Complete Working Setup" section you posted. I think it's a good idea but it could be done better. The wiki will get bloated very quickly if users started posted their configs and scripts directly to the wiki. Maybe users should post their configs and scripts in pastebins or personal pages and link to them via the wiki?

Whilst I understand the sentiment, the problem with pastebin is it's temporary. The problem with personal sites, they also tend to be temporary.
Maybe the files should be attachments rather than in-line, but, if I had come across the wiki page with full working example, I would have leapt on that and used it, rather than trying to understand all the intricate details and get things working. I think a fair percentage of people would take the 'something that works' in preference to 'step by step how to'.

Regardless, I will update the 'Complete Working Section' to reflect your input and should the Wiki Powers that be feel that the section is superfluous, then I am ok with that.

Maybe I/we should contribute a patch to the MediaTomb ebuild to include all this sort of configuration, out of the box, some use flags come to mind, 'raw' (because of the requirement for dcraw), 'thumbnails' (requirement for ffmpegthumbnailer), 'aac' (requirement to transcode aac/m4a) - this way, the whole 'working config' section in the wiki becomes redundant. :)
_________________
...Lyall
Back to top
View user's profile Send private message
BT
Apprentice
Apprentice


Joined: 13 Jun 2004
Posts: 247

PostPosted: Mon Jan 25, 2010 5:45 am    Post subject: Reply with quote

lyallp wrote:
I see where I went wrong with regard to '>' - I must have accidentally left the '-c' in - it should not be in the 'pic' extract.

Actually since dcraw doesn't support specifying an output file the complete command should be, exec dcraw -e -c "$in" > "${out}"

lyallp wrote:
Regardless, I will update the 'Complete Working Section' to reflect your input and should the Wiki Powers that be feel that the section is superfluous, then I am ok with that.

No problem just leave it for now since yours is the only config posted so far :D. Only thing you might want to remove is the audio and video scripts since they seem to be identical to the ones already posted on the wiki.

lyallp wrote:
Maybe I/we should contribute a patch to the MediaTomb ebuild to include all this sort of configuration, out of the box, some use flags come to mind, 'raw' (because of the requirement for dcraw), 'thumbnails' (requirement for ffmpegthumbnailer), 'aac' (requirement to transcode aac/m4a) - this way, the whole 'working config' section in the wiki becomes redundant. :)

There is no point in doing this for 0.11.0 since 0.12.0 is scheduled to be released this month. The 0.12.0 SVN ebuild already has a "complete" config and almost everything should work after enabling the relevant sections. The 0.11.0 config is barebones which is why it needs lots for configuration to get going.

I need to do some further tweaking to the raw image section to ensure that actual .tiff files (which the PS3 supports) don't get transcoded. I'll need to map .cr2, .nef and any other raw image formats to a "fake" mimetype like image/raw and tell MediaTomb to transcode it instead. This is the same technique Funtoo uses for it's config.xml.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1248
Location: Adelaide/Australia

PostPosted: Mon Jan 25, 2010 11:06 am    Post subject: Reply with quote

I applied the changes mentioned above and had endless trouble, until I realised that all my CR2 (raw) images had been scanned with MediaTomb before I had changed the mime type to 'image/raw' - so I was sending the wrong media stream to the PS3.

It wasn't exactly obvious to me how I should force MediaTomb to completely rescan images, including mime type.

Once I truncated my MediaTomb database and re-scanned, evertyhing worked great.
_________________
...Lyall
Back to top
View user's profile Send private message
BT
Apprentice
Apprentice


Joined: 13 Jun 2004
Posts: 247

PostPosted: Mon Jan 25, 2010 11:17 am    Post subject: Reply with quote

lyallp,

The mimetypes are set during import so any changes you make to mimetype mappings after import will also require your to re-import your files. I guess I should add a note somewhere on the wiki about this since it does confuse a lot of users.

The "Complete Working Setup" is much better now and is definitely worth keeping. Nice work :D
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1248
Location: Adelaide/Australia

PostPosted: Wed Mar 17, 2010 9:27 am    Post subject: Reply with quote

Updated wiki to include 'MKV' videos (matroska) transcoding to PS3 in the working example.

I also added a note about transcoding using video2mpeg and video2jpeg (use video2jpeg as it enables pause, rewind, fast forward, etc).
_________________
...Lyall
Back to top
View user's profile Send private message
BT
Apprentice
Apprentice


Joined: 13 Jun 2004
Posts: 247

PostPosted: Mon Mar 29, 2010 11:50 pm    Post subject: Reply with quote

MediaTomb 0.12.0 has been released and is in the tree. I will be updating the Wiki soon which will see some sections reduced in size since the config has much better defaults now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum