Use Janus server as WebRTC peer for recording

1,238 views
Skip to first unread message

Steven McArdle

unread,
Aug 13, 2015, 4:17:51 PM8/13/15
to meetecho-janus
Hi People.

This is my first time posting to this group so be gentle :)

I have a use case with my current WebRTC comms platform I would like to resolve and I am hoping that Janus will provide me that solution.

I already have multi-party peer-to-peer where up to X number of participants are already participating in a session so gUM permissions have already been granted and each participant already has their local media stream displayed etc.
During this session the organiser should be able to start and stop recording all the streams as they please.
The organiser can then later download each individual recorded stream, as well as an ffmpeg "composed" mosaic of all of the streams for each recording period.

I have tried various client side solutions such as MultiStreamRecord etc and none of them are suitable due to many reasons and the only real solution is to record the raw streams on a server and encode/re-encode there.

My ideal solution would be to find a nodejs WebRTC endpoint that each participant could establish a peer connection with and have the node server directly record this raw stream for later processing, however, there are no nodejs WebRTC endpoints that I am aware of or at least haven't managed to find any.

So, the way I would like to address this is with Janus as follows.

1. When the organiser selects to record a message is sent to each participant over the data channels to instruct them to create a new one-way peer to Janus attaching their current (already retrieved) local video stream to the offer
2. Once the one-way peer connection is established, with the Janus record plugin, start recording their stream
3. They each provide a unique path for their own recording based on the meeting/session name, current time and unique user id's
3. When the organiser selects to stop the recording a message is sent to each participant over the data channels to drop the peer connection to Janus and Janus stops recording
4. As each participant drops their connection they send a message over a websocket to our node.js signalling server that starts an ffmpeg process to re-encode the Janus recording to individual webm, ogg and MPEG4 versions
5. ffmpeg is then instructed to compose a separate mosaic of each format, these can then be uploaded by the organiser to their local machine and/or archived in a CMS

So my question is this, does the Janus Javascript API allow me to create a one way session (audio and video) and connect to the Janus gateway record plugin without requesting gUM again for each user? 
Basically can I avoid the gUM stage in the Janus API and go directly to creating an offer and attaching the existing local stream to it ?


I hope this is clear and any pointers anybody would like to add would be very appreciated.

Steve

Lorenzo Miniero

unread,
Aug 15, 2015, 6:14:25 AM8/15/15
to meetecho-janus
You can use the Record&Play plugin for the purpose.

L.
Reply all
Reply to author
Forward
0 new messages