mediatomb and panasonic tv

Help
anxo
2010-11-13
2013-05-30
  • anxo
    anxo
    2010-11-13

    Hi everybody. I'm trying to play divx - avi file - offered to my panasonic tv for mediatomb in ubuntu 0.04. Actually i can see the computer files on tv's client but no more. The tv's client is no able to play the files. Whit the jpg files there is no problem. Can anyone take a look to my config file and help me to resolve the problem. Thanks.

    P.d. Sorry for my english, it's not quite good.
    P.d2 my config 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">
      <!-
         Read /usr/share/doc/mediatomb-common/README.gz section 6 for more
         information on creating and using config.xml configration files.
        ->
      <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:5fc1533e-da98-40c4-aa2c-77296b151077</udn>
        <home>/var/lib/mediatomb</home>
        <webroot>/usr/share/mediatomb/web</webroot>
        <storage>
          <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" ->
        <!-
           Uncomment the lines below to get rid of jerky avi playback on the
           DSM320 or to enable subtitles support on the DSM units
        ->
       
    <add header="transferMode.dlna.org: Streaming"/>
    <add header="contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=017000 00000000000000000000000000"/>

        <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>
        ->
        <extended-runtime-options>
          <ffmpegthumbnailer enabled="no">
            <thumbnail-size>128</thumbnail-size>
            <seek-percentage>5</seek-percentage>
            <filmstrip-overlay>yes</filmstrip-overlay>
            <workaround-bugs>no</workaround-bugs>
          </ffmpegthumbnailer>
          <mark-played-items enabled="no" suppress-cds-updates="yes">
            <string mode="prepend">*</string>
          </mark-played-items>
        </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>
            <dvd-script>/usr/share/mediatomb/js/import-dvd.js</dvd-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"/>
            <map from="flv" to="video/x-flv"/>
            <map from="mkv" to="video/x-matroska"/>
            <map from="mka" to="audio/x-matroska"/>
    <map from="avi" to="video/divx"/>
            <!- Uncomment the line below for PS3 divx support ->
            <!- <map from="avi" to="video/divx"/> ->
            <!- 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"/>
            <map from="application/ogg" to="object.item.audioItem.musicTrack"/>
          </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="application/x-iso9660" as="dvd"/>
            <treat mimetype="application/x-iso9660-image" as="dvd"/>
            <treat mimetype="video/x-matroska" as="mkv"/>
            <treat mimetype="audio/x-matroska" as="mka"/>
          </mimetype-contenttype>
        </mappings>
        <online-content>
          <!- Make sure to setup a transcoding profile for flv ->
          <YouTube enabled="no" refresh="28800" update-at-start="no" purge-after="604800" racy-content="exclude" format="flv" 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>
          <Weborama enabled="no" refresh="28800" update-at-start="no">
            <playlist name="Active" type="playlist" mood="active"/>
            <playlist name="Metal" type="playlist">
              <filter>
                <genres>metal</genres>
              </filter>
            </playlist>
          </Weborama>
          <AppleTrailers enabled="no" refresh="43200" update-at-start="no" resolution="640"/>
        </online-content>
      </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 -o byteorder:big -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{access=file,mux=ps,dst=%out} vlc:quit"/>
            <buffer size="14400000" chunk-size="512000" fill-size="120000"/>
          </profile>
        </profiles>
      </transcoding>
    <protocolInfo extend="yes"/><!- 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=01500000000000000000000000000000"/>
    </custom-http-headers>
    </config>

     
  • Jin
    Jin
    2010-11-21

    Is it that the avi files are "greyed out" and that you are not allowed to press play on the avi file, or is it that you press play and then the TV says, that the file can not be played?

     
  • anxo
    anxo
    2010-11-22

    well, when i try to play the file, my tv saids " file not readable".
    Thanks for answering.

     
  • Nithin Philips
    Nithin Philips
    2010-11-29

    It looks there are some conflicting settings in your config. I have a Samsung LNxxC630 series TV and the following config works well for me: http://pastebin.com/2jhNWYyV

    Backup your current config and replace it with this one, restart both mediatomb and your tv and see if it works.

    To restart mediatomb enter in the terminal:

    sudo service mediatomb restart
    
     
  • Nithin Philips
    Nithin Philips
    2010-11-29

    I forgot to mention that you might need to remove your media sources from mediatomb and re-add them as well.

    sudo rm /var/lib/mediatomb/mediatomb.db  /var/lib/mediatomb/mediatomb.db-journal
    
     
  • anxo
    anxo
    2010-12-30

    Thanks, my friend. Your config file  works fine for me in my panasonic TX-L42D25. Now the following step is to get transcode works, i mean, my tv doesn't play mkv files. It's possible to play this files with transcode???.

    Thanks again for your help.

     
  • Nithin Philips
    Nithin Philips
    2011-01-05

    Sorry friend, I'm afraid I can't help you much with transcoding. My TV can play mkv files natively, so I don't have any problems there. I tried to do transcoding via mediatomb, but playing trancoded items often caused the TV to freeze and reboot. While I was looking for help with transcoding setup, I found this article to be of help: <http://www.vanalboom.org/node/10>. According to the mediatomb manual, you need an encoder that can output to FIFO files, and mencoder and vlc seem to be able to do that, but in my case to no avail. Hopefully this will get you started. Good luck.

     

  • Anonymous
    2011-01-11

    I have a first version of a valid file for Panasonic Viera G20 Mediatomb UPNP Server on Ubuntu. It has been hard work today, but looking a lot I got something that works.

    /etc/mediatomb/config.xml  Ubuntu  Panasonic Viera G20

    <?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>
        <interface>eth0</interface>
        <port>50000</port>
        <pc-directory upnp-hide="yes"/>
        <ui enabled="yes" show-tooltips="yes">
          <accounts enabled="no" session-timeout="30">
            <account user="mediatomb" password="mediatomb"/>
          </accounts>
        </ui>
        <name>MyMediatomb</name>
        <udn>uuid:0c61a209-4618-4fcc-beba-a4e06ba678b0</udn>
        <home>/var/lib/mediatomb</home>
        <webroot>/usr/share/mediatomb/web</webroot>
        <storage caching="yes">
          <sqlite3 enabled="yes">
            <database-file>sqlite3.db</database-file>
          </sqlite3>
          <mysql enabled="no">
            <host>localhost</host>
            <username>mediatomb</username>
            <database>mediatomb</database>
          </mysql>
        </storage>
        <protocolInfo extend="yes"/>
        <extended-runtime-options>
          <ffmpegthumbnailer enabled="no">
            <thumbnail-size>128</thumbnail-size>
            <seek-percentage>5</seek-percentage>
            <filmstrip-overlay>yes</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>
              <content>video</content>
            </mark>
          </mark-played-items>
        </extended-runtime-options>
      </server>
      <import hidden-files="no">
        <filesystem-charset>UTF-8</filesystem-charset>
        <metadata-charset>ISO-8859-15</metadata-charset>
        <scripting script-charset="UTF-8">
        </scripting>
        <mappings>
          <extension-mimetype ignore-unknown="no">
            <map from="mp3" to="audio/mpeg"/>
            <map from="ogm" to="video/oggmedia"/>
            <map from="mkv" to="video/matroska"/>
            <map from="iso" to="video/dvdiso"/>
            <map from="wmv" to="video/x-ms-wmv"/>
            <map from="flv" to="video/x-flv"/>
            <map from="avi" to="video/avi"/>
            <map from="rm" to="video/realmedia"/>
            <map from="srt" to="video/subtitle"/>
            <map from="sub" to="video/subtitle"/>
            <map from="mpg" to="video/mpeg"/>
          </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="image/jpeg" as="jpg"/>
            <treat mimetype="video/avi" as="avi"/>
          </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/transcode" using="mencoder-int"/>
          <transcode mimetype="video/realmedia" using="mencoder-int"/>
          <transcode mimetype="video/oggmedia" using="mencoder-720"/>
          <transcode mimetype="video/matroska" using="mencoder-720"/>
          <transcode mimetype="video/dvdiso" using="mencoder-iso"/>
          <transcode mimetype="video/subtitle" using="mencoder-sub"/>
        </mimetype-profile-mappings>
        <profiles>
          <profile name="mencoder-sub" 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="/usr/bin/mediatomb-mencoder-sub" arguments="%in %out"/>
            <buffer size="1000000" chunk-size="512000" fill-size="20480"/>
          </profile>
          <profile name="mencoder-int" 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="mencoder" arguments="%in -oac lavc -ovc lavc -of mpeg -lavcopts vcodec=mpeg2video:keyint=1:vbitrate=200000:vrc_maxrate=9000:vrc_buf_size=1835 -ofps 25 -mpegopts muxrate=12000 -af lavcresample=44100 -vf harddup -o %out"/>
            <buffer size="1000000" chunk-size="512000" fill-size="20480"/>
          </profile>
          <profile name="mencoder-720" 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="mencoder" arguments="%in -aid 0 -sid 0 -oac lavc -ovc lavc -of mpeg -lavcopts vcodec=mpeg2video:keyint=1:vbitrate=200000:vrc_maxrate=12000:vrc_buf_size=1835 -mpegopts muxrate=12000 -vf harddup,scale -zoom -xy 720 -font /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf -subfont-autoscale 0 -subfont-text-scale 20 -slang nl,en -noautosub -ofps 24000/1001 -o %out"/>
            <buffer size="1000000" chunk-size="512000" fill-size="20480"/>
          </profile>
          <profile name="mencoder-iso" 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="/usr/bin/mediatomb-mencoder-iso" arguments="%in %out"/>
            <buffer size="1000000" chunk-size="512000" fill-size="20480"/>
          </profile>
        </profiles>
      </transcoding>
    </config>
    

    Profiles reference to shell scripts

    /usr/bin/mediatomb-mencoder-sub

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    #!/bin/bash 
    srt="$1"
    output="$2"
    # filename must be of the form "movie name.XX[X].srt" or "movie name.srt" 
    base_name="$(echo $srt | sed 's/\..\{2,3\}\.srt$//' | sed 's/\.srt$//')"
    extensions="avi mp4 mpg mov"
    for ext in $extensions ; do
       input=$base_name.$ext;
       if [[ -e $input ]]; then break; fi
    done
    exec mencoder "$input" \
    -oac lavc -ovc lavc -of mpeg \
    # Frames Option in MPEG
    -ofps 24000/1001 \
    -lavcopts vcodec=mpeg2video:keyint=1:vbitrate=200000:vrc_maxrate=9000:vrc_buf_size=1835 \
    -vf harddup -mpegopts muxrate=12000 \
    -sub "$srt" -font "/usr/share/fonts/dejavu/DejaVuSans.ttf" -subfont-autoscale 2 \
    -o "$output"
    

    and /usr/bin/mediatomb-mencoder-iso

    1
    2
    3
    4
    5
    6
    7
    #!/bin/bash
    CHAPTER=`lsdvd "$1" | grep Longest | sed 's/.* //'`
    exec mencoder -dvd-device "$1" \
    dvd://$CHAPTER -slang nl,en -oac copy -ovc lavc -of mpeg \
    -lavcopts vcodec=mpeg2video:keyint=1:vbitrate=200000:vrc_maxrate=12000:vrc_buf_size=1835 \
    -mpegopts muxrate=12000 -vf harddup,scale=720:-2 \
    -o "$2" &>/dev/null
    

    http://www.vanalboom.org/node/16 is nice for a future review

    Cheers !

     

  • Anonymous
    2011-10-02

    Thanks a lot for sharing your effort.
    For some reason though the second line of your config.xml has misplaced semicolons that invalidate the XML, removing those got it to work.
    For other who may be reading this and getting errors about mencoder make sure you have mencoder installed (just run "sudo apt-get install mencoder")