This project is serious fun. Nothing is better than something that helps a geek figuring out technology and has an immediate tangible personal benefit. My “ClemensTV” (quite a humble choice of a code name!) project is one of these. The screenshot below shows what my Indigo service does to a completely innocent and unsuspecting Windows Media Player without any additional client code install/footprint. Worked on first try on my girlfriend Sabine’s notebook (that’s the benchmark; she doesn’t even have .NET 1.x on her machine) as well as on a few of my friends’ machines who I gave nothing but a username/password and an URL.  

XHTML with inline AJAX scripts, ASX stream envelopes, ASX play lists, RSS, OPML, and even raw binary GIFs all served from Indigo endpoints (one per TV channel and one for the overall channel lineup). With [ServiceContract] and [OperationContract] and all that jazz (plus, admittedly, some somewhat significant code, config and attribute “magic”).

The only thing in the Windows Media Player content pane that isn’t served up through an Indigo channel is the live video stream itself – and if it were necessary…

Tech details to come… Gotta watch TV ;-)

Categories:

October 17, 2005
@ 02:39 PM

End of the hibernation mode. Here’s one of the reasons (besides a lot of “actual work”) why I’ve been hiding in the past few months. And it very much feels like the start of a project I started a while ago (7/17/03 was the day I switched) and which is now this:

Since the beginning of the year I’ve been throwing around some ideas to fix a personal “problem” that I have as a frequent business traveler: Access to “my” local cable television (football!) and the recorded content that I have on my home machine. As I blogged already, I bought a Windows Media Center PC along with SnapStream’s BeyondTV product as a personal video recorder and “live streaming” server and got myself a 3072/512 KBps DSL connection.

It turned out that my concrete use case of wanting to access my home machine and content primarily from hotels and elsewhere on the road (and not so much from within my apartment) isn’t well covered by either Windows Media Center Edition or BeyondTV. Both products have options to stream content across the local network in some way. In addition to that BeyondTV has a small built-in web server that lets you access live TV and streams via a HTML interface so that you can actually get at it from anywhere. In fact, there are extensions for Media Center that let you do something similar. But somehow, none of that was really the solution I envisioned. What I wanted is a smart client that works online and offline and can replicate recorded content down to my notebook’s disk. I want to have the TV guide data (electronic program guide) cached on my notebook so I can schedule recordings locally (and replicate them down to the PVR as I get connected) and/or get alerts whenever a show is coming up that is of interest to me. I want a smart client that has a “10 feet” user interface and support for a remote control and the smart client shall look graphically appealing. And lastly, and possibly most importantly, I want a good excuse to stuff as many feature showcases for Indigo and Avalon (yeah, yeah: WCF/WPF, yadda, yadda) into the combined solution.

When I started thinking about how to approach this, I was thinking that the smart client was the thing to focus on. So by now I have acquired what I think is a rather scarily broad set of Avalon development skills (for a server guy, at least). Heck, I even taught myself how to tilt and turn a 3D plane with video on it without having to copy someone else’s XAML! The first UI prototype was sitting right on top of BeyondTV’s API, which is exposed as a set of Web Services, but somewhat feels like a COM API on a longer leash. Since using that API directly is a bit cumbersome, I wrote a wrapper around it to make it a bit more accessible and “service like”. And while that was all cute and started working, it somehow it still didn’t feel like the right thing to do.

What would I do about other sources? NASA TV provides a live web stream that I sometimes look at, not to mention various video webcasts for developers and the like. And what about podcasts? What about internet radio? Couldn’t blogs be integrated into all of that? Wait…. couldn’t my live TV and recording sources be like blogs?

Well, I can program and hence they can. I wrote and I am still writing an Indigo-powered server that wraps BeyondTV (and other sources) to become a “video blog” server. My Avalon-powered smart client for which I have some bits and pieces in place of course won’t be dependent on my video server, but will understand blogs, podcasts, video blogs and whatever else I can find and will integrate it all into a remote control navigable text/radio/video UI.

I’ll drill into and write about the things that I am doing to make it all work in the next few weeks and months and as I proceed. For now, I’ll just tease you a bit and show you a selection of three (incomplete in terms of content and features) XML snippets that the server generates. If you hit the server application root directory, you get an OPML with all the live TV channels that are available (the list below is shortened considerably):

< opml >
  <
head >
    <
title > TV </ title >
    <
dateCreated > Mon, 17 Oct 2005 14:27:04 GMT </ dateCreated >
  </
head >
  <
body >
    <
outline title = " MTV " xmlUrl = " http://tattoine:8100/TV/MTV " />
    <
outline title = " TELE5 " xmlUrl = " http://tattoine:8100/TV/TELE5 " />
    <
