2

My architecture is [arch0.dot]:

circo

One laptop is [broadcast] streaming two video and two audio streams to all the [JavaScript] clients. Additionally I have a WebSockets connection for chat.

Server [written in Node.JS] must:

  • Record chats (currently does this through an append only file)
  • Record video and audio streams (client currently does this through MediaRecorder; but want to move to server)

Related: WebRTC vs Websockets: If WebRTC can do Video, Audio, and Data, why do I need Websockets?

Which technology makes the most sense for this common architecture, in late 2017?

Samuel Marks
  • 1,611
  • 1
  • 20
  • 25

2 Answers2

3

Both WebRTC and WebSockets is a good technical choice. When you're building a WebRTC service there's two different parts; a peer connection and a signaling server. The signaling server handles all the metadata transfers between the peers (so they can communicate before the peer connection is ongoing). Typically you'll have a WebSocket connection for receiving events and a REST API for sending events.

It sounds that what you're asking for is a media server. A media server makes the WebRTC connection to a peer-to-media-server-to-peer connection, instead of a peer-to-peer connection. Because all the media goes through the media server, you can record all the traffic (audio/video/data), and there's no need to use MediaRecorder at the client side.

You wont need any special support at the server side for the one way communication of audio/video streams, that can be done client side with WebRTC.

Regarding media server I've been looking at https://github.com/versatica/mediasoup/ since they seem to be used a lot and maintained for a pretty long time.

kontrollanten
  • 2,649
  • 19
  • 32
  • 1
    You mentioned recording and then recommended mediasoup. AFAIK, Mediasoup does not support recording. Janus is the most suitable IMHO followed by kurento and jitsi if recording is a concern – bugwheels94 May 03 '18 at 15:36
-4

Websockets is a 10yr old concept, WebRTC is fairly new (few years) but available in all modern browsers: Chrome, Firefox, Edge. Overall I would say WebRTC is intended as a replacement for Websockets. Now that it's been in browsers a year or more, it's a fairly mature and stable solution.

TravisO
  • 9,406
  • 4
  • 36
  • 44
  • 5
    So what is your definitive answer? Your answer is not really clear or are you trying to be clever with your answer and not give a definitive answer? – user2056633 Oct 04 '17 at 16:32