LiveTranscoding

Transcoding properties for RTMP streaming.

export class LiveTranscoding {

  width?: number;

  height?: number;

  videoBitrate?: number;

  videoFramerate?: number;

  lowLatency?: boolean;

  videoGop?: number;

  videoCodecProfile?: VideoCodecProfileType;

  backgroundColor?: number;

  videoCodecType?: VideoCodecTypeForStream;

  userCount?: number;

  transcodingUsers?: TranscodingUser[];

  transcodingExtraInfo?: string;

  metadata?: string;

  watermark?: RtcImage[];

  watermarkCount?: number;

  backgroundImage?: RtcImage[];

  backgroundImageCount?: number;

  audioSampleRate?: AudioSampleRateType;

  audioBitrate?: number;

  audioChannels?: number;

  audioCodecProfile?: AudioCodecProfileType;

  advancedFeatures?: LiveStreamAdvancedFeature[];

  advancedFeatureCount?: number;
}

Properties

width
Total width of the video stream, in pixels. Default is 360.
  • If streaming video, the value range of width is [64,1920]. If the value is less than 64, the Agora server automatically sets it to 64; if greater than 1920, it is set to 1920.
  • If streaming audio only, set both width and height to 0.
height
Total height of the video stream, in pixels. Default is 640.
  • If streaming video, the value range of height is [64,1080]. If the value is less than 64, the Agora server automatically sets it to 64; if greater than 1080, it is set to 1080.
  • If streaming audio only, set both width and height to 0.
videoBitrate
Video encoding bitrate in Kbps. This parameter does not need to be set. Keep the default value STANDARD_BITRATE, and the SDK automatically matches the optimal bitrate based on the resolution and frame rate you set. For the relationship between resolution and frame rate, see Video Profile.
videoFramerate
Frame rate of the output video for RTMP streaming. Value range is (0,30], in fps. Default is 15 fps.
Note: The Agora server adjusts frame rates higher than 30 fps to 30 fps.
lowLatency
Note: Deprecated. Not recommended.
Low latency mode
  • true: Low latency, quality not guaranteed.
  • false: (default) High latency, quality guaranteed.
videoGop
GOP (Group of Pictures) of the output video for RTMP streaming, in frames. Default is 30.
videoCodecProfile
Codec profile of the output video for RTMP streaming. Can be set to 66, 77, or 100. See VideoCodecProfileType.
Note: If you set this parameter to a value other than the above, the Agora server adjusts it to the default value.
videoCodecType
Codec type of the output video for RTMP streaming. See VideoCodecTypeForStream.
transcodingUsers
Manages users involved in video mixing for RTMP streaming. Supports up to 17 users simultaneously. See TranscodingUser.
transcodingExtraInfo
Reserved parameter: custom information sent to the RTMP client, used to populate SEI frames in H264/H265 video. Max length: 4096 bytes.
backgroundColor
Background color of the output video for RTMP streaming. Represented as a hexadecimal RGB integer without the # sign. For example, 0xFFB6C1 represents light pink. Default is 0x000000 (black).
userCount
Number of users in the video mixing. Default is 0. Value range: [0,17].
metadata
Metadata sent to the CDN client.
Note: Deprecated. Not recommended.
watermark
Watermark on the live video. Image format must be PNG. See RtcImage. You can add one watermark or multiple using an array. This parameter is used with watermarkCount.
backgroundImage
Background image on the live video. Image format must be PNG. See RtcImage. You can add one background image or multiple using an array. This parameter is used with backgroundImageCount.
audioSampleRate
Audio sample rate (Hz) of the output media stream for RTMP streaming. See AudioSampleRateType.
audioBitrate
Bitrate of the output audio for RTMP streaming. Unit: Kbps. Default is 48. Maximum is 128.
audioChannels
Number of audio channels in the output audio for RTMP streaming. Default is 1. Value must be an integer in [1,5]. Recommended values are 1 or 2. Values 3, 4, and 5 require special player support:
  • 1: (default) Mono
  • 2: Stereo
  • 3: Three channels
  • 4: Four channels
  • 5: Five channels
audioCodecProfile
Codec profile of the output audio for RTMP streaming. See AudioCodecProfileType.
watermarkCount
Number of watermarks on the live video. The total number of watermarks and background images must be ≥ 0 and ≤ 10. Used with watermark.
backgroundImageCount
Number of background images on the live video. The total number of watermarks and background images must be ≥ 0 and ≤ 10. Used with backgroundImage.
advancedFeatures
Advanced features for transcoding and streaming. See LiveStreamAdvancedFeature.
advancedFeatureCount
Number of enabled advanced features. Default is 0.