Thursday, March 24, 2011

How to :Test IIS Media service Smooth streaming tutorial

Http for streaming, for IIS, there is the media service, let’s download and install it using the platform installer

using the web platform installer 3.0 (like the Yum for Centos), pick up the media service package and click to install.


also install the smooth string client,


when done, you will noticed that in install several HttpHandlers to IIS,


and check the handler mapping features,

Path Handler
*.ism Smoothhandler
*.isml LiveStreamingHandler
*.isx PlayListHandler


Also you will see several media tools,


Now we have the infurscture and components to Host and support the smooth streaming, we need import those assets to the virtual Directory just like other aspx files.

encoder  , there is a encoder to encode one raw video file to tens of other formats with different qualities. (used for smooth streaming, when the network bandwidth is great enough, throw the 1080P one to the client. )
Download encoder full version (Expression Studio 4 Premium (x86) - DVD (English))from your MSDN subscription. note, the free downloadable encoder 3 doesn’t support the smooth streaming encoding. No free lunch,

>>so download Expresion 4, and install the Microsoft Expression Encoder 4 with Service Pack 1 (SP1)

Create a new project, import the raw video. search and select all streaming presets and click apply. then click encode to go,

this process is a CPU intensive work, try to run on more powerful server with lots cpu cores.
the output folder looks like this, one ism file and several ismv files based on your presets selectons

Now copy this folder to the iis virtual folder you created,
then you can see the file listed in the iis add-on , smooth streaming,

host/runtime is ready, content is there, now need to write a Silverlight client to view the content,

let’s build using  the Microsoft Silverlight Media Framework 2.4, which comes with the built-in streaming player.

create one smooth streaming application( a Silverlight project which has been customized to reference the extensions dll.)


replace the ism file with ours,

 <Grid x:Name="LayoutRoot"  Loaded="LayoutRoot_Loaded" Background="White">
        <smf:SMFPlayer x:Name="s" AutoPlay="True">
                <media:PlaylistItem DeliveryMethod="AdaptiveStreaming"  MediaSource="http://localhost/hellomedia/Wildlife.ism/Manifest"/>

put a clientaccesspolicy.xml to the iis root folder,

<?xml version="1.0" encoding="utf-8"?>




      <allow-from http-request-headers="*">

        <domain uri="*"/>



        <resource path="/" include-subpaths="true"/>





then click F5 to run, that’s it.


in case you can’t see the video, check this out ,why? Silverlight smf player never play.

No comments:

Locations of visitors to this page