Class EncodingParameters


  • public class EncodingParameters
    extends java.lang.Object
    Defines audio and video encoding parameters. Maximum bitrate is specified as Transport Independent Application Specific Maximum (TIAS) bitrate RFC3890 in kilobits per second (kbps) excluding IP/UDP/TCP headers. **Note:** These encoding parameters are applied for each peer connection, each track and each simulcast layer.

    - For group Rooms, there is a single peer connection to Twilio Media Server, but for peer-to-peer Rooms, there is a separate peer connection for each participant. I.e., if you set maximum video bitrate to 1 Mbps and you have two RemoteParticipant`s in the Room, the effective video send bitrate may be up to 2 Mbps.

    - If you are publishing multiple video tracks (e.g. camera and screen share), each track receives the maximum bitrate specified. I.e. if you set maximum video bitrate to 1 Mbps and you publish both a camera and a screen share track, the effective video send bitrate may be up to 2 Mbps.

    - If simulcast is used for video tracks, each simulcast layer receives the maximum bitrate specified. I.e. if your set the maximum bitrate to 1 Mbps and you publish a simulcast video track, the effective video send bitrate may be up to 3 Mbps if there are three simulcast layers.

    Encoding parameters can be updated any time, using LocalParticipant.setEncodingParameters(EncodingParameters).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      int maxAudioBitrate
      Maximum audio send bitrate in kilobits per second (kbps).
      int maxVideoBitrate
      Maximum video send bitrate in kilobits per second (kbps).
    • Constructor Summary

      Constructors 
      Constructor Description
      EncodingParameters​(int maxAudioBitrate, int maxVideoBitrate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • maxAudioBitrate

        public final int maxAudioBitrate
        Maximum audio send bitrate in kilobits per second (kbps). Zero indicates the WebRTC default value, which is codec dependent. The maximum bitrate for Opus is 510 Kbps.
      • maxVideoBitrate

        public final int maxVideoBitrate
        Maximum video send bitrate in kilobits per second (kbps). Zero indicates the WebRTC default value, which is 2,000 Kbps.
    • Constructor Detail

      • EncodingParameters

        public EncodingParameters​(int maxAudioBitrate,
                                  int maxVideoBitrate)
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        @NonNull
        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object