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

28

Dec/09

Unable to access MythTV Perl API. Try with –verbose to find out why.

Monday, December 28th, 2009

I have been getting the error message

Unable to access MythTV Perl API. Try with –verbose to find out why.

on MythTv running on Ubuntu 8.04. It wasn’t bothering me too much because the TV guide was still being updated. Also I believe this is something to do with MythTV-Status only which prints out in the console what is being recorded (if any), next up coming recording and the amount of available space.

The problem is the MythTv-Status program is ran on a schedule and is requires the config.xml in the ~/.mythtv directory to be copied or a symbolic link in /root/.mythtv Run the following commands to solve the problem:
$ sudo mkdir /root/.mythtv
$ sudo ln -s ~/.mythtv/config.xml
$ sudo /etc/init.d/mythtv-status reload

The last command will run MythTv-Status to read the new configuration XML file and run without any errors.

The only problem it has caused is that it does not say how many days worth or TV guide it has where as before this fix it specified it with errors.

Unable to access MythTV Perl API. Try with –verbose to find out why. Ubuntu Forum

16

Aug/09

Recording CurrentCost Data & Viewing It On The Web

Sunday, August 16th, 2009

Overview

I have (finally) got my project to a working stage so I thought I’d write a bit about it. After buying a CurrentCost CC128 device I was not happy with the software on the Internet for extracting the data. The FDI chip used on the USB cable to the device did not support 64 bit Windows 7 so it crashed on me and the Linux alternatives were basic and look fairly complicated to set up.

Planning

Architecture Diagram

I want the data to be accessed via a web page. I decided to use JavaScript to implement the graphing and AJAX to do a client – server architecture. Also it’s the most popular way of generating dynamic web page which I hope the graph would be done in near real time.

I have not decided what technology for the server side script which would handle the AJAX requests but I ended up using PHP. The PHP script retrieves data from the database, formats it and sends it back to the web page to be graphed.

I have a LAMP stack configuration so I’m using an Apache web server with a MySQL database. All the device data will be stored in the database by a another script which I wanted to use Python for.

The Python script listened for the XML strings sent via a USB cable from the CurrentCost device. The script would then extract the data from XML and store it into the database.

From the start I wanted my software to run on a Linux based system because I want a server at home running on Linux 24/7. This would allow my other devices to be freely turn it self off etc. Also most of other services were on Linux.

Implementation

The FDI chip from the USB cable takes care of the USB to Serial conversion which makes reading data a lot easier but also it uses an up to date connection. Using a terminal and example XML documents found on the web I could see what the XML format looks like. All data is sent every 6 seconds over USB to a serial port. Ever 1 minutes past the hour e.g 15:01 historical data is sent over the cable or by pressing a button on the device.

Once received the Python script parses the XML, extracts data it needs and inserts it into the database.

When a user views the web page, an asynchronous request is sent to the PHP server side script, gets the data from the database and returns it to the web page. The web page then formats it correctly to be parsed into a JavaScript Graph. The web page is currently set to refresh every 10 seconds but this may change depending on how the server holds up.

Graph

Problems

At the moment there are loads of problems and improvements that can be done. This is just a brief post of what I have so far. The Python script can’t handle the historical data and falls over so it won’t run longer than 1 hour.

The AJAX response returns a formatted string. I want to convert this to an XML response so it’s easier / cleaner to retrieve multiple data.

I want to limit the data by date / time because the graph will look tiny / there would be a lot of information being sent back and forth every 10 seconds refresh.

I’m not happy with the scaling of the graphs. It’s using dual axis for energy and temperature.

Some sort of statistics besides a graph like total engery consumed for x days/months/years, etc.

Eventually the Python script will become a Linux Daemon but this is only once it’s stable enough.

Twitter Integration would be nice. I would use the Python script to post a tweet every hour with a simple message. The profile will be protected so that only I can see what it says.

Summary

Still got ways to go but it’s getting there. It’s nice to finally see something from my days of work. Especially if I have never used Python or PHP from scratch before.


