Koozali.org: home of the SME Server

Mini HowTo - MediaTomb for use with Windows Media Player 12 (Win7)

Offline Rien

  • *
  • 216
  • +0/-0
    • http://www.taurix.nl
Tested on Oracle VM VirtualBox
Please be carefull and test it yourself first before installing MediaTomb on your production server. I'm a newbe!



Server
======
Fresh install SME server 7.5.1, updated with 'yum update'

Clients
=======
Win7
Windows Media Player 12
(Windows Media Player 11 on Vista doesn't recognize the MediaTomb server !)

See http://mediatomb.cc for additional info!


To install MediaTomb you need to have access to the 'DAG' repository. In case you haven't  configured this repository in yum, you can do the following:

Code: [Select]
/sbin/e-smith/db yum_repositories set dag repository \
Name 'Dag' \
BaseURL 'http://apt.sw.be/redhat/el$releasever/en/$basearch/dag' \
EnableGroups no \
GPGCheck yes \
GPGKey http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt \
Visible no \
Exclude freetype,htop,iptraf,rsync,syslinux \
status disabled

Followed by:

Code: [Select]
signal-event yum-modify

Create the mediatomb database in MySQL:

Code: [Select]
mysql
mysql> CREATE DATABASE mediatomb;
mysql> GRANT ALL ON mediatomb.* TO 'mediatomb'@'localhost';
mysql> exit

Because there is no rpm avaiable, we have to compile MediaTomb from source.

We need the following packages to compile:

Code: [Select]
yum install kernel-headers kernel-devel cpp e2fsprogs-devel gcc gcc-c++ glibc glibc-devel glibc-headers glibc-kernheaders libstdc++ libstdc++-devel m4 zlib zlib-devel make automake fuse

Install the rpm's needed to compile MediaTomb:

Code: [Select]
yum install --enablerepo='dag' libupnp libupnp-devel libdlna libdlna-devel expat expat-devel libjs-devel spidermonkey taglib taglib-devel libexif libexif-devel
curl curl-devel libextractor libextractor-devel ffmpeg ffmpeg-devel

From http://rpm.pbone.net

Download the libmagic.so.1 for Fedora core 3: ftp://ftp.nluug.nl/pub/os/Linux/distr/fedora/linux/core/updates/3/i386/file-4.12-1.FC3.1.i386.rpm and save it in the directory of your choice.

Code: [Select]
yum localinstall file-4.12-1.FC3.1.i386

Download MediaTomb source code from http://mediatomb.cc: mediatomb-0.12.1.tar.gz and save it in the directory of your choice.

Code: [Select]
tar -zxvf mediatomb-0.12.1.tar.gz

then compile the sourc code:

Code: [Select]
./configure --enable-mysql --enable-ffmpeg
make
make install

Now Mediatomb is installed

To activate Mediatomb just type:

Code: [Select]
mediatomb

Then you probally get:

INFO: Mediatomb configuration was created in: /root/.mediatomb/config.xml
ERROR: You  are using MySQL! Please edit /root/.mediatomb/config.xml and enter your MySQL host/username/password!

Don't panic. It isn't neccessary to edit host/username/password because we generated the 'mediatomb' database with user 'mediatomb' without a password.

Just stop MediaTomb with '^C' and start MediaTomb again using:

Code: [Select]
mediatomb

Now you get the message 'INFO: database created succesfully' among other messages.

Stop MediaTomb again with '^C'

Don't forget to add the following line to the file '/etc/rc.d/rc.local' if you want to start the Mediatomb server automatically:

Code: [Select]
mediatomb -d

(option -d to run MediaTomb in the background as daemon)


Editing the 'config.xml' file
=============================

Open the 'config.xml' file.

If you want to change the name of the server, look for the string:

  <name>MediaTomb</name>  and replace 'MediaTomb' with your own name

Because I use MySQL (instead of Sqlite), I changed the following:

  <sglite3 enabled="yes"> to <sglite3 enabled="no"> 
  <mysql enabled="no"> to <mysql enabled="yes">

For PS3 support I changed:

  <protocolInfo extend="no"/> to <protocolInfo extend="yes"/>

MediaTomb generates several (virtual) containers of the same song. Because I want to use the MediaTomb server in 'Windows Media Player 12' (Win7 clients), I want to force MediaTomb to just follow the structure of my music directory (artist | album | song). To do that, I changed the following:
 
  <virtual-layout type="builtin"> to <virtual-layout type="disabled">

save the file.

To start your MediaTomb server with the correct settings do:

Code: [Select]
signal-event post-upgrade; signal-event reboot
After rebooting, you can open the GUI. Open your browser and type:
http://your-smeserver-ip-adres:49152/

(MediaTomb uses port 49152 by default)

Select "Filesystem" in the menu-bar and select your music directory (in my case /home/e-smith/files/ibays/music/files)
click the most right icon on the menu-bar (a "+" combined with a "S"). Then set:
Scan Mode = Timed
Scan Level = Full
Recursive = yes
Include hidden files/directories = no
Scan Interval (in seconds): 1800

MediaTomb will scan your music-directory and add the files to your mediatomb database.

Of course you can add more directories if you want.

Open 'Windows Media Player" on your win7-client. There you will find your MediaTomb-server.

====================


Please comment !!

« Last Edit: January 11, 2011, 11:36:09 PM by Rien »
Rien
(The Netherlands)......

Offline SuperGrover

  • ***
  • 56
  • +0/-0
Re: Mini HowTo - MediaTomb for use with Windows Media Player 12 (Win7)
« Reply #1 on: May 12, 2011, 02:00:34 PM »
Hoi Rien (I'm Dutch also),

Thanks for the great how-to. I just bought a Philips TV which has DLNA capability and I didn't want to spend money on Twonky (remember, I'm Dutch  :D)

I have a couple of comments:

The code block for the mysql commands will work for copy-pasting if it is like this:

Code: [Select]
mysql
CREATE DATABASE mediatomb;
GRANT ALL ON mediatomb.* TO 'mediatomb'@'localhost';
exit

The code:
Code: [Select]
yum install kernel-headers kernel-devel cpp e2fsprogs-devel gcc gcc-c++ glibc glibc-devel glibc-headers glibc-kernheaders libstdc++ libstdc++-devel m4 zlib zlib-devel make automake fuse
returned: No Match for argument: fuse for me ?

This command didn't work for me:
Code: [Select]
yum localinstall file-4.12-1.FC3.1.i386
I had to do:
Code: [Select]
yum localinstall file-4.12-1.FC3.1.i386.rpm
Also please don't forget to go into the extracted mediatomb directory
Code: [Select]
cd mediatomb-0.12.1and then execute

Code: [Select]
./configure --enable-mysql --enable-ffmpeg
make
make install

the ./configure gave these results:

Code: [Select]
checking sqlite3.h usability... no
checking sqlite3.h presence... no
checking for sqlite3.h... no
checking /usr/local/include/sqlite3.h usability... no
checking /usr/local/include/sqlite3.h presence... no
checking for /usr/local/include/sqlite3.h... no
checking for mysql_config... /usr/bin/mysql_config
checking mysql cflags... -I/usr/include/mysql -g -pipe -m32 -march=i386 -mtune=pentium4 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing
checking mysql libs... -L/usr/lib/mysql -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread -L/usr/lib -lssl -lcrypto
checking mysql.h usability... no
checking mysql.h presence... no
checking for mysql.h... no
configure: error: unable to configure mysql support

maybe due to this error, the make command returned:
Code: [Select]
make: *** No targets specified and no makefile found.  Stop.

Can you please help me trying to get it up and running??

Offline SuperGrover

  • ***
  • 56
  • +0/-0
Re: Mini HowTo - MediaTomb for use with Windows Media Player 12 (Win7)
« Reply #2 on: May 13, 2011, 08:19:24 PM »
I just had a email from Rien, and the solution worked:

Code: [Select]
yum install mysql-devel
yum –enablerepo=’dag’ install ffmpeg-devel
./configure --enable-mysql --enable-ffmpeg
make
make install

Thanks Rien!