A class for managing user-specific CDN live audio/video transcoding settings in setLiveTranscoding.

example

Sample code

var LiveTranscoding = {
  width: 640,
  height: 360,
  videoBitrate: 400,
  videoFramerate: 15,
  audioSampleRate: AgoraRTC.AUDIO_SAMPLE_RATE_48000,
  audioBitrate: 48,
  audioChannels: 1,
  videoGop: 30,
  videoCodecProfile: AgoraRTC.VIDEO_CODEC_PROFILE_HIGH,
  userCount: 0,
  backgroundColor: 0x000000,
  transcodingUsers: [],
  images: [],
};

Hierarchy

  • LiveTranscoding

Index

Properties

Optional audioBitrate

audioBitrate: number

Bitrate of the CDN live audio output stream in Kbps.

Positive integer. The default value is 48, and the highest value is 128.

Optional audioChannels

audioChannels: 1 | 2 | 3 | 4 | 5

Number of audio channels for the CDN live stream.

Agora recommends choosing 1 or 2. Special players are required if you choose 3, 4 or 5:

  • 1: (Default) Mono
  • 2: Dual sound channels
  • 3: Three sound channels
  • 4: Four sound channels
  • 5: Five sound channels

Optional audioSampleRate

audioSampleRate: 32000 | 44100 | 48000

Audio sampling rate:

  • 32000: 32 kHz
  • 44100: (Default) 44.1 kHz
  • 48000: 48 kHz

Optional backgroundColor

backgroundColor: number

The background color in RGB hex value.

Value only, do not include a #. The default value is 0x000000. The value range is [0x000000, 0xffffff].

Optional height

height: number

Height of the video.

Positive integer, the default value is 360. The value range is [64, 10000].

  • When pushing video streams to the CDN, set the value of width × height to at least 64 × 64, or the SDK adjusts it to 64 x 64.
  • When pushing audio streams to the CDN, set the value of width × height to 0 × 0.

images

Adds a watermark image to the CDN live stream.

Since
   3.0.0

See TranscodingWatermark for details.

Optional lowLatency

lowLatency: boolean

DEPRECATED

Latency mode:

  • true: Low latency with unassured quality.
  • false: (Default)High latency with assured quality.

transcodingUsers

transcodingUsers: TranscodingUser[]

Manages the user layout configuration in the CDN live streaming.

Agora supports a maximum of 17 transcoding users in a CDN streaming channel. See TranscodingUser for details.

Optional userCount

userCount: number

Number of users; default value is 0. The maximum is 17.

Optional videoBitrate

videoBitrate: number

Bitrate of the CDN live output video stream.

Positive integer. The default value is 400 Kbps. The value range is [1,1000000].

Set the bitrate according to the Video Profile Table. If you set a bitrate beyond the proper range, the SDK automatically adapts it to a value within the range.

Optional videoCodecProfile

videoCodecProfile: 66 | 77 | 100

Video codec profile type.

Set it as 66, 77, or 100 (default). If you set this parameter to other values, Agora adjusts it to the default value 100.

  • 66: Baseline video codec profile. Generally used in video calls on mobile phones.
  • 77: Main video codec profile.Generally used in mainstream electronics, such as MP4 players, portable video players, PSP, and iPads.
  • 100: (Default) High video codec profile.Generally used in high - resolution broadcasts or television.

Optional videoFramerate

videoFramerate: number

Frame rate of the output data stream set for CDN live.

Positive integer. The default value is 15 fps. The value range is [1, 30]. Agora adjusts all values over 30 to 30.

Optional videoGop

videoGop: number

Video GOP in frames. The default value is 30 frames. The value range is [1,10000].

Optional width

width: number

Width of the video.

Positive integer, the default value is 640. The value range is [64, 10000].

  • When pushing video streams to the CDN, set the value of width × height to at least 64 × 64, or the SDK adjusts it to 64 x 64.
  • When pushing audio streams to the CDN, set the value of width × height to 0 × 0.