Building the Next YouTube with Windows Azure Media Services


Published on

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.

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Image taken from under Creative Commons 2.0 license.
  • Image taken from under Creative Commons 2.0 license.
  • Image taken from under Creative Commons 2.0 license.
  • Full list of supported import and export formats and codecs:
  • Remarks:Third-party SDK for HLS on Windows RT and Windows Phone 8: SDK for IIS Smooth Streaming on Android in-app: (there are others)Android supports HLS natively only since 3.0, and there are some issues with this support (browser and in-app): see: for some more links and details
  • Example:Encoding a 200MB video to both IIS Smooth Streaming and HLS formats in various bitrates may produce 800 MB of output, for a total of 1GB encoding I/O. Total cost: $1.99.Storing the 800 MB of output would cost approximately $0.06 per month (without geo-replication).Streaming the 200 MB video to 10,000 clients per month (assuming 50% average consumption rate) = 976GB would cost approximately $117 per month.
  • Illustrate the creation of a new media service.Upload a small mp4 asset. (clipcanvas…mp4)Publish the source (show that the URL is a simple blob storage URL).Use the built-in test player for the source, or simply copy the URL to the browser (this is a progressive download player).Encode the asset for HLS. Explain that there is an intermediate step that encodes to IIS Smooth Streaming and then creates an additional manifest for HLS.Monitor job progress.Publish both the intermediate IIS Smooth Streaming output and the HLS output.Use the built-in test player for IIS Smooth Streaming playback.Use an iPhone/iPad/iOS Simulator for HLS playback.
  • Show the SimpleUploadEncodeDeliver demo console application:Review the code that creates an asset, gets a storage URL (locator) for uploading the asset, and uploads it.Review the code that configures the encoding job (MP4 ==> IIS Smooth Streaming ==> Apple HLS).Review the code that waits for the encoding job to complete.Review the code that generates the final streaming URLs.(This code was taken from the walkthrough that you see on the dashboard of every new Media Service.)
  • Show HTML5 page on Mac, Windows, iPad (progressive download with <video> element) – from IBA portalShow Silverlight page on Mac, Windows – from IBA portalShow iOS app with MediaPlayer framework
  • Demonstrate the IBA pilot “CMS” running end-to-end on Windows Azure.Upload a media file:curl -X POST --data-binary @test.mp4Wait for encoding to complete.Demonstrate the resulting URLs on Windows / OS X / iOS.Demonstrate the SkyRocketMedia CMS: http://www.skyrocketmedia.netWalk through the different screens, explain that it is a nice wrapper on top of the Azure portal.
  • Building the Next YouTube with Windows Azure Media Services

    1. 1. SELA DEVELOPER PRACTICEMay 5-9, 2013Lights, Camera, Action:Windows Azure Media ServicesSasha GoldshteinCTO, SELA
    2. 2. With Windows Azure MediaServices, you can upload, manage,encode, and stream your media to avariety of devices on a cloudscale.
    3. 3. Maybe you have a bunch of trainingvideos you want to share with yourglobal employee contingent, in the officeand on the go …
    4. 4. … or maybe you are hosting the OlympicGames and need to stream to hundredsof millions of consumer devices, withpeaks of 100x the standard traffic …
    5. 5. … or maybe you’re a TV network, acellular carrier, a radio station, an adagency, a consumer video website …and you want to stop worrying aboutinfrastructure and embrace cloud scale.
    6. 6. FeaturesVODLivestreamingcoming soonEncoding tomultipleformatsEncryption(DRM)Progressivedownloadfrom blobSmoothstreamingDynamicpackaging.NET andJava SDKsRESTendpoints
    7. 7. 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 AudioCodec.wmv VC-1 WMA.mp4 H.264 AACSmooth Streaming FileFormat (.ismv)H.264VC-1AACWMA
    8. 8. Supported Devices• Very wide device coverage for progressive download• Device coverage for adaptive streaming:Platform IIS SmoothStreamingApple HTTP LiveStreaming (HLS)Windows (IE) Silverlight 3rd party SDK(Flash)OS X (Safari) Silverlight <video> elementWindows RT Microsoft SDK 3rd party SDKAndroid (Browser) 3rd party SDK(Flash)<video> elementiOS (Safari) <video> elementWindows Phone Microsoft SDK 3rd party SDKiOS (in-app) Microsoft SDK MediaPlayer FWAndroid (in-app) 3rd party SDK VideoView
    9. 9. Pricing Principles• Available in all sub-regions (NA, Europe, Asia)• 99.9% availability guarantee with On-DemandStreaming Reserved UnitComponent PriceData processing (input and output)EncodingPackagingUp to $1.99 /GBUp to $1.49 /GBStorage Up to $0.07 /GBOutbound bandwidth Up to $0.12 /GBReserved encoding unit $99 / monthReserved on-demand streamingunitGuaranteed 200 Mbps per unit$199 / month
    10. 10. DEMOWindows Azure Media Services Portal
    11. 11. Managing and PlayingAssets
    12. 12. Ingesting Assets from the .NET SDKObtain a CloudMediaContext• Gives you access to all objects and APIsCreate an asset (IAsset)• A collection of media filesCreate a file (IAssetFile)• A single file within an assetCreate an access policy and locator• Determines ACL for asset and provides aURL for upload
    13. 13. Encoding Assets from the .NET SDKObtain a media processor(IMediaProcessor)• Media processors can encode and package assetsCreate an encoding job (IJob)• A job is a set of tasks for Media ServicesAdd tasks to the job (ITask)• E.g., encode WMV file for Apple HLS• Tasks have input assets and output assetsMonitor job progress until it completes
    14. 14. Delivering Assets from the .NET SDKLocate the output asset for a jobCreate an access policy and locatorGenerate URLs• For progressive download• For streaming (IIS/HLS)Optional: Enable CDN• For progressive download (blob storage)• For streaming origin server
    15. 15. DEMOUploading and encoding an asset from the .NET SDK
    16. 16. Playing Progressive Download Assets• For progressive download in browsers that supportHTML5 video, use the <video> element<video width="640" height="480" controls><source src="@Html.Raw(Model.Mp4SourceUrl)"type="video/mp4" /></video>
    17. 17. Playing IIS Smooth Streaming• For PC and Mac delivery of IIS Smooth Streaming,use the Silverlight Smooth Streaming SDK• Sample player available on CodePlex•<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="mediaurl=@Model.SilverlightStreamingUrl"/></object>Server-hostedSilverlightplayerParameters forplayer
    18. 18. Playing HLS In-App on iOS• The iOS MediaPlayer framework natively supportsApple HLS URLsself.player = [[MPMoviePlayerController alloc]initWithContentURL:[NSURL URLWithString:...]];self.player.scalingMode = MPMovieScalingModeAspectFill;self.player.controlStyle = MPMovieControlStyleDefault;[self.view addSubview:self.player.view];[self.player play];
    19. 19. DEMODelivering assets to various devices
    20. 20. End-to-End Flow
    21. 21. On-Premises Windows AzureUpload AppASP.NETWeb SiteWorkerRoleMediaServicesEncoderMediaServicesStreamingAzure BlobStorageQueueStorageAzureTableStorage(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 Storage12 31 2 3 44 5 56 7 88 7
    22. 22. DEMOEnd-to-end flow and CMS
    23. 23. Summary & Call to Action• Windows Azure Media Services is a cloud-scaleplatform offering for media management,conversion, and delivery• .NET management SDK and REST endpoints• Wide device reach with adaptive streaming andprogressive download• Try it for free as part of the Azure 90-day trialLearn
    24. 24. SELA DEVELOPER PRACTICEMay 5-9, 2013Thank You!Questions?Sasha