<commit_before>+++
categories = ["AWS", "Lambda", "Elastic Transcoder"]
date = "2016-05-24T16:21:57+08:00"
draft = false
tags = ["AWS", "Lambda"]
title = "Serverless Approach to Transcode Media"
image = "http://fartashh.github.io/images/lambda-transcoder/s3-lambda-transcoder.png"
desc = "Handling and managing media content is quite challenging. You need to decode the media to different formats and qualities, to serve users with different device and bandwidth. In this post I'm going to explain how to setup the fully automated serverless approach by using AWS S3, Lambda, and Elastic Transcoder "

+++

{{< img src="/images/post/lambda-transcoder/s3-lambda-transcoder.png" title="" class="align-center">}}
Handling and managing media content is quite challenging. You need to decode the media to different formats and qualities, 
to serve users with different devices and bandwidth. 
And I am pretty sure you don't want to handle this complexity in your app :).
In this post I am going to explain how to setup the fully automated serverless approach by using AWS S3, Lambda, and Elastic Transcoder. 
<!--more-->

## Case Study
I always understand and learn any new concept better by using case studies; so I have decided to have one. 

> Build feature to support streaming for IOS devices

As you may know Apple use HTTP Live Streaming (HLS) which is an adaptive streaming communications protocol created by 
Apple to communicate with iOS and Apple TV devices and Macs running OSX in Snow Leopard or later.

The final system, automatically detects the *.mp3 file uploaded to `input` bucket, call lambda function, to create a new 
Transcoder job (convert mp3 to hls) and save the output in `output` bucket.

## Setup Elastic Transcoder
Amazon Elastic Transcoder is media transcoding in cloud. It helps us to convert media files, which have been stored in S3, into 
media files into the formats required by consumer playback devices. In our case, we want to convert mp3 to the format supported 
by HLS protocol.

In order to get it up and running, you need to be familiar with three components of ET:
  <commit_msg>lambda-transcoder<commit_after>+++
categories = ["AWS", "Lambda", "Elastic Transcoder"]
date = "2016-05-24T16:21:57+08:00"
draft = false
tags = ["AWS", "Lambda"]
title = "Serverless Approach to Transcode Media"
image = "http://fartashh.github.io/images/lambda-transcoder/s3-lambda-transcoder.png"
desc = "Handling and managing media content is quite challenging. You need to decode the media to different formats and qualities, to serve users with different device and bandwidth. In this post I'm going to explain how to setup the fully automated serverless approach by using AWS S3, Lambda, and Elastic Transcoder "

+++

{{< img src="/images/post/lambda-transcoder/s3-lambda-transcoder.png" title="" class="align-center">}}
Handling and managing media content is quite challenging. You need to decode the media to different formats and qualities, 
to serve users with different devices and bandwidth. 
And I am pretty sure you don't want to handle this complexity in your app :).
In this post I am going to explain how to setup the fully automated serverless approach by using AWS S3, Lambda, and Elastic Transcoder. 
<!--more-->

## Case Study
I always understand and learn any new concept better by using case studies; so I have decided to have one. 

> Build feature to support streaming for IOS devices

As you may know Apple use HTTP Live Streaming (HLS) which is an adaptive streaming communications protocol created by 
Apple to communicate with iOS and Apple TV devices and Macs running OSX in Snow Leopard or later.

The final system, automatically detects the *.mp3 file uploaded to `input` bucket, call lambda function, to create a new 
Transcoder job (convert mp3 to hls) and save the output in `output` bucket.

## Setup Elastic Transcoder
Amazon Elastic Transcoder is media transcoding in cloud. It helps us to convert media files, which have been stored in S3, into 
the formats required by consumer playback devices. In our case, we want to convert mp3 to the format supported 
by HLS protocol.

In order to get it up and running, you need to be familiar with three components of ET:
  
{'fraction_non_alphanumeric': 0.06467661691542288, 'fraction_numerical': 0.012319355602937692, 'mean_word_length': 4.54796320630749, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3310514', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1097, 'n_words': 617}