You are currently browsing the category archive for the ‘Silverlight’ category.
Today we released Beta 2 of the Microsoft IIS Smooth Streaming Format SDK 1.0.
The IIS Smooth Streaming Format SDK provides application developers the capability to mux encoded video and audio elementary streams into Smooth Streaming fragmented-MP4 format that is compliant with the Smooth Streaming Format and Protected Interoperable File Format (PIFF) specifications. The IIS Smooth Streaming Format SDK includes a native C++ static library that can be linked into your applications to support the muxing of fragmented-MP4 into files or sent live via HTTP POST to a server running Internet Information Services (IIS) 7.0 and IIS Media Services 3.0 and IIS Media Services 4.0 Beta 1. The SDK is available for download here.
Documentation for the SDK can be found online here – IIS Smooth Streaming Format SDK MSDN documentation and the release notes are available here – IIS Smooth Streaming Format SDK Beta 2 Release Notes.
The primary purpose of the IIS Smooth Streaming Format SDK is to enable developers to create applications that can generate PIFF compliant Smooth Streaming formatted fragmented-MP4 files for use in video-on-demand and live streaming scenarios. In addition, the SDK can be used to encrypt content using standard AES encryption as required by the PIFF specification (this SDK only supports the PlayReady specific protection headers).
It is expected that the video and audio encoding functionality is done externally from the SDK. Encoding for VC-1 can be accomplished by using the Microsoft VC-1 Encoder SDK – Professional. If you wish to do H.264 encoding, you will need to acquire a 3rd party H.264 encoding SDK and AAC audio encoder. There are lots of encoding library choices available both free and commercial.
The components of the SDK include:
- A static-linked packaging library ssfsdk.lib, along with appropriate header files, that delivers f-MP4 wrapping capability to an application for use with the following video and audio codec combinations:
- Closed GOP encoded VC-1 with Elementary Stream Sequence Headers and WMA Pro, or WMA audio
- H.264 (AVC1 closed-GOP streams only with IDR frames at the first sample of a GOP – must not be an Annex B stream. PPS and SPS NAL units are not supported in the stream)
- AAC-LC audio
- Sample source code for a basic on-demand muxing application that uses DirectShow to source from files.
- Link to online MSDN documentation.
Updates included in the Beta 2 release of the Smooth Streaming Format SDK are:
- H.264 PlayReady sub-sample encryption support.
- PIFF 1.1 spec compliance.
- Multi-language audio muxing.
- Text stream and TTML track muxing support.
This is in addition to the following supported features:
- Support for Protected Interoperable File Format (PIFF) 1.1 compliant fragmented-MP4 file output.
- Support for ISO Base Media (ISO/IEC 14496-12:2008) spec compliance.
- Support for muxing live and on-demand content.
- Support for appropriate header boxes and formatting required for live streaming using IIS Media Services.
- Support for AES-CTR encryption of VC-1 and H.264 encoded content for use with PlayReady licensing servers and Silverlight 4.0 or higher.
- Support for writing out a compliant Smooth Streaming Transport Protocol server manifest files.
- Support for writing out a compliant Smooth Streaming Transport Protocol client manifest files.
NOTE: Beta 2 includes a “Go-Live” license if you would like to use this SDK in production applications.
If you have questions on how to use this SDK in your applications, comments, or feedback on the SDK please send them to me directly or to smooth@microsoft.com.
Download the Smooth Streaming Format SDK Beta 2 here:
Resources
- Download the Protected Interoperable File Format specification
- Download the IIS Smooth Streaming Transport Protocol Specification
- Download the Smooth Streaming Client 1.0
- API documentation for Smooth Streaming Client
- More Information on Smooth Streaming
- More Information on Live Smooth Streaming
- Supporting documentation on getting started with Smooth Streaming
It was a great week at the National Association of Broadcasters (NAB) convention in Las Vegas this year. It’s always fantastic to run into the extended family of friends, partners, and customers from around the world. We had a lot of great new technology announcements and demonstrations this year and too many partner announcements to cover in a quick blog post, but here is a recap of the highlights.