outline title = " BAYERN " xmlUrl = " http://tattoine:8100/TV/BAYERN " />
    <
outline title = " NDR " xmlUrl = " http://tattoine:8100/TV/NDR " />
    <
outline title = " TV nrw " xmlUrl = " http://tattoine:8100/TV/TV-nrw " />
    <
outline title = " RTL " xmlUrl = " http://tattoine:8100/TV/RTL " />
    <
outline title = " SAT.1 " xmlUrl = " http://tattoine:8100/TV/SAT.1 " />
    ...
  </
body >
</
opml >

If you were follow the MTV link in the OPML you’d get the MTV RSS, with the guide data much like what I am showing below. [I just left three shows in it here for demo purposes – typically every channel has about 7-10 days worth of guide data].  Note that the <pubDate> for every item is the date/time when that show is going to air. Future dates are perfectly legal in RSS. Each item has, of course, a <link> on its own, which get you to more details on the show, like a list of actors, the status of whether you want to record the show or want an alert when it starts, or some rich media preview (there something there now, but nothing I am willing to show, yet).  

< rss xmlns:wsa = " http://schemas.xmlsoap.org/ws/2004/08/addressing " xmlns:ctv = " http://schemas.vasters.com/2005/08/clemensTV/channels " version = " 2.0 " >
   <
channel ctv:mediaChannel = " true " >
      <
title > MTV </ title >
      <
link > http://tattoine:8100/TV/MTV/media </ link >
      <
description > MTV </ description >
      <
image >
         <
url > http://www.tvtoday.de/tv/programm/bilder/senderlogos/mtv.gif </ url >
         <
title > MTV </ title >
         <
link > http://mtv.de </ link >
      </
image >
      <
copyright > (c)2005 MTV </ copyright >
      <
lastBuildDate > Mon, 17 Oct 2005 15:26:09 GMT </ lastBuildDate >
      <
generator > ClemensTV </ generator >
      <
ttl > 60 </ ttl >
      <
item >
         <
title > Viva La Bam </ title >
         <
guid > EP:0001000000055045:127744056000000000 </ guid >
         <
link > http://tattoine:8100/TV/MTV/item/EP:0001000000055045:127744056000000000 </ link >
         <
pubDate > Sat, 22 Oct 2005 00:00:00 GMT </ pubDate >
         <
description > Show mit Bam Margera, USA </ description >
         <
ctv:Duration > PT30M </ ctv:Duration >
      </
item >
      <
item >
         <
title > Masters </ title >
         <
guid > EP:0001000000055045:127744020000000000 </ guid >
         <
link > http://tattoine:8100/TV/MTV/item/EP:0001000000055045:127744020000000000 </ link >
         <
pubDate > Fri, 21 Oct 2005 23:00:00 GMT </ pubDate >
         <
description > Depeche Mode </ description >
         <
ctv:Duration > PT1H </ ctv:Duration >
      </
item >
      <
item >
         <
title > Pimp My Whatever </ title >
         <
guid > EP:0001000000055045:127744002000000000 </ guid >
         <
link > http://tattoine:8100/TV/MTV/item/EP:0001000000055045:127744002000000000 </ link >
         <
pubDate > Fri, 21 Oct 2005 22:30:00 GMT </ pubDate >
         <
description > Day * Neue Reihe </ description >
         <
category > Reihe </ category >
         <
ctv:Duration > PT30M </ ctv:Duration >
      </
item >
      ... 
   </
channel >
</
rss >

Now up to here that’s pretty logical; if you follow the <link> for the <channel> (here: http://tattoine:8100/TV/MTV/media), you will get something like the following XML bit with the content type ‘video/x-ms-asf’:

< ASX Version = " 3.0 " >
   <
entry >
      <
ref href = " http://tattoine:8080 " />
   </
entry >
</
ASX >

Since that’s apparently a Windows Media Player ASX file my server generates, Media Player will open if you navigate to the URL using IE or Firefox (on Windows). Who said that the <link> in RSS must resolve to HTML? Guess what Media Player will play? MTV Germany of course. Live. As I generate the ASX stream, I instruct the backend video server to switch to that respective tuner channel. Also, since I am creating an indirection point here, I could also scale this over multiple stream servers and tuners.

One of the technically noteworthy aspects of this application is that I am using Indigo for all communication aspects, but this application spits out pure XML, even with varying content-types. In fact, the entire server will likely not put a single plain-text, XML 1.0 encoded SOAP envelope onto the wire, but will be rather REST’ish and POX’ish. The only exception from that is the chunking download protocol, which I am implementing with a TCP-duplex channel (which uses binary encoding and is strictly a Indigo-to-Indigo communication path for my smart client).

Stay tuned.

Categories: Blog