How to record a relayed stream on server using TUR

2020-07-09 07:17发布

So here's the story, I'm building a WebRTC app and I have to record the stream on server.

"WebRTC is p2p dude, choose a media server"

Yes, I know, please avoid this comment ;)

But then I tought about one thing, what if I force all the stream to use the TURN server. The packets are going through the server, so I guess I can take them and save it

The question is how to do this.

Any suggestions?

标签: webrtc turn
2条回答
聊天终结者
2楼-- · 2020-07-09 07:39

TURN servers are intended to be relayed media, which means that media streams are not decrypted, mux'ed, processed, or recorded. I get that you're asking to avoid the "choose a media server" comment, but that's like saying "I need put in this screw; which hammer should I use? Please don't tell me to get a screwdriver." - The hammer isn't the right tool.

You can still use WebRTC and p2p, but the media server (like Jitsi, for example) acts as a peer in a star topology, where all streams are sent to the media server, and can be recorded, relayed, bundled, etc.

查看更多
干净又极端
3楼-- · 2020-07-09 07:46

You can use a WebRTC gateway like Janus or Kurento (I assume you have figured it out by now :) )

查看更多
登录 后发表回答