Thursday, September 18, 2008

Media Center / PVR Concept

Recently, I had an idea for an open concept Media Center and PVR. This concept includes a 3 tier system consisting of a Front End, Application Server, and Backend.

The First Tier
The Front End consists of an Html/Css/Javascript rendering engine combined with a media player. WebKit and Mplayer would be a good choices for this, since both can already be ported to different hardware, including PCs and low powered devices.

Using Html as the front end seems like a logical choice since there is a large pool of existing web developers that are familiar with technologies. The Front End engine will also require a robust media player engine such as mplayer or vlc. Html pages can embed video windows into their pages, as when displaying the Guide data, or play fullscreen, when watching regular TV or movies.

The Html UI itself would have several common branded UI elements, such as input boxes, tables, buttons, etc, and Application Designers would be encouraged to leverage those UI elements so that themes would would work with their custom applications.

The Second Tier
The second tier would be an Application Server. My choice for this, because I use java, would be to use Tomcat or Jetty as the server. The server's role would be to serve up resources to the Front End and to handle Rest services. The Server, since it is a standard Application Server, can host any number of custom, server side applications. The applications would be deployed to the Server and then accessible to any of the clients. There would be a well defined set of restful services that would define the core interactions between the Client and the Application Server.

Two standard applications that would be deployed on the the Server would be a Media Center application and a PVR Application. These 2 core applications would simply be pluggable proxy applications that proxy Front End requests to the Back End. For example, the Frond End may send to a request to the Server for a list of all movies in the Media Center. The Server would dispatch that request to one or more Backend plugins, and send the formatted results to the Front End. The Server, in this case, would accept plugins for different Back Ends, and the server could, in theory, utilize multiple backends or different types. Examples of backends, could include MythTV or SageTV.

When media is being streamed to the Client, it would either do so via a proxy service in the Application Server, or the Client would play the Url directly from the backend. Using this model, if a back end can support exporting a media streams over http, then it can elect to have its stream read directly by the client. In the case where the back end cannot export it's media stream over http, then the proxy application in the application server would provide an http stream to the client. But, even if a client is receiving a stream directly from the backend, it would still be required to send its commands via the application server. In order words, the backends are media exporters only, and should not be interacted with directly from a client.

The Third Tier
The third tier is the Back End. As mentioned above, a back end would probably consist of using MythTV, SageTV, or some other extensible PVR/MediaCenter that is already well established. By using an existing backend, as a plugin, the user is not locked into any technology, and they can move between different backend solutions. This may not be an attractive feature to backend providers, but it is an attractive feature to consumers.

Keep in mind, the concept here remains the same, no matter what the actual technology that is used. The concept is an open media center consisting of 3 tiers; Html Frontend, Application Web Server, and PVR Backend. I've chosen Java as the preferred Application Web Server, but in reality, it could be any open web server technology.

Pros and Cons
Pros
  • Web technologies are widely used and fairly easy to understand
  • Using a middle tier means that you don't have vendor lock in
  • Doesn't "reinvent the wheel" when it comes to PVR solutions, since you are reusing existing PVR Backends.
  • WebKit and MPlayer haven been ported to many embedded devices.
  • Rapid development and deployment of Media Center applications using Html
  • Middle Tier can proxy more than 1 back end, allowing you to add/remove backends for testing, etc.
Cons
  • Many systems are single tier, some are 2. Adding in a third tier (in this case ,the middle tier) adds some complexity.
  • Html won't allow from some of the eye candy that some Media Centers are using today.
  • Interaction between the Front-end and the Middle Tier needs to be well thought out.
Conclusion
I own a number of small embedded devices, such as the MVP and HD-100. At some point, I'd like to play around with seeing how well these devices could handle a WebKit rendering engine and see if this idea could actually come to life on these devices. I know some people have played with the MVP and have used it as a front-end to ReplayTV and MythTV. My challenge would be so see if WebKit could actually run on these devices and be usuable as a MediaCenter/PVR front end.

Wednesday, September 17, 2008

Metadata Tool Goes Visual

I originally wrote the Batch Metadata tool because I had a large collection of movies, and Sage didn't provide a way to import my existing collection with metadata. Nielm's IMDB tool was good, but it's a one at a time solution.

So, a tool was born, and it works quite well at what it's meant to do; fetch metadata and create output properites and thumbnails. Now, I'm looking at a bigger picture, that includes full media management. Obviously the Batch Metadata tool is a part of the solution, and I decided to use GWT (Google Widget Toolkit) as the UI. I was looking for an excuse to try out GWT and this project became my excuse.

I decided to make this a web application for one main reason; I like web applications. I read my email online, my photos are online, my calendar is online, and all this translates into convenient access to my information. I wanted my media to be accessed in the same way. I have 7 computers in my house. I don't use all of them, but I do use 4 of them. I wanted to be able to quickly access my media, make changes and import new movies from any of those computers. A web application made sense.

The features that I'm looking at putting into this application include
  • Media importing from local filesystem.
  • Metadata fetching (from multiple sources)
  • Batch metadata updating (from multiple sources)
  • Metadata editing
  • Cover art updating (from mulitple sources)
  • File management (moving and deleting)
  • UPnP Server
  • Media playback
  • SageTV integration
  • Handle TV media (recorded shows) as well as movies.
This project has started. I'm hoping to have a beta of it ready to go in a few weeks. Obviously the beta won't include all the features, but hopefully it will provide some of the core ones. I realize that there are a couple of web project from SageTV, but this isn't a SageTV application. It's a web application that may or may not integrate with SageTV. It will not run in the same java process as a SageTV server (but it could).

Stay in touch. I'll update my blog on the progress.