IIS Smooth Streaming Client and Silverlight Media Framework (SMF) – showcased demos with Multiple audio languages and subtitles using SMF and the demos worked flawless. We demoed how you could build a player with less than 10 lines of code using SMF. In addition the latest version of the SMF player now supports Timed Text Markup language (TTML) for displaying captions and subtitles. We now support “textstream” tracks that work similar to the fragmented MP4 video and audio, but contain caption text in TTML format. We also demonstrated multi-language audio support. You can now seamlessly switch between audio tracks in the player. We also announced several new encoding partners that are adopting the Smooth Streaming Format SDK, and several partners who have integrated TTML caption conversion from 608/708 and Teletext, multi-language audio, and ad-insertion using SCTE-35 signaling via sparse stream events.
The Smooth Streaming Format SDK Beta 1 is available as of early March this year, and we will be shipping Beta 2 at the end of May which includes additional support for multi-language audio, Text Streams, and H264 PlayReady sub-sample encryption (per the PIFF 1.1 specification).
IIS Smooth Streaming in 3D – this demo was a crowd puller. It may be the colored 3D glasses but people loved watching 3D content in a browser and the same content was also demoed on a TV connected to a set top box running Silverlight. This demo was done working very closely with Level 3. Alex Zambelli, who put this demo together, has more details here.
The Silverlight Rough Cut Editor tool – I’ve talked about this project in the past. This was originally a project that I started on the IMM team for use as a web part in SharePoint. Since the IMM project was closed down, we have kept revising this tool and used it in many Live events including the Winter Olympics. Now the RCE code is available for you to download from the Code Gallery site on MSDN. You can create a new source by combing portions of multiple individual sources (including live Smooth Streaming sources) in a matter of a few minutes. The tool is really easy to use and super useful in creating highlights. It’s also easy to customize and extend since it is based on the PRISM framework. You can integrate the tool easily into your own MAM and DAM or custom database systems to create an end-to-end workflow.
Microsoft Silverlight Analytics Framework (MSAF) and visualizations of data using Pivot / Azure (Silverlytics) – SAF already integrates top analytics providers and enables easy analytics integration for Silverlight applications including the ones that use IIS Smooth Streaming. The folks at Location 3 Media used MSAF and Microsoft Pivot to create some super cool visualizations for real-time analytics data.
Silverlight Enhanced Movie Framework – this framework allows for rich Blu-ray like experiences with offline Silverlight apps. The demos included the movie “The Hangover” among others at the booth. This will be the future of movie delivery for me. I don’t even own a Blu-ray player because I prefer not to collect plastic landfill discs!
At the booth we demoed live IIS Smooth Streaming to an iPhone and iPad. The streams were generated by Expression Encoder 4.0 that was sending 10 different bitrates to multiple clients. This new feature allows you to enable on-the-fly transmuxing at the IIS Media Services publishing point. All you need to do is send the usual Smooth Streaming fragmented-MP4 streams to the publishing point in H.264/AAC at the right profiles and we will re-wrap to MPEG2 Transport Stream and segment the video on the fly. The same streams can also be consumed from the publishing point in their fragmented MP4 format using Silverlight on multiple clients, including Mac, Windows, Linux, Windows Phone 7, Nokia S60, and the Broadcom and Intel set-top boxes. This feature is going to be included in IIS Media Services 4.0 Beta 1 in June.
IIS Smooth Streaming for Windows Phone 7 – using the exact same streams that we are sending to the iPad we are able to deliver to Windows Phone 7, which is now running Silverlight and a version of the Smooth Streaming Media Element. The Windows Phone 7 is capable of decoding H264 and AAC at even higher profile settings than Apple’s IPad recommendations, and we should see some even higher quality presets coming soon for Expression Encoder 4.0.
IIS Smooth Streaming for Nokia S60 devices
Expression Encoder 4 (EE4) – we demoed encoding and delivering HD content using IIS Smooth Streaming and EE4 running on the same machine. EE4 is going to be a great tool when it ships. It now has support for Live Smooth Streaming! We had a 24 core Intel server streaming 10 bitrates of Live Smooth Streaming (from 6Mb down to 200kbps) along with a second instance of EE4 running with 3 streams targeted at the IPad profile settings. Fantastic!
In addition to all of this great news, we announced that Silverlight adoption has reached 60% globally, on Tuesday just down the street from the NAB convention we launched Visual Studio 2010, and on Thursday we launched Silverlight 4.0.
Here is the full Microsoft press release for more details.
I’m looking forward to seeing everyone at IBC in Amsterdam at the end of the Summer with a lot more cool demos! We have some fantastic stuff in the works.
Beta 2 of the IIS Smooth Streaming Player Development Kit (SSPDK) contains a very important Silverlight control called the SmoothStreamingMediaElement. This control is the core client side component for making Smooth Streaming work in Silverlight.
In the latest release, Vishal Sood and team have added in support for a new manifest format called the Composite Manifest.
This new manifest can be used in scenarios where you want to do one of the following:
- Create a new video clip that is composed of many smaller sections of existing content.
- Create a single or series of highlight clips from a very long clip (which could be the archive of a live event).
I view this new Composite Manifest like a new Edit Decision List (EDL) format since I have a background in the broadcast and post production world. This new manifest allows me to create a cuts only EDL file that can be used by the player to dynamically generate new clips without going through the process of re-assembling, re-encoding, or trans-muxing assets.
This new manifest enables really cool scenarios where you can create Edit Decision Lists (EDLs) on the fly in a web based RCE tool (more coming on this later…) and generate new assets from existing ones without touching the content.
Pay close attention to the fact that even though your Smooth Streaming files may have chunks that are 2 seconds in duration, the new Composite Manifest lets you start and end your clips within the boundaries of that chunk. So you are not restricted to making edits at the fragmented-MP4 chunk boundaries.
Read up on the new Composite Manifest format and how to define Clips here:
Vishal Sood posted a new blog entry on the latest release of the Smooth Streaming Player Development Kit Beta 2 last week.
Read all about the new features in the Player SDK, and download the bits here: http://blogs.iis.net/vsood/archive/2010/01/15/iis-smooth-streaming-player-development-kit-beta-2-released.aspx
Key features include:
-
Basic Playback controls
- APIs such as Play, Pause, Stop, etc.
- Events for Playback and Diagnostics
- Properties to track position, etc.
- Advanced Playback support
- DVR support for Live Smooth Streaming
- Support for keeping track of Live event while in DVR (*new in Beta 2*)
- Trick Play: Slow Motion
- Trick Play: Fast Forward / Rewind (*new in Beta 2*)
- H.264 / AAC support (*new in Beta 2*)
- Monetization
- Ad Playback integration – scheduling capabilities, tracking Ad progress
- Live Ad Insertion with Live Smooth Streaming
- Rich Analytics with IIS Advanced Logging
- Support for specifying markers/Ad ingestion point outside the main manifest (*new in Beta 2*)
- Content Protection – PlayReady integration for VC1 content
- Composite Manifest Support for scenarios like Rough Cut Editing (*new in Beta 2*)
- Selecting Tracks for playback (e.g., restrict the bit-rates available, support multiple camera angles in a single stream, etc.)
- Support for progressive download Ads/content
- SSME is used in Silverlight Media Framework(SMF) and the partnership helps facilitate faster player development
The Silverlight Media Framework has also been updated to version 1.1 which includes the latest SmoothStreamingMediaElement from Beta 2 of the Smooth Streaming Player SDK. This includes support for progressive download content in addition to Smooth Streaming format support.
Get the latest drop of the Silverlight Media Framework 1.1 on Codeplex: http://smf.codeplex.com/
Michael Scherotter just posted a great sample of creating Netflix style ‘zoetrope’ player thumbnails in Silverlight.
His sample uses the latest version of the Silverlight Media Framework that is posted at http://smf.codeplex.com, and Expression Encoder 3.0.
We are looking into adding in support for embedded "Zoetrope” tracks to the Smooth Streaming Format SDK and Silverlight Media Framework in a later release.
Demo: http://xmldocs.net/smf
Source Code: http://code.msdn.microsoft.com/SMFThumbnailScrub
The latest release of Expression Encoder 3.0 is almost ready to ship and has a lot of great enhancements including new presets for H.264, full control of the H.264 encoding parameters, a new Screen Capture tool (which looks fantastic!) and a new object model API that include support for Live Encoding.
James Clarke provides a great overview of the new features in this blog post.
To check out the Screen Capture tool in action, check out Keith Comb’s HD Screencast demo post here.
Today I wanted to check out the new API, particularly the new sample PowerShell 2.0 module that James built out to put into the SDK.
You can locate the new sample PowerShell cmdlet in the Samples directory of the SDK : C:\Program Files (x86)\Microsoft Expression\Encoder 3\SDK\Samples\EncoderPowerShellModule.
The sample comes as a Visual Studio C# project that you need to compile. I converted the project to a VS 2010 solution and then compiled it quickly without any issues.
Note that there is a post-build script that is run to copy the output into your WindowsPowershell modules folder – watch out for that if you have Powershell configured in a non-default way.
I created a folder called ExpressionEncoder in my Modules folder under WindowsPowershell and deployed the ExpressionEncoder.dll into that folder.
The big trick if you are running on Windows 7 RC x64, you have to launch the PowerShell (x86) version and not the x64 version or you will get an error message that the Microsoft.Expression.Encoder assembly can’t be found. That is due to the fact that it is a 32 bit assembly and it can’t be loaded from the x64 version of PowerShell 2.0.
Once you switch over to the x86 version of PowerShell 2.0, you can edit your $profile, and add the following line to it.
import-module ExpressionEncoder
Now you can do something like the following to batch convert a folder of media to a specific profile template:
ls ‘C:\users\Public\Videos\Samples’ | Convert-Media -VC1IISSmoothStreamingSD480pVBR -TemplateBlackGlass -Output $home\desktop
This example runs all files in a folder through the Zune HD Profile for H.264 and outputs it to a directory.
Once the encoding is kicked off, you will see the progress in your PowerShell console. It will display the current clip, progress percentage, the current pass and a progress bar will be displayed as well.
Now, you can get more complex and write some very handy PowerShell scripts to generate media in your own workflows! I love Powershell, and I’m looking forward to using this a lot in my own work.
One of my favorite Silverlight developers (who is working on our Rough Cut Editor project ) Ezequiel Jadib who works at SouthWorks in Buenos Aires posted an awesome article on how to start, stop, and shutdown smooth streaming publishing points.
He did a great job of digging through the API in Reflector and figuring things out quickly.
The nice part about this is that we had a scenario on one of our test servers where we wanted to constantly loop a video on a publishing point so that it appeared to be a Live stream (since in these economic times we were too cheap to set up a live encoder). So E-Z (I call him that because he makes my life easy) used the tools in the Smooth Stream SDK to play back a 10 minute clip and restart the publishing point infinitely.
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
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.
