24
SELA DEVELOPER PRACTICE May 5-9, 2013 Lights, Camera, Action: Windows Azure Media Services Sasha Goldshtein CTO, SELA Group @goldshtn blog.sashag.net

Building the Next YouTube with Windows Azure Media Services

Embed Size (px)

DESCRIPTION

Sasha Goldshtein's presentation at the Sela Developer Practice (May 2013) on Windows Azure Media Services. Covers basic scenarios, the .NET SDK, and finally an end-to-end flow using WAMS to deliver progressive download and adaptive streaming content.

Citation preview

Page 1: Building the Next YouTube with Windows Azure Media Services

SELA DEVELOPER PRACTICEMay 5-9, 2013

Lights, Camera, Action:Windows Azure Media ServicesSasha Goldshtein

CTO, SELA Group

@goldshtn

blog.sashag.net

Page 2: Building the Next YouTube with Windows Azure Media Services

With Windows Azure Media Services, you can upload, manage, encode, and stream your media to a variety of devices

on a cloud scale.

Page 3: Building the Next YouTube with Windows Azure Media Services

Maybe you have a bunch of training videos you want to share with your global employee contingent, in the

office and on the go…

Page 4: Building the Next YouTube with Windows Azure Media Services

…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…

Page 5: Building the Next YouTube with Windows Azure Media Services

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

Page 6: Building the Next YouTube with Windows Azure Media Services

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

Page 7: Building the Next YouTube with Windows Azure Media Services

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 formatsFile Format Video Codec

Audio Codec

.wmv VC-1 WMA

.mp4 H.264 AAC

Smooth Streaming File Format (.ismv)

H.264VC-1

AACWMA

Page 8: Building the Next YouTube with Windows Azure Media Services

Supported Devices

• Very wide device coverage for progressive download

• Device coverage for adaptive streaming:Platform IIS Smooth

StreamingApple 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

Page 9: Building the Next YouTube with Windows Azure Media Services

Pricing Principles

• Available in all sub-regions (NA, Europe, Asia)

• 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

Page 10: Building the Next YouTube with Windows Azure Media Services

DEMOWindows Azure Media Services Portal

Page 11: Building the Next YouTube with Windows Azure Media Services

Managing and Playing Assets

Page 12: Building the Next YouTube with Windows Azure Media Services

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

Page 13: Building the Next YouTube with Windows Azure Media Services

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

Page 14: Building the Next YouTube with Windows Azure Media Services

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

Page 15: Building the Next YouTube with Windows Azure Media Services

DEMOUploading and encoding an asset from the .NET SDK

Page 16: Building the Next YouTube with Windows Azure Media Services

Playing Progressive Download Assets• For progressive download in browsers that

support HTML5 video, use the <video> element

<video width="640" height="480" controls>

<source src="@Html.Raw(Model.Mp4SourceUrl)"type="video/mp4" />

</video>

Page 17: Building the Next YouTube with Windows Azure Media Services

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

Page 18: Building the Next YouTube with Windows Azure Media Services

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];

Page 19: Building the Next YouTube with Windows Azure Media Services

DEMODelivering assets to various devices

Page 20: Building the Next YouTube with Windows Azure Media Services

End-to-End Flow

Page 21: Building the Next YouTube with Windows Azure Media Services

On-Premises

Windows Azure

Upload App

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

Page 22: Building the Next YouTube with Windows Azure Media Services

DEMOEnd-to-end flow and CMS

Page 23: Building the Next YouTube with Windows Azure Media Services

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

Learn more:www.windowsazure.com/en-us/home/

scenarios/media/

Page 24: Building the Next YouTube with Windows Azure Media Services

SELA DEVELOPER PRACTICEMay 5-9, 2013

Thank You!Questions?

Sasha Goldshtein

@goldshtn

blog.sashag.net