美文网首页
Licode Simulcast

Licode Simulcast

作者: lidedongsn | 来源:发表于2018-09-10 18:22 被阅读73次

Licode Simulcast

licode enable simlcast

Publisher端创建stream的时候config参数添加simulcast

room.publish(localStream, {simulcast: {numSpatialLayers: 2}});

numSpatialLayers 是Publisher发送的spatial layers的最大数

目前web端的话只能是遵循原生webrtc的设定

struct SimulcastFormat {
  int width;
  int height;
  // The maximum number of simulcast layers can be used for
  // resolutions at |widthxheigh|.
  size_t max_layers;
  // The maximum bitrate for encoding stream at |widthxheight|, when we are
  // not sending the next higher spatial stream.
  int max_bitrate_kbps;
  // The target bitrate for encoding stream at |widthxheight|, when this layer
  // is not the highest layer (i.e., when we are sending another higher spatial
  // stream).
  int target_bitrate_kbps;
  // The minimum bitrate needed for encoding stream at |widthxheight|.
  int min_bitrate_kbps;
};

// These tables describe from which resolution we can use how many
// simulcast layers at what bitrates (maximum, target, and minimum).
// Important!! Keep this table from high resolution to low resolution.
// clang-format off
const SimulcastFormat kSimulcastFormats[] = {
  {1920, 1080, 3, 5000, 4000, 800},
  {1280, 720, 3,  2500, 2500, 600},
  {960, 540, 3, 900, 900, 450},
  {640, 360, 2, 700, 500, 150},
  {480, 270, 2, 450, 350, 150},
  {320, 180, 1, 200, 150, 30},
  {0, 0, 1, 200, 150, 30}
};

Subscriber 订阅流的时候可以直接按照普通subscriber订阅的方式直接订阅,比较nice的一点是,可以指定订阅spatialLayertemporalLayer,其中spatiaLayer为resolutions,temporalLayer为FrameRate,一般temporalLayer有三个可供选择,比如:

Spatial Layer (0): 320 240
Spatial Layer (1): 640 480
Spatial Layer (2): 0 0
Spatial Layer (3): 0 0
Temporal Layer (0): 3
Temporal Layer (1): 11
Temporal Layer (2): 14
Temporal Layer (3): 0
Temporal Layer (4): 0

可以在room.on('stream-subscribed', function (streamEvent) 事件中设定

stream._setStaticQualityLayer(1, 2);

这样订阅的就是分辨率640 x 480帧率为14的流

相关文章

  • Licode Simulcast

    Licode Simulcast licode enable simlcast Publisher端创建strea...

  • licode-编译错误锦集

    licode官网[https://licode.readthedocs.io/en/master/from_sou...

  • WebRTC simulcast

    简介 Simulcast 可以翻译成联播,不是新闻联播,而是多个媒体流的传播,如图所示 注: SFU 即 Sele...

  • licode

    1.Licode模块 Erizo 基于webRTC针对视屏会议场景的一对多组件 Erizo API Erizo的N...

  • Simulcast ABR SVC

    1. Simulcast 客户端上传多分辨率,多码率,由SFU来决定数据类型下发。 2. ABR(Adaptive...

  • licode iOS

    从零开始接触音视频这一块的,自己默默摸索,即将大功告成,现在记录一下开发过程和遇到的坑 深刻理解,跑通Demo距离...

  • 如何搭建Janus WebRTC服务器

    webrtc服务器有很多,licode/janus/kurento/mediasoup/jitsi,之前搭建lic...

  • 用libnice库做tcp连接(voip应用)

    为什么 在开源licode中用到libnice作为udp建连和传输, 同webrtc通信, 而且网上有较多libn...

  • 基于WebRTC的MCU开源项目Licode的环境搭建

    基于WebRTC的MCU开源项目Licode的环境搭建由于项目需求,需要构建多人通讯,调研了多人通讯的三种常见结构...

  • licode系列(一)安装使用

    1,准备环境 操作系统ubuntu16.04 如果需要外网使用,最好准备一个域名和ssl证书,现在很多云服务申请域...

网友评论

      本文标题:Licode Simulcast

      本文链接:https://www.haomeiwen.com/subject/muqegftx.html