MT is ignoring my transcoding settings.

Help
Jon
2011-12-15
2013-05-30
  • Jon
    Jon
    2011-12-15

    I am one of those people who hates to ask for help.  I'm usually able to solve almost any problem like this by googling, searching forums, etc, but I'm completely stumped.

    I'm trying to get MediaTomb to transcode an external URL so I can play it to a device that wouldn't normally support the stream type.  I've set the config file up for transcoding (see the file below) and added a new item as an external URL using my meta type (see below).  The result, no matter how much fiddling, tweaking, or testing I get is always the same.  MediaTomb completely ignores the transcoding settings and just passes on the URL directly to the player.  I wrote a UPNP library using perl that browses the contents of MediaTomb, so I'm positive it's outputting the original URL.  It also shows the direct URL when you click on the item in the MT web GUI.  I've turned the debug option on and looked through the logfile and there is nothing pertaining to transcoding at all.

    What I'm expecting to happen is this:

    Take the external URL of http://www.wcetv.com/asx/LIB/LIB100247_v5.asx and mask it as something like this:

    http://192.168.1.3:50500/content/media/object_id/20/res_id/0 (or whatever MT generates)

    just like all the other normal, playable files.  Then, once the request is received for that file, MT passes on the meta type I provided in the config file and pull the external URL and transcode it on the fly to the player.  Am I wrong about this?

    Here is my config file:

    <?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>
        <ui enabled="yes" show-tooltips="yes">
          <accounts enabled="no" session-timeout="30">
            <account user="mediatomb" password="mediatomb"/>
          </accounts>
        </ui>
        <name>MediaTomb</name>
        <udn>uuid:ec07f433-6763-46f7-868b-1ac17f885dce</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="no"/><!-- For PS3 support change to "yes" -->
        <custom-http-headers><!-- Samsung needs it -->
          <add header="transferMode.dlna.org: Streaming"/>
          <add header="contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000"/>
          <add header="Connection: close"/>
          <add header="ETag: 45114-22d484428-4b37c52c76c9d"/>
        </custom-http-headers>
        <pc-directory upnp-hide="yes"/>
        <extended-runtime-options>
          <mark-played-items enabled="no" suppress-cds-updates="yes">
            <string mode="prepend">*</string>
            <mark>
              <content>video</content>
            </mark>
          </mark-played-items>
          <lastfm enabled="no">
            <username>lastfmuser</username>
            <password>lastfmpass</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="js">
            <import-script>/usr/share/mediatomb/js/import.js</import-script>
          </virtual-layout>
        </scripting>
        <autoscan use-inotify="auto">
          <directory location="/usr/local/mh/media" mode="inotify" level="full" recursive="yes" hidden-files="no"/>
        </autoscan>
        <mappings>
          <extension-mimetype ignore-unknown="yes">
            <map from="asf" to="video/x-ms-asf"/>
            <map from="asx" to="video/x-ms-asx"/>
            <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="mkv" to="video/x-mkv"/>
            <map from="m2ts" to="video/mpeg"/>
            <map from="avi" to="video/avi"/>
            <map from="mov" to="video/quicktime"/>
            <map from="flv" to="video/x-flv"/>
          </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-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/x-ms-asx" as="asx"/>
          </mimetype-contenttype>
        </mappings>
        <online-content>
          <YouTube enabled="no" refresh="28800" update-at-start="no" purge-after="604800" racy-content="exclude" format="mp4" hd="no">
            <favorites user="mediatomb"/>
            <standardfeed feed="most_viewed" time-range="today"/>
            <playlists user="mediatomb"/>
            <uploads user="mediatomb"/>
            <standardfeed feed="recently_featured" time-range="today"/>
          </YouTube>
        </online-content>
      </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="oggflac2raw"/>
          <transcode mimetype="video/x-ms-asx" using="vlcmpeg"/>
          <transcode mimetype="video/transcode" using="vlcmpeg"/>
        </mimetype-profile-mappings>
        <profiles>
          <profile name="oggflac2raw" enabled="no" type="external">
            <mimetype>audio/L16</mimetype>
            <accept-url>no</accept-url>
            <first-resource>no</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>no</first-resource>
            <hide-original-resource>no</hide-original-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 'mediatomb -compile-info' output is:

    MediaTomb UPnP Server version 0.12.1 - http://mediatomb.cc/
    ===============================================================================
    Copyright 2005-2010 Gena Batsyan, Sergey Bostandzhyan, Leonhard Wimmer.
    MediaTomb is free software, covered by the GNU General Public License version 2
    Compile info:
    -------------
            host:                   i386-redhat-linux-gnu
            sqlite3:                yes
            mysql:                  yes
            libjs:                  yes
            libmagic:               yes
            inotify:                yes
            libexif:                yes
            id3lib:                 disabled
            taglib:                 yes
            ffmpeg                  missing
            libmp4v2:               yes
            external transcoding:   yes
            curl:                   yes
            YouTube:                yes
            libextractor            disabled
            db-autocreate:          yes
            debug log:              yes
            protocol info extension:yes
            ffmpegthumbnailer:      missing
            lastfmlib:              yes
            data directory:         /usr/share/mediatomb
    

    My External URL item is setup as follows:

    Type: External Link (URL)
    Title: MyFile
    URL: http://www.wcetv.com/asx/LIB/LIB100247_v5.asx
    Protocol: http-get
    Class: object.item.videoItem
    Description: *blank*
    Mimetype: video/transcode

    Thank you all so much for your help. 

     
  • Jin
    Jin
    2011-12-15

    Change this <hide-original-resource>no</hide-original-resource> to yes in your profile, I think that should do it. And btw, I suggest to not reinvent the wheel and have a look at gupnp tools which are very useful for debugging UPnP related problems.

    Kind regards,
    Jin