Monday, September 15, 2008

SageTV - PVR and Media Center

Several months ago I decided to take SageTV for a spin. I'm a long time XBMC fan, but with HD becoming ubiquitous, I needed to find a solution that could deliver HD content to my TV, and XBMC on the Xbox wasn't doing it.

My first experience with SageTV was a little disappointing. I only needed a HD Media Center, and Sage's Media Center functionality is severely lacking. But, despite that, I forged ahead with a complete SageTV install. The final selling point for me was the SageTV could use a thin client media extender as a front end. Shortly after installing SageTV, I purchased the HD100 Media Extender for SageTV. This extender product worked flawlessly on my divx, xvid, dvd, and HD content. Without the HD extender, SageTV is just like any other Media Center solution, except that it costs money.

One of the core features missing in the SageTV Media Center is the lack of an automated metadata import tool, that can import movie metadata from external sources, such as IMDB, or other locations. This is a standard feature in my XMBC configuration and not having it made the movie experience so much less enjoyable. Not having this feature bothered me so much that I decided to write an external tool that could scrape movie information from several sources and allow SageTV to import that information. This tool is the Batch MetaData Tool. Although the Batch MetaData Tool was written with SageTV in mind, it can be extended to output it's metadata information in different formats. I'll post more about the this tool later.

Since Installing SageTV and buying the HD100, I decided to give the PVR funtionality a try. I started out with SD content, then I purchased the HD-PVR and a Bell 6141 reciever and I started recording HD content. The quality and the performance was very good. SageTV has a very nice interface for recording TV shows, resolving conflicts, and managing recorded shows. I still can't use it to replace my Bell dual tuner HD PVR, but I do use it to supplement it. The great thing about having SageTV is that all of my recordings can be accessed via any computer, or extender, in the house, or even over the internet using the Placeshifter client. Record once, Watch anywhere; a dream come true.

Unfortunately, it's not all bliss. My SageTV setup has locked up from time to time. It seems that it is a combination of SageTV and the HD-PVR. If I disconnect the HD-PVR, then SageTV does not lock up at all. In fact, my SageTV was up for several months until I hooked up the HD-PVR. This may have nothing to do with SageTV and everything to do with the HD-PVR drivers. I'm still investigating.

Just for reference, I thought I'd make a Pros and Cons list of SageTV features.

SageTV Pros
  • Stable and reliable PVR and Media Center
  • Supports SD and HD extenders
  • Supports Plugins
  • User-friendly UI
  • Java based (not everyone would consider this a Pro, but I do)
  • Runs on Windows/Linux/Mac
  • Has built-in EPG data
  • Great at managing recordings
  • Placeshifter that turns SageTV into a Sling like appliance.
SageTV Cons
  • Linux version has no trial
  • Plugin model requires learning a new Xml scripting language
  • Media Center is very lacking in features (IMDB lookup, Stacking, Genres)
  • Cost. You license everything. Server, Client and Extenders.
  • No UPnP Media Server or Renderer support.
  • Can't play DVDs unless they have been decrypted.
  • Can't play iso files.
  • Placeshifter can't play DVDs at all.
Despite its shortcommings, SageTV is still a great buy, in my oppinion. Keep in mind that SageTV has a very active plugin community and many of it's shortcommings are addressed in user contributed plugins. For example, IMDB support and Web support are both available as plugins. Also, Microsoft Media Center converts are happy to find that there is a SageMC UI replacement that seems to appeal to their visual senses.

If you want a slick HD setup, without a computer in the living room, then SageTV is your answer. It may not be the most visually appealing software, but it will get the job done. If you plan on having a full blown computer in the livingroom, then perhaps something free and open source might be a better option. When I first bought SageTV, XMBC for Linux was not available. Given all that I really wanted was a HD Media Center with lots of functionality, then XMBC for Linux would be been a great choice. It would have required that I put a computer in the livingroom, but given what I've spent on SageTV licenses and hardware (HD-PVR and HD100), I could have put a computer in the livingroom.

So, I've jumped into SageTV with both feet. My next steps are to personalize it and make it better for my needs. To achieve this, I've compiled a list of projects that I'm either working on, or plan to work on, in order to make SageTV better suit my needs.

Proposed Personal Projects
  • GWT based media management tool (extending what I've already done with the Batch MetaData Tool) (in progress)
  • Add in UPnP Server support so that I can use my Xbox's as SD clients, and potentially a PS3 as a client. (researching)
  • Remote API for SageTV (Export the SageAPI as a set of restful services) (in progress)
  • GWT based plugin manager. Tool that will show plugins, and allow you install them from the web interface. (researching)


Stay in touch, and I'll keep you posted on how I make out with these ambitious projects.

Friday, September 12, 2008

First Contact

I play with a lot of technologies, mainly java enabled ones, but still, I do my share of testing the bleeding edge.

As I dabble in each of these new and old technologies, I find myself making notes about things I like and things I don't like. I thought it might prove useful to others if I shared my experiences as I investigate and use technologies.

Over the past year, I've played with, OSGI, UPnP, GWT, MythTV, SageTV, and extending my knowledge of the Java language. I have 13 years experience programming online commerce applications. 10 of those years were spent in Java. The first few years I spent in C, until I was forced to move to Java. I resisted the change, but now I am very much a Java technology evangelist.

Over the next few months, I'll post articles on my experiences with technology. Some of the upcoming ideas that I'm currently working on include....
  • Writing applications using GWT
  • MythTV as a SageTV network encoder
  • Embedding OSGI in existing applications
  • Building a UPnP Server
  • Java Lessons
  • SageTV experiences
Stay tuned, and feedback is appreciated.