webrtc服务器janus的一点看法

接触webrtc也有一年多时间了,刚开始由于对webrtc也不熟悉,为了快速开发以及出产品,最终选择了开源webrtc服务器janus,然后做了一些自己的定制开发,下面先对janus做一个简单的介绍。
1、janus的整体架构图如下:
在这里插入图片描述
2、janus的p2p穿网ICE策略是基于libnice这个开源库做的;srtp加解密是基于思科开源的libsrtp做的;标准sip协议栈是基于NOKIA开源的sofia sip开源协议栈开发的;http模块是基于libmicrohttpd开发;websocket是基于libwebsockets开发的;DTLS,UDP版的TLS,就是加密的UDP,WebRTC用来传递SRTP的密钥,使用了OpenSSL/BoringSSL;janus目前支持的音频编解码格式有PCMU、PCMA、G722、ISAC_32K及ISAC_16K,视频编解码格式有VP8、VP9及H264。
3、janus做为一个SFU服务器还是非常适合的,如果你想通过SIP等接入,janus也是非常适合的,当然你也可以通过开发插件接入各种私有协议的设备。以前视频预览,好多厂家都是通过嵌入VLC或者其他插件来实现,那么无插件预览,我们可以在janus上开发一个插件,做一些特殊的处理,就可以实现无插件视频预览的功能。
4、janus的音视频弱网层面相比其他服务器不是特别完善,因为它没有实现FEC、rtx等,仅实现了FIR、PLI、NACK、remb带宽估计,这是不够的,在弱网视频丢包的情况下,需要实现webrtc端到端的qos全家桶。
5、在部署时,要根据实际情况,比如:单台服务器的性能(CPU核心数等),来决定是否开启默认配置文件中general中的event_loops,默认配置是不开启每个处理开一个线程来处理相关媒体,这样在并发量高的情况下,可能就会出现问题,下面把该配置对应的英文注释贴在下面:
By default, Janus handles each have their own event loop and related thread for all the media routing and management. If for some reason you’d rather limit the number of loop/threads, and you want handles to share those, you can do that configuring the event_loops property: this will spawn the specified amount of threads at startup, run a separate event loop on each of them, and add new handles to one of them when attaching. Notice that, while cutting the number of threads and possibly reducing context switching, this might have an impact on the media delivery, especially if the available loops can’t take care of all the handles and their media in time. As such, if you want to use this you should provision the correct value according to the available resources (e.g., CPUs available).

  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值