본문 바로가기
CS/Computer

Video call (feat.WebRTC)

by JiGyeong 2021. 2. 8.

webrtc

미디어 서버 종류

출처 : antmedia.io/5-reasons-to-prefer-ant-media-server-over-sfu/

 

5 Reasons to Prefer Ant Media Server over SFU - Ant Media

5 Reasons to Prefer Ant Media Server over SFU, we will tell the advantages of Ant Media Server over an SFU. Read More about Ant Media Server

antmedia.io

 

개발 1단계 :

시그널 서버 (socket)

클라이언트간의 정보 교환을 위한 프로세스

- 통신을 열고 닫는데 사용되는 세션 컨트롤 메세지

- 에러 메세지

- 코덱 설정, 대역폭, 미디어 타입 등의 메타데이터

- 보안 연결을 위한 키 데이터

- 호스트의 IP Port와 같은 네트워크 데이터

 

시그널링 프로세스는 WebRTC API에 의해 구현되지 않아 직접 구축 필요

 

 

설명 잘 해놓은 사이트

www.html5rocks.com/ko/tutorials/webrtc/infrastructure/

 

Build the backend services needed for a WebRTC app: STUN, TURN, and signaling - HTML5 Rocks

Build the back-end services you need to run a WebRTC application: STUN, TURN, and signaling.

www.html5rocks.com

개발 2단계 :

[Relay Server]

STUN : 공용 주소 없이 WebRTC 피어간 통신이 가능하도록 사용. NAT 뒤에서 동작한 어플리케이션으로부터 전달된 IP:Port를 확인하고 그 주소를 응답으로 되돌려 보냄.

TURN : 시그널링 데이터가 아닌 Peer 간의 오디오/비디오/데이터 스트리밍 릴레이를 위해 사용

 

[Media Server]

WebRTC

 

개발 3단계 :

-> (발신) invite

<- (수신) accept

-> camera 정보

 

-> SDP Request 

<- SDP Response

-> Candidate (Local Address(IP:Port), Public Address, Turn Server Address)

video정보를 각각 담에 보냄

<- Candidate (Local Address(IP:Port), Public Address, Turn Server Address)

video, data 정보가 각각 담겨옴

 

내가 구현한 방식 SFU에서는

위 메시지가 

[ 미디어서버 - 나 ] 연결된 정보 한벌

[ Another peer - 미디어서버 ] 간 연결된 정보 한벌

+ 추가된 사람수만큼

 

더 넘어온다

 

Upload는 한 피어에 Audio/Video 모두 올림

Download는 Audio는 겹쳐서 /  Video는 따로 옴

 

'CS > Computer' 카테고리의 다른 글

Operating System  (0) 2019.06.07
Data In Digital  (0) 2019.05.17
프로그램에 관하여  (0) 2019.05.14
DLL (Dynamic Link Library)  (0) 2019.05.07
RPA (Robotic Process Automation)  (0) 2019.04.24