5

I am researching about WebRTC and I opened thousands of tabs about it. but still I exactly don't know what code I should write at where !!!

I am going to have a website using asp.net 4.5 and IIS 8 (if needed). It should have a vidoe conference. but for security resons, I need to record videos from both sides in the server. So I think I can't use p2p. please help me by providing some step-by-step tutorial, and please do not give me any more links!!! (I have no more room to open a new tab :D)

TYeeTY
  • 577
  • 8
  • 16

3 Answers3

1

You can do what you're trying to do with WebRTC - but you want to enforce a relay, so the data flows through the server and you can write the frames to disk. What that'll do is essentially eliminate the P2P part, but still make all the data flow over UDP rather than TCP, keeping performance high and bandwidth low. It's about the best you can hope for without going with something like flash media server.

For support in IE, you'll need a plugin of some sort - it doesn't support native WebRTC, and there's no support for native UDP connections in Flash either, so it's either Java applets or custom plugins.

We've done the heavy lifting for basically what you're trying to do with IceLink (I work @ Frozen Mountain). Oh, and to enforce the relay, you have to suppress any peer-candidate pairs that don't come through the relay (since WebRTC can have multiple candidates from multiple sources, just suppressing the options you don't want will ensure that the relay is the only option left).

Hope that helps!

Jerod Venema
  • 44,124
  • 5
  • 66
  • 109
  • There doesn't seem to be any easy way to record, though. It seems that IceLink is just functioning as a TURN server, but there's no documentation on really doing anything on the IceLink server (and no apparent built-in recording functionality). – Kat May 07 '15 at 21:01
  • Hey Mike! You just need to create a "Conference" object on the server (Java or .NET) and join it as a regular peer. Then you use the IvfVideoRecordingProvider as your "render" provider to render to disk instead of to the screen. (Yeah, we need to update the docs - working on that :-D). – Jerod Venema May 08 '15 at 02:03
  • I see, so it's treating the server as a client in a star topology, then. Thanks. – Kat May 08 '15 at 15:49
  • To expand on this now that I have more experience, an approach I found successful was to have an incoming and outgoing conference on the server. The former receives conferences (and does nothing with them) and has audio/video render providers that write to audio/video files (which we later merge into a single video file). The incoming conference then sends every frame to the outgoing conference, for which every connected peer has a single outgoing conference (which is used to send *their* video from the incoming conference to all other peers). It takes a bit of work to set this up. – Kat Jul 31 '15 at 21:54
  • I found that the recording render providers that IceLink provided to be buggy, so didn't use them. Had to roll our own recorders. You also have to keep track of when you receive frames so that you can keep the audio and video in sync. FFMPEG provides an easy way to merge the separate audio and video. – Kat Jul 31 '15 at 21:56
  • With that said, the documentation on IceLink's site is really weak. You'll have to do some guesswork. I recommend downloading the examples and mostly working on them. The portion of the documentation related to setting up the video conference is far too lacking to be of real use and is missing critical platform specific information. – Kat Jul 31 '15 at 21:58
  • @Mike - if there are particular bugs you hit w/ the recording, I'd love to know about it so we can address them, as well as any particular stuff you thing we can improve in the docs - anything we can do to make it easier on devs we'll definitely do! – Jerod Venema Aug 01 '15 at 18:56
0

You definitely need a custom solution for this. There is nothing in webrtc that will allow this by default - like you said, webrtc is p2p by default without any server that the streaming traffic goes through.

So you need to create a server side application that is going to act as a webrtc client. It needs to be able to establish a complete webrtc connection(SDP exchange, ICE...); and then the browser will start sending you audio and video packets which you can then record.

If you want to send the same audio/video packets to another browser(webrtc client) for a full audio-video conference, then you will have to allow the other webrtc clients to connect to the same server. Essentially your server would be a audio/video webrtc bridge with recording capabilities.

There is an open source audio/video webrtc bridge that you could check out for ideas - licode But obviously you will have to modify their code for your purpose. Good luck. FYI their server runs on linux and MacOSX.

Aki
  • 3,709
  • 2
  • 29
  • 37
0

In the past we've used TokBox's platform for WebRTC video conferencing + recording. The secret is to force route the video streams through the server so that they can be captured and stored on disk.

The nice thing about TokBox's implementation was that they joined the video streams together, in sync, in a single file, regardless of the number of participants. Thus we ended up with an easy to use/manage/distribute video recording.

This was 2 years ago. I believe the same is possible now with the self hosted Kurento media server and other platforms.

octavn
  • 3,154
  • 32
  • 49