bitrate property Null safety

int? bitrate
@JsonKey(includeIfNull: false), read / write

Bitrate of the video (Kbps). Refer to the table below and set your bitrate. If you set a bitrate beyond the proper range, the SDK automatically adjusts it to a value within the range.

You can also choose from the following options:

  • BitRate.Standard: (Recommended) The standard bitrate mode. In this mode, the bitrates differ between the LiveBroadcasting and Communication profiles:
    • In the Communication profile, the video bitrate is the same as the base bitrate.
    • In the LiveBroadcasting profile, the video bitrate is twice the base bitrate.
  • BitRate.Compatible: The compatible bitrate mode. In this mode, the bitrate stays the same regardless of the profile. If you choose this mode for the Live Broadcast profile, the video frame rate may be lower than the set value.

Agora uses different video codecs for different profiles to optimize the user experience. For example, the Communication profile prioritizes the smoothness while the Live Broadcast profile prioritizes the video quality (a higher bitrate). Therefore, We recommend setting this parameter as 0.

Video Bitrate Table

ResolutionFrame Rate (fps)Base Bitrate (Kbps)Live Bitrate (Kbps)
160 * 1201565130
120 * 1201550100
320 * 18015140280
180 * 18015100200
240 * 18015120240
320 * 24015200400
240 * 24015140280
424 * 24015220440
640 * 36015400800
360 * 36015260520
640 * 360306001200
360 * 36030400800
480 * 36015320640
480 * 36030490980
640 * 480155001000
480 * 48015400800
640 * 480307501500
480 * 480306001200
848 * 480156101220
848 * 480309301860
640 * 48010400800
1280 * 7201511302260
1280 * 7203017103420
960 * 720159101820
960 * 7203013802760

Note

  • The base bitrate in this table applies to the Communication profile.
  • The LiveBroadcasting profile generally requires a higher bitrate for better video quality. We recommend setting the bitrate mode as 0. You can also set the bitrate as the base bitrate value x 2.

Implementation

@JsonKey(includeIfNull: false)
int? bitrate;