spckce / SPChat

SPC Chat Project
3 stars 0 forks source link

스펙 명세 (Use Case) #2

Open spckce opened 6 years ago

pshsh88 commented 6 years ago

가장 기본으로 텍스트 기반 채팅은 되어야 할 듯

pshsh88 commented 6 years ago

보이스 챗

pshsh88 commented 6 years ago

(Optional) 화상 챗

pshsh88 commented 6 years ago

(Optional) 보드 공유 - like 캐치 마인드

jooojub commented 6 years ago

파일 공유 (전송)

pso1027 commented 6 years ago

화상통화시 네트워크 속도에 따른 해상도조절

oddheo commented 6 years ago

서버가있어야한다

WebRTC는 P2P 통신을 가능하게 합니다. 그러나... WebRTC는 여전히 다음과 같은 서버를 필요로 합니다. 시그널링(Signaling)이라 불리는, 클라이언트들의 통신을 조정하기 위한 메타데이터의 교환 서버 네트워크 주소 변환기(NAT) 및 방화벽 대응을 위한 서버 https://www.html5rocks.com/ko/tutorials/webrtc/infrastructure/

jooojub commented 6 years ago

내 서버 라파2라 이정도의 트래픽은 감당 안될텐데

pshsh88 commented 6 years ago

https://stackoverflow.com/questions/29032884/why-signaling-server-needed-for-webrtc 각 Peer 정보를 항상 알고 있으면 굳이 서버가 없어도 될 듯 하긴한데 그럼 너무 구리겠지?ㅋㅋ

pshsh88 commented 6 years ago

https://gist.github.com/yetithefoot/7592580 https://gist.github.com/sagivo/3a4b2f2c7ac6e1b5267c2f1f59ac6c6b

public stun, turn 서버들도 있나봄 이런거 이용해도 구현은 되겠는데, 대부분 외국서버라 성능이 안나오겠지? 참고바람.

pso1027 commented 6 years ago

웹기할때처럼 한달에 2천원인가 주고하는 서버 대여해도 되고 ㅋ

jooojub commented 6 years ago

앞으로도 비슷한 프로젝트 많이 할 수도 있으니 개인 서버 파는것도 괜찮을듯

oddheo commented 6 years ago

고려할것: STUN / TURN 서버 직접 구현할 것인가?

STUN server is used to get an external network address. TURN servers are used to relay traffic if direct (peer to peer) connection fails.

STUN: NAT 뒤에 있는 ip만 알아오는거라 구려도 됨 TURN: 실제 트래픽이 왔다갔다해야하므로 성능 중요 라지만 public 으로 있는게 얼마나 부족한가 혹은 정말 매번 이 경로를 타고 가는지는 확인필요

oddheo commented 6 years ago

고려할것: multipoint 다대다 통신을 어떻게 할 것인가?

Alternatively, a WebRTC app could choose one endpoint to distribute streams to all others, in a star configuration. It would also be possible to run a WebRTC endpoint on a server and construct your own redistribution mechanism

어느 한놈이 데이터를 받아다가 나머지에게 broadcast 하도록 구현한다. 클라이언트에서 이걸 쉽게 구현할 수 있도록 RTCPeerConnection 에서 뭔가 지원해주는듯함.

A better option for a large number of endpoints is to use a Multipoint Control Unit (MCU). This is a server that works as a bridge to distribute media between a large numbers of participants.

MCU 라는 네트웍장비 (혹은 서버) 를 통해서 데이터를 받게한다. 찾아보니 MCU 는 주로 엄청 여러 사용자가 각자 다른 환경 (PC, 모바일 등) 에 붙어있을때 각자의 환경에 맞게 적절히 transcoding 해서 보내는 기능이 메인인것 같음. TURN 과는 좀 다른데 TURN 은 데이터를 까보지않고 relay 만 하는 목적임. 그리고 direct connection 이 안되는 상황에서만 쟤를 통해 전송하지 peer 로 udp connection 이 된다면 그냥 그렇게 보내버리면 될듯

oddheo commented 6 years ago

롤에서처럼 말하고 있을때만 activation 되게 할 수 있을지? https://en.wikipedia.org/wiki/Voice_activity_detection 당연히 이걸 알고리즘을 짜서 하는건 어렵겠지만 javascript 에서 갖다쓸 방법은 있는듯 https://www.npmjs.com/package/voice-activity-detection https://github.com/voixen/voixen-vad 여기 description 들 보면 이미 webrtc 에서 그런 기능을 지원해주는것처럼 써놨는데 막상 그걸 어떤 api 로 쓸수있는지는 검색해도 잘 안나오는 것 같음.

pso1027 commented 6 years ago

Onvoicestart 같은거로 디텍되면 Stream.getTracks[0].enabled = true/false 줘서 pause/start 할수있는듯