image_alt_text

8

Feb/10

MediaTomb DLNA To Playstation 3

Monday, February 8th, 2010

Overview

I found the Video plugin for MythTV 0.21 to be inadequate for streaming to the Sony Playstation 3. It didn’t update fast enough when you dropped a video into the UPnP directory and also there was no external way of telling it to refresh it’s list of files without starting up Myth Frontend.

MediaTomb

MediaTomb is a UPnP server which can run as a standalone or as a daemon. It uses an XML configuration file for it’s settings (pretty neat stuff) and is pretty small in size. The software comes with it’s own web server so you don’t have to install a full apache install to get to the control panel and it uses SQLite by default so no big database backend to be installed.

Install & Configure MediaTomb

Install MediaTomb and ffmeg thumbnailer
sudo apt-get install mediatomb ffmpegthumbnailer
That’s it for the install!

edit the file config file in /etc/mediatomb/config.xml and change the following settings:

Enable PS3 support change this:

<protocolInfo extend=”no”/><!– For PS3 support change to “yes” –>

to

<protocolInfo extend=”yes”/><!– For PS3 support change to “yes” –>

and also

<!– <map from=”avi” to=”video/divx”/> –>

to

<map from=”avi” to=”video/divx”/>

Add the line
<pc-directory upnp-hide="yes"/>
below
<webroot>/usr/share/mediatomb/web</webroot>
so that it looks like this
<webroot>/usr/share/mediatomb/web</webroot>
<pc-directory upnp-hide="yes"/>

This hides the full directory path from the Playstation so it can only view the directories added and not the full system.

Add the following to enable thumbnail previews. I have found this does not work 100% of the time.

Enable transcoding
<transcoding enabled="no">
to
<transcoding enabled="yes">

Add the following transcode mappings under <mimetype-profile-mappings> tag:

<transcode mimetype=”video/divx” using=”video-thumbnail”/>
<transcode mimetype=”video/mpeg” using=”video-thumbnail”/>
<transcode mimetype=”video/mp4″ using=”video-thumbnail”/>
<transcode mimetype=”video/x-ms-wmv” using=”video-thumbnail”/>

Add the following settings between the <profiles></profiles> elements. Not the parent is plural and each profile is singular.

<profile name=”video-thumbnail” enabled=”yes” type=”external”>
<mimetype>image/jpeg</mimetype>
<accept-url>yes</accept-url>
<thumbnail>yes</thumbnail>
<resolution>128×128</resolution>
<agent command=”/usr/bin/ffmpegthumbnailer” arguments=”-i %in -o %out -s 128″/>
<buffer size=”524288″ chunk-size=”512″ fill-size=”1024″/>
</profile>

Restart MediaTomb service sudo /etc/init.d/mediatomb restart If it fails to restart then double check the config file for errors.

Go to the machine in a web browser on port 49152 e.g http://localhost:49152

On this web page configures the directories available over UPnP. The Database section shows what directories are visible / registered to MediaTomb and Filesystem shows the computer directories that can be added for DLNA / UPnP visibility. When a directory is added MediaTomb scans the directory and register them so they show up on the Playstation. These can include music, videos and pictures.

In the top right hand corner there is a plus “+” with two arrows around it. Clicking on it loads a new page in the main window, replacing the file lists in the directory. This is the page for setting how often it scans for changes.

Go to the Playstation, turn it on and go to the relevant category e.g photo in the menu. There should be a MediaTomb server in the list. If it does not appear go towards the top and scan for more media servers to look for MediaTomb.

Summary

The software is pretty self contained but I would have liked the option to use Apache and MySQL because those are already installed on my system.

MediaTomb does the job for now and whilst I cannot get the thumbnails to work on all the media it still does a brillant job of streaming the media to the Playstation. Unfortunately it’s not integrated into MythTV so records will still have to be done via MythTV but this is not a problem because all recorded TV shows are registered in the database.

A problem I did encounter was that I added multiple directories but reguardless of where they reside on the computer, all videos appear in one directory on the Playstation. I’m not sure if this is a bug or how it’s suppose to work.

[HOWTO]:Stream DivX/XviD to a PS3 with firmware 2.10 using MediaTomb and Ubuntu 7

