Friday, May 3, 2013

Live Streaming with IIS Media Services


Windows Azure Media Services as on today does not provide live streaming but there is a way to have live streaming work with Internet Information Services (IIS).

Though it is on the WAMS roadmap to provide Live Streaming as can be referred here (refer Live Streaming data point).

In this blog I will describe how easy it is to setup & configure live streaming with IIS.

Setup Requirements:
  • IIS Media Services 4.1
  • Expression Encoder 4 with Service Pack 2
  • There a couple of new changes/fixes done over SP1 you can read it here


What is Live Streaming?
  • Enables adaptive streaming of live events to Smooth Streaming clients
  • Communicates through HTTP to deliver live events
  • It is an IIS Media Services Extension
  • Adaption based on User Network Bandwidth

How does it work?


  • Acquire will be the source of your input like webcam, screen capture etc.
  • Encode & Deliver will be done by the encoding tool like Expression Encoder which will perform the real time encoding and sent the streams to the IIS Media Services endpoint
  • Consume side you can have a Silverlight player/HTML5 page (for Apple) which can play the live stream in a smooth streaming way. More info on Smooth Stream can be found here.


Live Broadcast Workflow:






















             * Comparison of the live streaming features in Windows Media Services and IIS Media Services can be found here

        Configure IIS Media Services:

1.
In IIS Manager, select the desired Web Site or virtual directory, and then double-click the Live Smooth Streaming Publishing Points icon.

 


2.
On the Live Smooth Streaming Publishing Points page, in the Actions pane, click Add


3
In the Add Publishing Point dialog box, on the Basic Settings tab, enter the following information.

File name: Enter a name for the Live Smooth Streaming publishing point definition file. We will be using the file name LiveSmoothStream. If you specify a different file name, be sure to substitute it appropriately as you follow these steps



4
On the Advanced Settings tab, select the Start publishing point automatically upon first client request check box. This setting allows an encoder to connect to the publishing point when the broadcast starts. Connection errors might occur if you don't enable this setting


5
If you want to deliver live streams to Apple® mobile digital devices, on the Mobile Devices tab, select the Enable output to Apple mobile digital devices check box

* Note: This option is only available on IIS Media Services 4.0 and above

6
Click OK. A newly created Live Smooth Streaming publishing point definition file named LiveSmoothStream.isml is added to the Web site root

7
Open the “LiveSmoothStream.isml” file by going to the website directory and editing it.

Add an new Entry as:
“<meta name="restartOnEncoderReconnect" content="true" />”

8
Select and right click on created Live Smooth Streaming Publishing Point and Click “Start Publishing Point”

Configure Expression Encoder:

1
Start Expression Encoder & select Live Broadcasting Project, and then click OK


2
Set up the source to use for your live broadcast


3
Select the Presets tab, choose the preset which shows IIS Live Streaming.


4
On the Output Tab enter the publishing point ex: http://<server-name>/LiveSmoothStream.isml and click Connect.

Note: Select the “Automatically update on restart” checkbox for the EventID as a Live Smooth Streaming publishing point must be reset on the server if you wish to broadcast to it multiple times. Each time you start and stop encoding, you must shut down and restart the publishing point on the server before you can connect to it again. Otherwise, data from the last run will still be on the server and you will encounter errors while broadcasting the next time



5
Click Start to begin the live broadcast.


Create a Silverlight Test Page to watch Live Streaming

1
Download SMF Player

2
Extract the files and copy “SmoothStreamingPlayer.html” and “SmoothStreamingPlayer.xap” files


3
Modify the “SmoothStreamingPlayer.html” page

Update the below line of code to point to the livestreaming URL as shown below:
<param name="InitParams" value="selectedcaptionstream=textstream_eng, mediaurl=http://<server-name>/LiveSmoothStream.isml/manifest" /> 
4
Run the “SmoothStreamingPlayer.html” on the browser



Create a HTML5 Test Page for Apple to watch Live Streaming


1
Create a simple HTML5 webpage with a video tag

<html>    
    <head>        
        <title>iPhone live streaming page</title>    
    </head>    
    <body>        
        <h1>Live stream.</h1>                 
        <video width="640"                
            height="480" src=" LiveSmoothStream.isml/manifest(format=m3u8-aapl).m3u8"                
            poster="MyPosterFrame.png"                
            autoplay="true"                
            controls="true" >
            Live
        </video>     
    </body>
</html>
2
Run the webpage on the browser






Attach is the small video which shows the Live Streaming here.

In my next blog I will provide some more insights on how to further extend IIS Streaming features and also provide some idea around the real time deployment scenario.

3 comments:

  1. Live streaming is the latest fad on social media so make sure to get live with your audience from time to time.
    Live streaming would give you a more intimate space with your viewers and encourage them to interact with you more often. It would allow more personal interaction with your audience in real time.
    You can also share your live videos later, so that those who have missed out the live streaming can view them again. A tour of your business, a demonstration of your products or an interview with the creators are some of the possible content which can be created with a live video.
    Make sure to make the most out of the apps which allows you to go live directly from the blog.

    ReplyDelete
  2. A lot of thanks for your whole hard work on this web page. My mother enjoys setting aside time for internet research and it is easy to understand why. All of us know all regarding the powerful tactic you provide simple suggestions through the blog and improve contribution from some other people about this idea and our own simple princess is certainly studying so much. Take pleasure in the remaining portion of the new year. Your performing a pretty cool job. streaming services best

    ReplyDelete