52
© 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

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

Embed Size (px)

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.

Citation preview

Page 1: 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

Page 2: On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED305) | AWS re:Invent 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

Page 3: On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED305) | AWS re:Invent 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

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

A Fragmented Ecosystem…

Many Devices, Codecs and Protocols…

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

Plethora of Devices

Supports only HLS

Devices are vendor specific

software-only baseline

Supports only smooth streaming

New devices entering the market

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

Library

Multiple Transcodes

Codecs

Screens

Asset L

ibra

ry

Managem

ent

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

Players and Security Models

Native Media

Players

Third-Party Media

Players

DRM-ed Content Tokenized Security

vs

vs

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

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

Page 9: On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED305) | AWS re:Invent 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

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

Agenda

• Challenges of media streaming beyond the desktop

• Traditional media streaming solution

• Media streaming best practices

• Using AWS to implement best practices

• Customer walkthrough

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

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

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

Avoid Storage Duplication

Same content in multiple places? Central location with archival backup

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

Global Reach

High Performance Delivery

Streaming Context Aware

Access Logs for Customer Insights

Pick the Right Content Delivery Network

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

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?

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

Securing Your Assets

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

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

Measure Viewer Experience

CDN Server Logs Real User Metrics

# of concurrent sessions (expected)

# of concurrent sessions (actual)

% of re-buffered sessions

Page 18: On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED305) | AWS re:Invent 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

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

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

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

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

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

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

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

Video Streaming through AWS

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

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

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

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

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

Monitor and Measure Customer Experience

Process Using Amazon Elastic MapReduce

Amazon CloudFront Access Logs

Video

Client Monitoring

Aggregator

Telemetry Data

Real User Metrics

Page 26: On-demand & Live Streaming with Amazon CloudFront in the Post-PC World (MED305) | AWS re:Invent 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

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

Customer Walkthrough

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

CHALLENGES IN HD

VIDEO ENCODING AND

DELIVERY

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

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

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

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

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

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)

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

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

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

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

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

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

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

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

……

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

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

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

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

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

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

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

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

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

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"

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

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

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

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!

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

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

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

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

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

WORKFLOW SUMMARY

Clients

Mezzanine

Files

CDN A CDN B

CDN C

Encoding API

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

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.

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

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

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

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

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

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)

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

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.

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

THANK YOU!

Ivan Yang

[email protected]

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

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.