CurrentCost previous post

CurrentCost Website

CurrentCost XML Specification

Dale Lane’s Blog on how to get data from a CurrentCost device

29

Sep/08

NewsGator RSS

Monday, September 29th, 2008

Overview

Whilst I’m not new to RSS/ATOM I have only recently started using an RSS Reader/Aggregator/Catcher/what ever you want to call them. RSS is one of the latest developments to use XML standards to deliver content using a subscription model. The RSS can contain anything from text to multimedia. Podcast is an excellent example of how it works but today I will be discussing RSS news reader from NewsGator.

Background

While RSS has been around for years now and ATOM arriving on the scene I have yet to believe in such methods of reading because almost all feeds that I would use only delivers cut down synopses of each article. This means I would see the title and a short description of the article and to read the full article I have to click on a link to load the web page containing the article. To me this just breaks the user experience as RSS is fairly plainly formatted but it worked for reading. When you click on the link to read the full article the actual site loads up with full of colour, images and adverts.

People may argue that they won’t get as much visits/hits on their original website. Well the RSS content is pulled from the original site and people have to go there to subscribe to it (most of the time). Now people might say they won’t get any clicks on their adverts… I mean sponsors. I do not see the problem with embedding the banners in the RSS feeds itself. RSS does allow this! Then there’s the argument for mobile devices or low bandwidth users would want a smaller version for faster download. Well most feeds currently that I use are cut down versions. I don’t see why web developers can’t include both. The full feed should display a summary for it’s first paragraph any ways.

I only started to use an RSS reader when I got my iPhone 3G. It was handy and cached (the summary at least) of articles from the sites I regularly visit. It saved a lot of time from loading the full site which could take a while when I’m on the go and reduced to EDGE or GSM. Since then it has rubbed of on the desktop.

I used NetNewsWire on the iPhone which was created by NewsGator. NewsGator provide an online service similar to Google Reader where you can access your feeds online. The reason I chose NewsGator service over Google was because they had their own RSS readers.

NewsGator Online Reader

NewsGator Online

NewsGator Online

NewsGator’s website looks similar to Google Reader where your subscriptions are on the left hand side with the main pane where the news is displayed in the middle. On the right is a column for recommendations.

I personally prefer the look of NewsGator because it’s clear with no coloured boxes all over the place however I do find the font size to be a tad small.

Both sites use strong or bold font face to highlight unread articles with a leading bracket displaying the number of unread items. Other similarities include tagging feature, email / share the article and function to mark the item as read or unread. Both sites offer different display options from list view to summary.

Google Reader

Google Reader

Google does have some cool statistics showing your reading habits as well as the ability to “star” things. NewsGator has a similar feature that allows you to attach the news article to your clippings. The best feature of Google Reader is it’s built in player. This means you can listen to a podcast from within the reader itself.

NetNewsWire (iPhone)

NetNewsWire iPhone Version

NetNewsWire is an iPhone app from NewsGator I have used it for a while now. When I first used it, it had few problems. Over time it has had updates and broke more things than it fixed. The current version is doing fairly well. It’s at the point where it looks like a production quality software. Unfortunately they have moved the settings to the iPhone settings page so in order to change anything you have to quit the application, navigate your pages to the settings, open settings and select NetNewsWire. This is very bad but once you have the settings done you would rarely visit it. It’s still no excuse for not having a link in the application.

NetNewsWire iPhone Version Badge

The application supports badges. Although it does not refresh your RSS feeds when the application is running it does display the number of unread items if you do not read all of them. There is the option to turn this off.

The app can load the full article in the app itself. It looks like an embedded version of Safari but it does not support the accelerometer.

The iPhone version also doesn’t have any other display or filter options. You can’t even re-mark read items as unread. The feeds are always listed in alphabetical.

Considering the power of the iPhone I believe there is much more room for improvement yet it’s still usable and they have ironed out the bugs that I can see so far.

