Anish Srinivasan
Anish Srinivasan

Reputation: 41

WebRTC - P2P - Server Side Video Recording

I’m planning to build a video conference app. (NodeJS + React Native)

Requirements

  1. One to One Video Conference ( 2 Speakers )
  2. Video / Audio Recording of both the participants.
  3. Store the recorded stream in an S3 bucket and watch the videos directly from it.
  4. Live Streaming (Future Goals, but not at the moment)

Strategies tried so far:

  1. Tried Twilio and Agora, but it wasn’t feasible due to pricing.
  2. Mediasoup (SFU - inspired from dogehouse) was another option, but it’s relatively new and the development time takes much longer.

So I have come to a conclusion to start with Peer to Peer using WebRTC with React Native and record videos on a virtual server by connecting as a ghost participant. ( 2 Speakers + 1 Ghost Participant)

Need some strategies to implement WebRTC recording at the server. (Recordings are a bit crucial, so I don’t want to depend on the client)

  1. Should I go with Puppeteer on server, join as ghost participant and record whenever a room is created, If yes - Is it possible to run multiple instances of puppeteer? Because at times, multiple room recordings might happen, so it needs to record concurrently. Need to confirm the scalability.

  2. Look into Kurento / Jitsi Any other options?

Great, if you could help me out! Cheers!!

Upvotes: 4

Views: 1538

Answers (3)

jch
jch

Reputation: 5651

The Galene SFU has native support for server-side recording (disclosure, I'm the main author). However, it is a fairly young project, which might be a problem for you.

Upvotes: 0

TopReseller
TopReseller

Reputation: 666

You can take a look at html5 videocall web application on GitHub for inspiration.

As it uses Wowza SE as relay for scaling and reliability, streams can be recorded server side with FFmpeg. FFmpeg can input one or multiple streams, mix/transcoded and output to a local or external destination. More advanced setups like PaidVideochat - Turnkey Videochat Site on WordPress support mixing multiple streams from conferencing/calls in same video file.

Using a relay streaming server is also great for scaling to multiple viewers.

Upvotes: 0

Hermes
Hermes

Reputation: 2898

As a developer evangelist for Agora, I want to say thanks for considering Agora. With regard to the pricing, while Agora offers a generous free-tier (10k min/ month) this is meant for development usage and once your project is deployed into production, costs will scale similar to hosting infrastructure (like AWS/GCP).

As with any project, to cover costs you will need to have some monetization strategy or have some free credits to grow the business. Similar to other platforms Agora has a start-ups program for qualified startups.

All that being said to answer your question about approach, I can tell you that the ghost client approach should work, Agora's cloud recording uses similar logic. With regard to scalability you could run multiple puppeteer instances.

Upvotes: 0

Related Questions