On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED305) | AWS re:Invent 2013

Post on 27-Jan-2015

113 views 4 download

Tags:

description

Learn how AWS customers are using Amazon CloudFront to deliver their video content to users over HTTP(S) using a number of modern streaming protocols such as Smooth Streaming, HLS, DASH, etc. You also learn about options for end-to-end security of your video content—through both encryption and preventing access from unauthorized users based on their location. Finally, we demonstrate how easy it is to use CloudFront to deliver both your on-demand and live video to a global audience with great performance.

Transcript of On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED305) | AWS re:Invent 2013

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.

Media Streaming with Amazon CloudFront in a

Post-PC World

Alex Dunlap, Senior Manager - Amazon CloudFront

November 14, 2013

Agenda

• Challenges of media streaming beyond the desktop

• Traditional media streaming solution

• Media streaming best practices

• Using AWS to implement best practices

• Demo: On-demand streaming to multiple devices using

Amazon CloudFront and Amazon Elastic Transcoder

• Customer walkthrough

Agenda

• Challenges of media streaming beyond the desktop

• Traditional media streaming solution

• Media streaming best practices

• Using AWS to implement best practices

• Demo: On-demand streaming to multiple devices using

Amazon CloudFront and Amazon Elastic Transcoder

• Customer walkthrough

A Fragmented Ecosystem…

Many Devices, Codecs and Protocols…

Plethora of Devices

Supports only HLS

Devices are vendor specific

software-only baseline

Supports only smooth streaming

New devices entering the market

Library

Multiple Transcodes

Codecs

Screens

Asset L

ibra

ry

Managem

ent

Players and Security Models

Native Media

Players

Third-Party Media

Players

DRM-ed Content Tokenized Security

vs

vs

Monitor

• Viewer experience

• Operational excellence

• Business impact

Identify

• Devices that need optimization

• Best delivery networks

• Viewer trends

Reduce

• Suboptimal viewer experience

• Turnaround times

• Operational costs

Agenda

• Challenges of media streaming beyond the desktop

• Traditional media streaming solution

• Media streaming best practices

• Using AWS to implement best practices

• Demo: On-demand streaming to multiple devices using

Amazon CloudFront and Amazon Elastic Transcoder

• Customer walkthrough

Agenda

• Challenges of media streaming beyond the desktop

• Traditional media streaming solution

• Media streaming best practices

• Using AWS to implement best practices

• Customer walkthrough

Device Video Compression Audio Compression Quality Level Delivery Protocol

iOS H.264 AAC SD (low), SD (high), HD HLS

Android H.264 AAC SD (low), SD (high), HD

HLS *

Windows Phone

8 / Xbox

H.264 AAC SD (low), SD (high), HD

Smooth Streaming

Roku H.264 AAC SD (low), SD (high), HD

HLS

PlayStation 3 H.264 AAC SD (low), SD (high), HD

HLS

Desktop H.264 AAC SD (low), SD (high), HD

HLS / Smooth Streaming

Encode to Take Advantage of Commonality

among Devices

Avoid Storage Duplication

Same content in multiple places? Central location with archival backup

Global Reach

High Performance Delivery

Streaming Context Aware

Access Logs for Customer Insights

Pick the Right Content Delivery Network

Feature Native Player Third-Party Player

Consistency No Yes

Customizability No Yes

Turn-Key Yes No

Debugging Support No Yes

Data Collection No Yes

Players – Native, Third Party, or Both?

Securing Your Assets

Pre-DRM DRM On-The-Fly CDN Private Content

Measure Viewer Experience

CDN Server Logs Real User Metrics

# of concurrent sessions (expected)

# of concurrent sessions (actual)

% of re-buffered sessions

Agenda

• Challenges of media streaming beyond the desktop

• Traditional media streaming solution

• Media streaming best practices

• Using AWS to implement best practices

• Demo: On-demand streaming to multiple devices using

Amazon CloudFront and Amazon Elastic Transcoder

• Customer walkthrough

Using AWS to Implement Media Streaming

