Más contenido relacionado La actualidad más candente (20) Similar a AWS 를 활용한 저지연 라이브 (Low Latency Live) 서비스 구현 - 류재춘 컨설턴트/에반젤리스트, GS Neot다 :: AWS Summit Seoul 2021 (20) Más de Amazon Web Services Korea (20) AWS 를 활용한 저지연 라이브 (Low Latency Live) 서비스 구현 - 류재춘 컨설턴트/에반젤리스트, GS Neot다 :: AWS Summit Seoul 20211. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
K O R E A | M A Y 1 1 - 1 2 , 2 0 2 1
2. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS 를 활용한 저지연 라이브
(Low Latency Live) 서비스 구현
류재춘
컨설턴트 / 에반젤리스트
GS Neotek
3. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
대세는 라방이다!
4. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Latency? CMAF?
5. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
시작하기에 앞서,
MP4 MP4 TS MKV
Video
H.264
Audio
AAC
Video
HEVC
Audio
AAC
Video
H.264
Audio
AAC
Video
H.264
Audio
AAC
Video
VP9
Audio
OPUS
WebM
• 어떤 동영상으로 서비스를 하시겠습니까?
• Video 는 H.264, Audio 는 AAC 코덱을 사용하여 압축하고, 컨테이너는 mp4 입니다.
6. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Live Streaming 에서의 Latency
• HTTP 기반 Live 서비스의 Latency 가 Hot 이슈
• Apple 의 초기 Spec 상으로 HLS 는 약 30초의 Latency 발생 (수정 된 권고사항으로는 약 20초)
• HTTP 기반의 경우, 보편적인 솔루션들은 최적화 작업을 통해 7~8초까지 줄일 수 있음
• 각 솔루션 및 업체별로 Latency 를 줄이고자 노력을 많이 기울이고 있는 상황
Live 서비스에 있어 Latency 에 대한 이슈
7. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Common
Latency
Reduced
Latency
Low
Latency
Near Real-Time
Latency
Live 서비스 Latency
10초 Segment
6초 Segment
2초 Segment
Chunked CMAF
WebRTC
0초
2초
5초
10초
20초
30초
이미지출처 : AWS
오늘의 주제 이미지출처 : AWS
8. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Protocol Latency 특징
RTSP, RTMP 약 3초 수준 시장에서 점차 Out
HLS 약 8초 수준 Max 6초 수준 가능하나 한계가 명확
WebRTC 약 2초 수준 화상 회의나 영상 통화에 적합
SRT 약 2초 수준 Edge 로는 아직 시장에서 검증이 안되었음
WebSocket 약 2초 수준 CMAF 전에 주목 받았으나 활용이 제한적
CMAF 약 3초 수준 시장에서 주목 받고 있고 Cache 구조 가능
Low Latency 를 고려해 볼 수 있는 프로토콜
9. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• WebRTC
• RTMP 이후 Low Latency Live 의 초기 시장 선점
• UDP 기반이기에 초고화질에는 한계가 있다는 업계의 의견과 방화벽 및 네트워크 이슈가 존재
• Cache 를 사용할 수 없어 트래픽 처리를 위한 Edge 를 WebRTC 전용 서버로 구성해야 하며,
처리능력에 있어서도 대표적인 WebRTC 지원 서버 Wowza 의 경우 기존 프로토콜 대비 1/10 수준
• CMAF
• CMAF 은 2016년도에 표준화가 시작되었지만, Low Latency Live 를 위한 CMAF 은 2018년부터 본격적으로 시작되
어 WebRTC 에 비해 시장 진입이 늦음
• HTTP 기반이고 Cache 가능하여 대규모 트래픽 처리를 위한 확장에 용이
• 전반적으로 Low Latency Live 시장의 대세로 자리잡는 듯 했으나 Apple 이 WWDC 2019 에서 Low Latency 를 위한
독자적인 Low Latency HLS 발표하여 기술이 양분 될 우려
WebRTC vs CMAF
10. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MPEG LL-DASH vs Apple LL-HLS
11. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MP4, TS, CMAF…
12. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• CMAF 이란?
• Microsoft 와 Apple 이 효율적이고 통일 된 새로운 표준 미디어 포맷에 대한 필요성을 느껴 표준화한 동영상 규격
• 하나의 동영상 파일 자체가 내부적으로 Fragmented 된 구조
• CMAF 으로 표준화 되기 전까지는 fMP4 로 명칭 (Fragmented MP4)
• MPEG-DASH 에서는 이미 예전부터 사용되어 왔고, Apple 은 2017년 iOS 11, macOS High Sierra 부터 지원
What is CMAF?
MP4 파일 구조 CMAF 파일 구조
moov
moof
mdat
moof
mdat
moof
mdat
moof
mdat
moov
mdat
0 18 ftyp
18 a3d moov
a55 623cb free
62e20 908441 mdat
0 24 ftyp
24 8 free
2c 4a free
76 50c moov
582 5c sidx
5de 3f0 moof
9ce 8ef53 mdat
8f921 3ec moof
8fd0d 96136 mdat
125e43 3ec moof
12622f 89687 mdat
1af8b6 3ec moof
1afca2 8d05f mdat
23cd01 6c8 moof
23d3c9 e56a7 mdat
13. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CMAF 의 장점
• Bitmovin 자료에 의하면, HLS 에서 사용되는 TS 컨테이너 보다 Overhead 가 낮아 ,
3% 에서 최대 10% 정도 CDN 비용 절감 (실제 TS 와 CMAF 의 동일 조건에서 파일 사이즈는 3.5% 차이가 있음)
• 표준 포맷 통일에 의한 미디어 환경 전반에 걸친 효율성 증가에 따른 비용 절감
(Storage 절감, Packaging 비용 절감, Cache 효율성 증가)
• HLS 의 TS 경우, 브라우저 표준 MSE (Media Source Extensions) 에서 지원하지 않아, Apple 기반을 제외하고는
JavaScript 나 Application 기반으로 동영상을 ReMultiplex (컨테이너 변경 및 재결합) 해야 하는데,
CMAF 은 브라우저에서 자체적으로 지원하여 (MSE 에서 지원) HLS 대비 성능 향상에 대한 장점을 가짐
일반적인 컨텐츠에서는 큰 차이를 느낄 수 없을 수 있으나, 4K 와 같은 UHD 컨텐츠를 재생할 경우에는 리소스 사용의
차이를 가져 올 수 있음
• Chunked Transfer Encoding 을 통해 Low Latency Live 서비스 가능
14. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
No! CTE!
15. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Packaging, Segment, Duration
001.ts
m3u8 002.ts 003.ts
Stream
RTMP Live Stream
HLS Live Stream
하나의 Session 에서 Data 전송
Duration
Segment (TS Container)
Manifest
Packaging
Keyframe
001.mp4
MPD 002.mp4 003.mp4
Low Latency Live
Manifest Segment (CMAF Container)
16. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Latency? From?
Packager
Encoder Player
Packaging
Latency
Buffer
• HLS Live 서비스에서 가장 많은 Latency 가 소요되는 구간은 Packaging 과 Player Buffer
• Apple 의 Spec 인 TS 10초 Duration 에 Playlist 3개인 경우,
• Packager 의 경우는 10초 TS 파일이 완성되어야 Response 가능
• Encoder 로부터 Input 후 아무리 빨라야 10초 후 Output
• Player 의 경우 m3u8 의 TS 파일 리스트를 순차적으로 재생
• Playlist 가 3개인 경우, 결국 10sec X 3 = 30sec 의 Latency 가 발생
RTMP HTTP
Buffer
Latency
17. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Latency? From?
Packager
Encoder Player
Packaging Buffer
01.ts
02.ts
03.ts
m3u8
①
③
②
⑥
⑤
④
Buffer
RTMP HTTP
18. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
d c b
01.ts
Chunked?
a
Segment
Segment
?
Chunk
19. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Chunked Encoding
• Chunk 는 moof 및 mdat 를 포함하는 참조 가능한 최소 미디어 단위. Chunk 가 결합되어 하나의 Segment 를 형성
• Segment 를 Chunk 로 다시 짧게 분할하는 장점은 Packaging 직 후, 각 Chunk 를 즉시 전송할 수 있다는 점
• Chunk 로 인한 이러한 빠른 송출 및 전송이 전체 Latency 를 감소시킴
001.mp4
MPD 002.mp4 003.mp4
Low Latency Live
Segment
Manifest
Chunk
Chunked Encoding d c b a
Fast Start
20. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Chunked Encoding
Low Latency
Common Latency
21. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Chunked Transfer
• Chunked Encoding 을 활용하여 Latency 를 줄이기 위해서는 HTTP 의 Chunked 전송과 결합 필요
• Packager 는 Segment 가 완전히 다 만들어지기 전에 전송을 시작하기 때문에 Segment 의 최종 크기를 알지 못함
• Chunked Transfer 는 전송하는 Object 의 최종 크기를 모를 경우 HTTP 1.1 에서 사용할 수 있는 데이터 전송 방법
• CDN 은 이러한 동작을 지원해야 하며, 동일한 방법으로 Chunk 를 Player 에 표현하여 인지시켜야 함
001.mp4
MPD 002.mp4 003.mp4
Low Latency Live
Chunk
Chunked Encoding
Chunked Transfer
d c b a
Segment
Manifest
Fast Stream
22. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Chunked Play
• Chunk 는 주소 지정이 가능한 독립된 단위가 아니기 때문에, Player 는 Chunk 가 아닌 Segment 를 요청
• 각 개별 Chunk 에 대해 HTTP 로 직접 Request 를 하지 않음
• Player 는 전송된 Chunk 를 식별할 수 있어야 하며, Chunk 를 디코딩하고 재생할 수 있어야 함
Packager Player
Packaging Buffer
01.ts
02.ts
03.ts
m3u8
a
Packager Player
Packaging
MPD
Buffer
500ms Chunk
Segment Duration x 3
Common Latency Low Latency
Fast Play
23. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Chunked Transfer Encoding
• CMAF? No! CTE!
• CMAF 자체로 Latency 를 줄이는 것은 아님
• CMAF 은 효율적인 컨테이너일 뿐 핵심은 Chunked Transfer Encoding
• Chunked Encoding 해서 Chunked Transfer 하고 Chunked Play 해야 함
Fast Start + Fast Stream + Fast Play
24. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS 기반 Low Latency
Workflow
25. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• AWS Elemental Live
• AWS Elemental Live 의 version 2.19.0 부터 AWS Elemental MediaStore 로의 Chunk 전송을 지원
• AWS Elemental Live 는 Low Latency Live 를 위해 CMAF 컨테이너와 Chunk 전송을 활용
• HEVC 와 H264 코덱을 사용할 수 있으며, 두 코덱의 Latency 는 동일
• 사실 Latency 는 코덱과는 관련성이 없음. Encoder 와 재생 Device 의 지원 여부가 중요
• AWS Elemental MediaStore
• 2019년 4월에 AWS Elemental MediaStore 는 Chunked Object Transfer 을 사용하여 Object 를 전송하는
Workflow 에 대한 지원을 발표
• 이 지원을 통해 DASH 또는 HLS 배포용으로 인코딩 된 CMAF Chunked Transfer Stream 을 사용하여,
Amazon CloudFront CDN 을 통해 Low Latency Live 에 대한 End-to-End Workflow 가능
AWS 기반 Low Latency Workflow
26. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Elemental
MediaStore
AWS Elemental Live Amazon CloudFront
Media Source Player
Low Latency Live Workflow on AWS
AWS Cloud Applications
On-Premises
27. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• AWS 기반 Low Latency Live 구성
https://aws.amazon.com/ko/blogs/media/part-2-getting-started-with-ultra-low-latency-using-aws-elemental-
live/
1. Elemental Live 버전 2.19.0 이상을 실행하고 있는지 확인
2. MediaStore 서비스 구성 (Container 생성)
3. AWS 콘솔에서 MediaStore 에 대한 쓰기 액세스 권한을 부여하는 IAM User 생성
4. IAM User 의 Access Key ID 와 Secret Access Key 보관
5. Elemental Live Encoder 설정 (Access Key ID 와 Secret Access Key 입력)
6. CloudFront 설정 (Origin 은 MediaStore)
7. Player 선택 (DASH.js , ExoPlayer 등)
8. Low Latency Live 재생 확인
AWS 기반 Low Latency Workflow
28. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Chunked Encoding 은
Encoding 단계에서 할 수도 있고
CDN 단계에서도 할 수 있다
29. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Low Latency Live Workflow with GS네오텍
HTTP
RTMP HTTP
GS네오텍
Packager
Encoder Amazon CloudFront Player
Packaging
Buffer Cache Buffer
GS네오텍에서 Low Latency Live 를 위한
CMAF 기반의 Chunked 를 지원하는 Packaging 서비스 제공
30. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Low Latency Live Workflow with GS네오텍
Amazon CloudFront Player
HTTP
Cache Buffer
Encoder
Buffer
RTMP HTTP
CMAF based Chunked Transfer Encoding
HTTP
RTMP
Port
1935
Port
80
Packaging
RTMP
Live Stream
Low Latency
Chunked
GS네오텍 Packaging Server
GS네오텍 Packager for Low Latency Live
31. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Trade-off
32. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Low Latency Live 에서 각 구간 별 Latency
Player
50%
Last Mile
5%
Delivery
3%
Ingest
5%
Encoding
29%
Capture
8%
From AWS
33. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Trade-off
• Player 는 안정적 재생을 위해 적정한 수준의 버퍼를 유지하는 것을 권장
• Player 버퍼 사이즈를 늘리는 것은 Latency 를 높게 함
• Latency 와 안정성에서 적정한 Trade-off 가 필요 (낮은 지연 vs 재생 안정성)
• Player 버퍼를 Client 설정으로 유도 (End-User 가 수정 가능하게 Player 메뉴 구성)
• Latency 가 가장 중요하다면, Player 버퍼의 최소화 선택
34. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GS네오텍에서 제공하는
프리미엄 라이브 솔루션
35. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GS네오텍 프리미엄 라이브 솔루션
• Live Encoder 송출 지원
• Live 중간 광고
• Live 대체 프로그램 편성 연동
• HLS ID3 TAG 데이터 변환
• 광고 부가 정보 삽입
• 개인화 광고 (SMR 및 Google DAI 광고 연동)
• File to Live (VOD to Live)
• Live 프리미엄 모니터링
• Live Transcoding
• Packaging (HLS, DASH)
• DVR (Time Shift, Sliding Window)
• Live to VOD (Live Recording)
• Thumbnail Image from Live Stream
• Delay Live (라이브 지연 방송)
• Multi-DRM (Widevine, FairPlay, PlayReady)
• 외부 플랫폼 재전송 (YouTube, Facebook 등)
Features for Live Premium Solution
36. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Live 중간 광고 및 대체 방송 편성
GS네오텍 프리미엄 라이브 솔루션
• 광고 연동
• Live 서비스 광고 삽입 지원
• Live Stream 에 광고 메타 데이터 (부가 정보) 삽입 지원
• HLS ID3 Tag 데이터 변환 지원 (End-User 재생 시점 부가 광고 정보 연동)
• 개인화 광고를 위한 VAST 규격 지원
• Live 중간 광고 운영 지원 (대체 광고)
• 대체 프로그램 편성 연동
• 저작권 등의 이슈로 본 방송의 Stream 이 아닌 대체 방송으로 송출이 필요할 경우
• GS네오텍 솔루션과 API 로 연동하여 자동으로 대체 방송으로 Live Stream 전환
37. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Live 중간 광고 Case Study
GS네오텍 프리미엄 라이브 솔루션
• Case Study ‘TVING’
• GS네오텍 솔루션과 CJ ENM 광고 시스템이 API 로 연동되어 편성표에 맞춰 자동으로 TVING 자체 광고 삽입
• GS네오텍에서 Live Stream 에 광고 메타 데이터를 삽입하고, End-User 에서 광고 재생 시점에 메타 정보가
활용 될 수 있게 HLS ID3 Tag 로 변환
• CJ ENM 광고 시스템은 불특정 광고가 아닌 개인화 광고를 위해, HLS ID3 Tag 및 VAST (XML Format) 규격
연동을 통해 특정화 된 타겟 대상 조건이 일치하면 개인 광고 송출
• Case Study ‘NAVER’
• NAVER 스포츠 중계 라이브에 NAVER 자체 광고 삽입
• 프로야구 스포츠 중계와 같이 광고 삽입에 자동화 된 스케줄 연동이 불가능한 경우 운영자가 직접 스포츠
경기를 보면서 수동으로 광고를 삽입
38. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Google DAI 광고 연동 (개인화 광고)
GS네오텍 프리미엄 라이브 솔루션
• Google DAI (Dynamic Ad Insertion) 개인화 광고 연동
• Live Stream 에 메타 데이터를 추가하여 Google DAI 광고 연동
• GS네오텍 광고 플랫폼에서 Live Stream 의 메타 데이터 참조하여 Google DAI 와 연동
• 고객이 직접 Live Stream 에 메타 데이터 삽입이 어려운 경우 메타 데이터 삽입 지원
AD
Google AD Stream
Video Stream
39. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
File to Live (VOD to Live)
GS네오텍 프리미엄 라이브 솔루션
• File to Live
• VOD 파일을 Scheduling 하여 Live Stream 으로 송출
• 리얼 라이브의 Risk 부담을 줄이기위한 솔루션
• WEB UI 를 통한 Easy Configuration 지원
• Preview 를 통한 현재 송출 영상 확인
• Case Study ‘이투스’
• 코로나19 의 영향으로 오프라인 학원 수업을 온라인으로 편성
• 리얼 라이브의 부담을 줄이고자, 전날 컨텐츠 촬영 및 편집
• 편집 완료 된 Master 파일을 이용하여 온라인 라이브 수업 진행
• 수업 시간 변경 시, 휴식 시간 안내 및 타 강좌 안내 영상 송출
40. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
프리미엄 모니터링 (Gold Eyes)
GS네오텍 프리미엄 라이브 솔루션
Stream State Dashboard 감지 상세 사항
실제 영상 재생 확인 및 시스템을 통한 모니터링 (육안 관제 + 시스템 관제)
Agent 를 통한 송출 끊김, 정지 화면, 블랙 화면, 무음 등을 빠르게 감지
41. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
여러분의 소중한 피드백을 기다립니다.
강연 종료 후, 강연 평가에 참여해 주세요!
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
42. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
감사합니다
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.