Wednesday, November 29, 2006 - Posts

Windows Media Connect Practical Overview

Article Photos

WMPNSS Sharing Momento Main Menu

Windows Media Connect is a fantastic product.  In a nutshell I can plug in the Momento Photo Frame and within 2 minutes start to play pictures from my Windows Vista laptop.  But what is Windows Media Connect?

(Note: for simplicity I will primarily discuss photo sharing but most of this information can apply to audio/video as well).

Overview

WMC is a fairly new technology that appeared with Windows XP as an optional update a few years ago.  Currently in its 4th iteration it is now a very powerful framework.  The core WMC functionality is based heavily on the UPnP media renderer standard.  The standard outlines how a device may receive content from a host over a network.  Microsoft has built on this standard to provide a rich content access mechanism to enable devices (such as the Momento Photo Frame) to browse through content and display this content without breaking a sweat.  Using this we can create a highly intuitive browsing experience for the user to help them find any picture they want based on keywords/tags, date, rating and even the folder they originally were stored in.

There are essentially 2 sections to WMC.  The first being the UPnP support that allows a device to query the content service using standard UPnP commands.  The result of these queries is nicely formatted as XML and can easily be parsed.  The extraction of the content is handled by a web-based protocol.  Images are transferred via the http protocol yet audio/video uses other transfer protocols.

 

Browse Hierarchy

When browsing a WMC host a content hierarchy is presented to you.  Each step of the hierarchy is called a container which in turn can contain sub-containers.  The highest level (Container ID: 0) contains the “Music”, “Pictures”, “Video” containers and then the “Pictures” sub-container (Container ID: 3) contains the basic picture menu.  By keeping with this hierarchical view of data it is easy to remember the state and to easily navigate through the structure (Since the Picture Frame does not deal with audio/video we always start with container 3, thus automatically discarding any invalid data from the searches).

 

Windows Media Connect 1

This first version is not supported anymore so will not be discussed.

 

Windows Media Connect 2

This version of WMC has just been pulled (within the last few weeks) from the Microsoft Downloads site but since its architecture is still relevant it can be used successfully.  WMC 2 is a stand-alone application that lives side-by-side with the rest of your operating system.  At a top level (for pictures) WMC 2 can allow for a folder, date and playlist browse.  The WMC tool allows you to specify what folders are available to browse (My Pictures is on by default) and based on the data inside those folders it begins to create a list of all the available pictures.  One of the major drawbacks that we came across was the method for navigating through the dates.  The top level date container (Container ID: C) displays each possible date as a sub-container.  This can get very messy but thankfully later versions provide a nicer structure.

One of the cool things that WMC provides is on-the-fly image scaling.  The XML output specifies the URL of the picture we wish to receive.  Thankfully these URL’s can accept extra query parameters to alter basic properties of the picture.  The nicest one is scaling. {URL to image}?width=600,height=480 will return the closest image match (less than or equal to the size specified).  Since most devices will not have the processing power to rescale images (and images from modern cameras can be huge!) this feature is a life saver!  Unfortunately if your display is of a different ratio to the picture you may have to do some work to ensure that the picture is displayed in full screen (or risk having black borders added to your picture to centre it!).

 

Windows Media Connect 3 (WMPNSS v3)

Moving onto the Vista wave and along comes Windows Media Player 11 for Windows XP and a new name for Windows Media Connect (Windows Media Player Network Sharing Services).  Not only is this a fantastic upgrade to its predecessor it also includes the latest version of WMC.  WMC is not a stand-alone application anymore since WMP11 can manage your entire media library (pictures, audio, and video) and also share it to WMC devices.  From a technology point of view thankfully the basics are the same.  Browsing and downloading of content uses the same API’s so targeting your device for WMC 2 or above is a doddle and requires no code changes.

As an extra sparkle, the on-the-fly image scaling has changed slightly.  If a request for an obscure resolution 700*460 is given and the pictures original dimensions were 1024*768 the picture that is returned is 700*525 (a slightly bigger height that expected).  While this may sound odd it’s actually very handy.  Chances are the information at the top and bottom sections is irrelevant so if they are chopped off so the picture is shown full screen the unsightly black borders used to fill the space before no longer exist.  While some people may complain at this I am not too concerned.  Losing small segments from the top and bottom of a normal image really not that noticeable.

WMPNSS also bring to the table more browsing options.  Whereas with WMC 2 we had Folders, Dates and Playlists we now have Ratings and Tags/Keywords.  Tagging pictures is an easy way of categorising them and the ability to browse/play a tag from your WMC device removes the hassle of remembering what folder they were stored in.  Unfortunately setting Tags/Ratings on Windows XP isn’t easy the Windows Vista platform adds some great tools to assist with this.

Note: WMC 2 will cease to function after WMP 11 has been installed so the two will not run side-by-side.

 

Windows Media Connect 4 (WMPNSS v4)

Windows Vista provides WMPNSS 4 which on the surface looks and behaves exactly the same as WMPNSS v3.  Windows Media Player 11 on Vista looks and feels exactly like its XP counterpart but when partnered with the new Windows Photo Gallery is really comes into the light.  I won’t go into too much detail on Photo Gallery but in a nutshell, setting picture ratings and tags is now much easier and the changes are replicated almost immediately.

The ‘extra sparkle’ I described earlier with the XP on-the-fly scaling isn’t available though.  Having spoken to Microsoft about this issue it seems that although the 2 versions of WMP look the same (XP and Vista) they are in-fact using 2 different code paths so unfortunately some differences occur.  Although this isn’t such a big problem (for example you just query 1024*768 instead of 1024*600) it doesn’t quite make sense why this has been taken out.

 

How can I use this?

Now that I have described what Windows Media Connect actually is I will follow up this post with how we can actually talk to it.  Future articles will also focus on my experiences with developing the Windows SideShow content and how we took the Momento frame from concept to completion.