22

Jul/09

Ubuntu Music Streaming Server – Ampache

Wednesday, July 22nd, 2009

Overview

I wanted a music server for personal use so that I can access my music collection remotely or locally. A web front end with the ability to stream to various players would be key. It had to run on my Ubuntu system.

I do not / this article does not condone the use for piracy in any way.

GNUMP3d

GNUMP3d is a GNU music server. It is in the Ubuntu 8.04 repository and includes it’s own light weight server (good and bad points to this method). It’s all self contained so it does not require Apache or a database installed to run it.

The web front end is very basic with only text on the web page but has the ability to record statistics. Being a basic music server it does not support album art but it does have a lot of themes built in. All settings are changed in the config file but cannot be changed using the web front end. This means starting up SSH to even change a small setting like your chosen theme.

It runs on any system which has perl installed. The problem I had with this set up was the lack of user authentication. It had a “weak” and basic method of using a .password file which can be placed in the root of the music directory but this support was removed in the new version because it was “weak”. I do not want my server to be publicly accessible (that’s just asking for trouble). I went ahead and removed it.

Ampache

Ampache has more weight to it than GNUMP3d. It requires a web server, PHP and MySQL (Not tried it with any other database). It supports tags and album art, There is also an option for lyrics but I have yet to see this in action.

