Is it possible to save a video stream between two peers in webrtc in the server, realtime?
Asked Answered
I

3

6

Suppose I have 2 peers exchanging video with webRTC. Now I need both of the streams to be saved as video files in the central server. Is is possible to do it realtime? (Storing/Uploading the video from peers is not an option).

I thought of making a 3 node webRTC connection, with the 3rd node being the server. This way, I can screen record the 3rd node's stream or save it using some other way. But I am not sure about the reliability/feasibility of the implementation.

This is for a mobile application, and I would avoid any method that involves uploading/saving.

PS: I'm using Agora.io for the purpose of video-conference.

Interdepartmental answered 21/5, 2019 at 15:8 Comment(1)
Is it possible with webRTC?Hamadryad
O
3

in my opinion you can do it like the record demo:https://webrtc.github.io/samples/src/content/getusermedia/record/.

record each stream to blobs and push them to your server with websocket.

then convert the blobs to a webm file or just add in a video

Overshoe answered 24/5, 2019 at 11:42 Comment(2)
How can I add in a video?Meathead
use ffmpeg is the best choice. docs here:ffmpeg.org/ffmpeg.htmlOvershoe
C
1

Agora doesn't offer on-premise recording out of the box but they do provide thee code for you to be able to launch your own on-premise recording using your own server. Agora has the code and instructions to deploy on GitHub: https://github.com/AgoraIO/Basic-Recording

The way it works, once you have set up the Agora Recording SDK, the client would trigger the recording to start, via user interaction (button tap) or some other event (i.e. peer-joined or stream-subscribed) this will trigger the recording service to join the channel and record the streams. _The service outputs the video file once recording has stopped.

Chaise answered 22/5, 2019 at 13:7 Comment(1)
what about recording session in reactjsQuicksilver
W
0

you need a WebRTC media server.

WebRTC media servers makes it possible to support more complex scenarios WebRTC media servers are servers that act as WebRTC clients but run on the server side. They are termination points for the media where we’d like to take action. Popular tasks done on WebRTC media servers include:

Group calling Recording Broadcast and live streaming Gateway to other networks/protocols Server-side machine learning Cloud rendering (gaming or 3D) The adventurous and strong hearted will go and develop their own WebRTC media server. Most would pick a commercial service or an open source one. For the latter, check out these tips for choosing WebRTC open source media server framework.

In many cases, the thing developers are looking for is support for group calling, something that almost always requires a media server. In that case, you need to decide if you’d go with the classing (and now somewhat old) MCU mixing model or with the more accepted and modern SFU routing model. You will also need to think a lot about the sizing of your WebRTC media server.

For recording WebRTC sessions, you can either do that on the client side or the server side. In both cases you’ll be needing a server, but what that server is and how it works will be very different in each case.

If it is broadcasting you’re after, then you need to think about the broadcast size of your WebRTC session.

link:https://bloggeek.me/webrtc-server/

Wayworn answered 4/5, 2021 at 5:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.