LiveTranscoding

Used to configure transcoding parameters for media streaming.

public class LiveTranscoding {
  public int width;
  public int height;
  public int videoBitrate;
  public int videoFramerate;
  @Deprecated public boolean lowLatency;
  public int videoGop;
  private ArrayList<AgoraImage> watermarkList;
  private ArrayList<AgoraImage> backgroundImageList;
  public AudioSampleRateType audioSampleRate;
  public int audioBitrate;
  public int audioChannels;
  public AudioCodecProfileType audioCodecProfile;
  public VideoCodecProfileType videoCodecProfile;
  public VideoCodecType videoCodecType;
  @Deprecated public int userCount;
  @Deprecated public int backgroundColor;
  public String userConfigExtraInfo;
  @Deprecated public String metadata;
  private Map<Integer, TranscodingUser> transcodingUsers;
  private Map<String, Boolean> advancedFeatures;
}

Properties

width
Video width in pixels. Default is 360.
  • When pushing video streams to the CDN, the valid range for width is [64,1920]. If the value is less than 64, Agora server automatically adjusts it to 64; if greater than 1920, it is adjusted to 1920.
  • When pushing audio streams to the CDN, set both width and height to 0.
height
Video height in pixels. Default is 640.
  • When pushing video streams to the CDN, the valid range for height is [64,1080]. If the value is less than 64, Agora server automatically adjusts it to 64; if greater than 1080, it is adjusted to 1080.
  • When pushing audio streams to the CDN, set both width and height to 0.
videoBitrate
Video encoding bitrate (Kbps). You do not need to set this parameter; just keep the default value STANDARD_BITRATE. The SDK automatically matches the most suitable bitrate based on the configured video resolution and frame rate. See Video profile for details on resolution and frame rate mappings.
videoFramerate
Frame rate (fps) of the video output for media streaming. Default is 15. Valid range is (0,30].
Note: Values greater than 30 are adjusted to 30 by the Agora server.
lowLatency
Latency mode:
  • true: Low latency mode, but video quality is not guaranteed.
  • false: Default. High latency but better video quality.
videoGop
GOP (Group of Pictures) setting for video frames in media streaming, in frames. Default is 30.
audioSampleRate
Audio sample rate (Hz) of the media output stream. See AudioSampleRateType.
audioBitrate
Audio encoding bitrate of the output stream in Kbps. Default is 48, maximum is 128.
audioChannels
Number of audio channels used in media streaming. Agora recommends using 1 (mono) or 2 (stereo). If you choose 3, 4, or 5, specific player support is required.
  • 1: Default. Mono.
  • 2: Stereo.
  • 3: Three channels.
  • 4: Four channels.
  • 5: Five channels.
audioCodecProfile
Audio codec profile type used in media streaming. See AudioCodecProfileType.
videoCodecProfile
Video codec profile type used in media streaming. Can be set to 66, 77, or the default 100. See VideoCodecProfileType.
Note: If set to other values, Agora automatically uses the default value.
videoCodecType
Video codec type used in media streaming. See VideoCodecType.
userCount
Number of users in media streaming. Valid range is [0,17].
userConfigExtraInfo
Reserved field. Used to send user-defined information to the CDN playback client as SEI in the H.264/H.265 video stream. Maximum byte length is 4096.
metadata
Metadata content sent to the CDN client.