• Native infrastructure services (Amazon S3, Amazon Elastic Transcoder, Amazon CloudFront, Amazon EC2)

• Partner solutions in AWS Marketplace

Well Formed Ecosystem

• Pay-as-you-go pricing model

• Capacity when you need it

• Global footprint

Cost Effective Scaling

• MPAA security best practices Media Specific

Capabilities

Amazon S3

Mezzanine File

Amazon Elastic Transcoder

Encode to Take Advantage of Commonality

among Devices

• Faster onboarding of content

• Reduced storage costs

• Less content management

overhead

• Lowest number of encodes that

span maximum number of devices

• H.264 video, AAC audio

• Low quality, high quality, and 720p

HD compression

Amazon S3

Images

Videos

Files

Binaries

Snapshots

Internet scale storage

via API

AWS Storage Gateway

Amazon S3,

Amazon Glacier

Integrates on-premises IT

and AWS storage

Amazon Glacier

Images

Videos

Files

Binaries

Snapshots

Storage for archiving and

backup

Storing and Managing Your Media Assets on AWS

Video Streaming through AWS

Video Streaming through AWS

All HTTP-based streaming protocols (HLS, HDS, Smooth Streaming, MPEG-DASH) supported

Video streaming-specific caching optimizations

Scalable to handle popular content

Global reach (43 edge locations)

Native streaming support for HLS

Joint solutions with streaming media ISVs

Granular customer access logs

Delivering Secured Content

• Private content features of Amazon CloudFront Restrict Access to

Content

• Vary based on platform you are reaching

• Partner solutions available in AWS Marketplace

• Enabled by AWS CloudHSM solution

Encrypt Content Using Policies

Monitor and Measure Customer Experience

Process Using Amazon Elastic MapReduce

Amazon CloudFront Access Logs

Video

Client Monitoring

Aggregator

Telemetry Data

Real User Metrics

Agenda

• Challenges of media streaming beyond the desktop

• Traditional media streaming solution

• Media streaming best practices

• Using AWS to implement best practices

• Demo: On-demand streaming to multiple devices using

Amazon CloudFront and Amazon Elastic Transcoder

• Customer walkthrough

Customer Walkthrough

CHALLENGES IN HD

VIDEO ENCODING AND

DELIVERY

WHO WE ARE

VEVO is the world's leading all-premium music video and

entertainment platform.

In August 2013:

• 4.4 billion video views worldwide

• 28% of global streams each month are on mobile

• 250 million unique visitors worldwide

• 75,000+ videos from more than 21,000 artists

CHALLENGES

Provide a cohesive video streaming experience across

many different platforms

Disparate streaming protocols and encodes for

different devices and different screen sizes

Quickly adapt and be able to penetrate new markets

SUPPORTED PLATFORMS

• Web (dynamic streaming over RTMP)

• iOS (HLS)

• Apple TV (HLS)

• Samsung TV (HLS)

• Roku (HLS)

• Flash syndicated player (HLS)

• XBOX (Smooth Streaming)

• Windows Phone / Windows 8 (Smooth Streaming)

• Android (PMD)

• Mobile web (PMD)

• VEVOTV linear channel

(RTMP/HLS/Smooth)

VIDEO RENDITIONS

• Currently VEVO encodes 35 different renditions for each video

• All video encodes are adaptive with the exception of Android and mobile

web at the moment

• Working towards consolidating to 18 different renditions and providing

adaptive playback for all platforms by end of year

• Achieved through implementing HLS/Smooth Streaming playback on as

many sets of platforms as possible

HLS APPROACH

• Find the least common denominator in terms of video encoding settings

• Example: HLS protocol has varying implementations on different

devices

• HLS 3 vs. HLS 4 support

• Provide lightweight options such as choice of manifest for different

devices

• Repeatable workflows that are agnostic to technology providers

HLS MANIFESTS

Using the same adaptive bitrate encode for as many devices as

possible:

• Control quality and startup time by creating multiple versions of

manifests for mobile vs. connected devices

