24
Build the Next YouTube: Windows Azure Media Services Sasha Goldshtein CTO, Sela Group Level: Intermediate

Build the Next YouTube: Windows Azure Media Services

Embed Size (px)

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.

Citation preview

Page 1: Build the Next YouTube: Windows Azure Media Services

Build the Next YouTube:Windows Azure Media Services

Sasha GoldshteinCTO, Sela Group

Level: Intermediate

Page 2: Build the Next YouTube: 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: Build the Next YouTube: 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: Build the Next YouTube: 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: Build the Next YouTube: 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: Build the Next YouTube: 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: Build the Next YouTube: 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 formats

File Format Video Codec Audio Codec

.wmv VC-1 WMA

.mp4 H.264 AAC

Smooth Streaming File Format (.ismv)

H.264VC-1

AACWMA

Page 8: Build the Next YouTube: Windows Azure Media Services

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

Page 9: Build the Next YouTube: Windows Azure Media Services

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

Page 10: Build the Next YouTube: Windows Azure Media Services

DEMOWindows Azure Media Services Portal

Page 11: Build the Next YouTube: Windows Azure Media Services

MANAGING AND PLAYING ASSETS

Page 12: Build the Next YouTube: 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: Build the Next YouTube: 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: Build the Next YouTube: 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: Build the Next YouTube: Windows Azure Media Services

DEMOUploading and encoding an asset from the .NET SDK

Page 16: Build the Next YouTube: 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> <sourcesrc="@Html.Raw(Model.Mp4SourceUrl)"

type="video/mp4" /></video>

Page 17: Build the Next YouTube: 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: Build the Next YouTube: 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: Build the Next YouTube: Windows Azure Media Services

DEMODelivering assets to various devices

Page 20: Build the Next YouTube: Windows Azure Media Services

END-TO-END FLOW

Page 21: Build the Next YouTube: Windows Azure Media Services

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

Page 22: Build the Next YouTube: Windows Azure Media Services

DEMOEnd-to-end flow and CMS

Page 23: Build the Next YouTube: 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

Page 24: Build the Next YouTube: Windows Azure Media Services

Thank You!Questions?

Sasha Goldshtein

@goldshtn

blog.sashag.net