You are currently browsing the category archive for the 'Silverlight' category.
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.
A recent article in InfoWorld attempted to tie the current economic downturn directly to the future success of Silverlight 2.0 adoption. My opinion is that this argument is pretty flawed.
For starters, since the October 2008 launch of Silverlight 2.0 it has been installed on over 300 million consumer PCs (or one in four), mostly the result of major events such as the Beijing Olympics (upgrades from 1.0), the new Netflix Watch Instantly services, The Democratic National Convention, and the Presidential Inauguration on CBS. Montalbano’s argument that the adoption rate for Silverlight will be impacted by the cutback in corporate IT budgets makes little sense to me since most enterprise applications would not be the major driving factor for adoption.
Flash did not earn its near 100% adoption of its previous player, or its now 45% adoption of player 10 through corporate IT department projects. It earned it through browser bundling, advertising, YouTube, and online media focused on the consumer. Silverlight will continue to gain adoption just fine during this economic downturn, as people will want more entertainment at home and via the web.
In addition, my experience shows that as things quiet down in IT departments due to budget cuts, developers will begin to re-train and try out new technologies. This downturn might give some more Microsoft camp developers the time they need to train-up on Silverlight and try out some new ideas so they are ready for the next wave of projects.
Last week Microsoft teamed up with the Presidential Inauguration Committee and CBS to stream the event live using Silverlight. The Channel9 team recently posted a nice video with Steven Woodard and Ben Waggoner discussing how it was done, and the historic last minute use of Moonlight (Silverlight for Linux) to provide an alternate experience for Linux users. Move Networks provided the video streams. You can check out the quality of this stream on Demand at CBS. Be sure to click the Watch HD link and install the Move Player.