The music server has many options including different playlist formats:

  • M3U
  • M3U Simple
  • PLS
  • ASX
  • RAM
  • XSPF
  • And also different streaming formats like shoutcast as well as different playback methods. The best part about Ampache is the built in flash player. Just like the BBC Radio player it opens a new window with the player and controls.

    The web front end allows you to create and modify playlists, upload, download, and find duplicate music files. Ampache has built in access control level (ACL) which is basic but it works.

    There are only 2 themes included and last.fm plugin. The non default theme is “pretty” but I find the font to be too small and there is no way of changing it. It has statistics and recently played songs which are bonus features.

    Pre-Requisite To Ampache

    Install Apache and MySQL if not already done so:
    sudo apt-get install apache mysql
    When prompted, enter the root password.

    Ensure Apache is up and running by typing http://localhost in a web browser. A message saying “It works!” should appear.

    Optional:
    Install MySQL Administrator to easily maintain the MySQL database:
    sudo apt-get install mysql-admin

    The following steps are beyond the scope of this how to:
    Connect to the database using your root account (using MySQL Admin).

    Create a username and password for Ampache as well as a schema. For remained of this post I will user the username=Ampache and password=password using the database schema Ampache.

    Ensure the Ampache database user has all privileges to the Ampache schema.

    Install Ampache

    Download the latest Ampache from Ampache.org/”>http://Ampache.org/ In my case it was 3.5.1
    wget http://Ampache.org/downloads/Ampache-3.5.1.tar.gz

    Extract the compressed files:
    tar -xzvf Ampache-3.5.1.tar.gz

    Move (and rename) the directory Ampache-3.5.1 to the web directory (by default in /var/www). Depending on where you want to access Ampache will depend on where you move the directory. Do ONE of the following:

    For Ampache to appear in the “root” directory e.g http://www.dannytsang.co.uk move all the files in Ampache-3.5.1 to /var/www:
    cd Ampache-3.5.1
    sudo mv * /var/www

    For Ampache to appear in the sub directory e.g http://www.dannytsang.co.uk/Ampache move all the files in Ampache-3.5.1 to /var/www:
    sudo mv Ampache-3.5.1 /var/www/Ampache

    Ensure you have got your Ampache files in the place you want to access them. I had to re-install it because I kept the directory as Ampache-3.5.1 which made it http://www.dannytsang.co.uk/Ampache-3.5.1/
    To re-install I have to remove the file /etc/apache/config.d/Ampache and go back to the beginning to copying the file.

    Next step is to ensure the file permissions are set correctly. For method one:
    sudo chmod -R 774 /var/www

    For method two:
    sudo chmod -R 774 /var/www/Ampache
    sudo chown -R root:www-data /var/www/Ampache

    Head over to http://localhost or http://www.localhost/Ampache and follow the on screen instructions to install Ampache.

    Post Install

    Everything else can be configured from the web interface with the exception of the music directory. Where ever you want to add music to Ampache, you have to make sure it has at least xx4 (read) file permission otherwise the Apache / Ampache will not be able to see the file. If you want to allow Ampache to manage files e.g upload new music files to your library you will need to give it write access too. The best way to deal with this is to add www-data to your username group. Either way I do not recommend allowing write access for security reasons.

    Review

    Ampache Login Page

    I intend on using the server whilst I’m not at home e.g abroad or at work. I can listen to all my collection without carrying it around with me and now my iPhone has more juice. I only use my iPhone to listen to music when I’m not in the office or listen to podcasts.

    The reason why I won’t use it for podcasts is because it doesn’t have speed playback and no bookmarking feature which allows you to resume from where you left off.

    Flash Player

    The Flash player was usable. It showed a dark grey buffering bar and a light grey bar for the currently playing track. A good visual of how much has been downloaded from the stream. All the tracks for the current play list is shown along with the album art cover (nice touch).

    WMP Player

    M3U streaming to Windows Media Player (WMP) worked very well. It too showed the album art and this method I could use the media keys on the computer.

    Both players had reasonably good quality but the flash player lacked settings to adjust the buffer rate. The problem with both methods was the buffering. Not only did it need to buffer for each track but it had to re-buffer if a song has already played – something common to streaming media except for QuickTime.

    WMP did lack the track titles until it got to the track itself. All it shows is index in the play list for the track if it hadn’t gotten to it yet.

    I suffered a lot of pauses from the flash player because it had to buffer a lot through random moments through the day. However, WMP also had it’s buffering problems too but I could set the buffer limits to cope. When this happens I had to turn to the player to see what was going on, distracting me from work.

    Ampache Track List

    Playlists can be a powerful tool but in this case it’s pretty simply use. There is a current playlist which you add you tracks to. You can save this list determinately as one playlist which adds a date time stamp and your username. You cannot rename it to something more useful. The current playlist can be formed of multiple store playlists as well as adhoc tracks.

    Ampache supports tags and track ratings. Ratings can be changed online too. It includes the usual filtering and sort of tracks by artists and albums as well as search.

    Adding libraries are fairly easy. You give it a directory path and it will index the given path. Libraries may exist locally or remotely. Options to update, clean, etc will automate management of songs.

    Ampache ACL

    Working with Ampache User Access Control Level (ACL) was easy but may be too simple for power users. It has a drop down of all available groups for a given feature. The bad part is it assumes that any group above the selected group also has access to that feature. I believe it does not allow you to add new groups either.

    Summary

    Ampache is a good but media server. As always the user interface could be tweaked and a lot more plugins and features can be added e.g HTML 5 player, uPNP but that’s like asking for the world. The set up was very easily to do and does all the basics I want.

    GNUMP3d Website

    Ampache Website

    28

    Dec/08

    Enabling Remote Access To MySQL

    Sunday, December 28th, 2008

    I recently set up a virtual machine with Linux running on it to test stuff out. I ran into the issue which I have solved many times when I had installed my server at home which has a LAMP set up. By default MySQL restricts access to the database to only root (because this is the only account that have been created) and on the local machine access only.

    First edit the MySQL configuration file. On Fedora this is located at:
    /etc/my.cnf
    and comment out or delete this line:

    bind-address 127.0.0.1

    to

    #bind-address 127.0.0.1

    Save the file and edit the permissions in mysql
    mysql -u root -p
    A password prompt for root should appear. Once logged into MySQL execute this command:
    GRANT ALL PRIVILEGES ON *.* TO ''@'%' IDENTIFIED BY 'password'

    where:

    • GRANT ALL PRIVILEGES ON – Gives full access to…
    • *.* – All tables. May be replaced with database or schema name
    • ‘root’ – user to grant permission to. May be replaced with other user names
    • ‘%’ – Any host wildcard. Can be replaced with domain or IP address to allow user to connect from
    • ‘password’ – The password for the user. May had different passwords for different domain / location of connection e.g localhost can have one password and 192.168.0.1 may have another

    Restart MySQL:
    sudo /etc/init.d/mysql restart