build the next youtube: windows azure media services
DESCRIPTION
Visual Studio Live presentation on Windows Azure Media Services. Describes the fundamental set of features and illustrates through the .NET SDK how to upload, encode, and deliver assets to a variety of client devices.TRANSCRIPT
Build the Next YouTube:Windows Azure Media Services
Sasha GoldshteinCTO, Sela Group
Level: Intermediate
With Windows Azure Media Services, you can upload, manage, encode, and stream your
media to a variety of devices
on a cloud scale.
Maybe you have a bunch of training videos you want to share with your global employee contingent, in the office and on the go …
… or maybe you are hosting the Olympic Games and need to stream to hundreds of millions of consumer devices, with peaks of 100x the standard traffic …
… or maybe you’re a TV network, a cellular carrier, a radio station, an ad agency, a consumer video website … and you want to stop worrying about infrastructure and embrace cloud scale.
Features
VODLive
streaming coming soon
Encoding to multiple formats
Encryption (DRM)
Progressive download from blob
Smooth streaming
Dynamic packaging
.NET and Java SDKs
REST endpoints
Supported Formats
• Import formats– Codecs: H.264, MPEG-1, MPEG-2, MPEG-4 v2, VC-
1, WMV, DV– File formats: AVI, MP4, MPEG, WMV, 3GP, ASF, DV,
TS, VOB, …
• Export formats
File Format Video Codec Audio Codec
.wmv VC-1 WMA
.mp4 H.264 AAC
Smooth Streaming File Format (.ismv)
H.264VC-1
AACWMA
Supported Devices
• Almost all devices for progressive• Device coverage for adaptive streaming:
Platform IIS Smooth Streaming Apple HTTP Live Streaming (HLS)
Windows (IE) Silverlight 3rd party SDK (Flash)
OS X (Safari) Silverlight <video> element
Windows RT Microsoft SDK 3rd party SDK
Android (Browser) 3rd party SDK (Flash) <video> element
iOS (Safari) <video> element
Windows Phone Microsoft SDK 3rd party SDK
iOS (in-app) Microsoft SDK MediaPlayer FW
Android (in-app) 3rd party SDK VideoView
Xbox Microsoft SDK
Pricing Principles
• Available in all sub-regions• 99.9% availability guarantee with On-
Demand Streaming Reserved Unit
Component Price
Data processing (input and output)EncodingPackaging
Up to $1.99 / GBUp to $1.49 / GB
Storage Up to $0.07 / GB
Outbound bandwidth Up to $0.12 / GB
Reserved encoding unit $99 / month
Reserved on-demand streaming unitGuaranteed 200 Mbps per unit
$199 / month
DEMOWindows Azure Media Services Portal
MANAGING AND PLAYING ASSETS
Ingesting Assets from the .NET SDK
Obtain a CloudMediaContext• Gives you access to all objects and APIs
Create an asset (IAsset)• A collection of media files
Create a file (IAssetFile)• A single file within an asset
Create an access policy and locator• Determines ACL for asset and provides a URL
for upload
Encoding Assets from the .NET SDK
Obtain a media processor (IMediaProcessor)• Media processors can encode and package assets
Create an encoding job (IJob)• A job is a set of tasks for Media Services
Add tasks to the job (ITask)• E.g., encode WMV file for Apple HLS• Tasks have input assets and output assets
Monitor job progress until it completes
Delivering Assets from the .NET SDK
Locate the output asset for a job
Create an access policy and locator
Generate URLs• For progressive download• For streaming (IIS/HLS)
Optional: Enable CDN• For progressive download (blob storage)• For streaming origin server
DEMOUploading and encoding an asset from the .NET SDK
Playing Progressive Download Assets
• For progressive download in browsers that support HTML5 video, use the <video> element
<video width="640" height="480" controls> <sourcesrc="@Html.Raw(Model.Mp4SourceUrl)"
type="video/mp4" /></video>
Playing IIS Smooth Streaming
• For PC and Mac delivery of IIS Smooth Streaming, use the Silverlight Smooth Streaming SDK– Sample player available on CodePlex– http://playerframework.codeplex.com/
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="/Content/SmoothStreamingPlayer.xap"/>
<param name="InitParams"
value="[email protected]"/></object>
Server-hosted Silverlight player
Parameters for player
Playing HLS In-App on iOS
• The iOS MediaPlayer framework natively supports Apple HLS URLs
self.player = [[MPMoviePlayerController alloc]initWithContentURL:[NSURL
URLWithString:...]];self.player.scalingMode = MPMovieScalingModeAspectFill;self.player.controlStyle = MPMovieControlStyleDefault;[self.view addSubview:self.player.view];[self.player play];
DEMODelivering assets to various devices
END-TO-END FLOW
On-Premises
Windows Azure
Upload AppASP.NET Web Site
Worker Role
Media Services Encoder
Media Services
Streaming
Azure Blob Storage
Queue Storage
Azure Table Storage
(1) Upload file to Web Site(2) Store file in Blob Storage(3) Store metadata in Table Storage(4) Put encoding command in queue
(5) Start encoding job(6) Wait for job to complete(7) Generate streaming URLs(8) Update metadata in Table Storage
1
2 3
1 2 3 44 5 56 7 8
8 7
DEMOEnd-to-end flow and CMS
Summary & Call to Action
• Windows Azure Media Services is a cloud-scale platform offering for media management, conversion, and delivery
• .NET management SDK and REST endpoints
• Wide device reach with adaptive streaming and progressive download
• Try it for free as part of the Azure 90-day trial
Thank You!Questions?
Sasha Goldshtein
@goldshtn
blog.sashag.net