• Acceptable to use 500 kbps starting bitrate on 3G/4G cellular networks

• On a TV connected device, 2400 kbps 720p playback is much more

appropriate

MASTER VARIANT PLAYLIST

#EXTM3U

#EXT-X-VERSION:4

#EXT-X-I-FRAME-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2728426,RESOLUTION=960x540,

CODECS="avc1.4d401f,mp4a.40.2",URI="2400/vs3149982123_iframe.m3u8"

#EXT-X-STREAM-INF:PROGRAM-

ID=1,BANDWIDTH=2728426,RESOLUTION=960x540,CODECS="avc1.4d401f,mp4a.40.2"

2400/vs3149982123_2400k_960x540.m3u8

#EXT-X-I-FRAME-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1449571,RESOLUTION=960x540,

CODECS="avc1.4d401f,mp4a.40.2",URI="1200/vs3149982123_iframe.m3u8"

#EXT-X-STREAM-INF:PROGRAM-

ID=1,BANDWIDTH=1449571,RESOLUTION=960x540,CODECS="avc1.4d401f,mp4a.40.2"

1200/vs3149982123_1200k_960x540.m3u8

……

BYTERANGE PLAYLIST

#EXTM3U

#EXT-X-TARGETDURATION:10

#EXT-X-VERSION:4

#EXT-X-MEDIA-SEQUENCE:0

#EXT-X-PLAYLIST-TYPE:VOD

#EXT-X-I-FRAMES-ONLY

#EXTINF:10.00000,

#EXT-X-BYTERANGE:1417@564

vs3149982123_0.ts

#EXTINF:10.00000,

#EXT-X-BYTERANGE:86377@564

vs3149982123_1.ts

#EXTINF:7.64000,

#EXT-X-BYTERANGE:54522@564

vs3149982123_24.ts

#EXT-X-ENDLIST

VIDEO STREAMING

• Use HTTP based protocol to deliver content where possible

• FMS servers generally have higher streaming costs

• ABR protocols benefit from faster startup time and the ability to target multiple

screen sizes

• Multi-CDN approach is not for everyone, but if footprint is large enough, it

provides best value\performance\stability balance

• Consider tradeoff between operational effort vs. extra redundancy and

protection from regional outages

• Video streaming in certain geographical regions and emerging markets are

more expensive

ENCODING WORKFLOW

Queue-based system with designated tasks

• Encoding Request: Mezzanine files uploaded to object storage

• Encoding Job: Tasks created for each video platform and its

associated renditions

• Delivery: Upload encoded assets to CDN(s)

• Update Data Layer: Back-end databases updated with information on

how to stream the video

QUEUE BASED ENCODING SYSTEM

Request

Service

Encoding

Service

Update

Service

CDNS

Qu

eu

e S

ys

tem

S

erv

ice

Sta

ck

Request Encode Delivery Update

Delivery

Service

On-Premises

Storage

Amazon S3

Storage

VEVO Database

ANATOMY OF AN ENCODING MESSAGE

JSON

__type : "EncodingMessage:#Vevo.Encoding.Data.Messages"

Attempt : 0

BatchId : "c7ad3b1f-b85b-4ed2-a1e0-84d3a1099147"

IsPriority : false

Isrc : "BRV222900341"

MessageId : "822745bc-9aac-497d-aac9-9794be54e7a2"

Platform : 8

Priority : 1

ServiceRole : 2

TaskType : "Vevo.Encoding.Tasks.EncoderTask"

VideoSizeMB : 419

CaptionSource

BucketName : "CaptionFiles"

Key : "BRV222900341/BRV222900341"

Destination

BucketName : "EncodedOutput"

Key : "BRV222900341/"

Source

BucketName : "Mezzanine"

Key : "BRV222900341/BRV222900341.mp4"

ENCODING WORKFLOW CONTINUED

Benefits:

1. Stateless – failed tasks will be reprocessed

2. Scalable – scale out fleet horizontally for large catalog re-

encodes

3. Maintainable – workflow is extremely repeatable

