You are currently browsing the monthly archive for February 2009.
This is an awesome little service that my colleague Derek Baron pointed me to.
I’m constantly forgetting what the namespace is for a given prefix in RDF. This little service lets you type in the prefix that you need and gives you back the namespace that you were looking for.
Try these examples. If you look at the source, you will see it is very easy to use in your own tools.
http://prefix.cc/foaf,dc,owl.ttl
If you add the .sparql extension, it will give you back a valid SPARQL query all ready to edit.
http://prefix.cc/rdf,rdfs,owl,dc,foaf,skos.sparql
If you want to get just the plain text for you tool, you can add .plain to the format.
http://prefix.cc/rdf,rdfs,owl,dc,foaf,skos.sparql.plain
And you get back this nicely formatted SPARQL query in plain text (no html tags).
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT *
WHERE {
?s ?p ?o .
}
A new whitepaper created by Xavier Pouyat, Alex Zambelli and team provides guidance for migration of media solutions built out on the old WMP OCX control.
It covers migration to Silverlight, Moonlight, Expresion Encoder, Play Ready DRM, etc…
http://www.streamingmedia.com/whitepapers/SilverlightMigrationGuide-February2009.pdf
Amazon announced recently that their EC2 customers can now access a number of public datasets including the DBPedia which contains 274 million RDF triples. This is very cool news. Provides a great cloud based resource for semantic reasoning over this public data, and the ability to incorporate it into your own custom applications.
Here’s just a few of the public data sets that are now available on Amazon web services.
DBpedia Knowledge Base provided by DBpedia.
DBpedia is a community effort to extract structured information from Wikipedia and to make this information available on the Web. The DBpedia knowledge base currently describes more than 2.6 million things, including at least 213,000 persons, 328,000 places, 57,000 music albums, 36,000 films, 20,000 companies. The knowledge base consists of 274 million pieces of information (RDF triples).
Freebase Data Dump provided by Freebase.com.
A data dump of all the current facts and assertions in the Freebase system. Freebase is an open database of the world’s information, covering millions of topics in hundreds of categories.
Wikipedia Extraction (WEX) provided by Freebase.com.
The Freebase Wikipedia Extraction (WEX) is a processed dump of the English language Wikipedia.
Check out the Amazon site for more details on the public databases: http://aws.amazon.com/publicdatasets/
Also it is interesting to note that the DBPedia folks recently announced links into the Freebase database that are referenced in their own RDF triples. These links show up as RDF triples that use the OWL SameAs property like this:
http://dbpedia.org/resource/Woody_Allen owl:sameAs http://rdf.freebase.com/ns/guid.9202a8c04000641f800000000004064f
These new links are provided in the 3.2 version of the DBPedia, which you can play around with directly using their SPARQL query endpoint located at http://dbpedia.org/sparql. They also have a richer query interface with sampel SPARQL queries here.
The IIS 7 team launched it’s first public beta of their Smooth Streaming extension.
Alex Zambelli provides a fantastic overview of the the new features in Smooth Streaming and describes its architecture in detail.
There are some really amazing features in Smooth Streaming that I can’t wait to begin to take advantage of. One of the biggest benefits is the ability to edge cache the content using standard networking equipment that exists today. The files are not streamed in the traditional sense, but are actually progressive downloaded in small 2-second chunks via HTTP. This allows each little chunk to be cached independently as though it was just another image or file request. So if someone in your neighborhood already asked for that chunk, it is probably still sitting in some local HTTP cache saving you a long trip back to the originating server.
In addition, the player uses logic to determine the network bandwidth and CPU load on the client machine, and it can choose which 2-second chunk to request next from a list of available files with appropriate bandwidths on the server.
The new file format for Smooth Streaming is based on an open ISO/IEC standard (ISO Base media file format) known as MP4. The MP4 container allows for easy storage of these chunks that are required by Smooth Streaming. You should read Alex’s post to understand the “box” nature of what is known as the “Fragmented MP4 File”. Another thing I like about MP4 is there is lots of room for adding metadata about the “boxes”. These new files also come with new file extensions to learn. The .ismv and .isma files are the new extensions that you will see for these MP4 containers.
One of the even more interesting aspects of Smooth Streaming is the server manifest file and the client manifest files. These are XML files that are hosted along with the MP4 containers to describe the various tracks, available bitrates, and metadata about the files for a given presentation.
The server manifest (*.ism) is based on the SMIL 2.0 spec. The advantage of this XML based manifest file is the ability to easily customize and extend the metadata available, and also the potential to dynamically generate the contents of the manifest for custom application needs.
The use of RESTful Urls in Smooth Streaming makes it possible to seek into a file at a specific fragment using an absolute time value (100 ns units).
http://video.foo.com/NBA.ism/QualityLevels(400000)/Fragments(video=610275114)
Now think about how handy that is, along with the tips from my previous post. You can now seek by SMPTE timecode using my TimeCode class to convert from a SMPTE 29.97 drop frame timecode to an absolute time in seconds, and then pass that to the Smooth Streaming server.
Or you could create an EDL and dynamically generate the client manifest required to play back your edits without requiring a file to be transcoded again. Just send down the modified client manifest with the chunks in the order that you want them played back! All kinds of interesting possibilities.
Be sure to also check out the Getting Started page on the IIS site and the section on Managing Your Presentations.
The best way to download the beta is to use the Web Platform Installer.
I have done a lot of work with Windows Media files in the past where it was a requirement to capture, embed, transmit, and display the actual timecode that was generated on a broadcast tape for the purpose of logging a file remotely.
This use case is common in the broadcast world where it is very cost effective to have a browser-based proxy viewer instead of $20k DigiBeta deck to do simple shot logging and commenting.
In the Windows Media 9 days we (MSFT) provided tools in the Windows Media 9 encoder, and in the Windows Format SDK, to allow for this type of workflow. The Data Unit Extension (DUE) in the Format SDK was provided for this purpose and allowed the developer or encoder to inject the SMPTE timecode into the per-frame DUE by populating the WMT TIMECODE EXTENSION DATA structure with the appropriate range, timecode and custom flags that you wanted. This was very useful and was implemented by a number of encoder manufacturers. The nice part about this was that it also provided support for time code breaks on a tape, which is a common scenario with older tape based cameras (new cameras just create a seperate MXF digital file each time I stop and start the camera, so it is not a big issue any more).
So, in our past we developed all of this wonderful code to embed SMPTE timecode into our files and a way to read it out in Windows applications that used the Format SDK and even support in the Windows Media Player OCX browser control to read and navigate this timecode. Then along comes Silverlight(tm) 1 and 2.
In Silverlight we now have the MediaElement. It does not do all of the cool stuff that the old WMP.ocx allowed with SMPTE timecode, but I have provided a workaround to that in our IMM solution. That workaround has now graduated to the Expression Encoder 2.0 SP1 and is available (in source!) as part of the Silverlight 2 Media Player template.
You can easily convert the TimeSpan object that is reported back from Silverlight’s MediaElement to SMPTE 12M timecode using this Timecode class that I created. You can also use it to seek a specific SMPTE timecode, build a Silverlight Rough Cut Editor, or build a timecode calculator application.
If you have Expression Encoder 2.0 SP1 installed go to this location to find the Timecode class.
C:\Program Files (x86)\Microsoft Expression\Encoder 2\Templates\en\SL2Standard\Source\MediaPlayer\TimeCode.cs
This is a struct that works just like the TimeSpan in .NET. You pass it the TotalSeconds from the CurrentPosition timespan of the MediaElement and the SMPTE 12M framerate that you want calculated (say for example SMPTE 29.97 Drop Frame), and the Struct will give you back a valid SMPTE timecode string.
You can also use it in reverse. Pass it a time and framerate that you want to go to, and get back the Absolute time in seconds, then set the current position to that.
As an example of using the Timecode.cs file, I have created a very simple Silverlight 2.0 player application in Blend 2.0 SP1.
It has a single MediaElement, a Slider control, a Play and Pause Button, and a timecode display.
For this example I am using a file that I created in Sony Vegas that is just a window burn of SMPTE timecode running at 29.97 Drop Frame. Drop frame is the hardest algorithm to do, so let’s stick with that one for now.
I uploaded the file to Silverlight Streaming so that you can use it also in your testing.
http://silverlight.services.live.com/1535/SMPTE_NTSC_Drop/video.wmv
In my XAML page’s code behind, I added a DispatcherTimer to fire an event to update the Timecode display every 500ms.
public partial class Page : UserControl { private readonly DispatcherTimer timer; private bool isSliderDragging = false; public Page() { InitializeComponent(); this.Player.AutoPlay = true; this.timer = new DispatcherTimer { Interval = new TimeSpan(500) }; this.timer.Tick += new EventHandler(this.Timer_Tick); this.timer.Start(); }
When my Timer ticks I update the Timecode display by grabbing the value of the TimeSpan in the Player.CurrentPosition and then pass it to the Timecode struct with the proper SMPTE 12M framerate that I want calculated. The struct then returns back a formatted SMPTE 12M timecode string.
private void UpdateTimecode() { var tc = SmpteTimecode.TimeCode.FromTimeSpan(Player.Position, SmpteFrameRate.Smpte2997Drop); TimeCode.Text = tc.ToString(); }
One thing to note is that I actually added a new function to the Timecode.cs file in this case to directly pass a TimeSpan in. This was not in the original code that shipped in SP1. It just passes the value of TotalSeconds to the constructor of TimeCode that takes a double in seconds.
public static TimeCode FromTimeSpan(TimeSpan value, SmpteFrameRate rate) { return new TimeCode(value.TotalSeconds, rate); }
The result looks like this. You can drag the slider around in this file and see that the reported SMPTE 12M NTSC drop frame timecode in green perfectly matches the window burn inside of the video file (the number at the top is framecount).
Unfortunately my hosted WordPress is not allowing me to embed Silverlight Streaming applications right now, so you can play with it live here.
(Note: if you are on a slow connection you should wait for the whole file to download or the seeking won’t be accurate).
Now, the obvious limitation is that we can’t easily deal with timecode breaks. One workaround for this that I have used is to embed the timecode breaks into the VC-1 file as Markers. In the marker you can specify that this is a break, and then in a custom Silverlight player when you hit that break you will easily be able to update the timecode that is being displayed by using the Timecode struct class as a Timecode “calculator”. Store the offset time in a Timecode and just add it to the current position and you will have a properly offset timecode to display!
Enjoy. It took me a long time to put all of those math operator precedence parentheses into this file so please send me email if you end up using this in your own projects. I would love to hear.
Also, you may have already considered this, but this class alone is a great base for a Silverlight based Rough Cut Editor solution. Just build a timeline control and playback engine based on the Timecode class.
Google, Yahoo, and Microsoft got together recently and agreed on something. It’s a small thing, but it has a lot of impact nonetheless.
What did they decide upon? Well, it’s actually a small little bit of semantic reasoning that web masters can now add to their pages to provide better search engine results.
It’s a simple link tag with the “rel” set to “canonical” like this:
<link rel="canonical" href="http://mysite.com"/>
What it does is stop duplicate content on the web. A rather small, but notable step towards adding semantics to web pages.
Read more here
I had some fun this week setting up SharePoint to run on my Windows Home Server. It actually went very smoothly. I was surprised.
I downloaded the WSS 3.0 SP1 installation package and just went through the standard installation, setting it up as a standalone server. After that completed, I noticed that the install had created a new web application on port 80, and shut down the default Home Server site. This was fairly simple to work around.
I went into SharePoint Central Administration and changed the host header for the default site to "share.mydomain.com”. My goal was to be able to browse to it using a simple to remember URL and be able to also get to the home server’s default admin site via a different host header like “homeserver.mydomain.com”.
In order to get this to work, you have to set the proper CNAME alias in your DNS provider. I use GoDaddy and they have a fairly simple to use tool for setting the CNAME aliases. I just added a CNAME for “share” and a CNAME for “homeserver” and pointed them both to my domain that is provided by Windows Homeserver’s virtual IP service which looks like this: myserver.homeserver.com.
After setting up the CNAME’s in my DNS, I went back to my home server and added the host header to my Windows Home Server default Web via Inetmgr.exe. Remember to set the host header to the full domain name “share.mydomain.com” or else it won’t work! I made that mistake first by setting the host header to just “share” thinking that IIS was actually smart.
Next I just restarted the default web and I was now able to get to both my home server admin page and my root SharePoint web collection. I could keep building on this on my home server by pointing to a blog.mydomain.com, or video.mydomain.com, etc…
My next attempt is to see if I can get PHP running with WordPress hosted on my Home Server as well so I can customize my themes more! The new Microsoft Web Application installer could help me out there. It installs PHP in IIS and also optionally can set up WordPress for you.
Every six-months Microsoft Services hosts a technical readiness conference. I actually had some time today to attend a few sessions and got some very useful links to some resources for SharePoint development that I did not know about.
There is a new CTP for the Visual Studio 2008 Extensions for SharePoint. Version 1.3 now available from the Microsoft Connect site. Improvements include installation support for x64 Windows Server (thank you!), and command line building. I’ll need to spend some time checking these out!
Another cool tool that I would love to start using in our own projects is the SharePoint Dispose Checker Tool. It works a lot like FXCop to analyze your SharePoint SDK code and make sure that you are properly disposing of the objects in the SDK. SharePoint objects use a mix of managed and unmanaged memory that is allocated on the heap using malloc calls. The objects that do this always implement the IDisposable pattern… however, a common mistake is to not call Dispose or to not put the objects in using statements. This tool can be integrated into your build to help find those errors early before they bring down your SharePoint server.
Related to the new v 1.3 Extensions, there is a great blog post by Michael Washman that shows how to use the latest CTP to deploy Workflows. I’m definitely going to be walking through this sample later.
Finally, some more reading to pile up on your nightstand… the Patterns & Practices team has a site on codeplex that focuses on SharePoint Architectural Guidance. Their last release was back in Nov. 2008, but I still have not gotten around to reading it. One benefit of posting to my blog is that maybe I will get around to it…maybe. Here is the direct link if you find the time to download it too.
