NodeJS的音频和视频会议 [英] Audio and video conference with NodeJS

查看:281
本文介绍了NodeJS的音频和视频会议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想构建一个Web应用程序,让两个对等体使用HTML5和没有插件的视频和音频流相互看到和听到(除了IE,我假装使用 getUserMediajs 使用闪回后退。)

I would like to build a web application that lets two peers see and hear each other using video and audio streaming with HTML5 and no plugins (except for IE, that I pretend to use getUserMediajs to use a flash fallback).

我还想传输使用NodeJS的数据,但我不知道从哪里开始。在一个例子中:

I also want to transmit that data using NodeJS but I have no idea where to start. In an example:

Peer A< ---> Node JS< ---> Peer B

Peer A <---> Node JS <---> Peer B

我对 Peer 2 Server 2 Peer 方法感兴趣,而不是 Peer 2 Peer 解决方案,如 PeerJS 因为:

I'm interested in this Peer 2 Server 2 Peer approach instead of a Peer 2 Peer solution like PeerJS because:

1)我认为所有浏览器都会更兼容。 如果这不完全正确,请告诉我

1) I think it will be more compatible will all browsers. If this is not entirely true, please let me know.

2)PeerJS(我对此并不感兴趣)在某些情况下依赖于黑魔法STUN-TURN-ICE信号。我读到某处只有70%的连接适合这种传输,我不能承受30%的损失。再次让我知道这是不是完全正确

2) PeerJS (which I'm not interested in) relies on black magic STUN-TURN-ICE signaling for some cases. I read somewhere that only the 70% of the connections are suitable for this kind of transmission, and I can not afford a loss of the 30%. Again let me know if this is no entirely true.

我已经玩过 socket.io 并了解getUserMedia()的概念以获取用户的网络摄像头,但不知道如何将其与socket.io链接并将其传输到其他客户端。

I have already played around with socket.io and know the concepts of getUserMedia() to get user's webcam, but don't know how to link that with socket.io and transmit that to the other client.

推荐答案


  1. 浏览器兼容性与添加服务器端组件无关。您可能是p2p或p2s2p,如果您发送的内容未被接收浏览器识别,则无法使用。

  1. The browser compatibility has nothing to do with adding a server side component. You could be p2p, or p2s2p, if what you send is not recognized by the receiving browser, it won't work.

ICE 必须对于webrtc,你不能没有,期间。默认情况下,您只能连接到同一网络中的计算机(候选主机)。如果您提供STUN服务器,您将能够将70%的案例连接在一起,更不用说在企业环境中。 http://webrtcstats.com/webrtc-revolution-in-progress/ 有一些供应商的最新统计数据。您可以看到,对于社交网站,截至2014年6月,92%的呼叫可以使用简单的STUN通过防火墙和NAT工作。剩下的被叫需要通过TURN服务器进行中继。你有很多免费的STUN服务器提供商,这是你应该使用的最低限度。

ICE is mandatory for webrtc, you can't do without, period. by default, you can only connect to computers in the same network (hosts candidates). If you provide a STUN server, you will be able to connect in 70% of the cases all together, much less in enterprise context. http://webrtcstats.com/webrtc-revolution-in-progress/ has the latest stats from some vendors. You can see that for social sites, as of june 2014, 92% of the calls can work through firewalls and NAT using simple STUN. The remaining of the called needed to be relayed through a TURN server. You have a lot of Free STUN server providers out there, this is the minimum you should use.

用于桌面IE和Safari的webRTC。

webRTC for Desktop IE and Safari.

虽然Flash回调很有意思(阅读,简单)但他们暂停了两个问题:

While flash callbacks are interesting (read, easy) they pause two problems:


  • 它们不会生成与对等连接或HTML5兼容的视频流。与对等连接不兼容,您无法发送图像或视频,只能在本地使用它。与HTML5不兼容意味着您无法在元素中使用生成的图像和视频,并且您无法以简单的方式将其呈现在Flash插件元素之外。在您指向的垫片的情况下,他们将每个单独的帧从Flash插件复制到HTML,并且他们在阅读中提到,这在计算上太广泛而不能用于现场视频。

  • flash使用不同的协议(RTMP,RTMFP,..)和webrtc中的编解码器,它们不能互相兼容。您需要单独维护或者使用复杂的双重用途基础设施来处理它。 OpenClove是一个提供这种双用途基础设施的供应商。例如。

另一种解决方案是在Desktop IE和Safari上安装webRTC插件(不闪存),它实现了纯粹的webRTC。在这种情况下,您可以直接与chrome,firefox,opera以及任何其他实现webRTC 1.0的浏览器进行互操作。

Another solution is to install on Desktop IE and Safari a webRTC plugin (not flash), which implements "pure" webRTC. In which case, you can directly interoperate with chrome, firefox, opera, and any other browser which implements natively webRTC 1.0

我们建议免费提供这样的插件(免费) )和所有(非特定供应商)此处

We propose such a plugin, for free (no cost) and for all (not vendor specific) here

这篇关于NodeJS的音频和视频会议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