MBRLinear is a multi-bitrate algorithm by implementing MBRLinear that switches between tracks quality depending on the network's congestion which is evaluated using the gradiant from the number of lost packets and the number of NACK received.

In addition before to evaluate the network quality as good it waits to get a full GOP size of frames for video.

Hierarchy

Constructors

Properties

_keyFramesDecoded: number
_lost: number
_nackCount: number
log: ILog

Start a log

Param

Returns

a Log object with the levels of log to call

Accessors

  • get learningUpStep(): number
  • delay added on every congestion to report next bitrate increasing

    Returns number

  • get maximumUpDelay(): number
  • maximum delay before to increase bitrate when network quality is good

    Returns number

  • get upDelay(): number
  • delay before to increase bitrate when network quality is good

    Returns number

Methods

  • Check if we are congested and need to reduce the bitrate now Implement this method to define your own congestion algorithm

    Parameters

    • elapsed: number

      Time since beginning of congestion, on a new state 'elapsed' is equals to 0 on first call

    • trackRef: MTrack

      Track used as reference for statistics, is always the video track playing excepting if the stream is a pure audio stream

    • stats: RTCInboundRtpStreamStats

      Statistics to use to determine if we have to decrease bitrate now

    Returns boolean

    true if we can decrease bitrate quality now

  • Check if we are congested and need to reduce the bitrate now Implement this method to define your own congestion algorithm

    Parameters

    • elapsed: number

      Time since beginning of congestion, on a new state 'elapsed' is equals to 0 on first call

    • trackRef: MTrack

      Track used as reference for statistics, is always the video track playing excepting if the stream is a pure audio stream

    • stats: RTCInboundRtpStreamStats

      Statistics to use to determine if we have to decrease bitrate now

    Returns boolean

    true if we can decrease bitrate quality now

  • Call this method regularly to control if we have to change track, it will update the tracks if needed and return true if a track has changed.

    Parameters

    • metadata: Metadata

      Metadata of the stream

    • tracks: {
          audio?: number;
          video?: number;
      }

      the audio and video track number, this object can be updated with the new track numbers

      • Optional audio?: number
      • Optional video?: number
    • stats: {
          audio?: RTCInboundRtpStreamStats;
          video?: RTCInboundRtpStreamStats;
      }

      Statistics to use to determine if we have to decrease bitrate now

      • Optional audio?: RTCInboundRtpStreamStats
      • Optional video?: RTCInboundRtpStreamStats

    Returns boolean

    true if a track has changed, false otherwise

Generated using TypeDoc