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

 http://www.iis.net/media

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

image

also install the smooth string client,

image

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

image

and check the handler mapping features,

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

image

Also you will see several media tools,

image

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,
image

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
image

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,
image

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.)

image

replace the ism file with ours,



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




put a clientaccesspolicy.xml to the iis root folder,









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

<access-policy>


  <cross-domain-access>


    <policy>


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


        <domain uri="*"/>


        </allow-from>


      <grant-to>


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


      </grant-to>


    </policy>


  </cross-domain-access>


</access-policy>





then click F5 to run, that’s it.


image







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