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

example

Sample Code

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

Hierarchy

  • LiveTranscoding

Index

Properties

audioBitrate

audioBitrate: number

Bitrate of the CDN live audio output stream in Kbps. The default value is 48, and the highest value is 128.

audioChannels

audioChannels: number

Agora’s self-defined audio channel type.

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

audioSampleRate

audioSampleRate: 32000 | 441000 | 48000

Audio sampling rate:

  • 32000: 32 kHz
  • 44100: 44.1 kHz
  • 48000: 48 kHz

backgroundColor

backgroundColor: number

Background color; default value is 0x000000.

height

height: number

Height of the video.

lowLatency

lowLatency: boolean

Latency mode:

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

transcodingUsers

transcodingUsers: object

Manages the user layout configuration in the CDN live streaming.

Agora supports a maximum of 17 transcoding users in a CDN streaming channel.

Type declaration

  • alpha: number

    Transparency of the video frame.

    The value ranges between 0.0 and 1.0:

    • 0.0: Completely transparent.
    • 1.0: (Default) Opaque.
  • height: number

    Height of the video.

  • uid: number | string

    User ID of the CDN live host.

  • width: number

    Width of the video.

  • x: number

    The position of the upper left end of the video on the horizontal axis.

  • y: number

    The position of the upper left end of the video on the vertical axis.

  • zOrder: number

    Layer position of the video frame.

    The value ranges between 0 and 100.

    From v2.3.0, Agora SDK supports setting zOrder as 0.

    • 0: (Default) Lowest.
    • 100: Highest.

userCount

userCount: number

Number of users; default value is 0.

videoBitrate

videoBitrate: number

Bitrate of the CDN live output video stream. The default value is 400 Kbps.

videoCodecProfile

videoCodecProfile: 66 | 77 | 100

Video codec profile type:

  • 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: High video codec profile.Generally used in high - resolution broadcasts or television.

videoFramerate

videoFramerate: number

Frame rate of the output data stream set for CDN live. The default value is 15 fps.

videoGop

videoGop: number

Video GOP in frames. The default value is 30 fps.

width

width: number

Width of the video.