FeedDemon (Windows)

FeedDemon

FeedDemon

FeedDemon has an Outlook feel to it. The subscribed feeds are on the left hand bar where your mail folders are normally displayed and the middle/right pane where the list of emails would be displayed is where the news items are.

The feed list uses a tree node with the ability to add custom folders/parent nodes for you to sort your feeds. Feeds with unread items are highlighted in bold and a bracket at the end of the feed name displays the number of unread items. The feed list pane is collapsible. Clicking on any of the child notes will display the RSS feed in the middle pane.

To read more you have to click on the title of the post or click the “read more” button usually displayed at the bottom of the description. This opens the web page with the article within FeedDemon itself.

FeedDemon has a neat function which allows you to watch for key words. You can add words to look for and simple search expressions like to look in the title and / or the description of the post, match case, whole word and / or all key words. These watch lists are executed every time the reader refreshes the feeds.

The feed items are sorted in chronological order with each post filed by days. The “Mark all items as read” button only marks the news under that day as read where as on the Mac it marks everything as read. I prefer the Mac way as you may see multiple days on one page! Also the button is in the main pane itself instead of the toolbar. This means the button disappears from the screen whilst you scroll through the news. Once you have looked at / opened all your news items you have to scroll to the top to mark all your unread items. There is a keyboard shortcut to do this.

FeedDemon Most/Least Popular

FeedDemon Most/Least Popular

FeedDemon does list a “Feeds I Pay the Most Attention To” and “Feeds I Pay the Least Attention To”. This can be accessed by clicking on the root node / subscriptions folder. I’m not sure how it calculates this whether you have to click on the article itself to be counted as read or loading the full article via the feed or how often feeds post things but it does seem quite accurate.

Instead of cool third bar on the right side like the Mac, FeedDemon uses tabbed browsing. Whilst this has done wonders for web browsers FeedDemon shows how not to implement tabbed browsing. You must have one tab open but the tab bar doesn’t show till you have more than one tab.

This would normally by for your feed list however you can open articles within this tab. What tends to happen is whilst an article loads, I click on another feed to look at other unread items. Of course if you don’t open up a new tab your currently loading article will turn into your feed listing! Not only that, the tab close button is on the right and not on all the tabs. I suppose this is preference but it should have the option.

The different views in FeedDemon are very obscure. I use the Folder view but changing the view to Feed View does nothing but add an overlay over the feed icons like you get a small arrow on shortcut icons in Windows.

There is no node in the tree where it display all the news that are unread from all the feeds like the Mac client. This is very of putting as I have to click on all the tree nodes that have unread news items instead of getting them all listed in the middle pane.

NetNewsWire (Mac)

NetNewsWire Mac Version

The Mac NetNewsWire RSS reader is similar to the Windows version with a few exceptions. The Mac has a third bar on the right which displays the web page of the news articles you went on to read the full article. It’s good because it lists them in thumbnail view so you can see a preview of the page. It also caches the page so it doesn’t have to load again and allows you to go back to another web page or back to the feed list whilst it’s loading. The bar only appears if you have visited a site otherwise it’s hidden allowing maximum viewing space. There is also the option to open the links in the background. but I have found it not to work like the Windows reader.

The Mac client also supports Growl notifications.

The font size is again a bit small. The reader has the option to change this.

For some odd reason NetNewsWire defaults it’s feed checking to every four hours. To me this is a long time to refresh news. Again a simple change in the preference will sort it out but it doesn’t help improve the usability.

Summary

All the readers by NewsGator are very good. They are fairly mature and stable. The service just works for text based RSS but for podcast support Google seems to be one up with it’s built in player.

The service provides a nice way to read the news and know which one’s you have read across all the supported platforms. Each reader has the pros and cons with the iPhone app being the most limited but it’s also the most recent out of all of them.

It’s a shame there is no Linux client. I’m always surprised by how companies can produce a Mac but no Linux support but I digress.

NewsGator Website
Google Reader
NetNewsWire