VIDEO ENCODING SETTINGS

• Provide multiple bitrates for devices to choose from

• Select an appropriate H.264 profile and level to gain maximum coverage across

devices

• Baseline profile 3.x level (less complexity)

• High profile 4.x 1080p output (better compression)

• Two-channel 44100Hz AAC audio format has broadest support

• Live video broadcasts are a different beast!

LAUNCHING ON A NEW PLATFORM

In late August 2013 VEVO launched on the Apple TV platform

How do we adapt HLS streams used for mobile devices to large screen device?

• Expanded HLS encoding profile to add additional 3400 kbps & 4200 kbps bitrate

encodes at 1080p resolution

• Implemented byte-range playlists without losing interoperability

• Reused widely for all devices supporting HLS natively

• Large undertaking to re-encode entire video catalog

API STACK

Availability

Zone 1

SQL Server

Availability

Zone 2

SQL Server

Availability Zone 1

Cache

Preloader ElasticCache

Cluster

API Server

Availability Zone 1

API Server

Availability Zone 2

Amazon S3

Lucene Indexes

US East

Da

ta L

aye

r

SQ

L R

ep

licati

on

Elastic Load Balancing

Route 53 DNS

WORKFLOW SUMMARY

Clients

Mezzanine

Files

CDN A CDN B

CDN C

Encoding API

CLOUDFRONT

• Ease of integration: Encoding workflows live in multiple cloud providers; simple to

extend existing logic to output to a permanent Amazon S3 origin for streaming

• Competitive pricing: Easy to work on proof of concept with pay-as-you-go model

without a heavy initial investment

• Prewarm cache from different geographic locations for anticipated high profile

assets

• Amazon S3 object storage is suitable as a origin in terms of caching efficiency

and easy-to-control levels of redundancy for further cost savings; model for

Amazon S3 + redundant backups is compelling from an overhead and

management perspective.

CLOUDFRONT CONTINUED

• Protecting video content residing on Amazon S3 origin is simple with origin

access identity

• Restrict access to all users except for CloudFront to ensure assets are only

streamed via CDN

• Integrate your own tokenization schemas for further security

• SSL for video content served over HTTP based protocol content if required

ANALYZE YOUR LOGS

• When selecting edge locations, study your origin logs to determine

best balance between in-region delivery and cost.

• LATAM? APAC?

• Ability to select geographic edge locations helps keep cost under

control as VEVO mostly operates in North America in Europe.

Understand your traffic before making a decision

New York, NY

Frankfurt Am Main, Hessen

Los Angeles, CA

Atlanta, GA

Milano, Italy

Madrid, Spain

Dallas, TX

Berlin, Germany

Houston, TX

Hamburg, Germany

Chicago, IL

Phoenix, AZ

Washington, DC

Montreal, QC

Philadelphia, PA

Paris, France

Toronto, ON

San Diego, CA

San Francisco, CA

Stuttgart, Baden-Wuerttemberg

ACHIEVED HIGHER AVERAGE BITRATE

New HLS profiles delivered over CloudFront to US and EU resulted in increased average bitrate

to iOS devices.

0

500

1000

1500

2000

2500

3000

6/1 6/11 6/21 7/1 7/11 7/21 7/31 8/10 8/20 8/30 9/9 9/19 9/29

Ave

rag

e K

bp

s

iOS Average Bitrate

iOS Bitrate Linear (iOS Bitrate)

LARGER MEDIA INDUSTRY CONCERNS

• Lack of standardization and fragmentation is still a major issue.

• The problem is not going to go away overnight. Is DASH the future? HTML 5?

• Take the initiative to establish own internal standards for your video operations by

consolidation around adaptive protocols and using repeatable workflows.

• Pick the right CDN(s); buffering time has proven correlation with loss of

engagement.

THANK YOU!

Ivan Yang

ivan.yang@vevo.com

We are sincerely eager to hear

your feedback on this

presentation and on re:Invent.

MED305

Please fill out an evaluation form

when you have a chance.