2. Amazon Web Services – APN Bootcamp Lab Guide 2018
Page 2 of 24
Table of Contents
Table of Contents ......................................................................................................................................... 2
Lab 개요 ........................................................................................................................................................... 3
준비 조건 ......................................................................................................................................................... 3
STEP1. Amazon MediaConvert 구성하기 ................................................................................................ 3
1-1. 미디어 화일 준비 ................................................................................................................................................ 3
1-2. MediaConvert 구성.......................................................................................................................................... 4
1-3. HLS 스트리밍 확인 ........................................................................................................................................... 10
1-4. DASH 스트리밍 ................................................................................................................................................ 11
STEP2. Amazon MediaPackage 구성하기 ............................................................................................. 12
2-1. MediaPackage Input 준비............................................................................................................................ 12
STEP3. Amazon MediaLive 구성하기 ..................................................................................................... 14
3-1. MediaLive Input 준비 .................................................................................................................................... 14
3-2. MediaLive Channel 준비 .............................................................................................................................. 16
3-3. MediaLive Input 을 위한 라이브 신호 준비 ............................................................................................... 18
STEP4. Amazon MediaPackage Endpoint 구성하기 ........................................................................... 19
4-1. MediaPackage 입력 확인 .............................................................................................................................. 19
4-2. MediaPackage Endpoint 생성 .................................................................................................................... 20
STEP5. Amazon MediaStore 구성 – MediaLive 출력 수신 ................................................................. 22
5-1. MediaStore Container 생성......................................................................................................................... 22
5-2. MediaLive 의 출력을 MediaStore 로 설정 ................................................................................................. 23
3. Amazon Web Services – APN Bootcamp Lab Guide 2018
Page 3 of 24
Lab 개요
§ OTT 기반의 미디어 서비스에 대한 기본 지식과 메타 데이터 구성에 대한 기본 지식을 이해
합니다.
§ MediaConvert, MediaLive, MediaStore, MediaPackage 그리고 MediaTailor 의 구성을
이해 합니다.
준비 조건
• 인터넷 브라우저: Chrome with HLS Native Player Plug-in installed
• OBS 다운로드 및 설치: https://obsproject.com/
• 개인방송 테스트를 위해 iOS, Android App Bitstream 사용
• AWS 계정 및 기본적인 AWS 사용 방법 숙지
STEP1. Amazon MediaConvert 구성하기
1-1. 미디어 화일 준비
1) 미디어 화일 다운로드(Click URL, curl 또는 wget 을 이용), https://s3.ap-northeast-
2.amazonaws.com/elementalkr-demo/Galaxy_Note_7.mp4
2) S3 에 미디어 화일 업로드, AWS CLI 또는 Console UI 에서 업로드. 이때 해당 버켓은 public 으로
read 될 수 있도록 설정. (Permissions > Buckey Policy 내 아래 policy 복사 입력)
3) 미디어 화일은 30 초 분량으로 크기는 6Mbytes
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::버킷명으로 변경/*"
]
}
]
}
4. Amazon Web Services – APN Bootcamp Lab Guide 2018
Page 4 of 24
1-2. MediaConvert 구성
1) AWS Console Login, 본 Lab 을 수행할 리젼 선정 (Tokyo Region 사용)
2) 콘솔 화면에서 MediaConvert -> ‘Get started’ 버튼 선택
3) Step 1 : Create job 의 Inputs 에 input1 에 미디어 화일이 있는 경로를 선택
4) Step 2: Output groups 에서 Add 버튼 선택 후 File group 선택
5) Step 3: Output groups 에서
Add 버튼 선택 후 File group
선택, Custom group name,
Destination (S3 bucket)
그리고 Output1 의 Name
modifier 기입
5. Amazon Web Services – APN Bootcamp Lab Guide 2018
Page 5 of 24
6) Step 4: Output1 선택후 Container -> No Container 선택, Video codec -> Frame
Capture to JPEG 선택, Resolution -> 320 x 240 선택
7) 아래와 같이 Audio 1 을 클릭하여 Remove Audio 버튼을 선택해 Audio 1 삭제.
8) Step 5: Output groups 에서 Add 버튼 선택 후 Apple HLS 선택
6. Amazon Web Services – APN Bootcamp Lab Guide 2018
Page 6 of 24
9) Step 6: Custom group name, Destination (S3 Bucket), Segement lengh -> 2 기입,
Outputs -> Add output 버튼을 2 회 사용하여 Output1, Output2 그리고 Output3 생성
10) Step 7: Output 1 을 선택 후 Output settings -> Name modifier 의 값과 Stream
settings -> Video 의 Resolution(w x h)과 Bitrate(bits/s)을 업데이트. 아래의 표와 같이
Output2 와 Output 3 에 대해서 적용
Name
modifier
Timecode
burn-in
Resolution Bitrate
11. Amazon Web Services – APN Bootcamp Lab Guide 2018
Page 11 of 24
3) Native HLS Playback 추가후 “option + command + I”(맥 기준) 를 선택하여 개발자 모드
사용, 복사한 Link 를 URL 창에 복사 하여 영상 재생, 재생되는 영상과 오른쪽 창에 실제
메타데이터, 영상 파일 수신에 대한 절차를 확인 (Network 탭 선택 후 Command + R 로 reload)
1-4. DASH 스트리밍
1) Add output group 을 선택한후 DASH ISO 선택
2) Group name, Destination 을 선택, Fragment length 를 원하는 초로 기입, 아래는 2 초로 되어
있습니다. 그리고 Single File, Segmented File 중 하나를 선택
14. Amazon Web Services – APN Bootcamp Lab Guide 2018
Page 14 of 24
STEP3. Amazon MediaLive 구성하기
3-1. MediaLive Input 준비
1) AWS Console Login, 본 Lab 을 수행할 리젼 선정 (Singapore Region 사용)
2) 콘솔 화면에서 MediaLive -> ‘Create input’ 버튼 선택 (Create Channel 만 보이는 경우
선택 후 왼쪽 Inputs 메뉴 선택 후 Create Input 버튼 선택)
3) Step 1: Input detail 에 이름 기입, input type 에 RTMP (push) 선택, Input security
group 에 Create 선택후 “0.0.0.0/0” 기입 -> Create input security group 선택하여 그룹
생성, Input destinations 중 Destination A 에 “live/test1” Destination 에
“live/test2” 기입
16. Amazon Web Services – APN Bootcamp Lab Guide 2018
Page 16 of 24
3-2. MediaLive Channel 준비
1) Step 1: Create channel -> Channel name 기입 -> IAM role 선택 -> “Create role
from template” -> Create IAM role -> Channel template -> “Live event” 선택 ->
Attach input “생성한 input 선택” ->
2) Step 2: 좌측 창의 HD(HLS) 선택 -> HLS Group destination A 에 MediaPackage 첫번째
Package URL, User name 기입 -> Password 에서 Create AWS Elemental MediaLive
parameter 선택 -> Name 에 “medialive1” -> Password value 에 MediaPackage 첫번째
Package 의 Password 복사 -> Create AWS Elemental MediaLive parameter 선택
17. Amazon Web Services – APN Bootcamp Lab Guide 2018
Page 17 of 24
3) Step 3: HLS Group destination B 에 MediaPackage 두번째 Package URL, User name 기입
-> Password 에서 Create AWS Elemental MediaLive parameter 선택 -> Name 에
“medialive2” -> Password value 에 MediaPackage 두번째 Package 의 Password 복사 ->
Create AWS Elemental MediaLive parameter 선택
4) Step 4: 좌측 창의 Create channel 버튼 선택 -> Channels 페이지로 이동
18. Amazon Web Services – APN Bootcamp Lab Guide 2018
Page 18 of 24
5) Step 5: 채널 선택후 Start 선택
3-3. MediaLive Input 을 위한 라이브 신호 준비
1) OBS 소프트웨어 구동 -> Source -> + 버튼 선택후 Video Capture Device 선택 -> Device 에
노트북 Builtin 카메라 디바이스 선택 후 (그리고 640*480) -> OK
2) 오른쪽 하단의 Settings -> Stream -> Stream Type 을 Custom Streaming Server 를 선택
URL 에 MediaLive Input 의 URL 을 기입, URL 에 마지막 단어를 포함시키지 않고 마지막 단어는
Stream Key 에 적용. (예: MediaLive 의 Input 이 rtmp://52.76.42.222:1935/live/test1
인 경우 URL 에는 rtmp://52.76.42.222:1935/live/ 만 기입 하고 Stream Key 에 test1 기입
22. Amazon Web Services – APN Bootcamp Lab Guide 2018
Page 22 of 24
4) DASH Meta Data sample
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011"
xmlns:cenc="urn:mpeg:cenc:2013" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011
http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
type="static" minBufferTime="PT30S" profiles="urn:mpeg:dash:profile:isoff-main:2011"
mediaPresentationDuration="PT22.485S">
<Period start="PT0S" duration="PT22.485S" id="1">
<AdaptationSet mimeType="video/mp4" codecs="avc1.4d4028,avc1.4d4020,mp4a.40.2"
frameRate="45000/1499" segmentAlignment="true" subsegmentAlignment="true" startWithSAP="1"
subsegmentStartsWithSAP="1" bitstreamSwitching="false">
<ContentComponent contentType="video" id="1"/>
<ContentComponent contentType="audio" id="2"/>
<Representation id="1" width="1920" height="1080" bandwidth="5000000">
<BaseURL>20171026_1207421080p_dash_.mp4</BaseURL>
<SubRepresentation contentComponent="1" bandwidth="0" codecs="avc1.4d4028"/>
<SubRepresentation contentComponent="2" bandwidth="96000" codecs="mp4a.40.2"/>
<SegmentBase indexRange="1221-1356">
<Initialization range="0-1220"/>
</SegmentBase>
</Representation>
<Representation id="2" width="1280" height="720" bandwidth="2000000">
<BaseURL>20171026_120742720p_dash_.mp4</BaseURL>
<SubRepresentation contentComponent="1" bandwidth="0" codecs="avc1.4d4020"/>
<SubRepresentation contentComponent="2" bandwidth="96000" codecs="mp4a.40.2"/>
<SegmentBase indexRange="1218-1353">
<Initialization range="0-1217"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>
STEP5. Amazon MediaStore 구성 – MediaLive 출력 수신
5-1. MediaStore Container 생성
1) 콘솔 내 MediaStore 서비스로 이동하여 Continer 생성
2) 생성된 Continer 를 확인
23. Amazon Web Services – APN Bootcamp Lab Guide 2018
Page 23 of 24
3) Container 의 Data Endpoint 확인 그리고 Policy 에서 수신 받을 리소스의 정보를 입력.
예제에서는 모두에게서 받는 것으로 수정 (“*”)
5-2. MediaLive 의 출력을 MediaStore 로 설정
1) 콘솔 내 MediaLive 서비스로 이동하여 Destination 에서 CDN Setting 에서 HLS media store
선택. HLS group destination A 와 B 에 Mediastore endpoint 의 URL 을 입력. https 대신
mediastoressl 로 변경하여 입력. (예:
mediastoressl://mn63czzbzfhvt5.data.mediastore.ap-northeast-
1.amazonaws.com/test2/index) 마지막 test2 는 prefix 이며 index 는 master m3u8 을
위한 이름