Windows Azure Live Streaming solution allows quickly deploy scalable service to perform live video broadcasting through Windows Azure Web Roles.
Solution source code is available for download from
High level architecture presented in the following diagram:
Upstream Server (upstream.cloudapp.net)
Single instance Web role with Push publishing point (aka “ingest” server). URL of this publishing point used by Encoder to push video stream during Live event.
Important: to achieve redundancy for Push point it’s possible to deploy additional single Web role at different DNS. Azure staging deployment will work as well.
Upstream Server could be used as streaming server in small scale deployments. In this case player URL would be http://upstream.cloudapp.net/push.isml/manifest.
Downstream Server (downstream.cloudapp.net)
Multiple instances Web role with Pull publishing point. URL for this publishing point (e.g. http://downstream.cloudapp.net/pull.isml/manifest).
IIS Media Services 4
IIS Media Services 4 is automatically installed and configured via Web role startup tasks and Web Administration API.
Solution contains two predefined publishing points:
Push.isml – to receive video stream from encoder
Pull.isml – to pull video stream from Upstream Server
Each isml file deployed as part of normal Windows Azure deployment procedure either via management portal or from Visual Studio IDE.
Important: Push/Pull points configuration can be performed by simply editing isml (XML) files in Visual Studio or any other text editor.
Solution makes use of sample Silverlight player from iis.net/media site
Below we provide detailed deployment steps.
Install Visual Studio 2010 Service Pack 1
Solution uses newest ASP.NET MVC3 and Razor technology so SP1 is recommended.
Install Windows Azure Visual Studio Tools
Windows Azure SDK must be installed on local PC to enable creating deployment packages. We recommend installing Visual Studio Tools as well to support direct publishing and debugging
from Visual Studio IDE.
Important: Check Windows Azure SDK system requirements
if you won’t use Web Platform installer
Install Expression Encoder 4 Pro SP1
Expression Encoder 4 Pro SP1 required to deliver Live Smooth Streaming broadcasts. Encoder must be installed on PC with video source connected. (e.g. video capture device, USB camera,
Important: Pro version required for Live Smooth Streaming and Apple devices support
Download solution source code
Download Visual Studio 2010 solution source code from
Load Visual Studio solution
1. Extract downloaded zip file to some location
2. Start Visual Studio in elevated mode (Ctrl+Shift+Click)
3. Open MediaServices.sln from save location
4. Cancel prompt to connect to source control server and then press OK to go offline
5. In next dialog answer No to question to remap Web project URL
6. If project can’t be opened and appears as grey in VS and you plan to run project locally against local IIS with Media Services installed then you must map MediaPortal folder to http://localhost:8080 in IIS Manager
7. If project can’t be opened and appears as grey in VS and you won’t plan to use local IIS Media Services or will change a local IIS url then do the following:
a. Right-Click MediaPortal in Solution Explorer and choose Edit MediaPortal.csproj
b. Find <UseIIS> and change to <UseIIS>False</UseIIS>
c. Find <IISUrl> and change to <IISUrl></IISUrl>
d. Right-Click MediaPortal in Solution Explorer and Reload
8. You should have the following solution loaded in Visual Studio:
Test run project locally
The following steps are optional – it’s just to make sure the solution can run on your PC:
Make sure MediaPortal is a startup project (Right-Click and choose Set as Startup Project)
Open MediaPortal properties page (Double-Click Properties under MediaPortal name)
Choose Web from left-side tabs
Use IIS Express as shown below:
Create Virtual Directory if asked so (change port number if necessary)
Hit F5 – default browser should open with portal loaded similar to below:
Configure Publishing Points
Solution contains two predefined publishing points as shown below:
Push.isml file doesn’t contain any external references and can be left as is.
Pull.isml must be edited to include reference to Upstream Server. Double-click to pull.isml and edit smil/body/switch/ref element as shown below:
src must contain URL of Push publishing point at Upstream Server such as http://upstream.cloudapp.net/push.isml
Optional Downstream Server configuration
Project web.config file has optional application configuration setting:
value="" /> <!--
Put http://server here -->
This setting is optional and used in Web portal to identify downstream server. It only defines which URL is shown as a Player URL when user connects to Upstream server Web portal.
Windows Azure Project configuration
Number of Web role instances
Number of instances configured via UI (Double-Click to WindowsAzureProject1-Roles-MediaPortal) or in ServiceConfiguration.cscfg file:
Important: Configure only
1 instance of Upstream server. Configure more than 1 instance of Downstream server.
Make sure Web role runs in elevated security context (required to properly configure IIS Media Services):
Creating Hosted Services
management portal and create two separate deployments. It’s important to have separate DNS for Upstream and Downstream servers. Deployments could be in the same hosted service but be staging and production. Read more about Windows Azure deployments:
For example one could create the following deployments:
http://upstream.cloudapp.net – for Upstream server
http://downstream.cloudapp.net – for Downstream servers
Important: make sure to put hosted services in the same datacenter to avoid unnecessary traffic between Upstream and Downstream servers.
Publishing Solution to Windows Azure
Normal procedure is used to publish solution to Windows Azure. As already mentioned Upstream server must have only 1 Web role instance so change number of instances to 1 for Upstream
deployment. After deploying Upstream server change number of instances to >1 and deploy the same solution as downstream server.
Important: Upstream and Downstream solutions are the same. The only difference is number of instances and which publishing point used.
Encoding Live Stream
After solution was successfully published to Windows Azure one can set Encoder to push Live video stream to publishing point. The following is a basic steps required to start encoding
session. For more information refer to complete guide at http://learn.iis.net/page.aspx/620/getting-started-with-iis-live-smooth-streaming/
Start Expression Encoder 4 Pro SP1 and choose Live Broadcasting Project
Add Live Source, choose one of the IIS Smooth Streaming Presets, check “Publishing Point” for output and use http://upstream.cloudapp.net/push.isml as configured before.
Hit Start and start encoding session
Watching Live Stream
Web portal in the solution includes Live Smooth Streaming player which uses the following <object> tag:
alt="Get Microsoft Silverlight"
InitParams must have mediaurl part pointing to either push point at Upstream server (single server deployment) or pull point at Downstream server.
For Upstream: http://upstream.cloudapp.net/push.isml/manifest
This HTML snippet above could be inserted inside <iframe> at any Web site.
Watch Live Stream from portal
Open one of the deployments (e.g. http://downstream.cloudapp.net) in browser and:
If you at Upstream server as defined by Pull.isml point configuration (that is Upstream server referred in Pull.isml) click on one of the URL under right pointing arrow
If you at Downstream server (that is server you’re accessing isn’t referred in Pull.isml) click on one of the URL under left pointing arrow
Portal currently provided readonly configuration experience.