Classes

enum  AudioCodecProfileType
 
enum  AudioSampleRateType
 
class  TranscodingUser
 
enum  VideoCodecProfileType
 

Public Member Functions

int addUser (TranscodingUser user)
 
final ArrayList< TranscodingUsergetUsers ()
 
void setUsers (ArrayList< TranscodingUser > users)
 
void setUsers (Map< Integer, TranscodingUser > users)
 
int removeUser (int uid)
 
int getUserCount ()
 
int getBackgroundColor ()
 
void setBackgroundColor (int color)
 
void setBackgroundColor (int red, int green, int blue)
 
int getRed ()
 
int getGreen ()
 
int getBlue ()
 
void setRed (int red)
 
void setGreen (int green)
 
void setBlue (int blue)
 

Public Attributes

int width
 
int height
 
int videoBitrate
 
int videoFramerate
 
boolean lowLatency
 
int videoGop
 
AgoraImage watermark
 
AgoraImage backgroundImage
 
AudioSampleRateType audioSampleRate
 
int audioBitrate
 
int audioChannels
 
AudioCodecProfileType audioCodecProfile
 
VideoCodecProfileType videoCodecProfile
 
int userCount
 
int backgroundColor
 
String userConfigExtraInfo
 
String metadata
 

Detailed Description

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

Member Function Documentation

◆ addUser()

int io.agora.rtc.live.LiveTranscoding.addUser ( TranscodingUser  user)

Adds a user displaying the video in CDN live.

Parameters
usertranscodingUser.
Returns
  • 0: Success.
  • <0: Failure.

◆ getUsers()

final ArrayList<TranscodingUser> io.agora.rtc.live.LiveTranscoding.getUsers ( )

Retrieves the user list in CDN live.

This method retrieves all users in CDN live. The user list returned by this method is read-only and should not be modified.

Returns
User list in a array.

◆ setUsers() [1/2]

void io.agora.rtc.live.LiveTranscoding.setUsers ( ArrayList< TranscodingUser users)

Sets the users in batches in CDN live.

This method sets all users involved in the CDN live stream. This method replaces the old user data with the new user data.

Parameters
usersAll users involved in CDN live.

◆ setUsers() [2/2]

void io.agora.rtc.live.LiveTranscoding.setUsers ( Map< Integer, TranscodingUser users)

Sets the users in batches in CDN live. This method sets all users involved in CDN live. This method replaces the old user data with the the new user data.

Parameters
usersAll users involved in CDN live.

◆ removeUser()

int io.agora.rtc.live.LiveTranscoding.removeUser ( int  uid)

Removes a user from CDN live.

Parameters
uidUser ID of the user to remove from CDN live.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getUserCount()

int io.agora.rtc.live.LiveTranscoding.getUserCount ( )

Retrieves the number of users transcoded in CDN live.

Returns
Number of users transcoded in CDN live.

◆ getBackgroundColor()

int io.agora.rtc.live.LiveTranscoding.getBackgroundColor ( )

Retrieves the background color in hex.

Returns
Background color to set in RGB hex value.

◆ setBackgroundColor() [1/2]

void io.agora.rtc.live.LiveTranscoding.setBackgroundColor ( int  color)

Sets the background color of the CDN live stream in the format of RGB hex.

Parameters
colorBackground color to set in RGB hex value. Value only, do not include a #.

◆ setBackgroundColor() [2/2]

void io.agora.rtc.live.LiveTranscoding.setBackgroundColor ( int  red,
int  green,
int  blue 
)

Sets the background color in RGB format.

Parameters
redRed component.
greenGreen component.
blueBlue component.

◆ getRed()

int io.agora.rtc.live.LiveTranscoding.getRed ( )
Deprecated:
Retrieves the background color's red component.
Returns
Background color's red component.

◆ getGreen()

int io.agora.rtc.live.LiveTranscoding.getGreen ( )
Deprecated:
Retrieves the background color's green component.
Returns
Background color's green component.

◆ getBlue()

int io.agora.rtc.live.LiveTranscoding.getBlue ( )
Deprecated:
Retrieves the background color's blue component.
Returns
Background color's blue component.

◆ setRed()

void io.agora.rtc.live.LiveTranscoding.setRed ( int  red)
Deprecated:
Sets the background color's red component.

◆ setGreen()

void io.agora.rtc.live.LiveTranscoding.setGreen ( int  green)
Deprecated:
Sets the background color's green component.

◆ setBlue()

void io.agora.rtc.live.LiveTranscoding.setBlue ( int  blue)
Deprecated:
Sets the background color's blue component.

Member Data Documentation

◆ width

int io.agora.rtc.live.LiveTranscoding.width

Width (pixel) of the video. The default value is 360. The minumum value of width × height is 16 × 16.

◆ height

int io.agora.rtc.live.LiveTranscoding.height

Height (pixel) of the video. The default value is 640. The minumum value of width × height is 16 × 16.

◆ videoBitrate

int io.agora.rtc.live.LiveTranscoding.videoBitrate

Bitrate (Kbps) of the CDN live output video stream. The default value is 400. Set this parameter according to the Video Bitrate Table. If you set a bitrate beyond the proper range, the SDK automatically adapts it to a value within the range.

◆ videoFramerate

int io.agora.rtc.live.LiveTranscoding.videoFramerate

Frame rate (fps) of the CDN live output video stream. The default value is 15. Agora adjusts all values over 30 to 30.

◆ lowLatency

boolean io.agora.rtc.live.LiveTranscoding.lowLatency

Latency mode:

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

◆ videoGop

int io.agora.rtc.live.LiveTranscoding.videoGop

Gop of the video frames in the CDN live stream. The default value is 30 fps.

◆ watermark

AgoraImage io.agora.rtc.live.LiveTranscoding.watermark

The watermark image added to the CDN live publishing stream. Ensure that the format of the image is PNG. Once a watermark image is added, the audience of the CDN live publishing stream can see it. See AgoraImage.

◆ backgroundImage

AgoraImage io.agora.rtc.live.LiveTranscoding.backgroundImage

The background image added to the CDN live publishing stream. Once a background image is added, the audience of the CDN live publishing stream can see it. See AgoraImage.

◆ audioSampleRate

AudioSampleRateType io.agora.rtc.live.LiveTranscoding.audioSampleRate

Self-defined audio-sample rate: AudioSampleRateType.

◆ audioBitrate

int io.agora.rtc.live.LiveTranscoding.audioBitrate

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

◆ audioChannels

int io.agora.rtc.live.LiveTranscoding.audioChannels

Agora’s self-defined audio channel type. We recommend choosing 1 or 2. Special players are required if you choose 3, 4 or 5:

  • 1: (Default) Mono.
  • 2: Two-channel stereo.
  • 3: Three-channel stereo.
  • 4: Four-channel stereo.
  • 5: Five-channel stereo.

◆ audioCodecProfile

AudioCodecProfileType io.agora.rtc.live.LiveTranscoding.audioCodecProfile

Audio codec profile type: AudioCodecProfileType. Set it as LC-AAC or HE-AAC. The default value is LC-AAC.

◆ videoCodecProfile

VideoCodecProfileType io.agora.rtc.live.LiveTranscoding.videoCodecProfile

Video codec profile type: VideoCodecProfileType. Set it as BAELINE, MAIN, or HIGH (default). If you set this parameter to other values, Agora adjusts it to the default value HIGH.

◆ userCount

int io.agora.rtc.live.LiveTranscoding.userCount

Number of users in the live broadcast.

Deprecated:
This parameter is deprecated. We recommend using the getUserCount method.

◆ backgroundColor

int io.agora.rtc.live.LiveTranscoding.backgroundColor

Sets the background color.

Deprecated:
This parameter is deprecated. We recommend using the setBackgroundColor method to set the background color.

◆ userConfigExtraInfo

String io.agora.rtc.live.LiveTranscoding.userConfigExtraInfo

Reserved property. Extra user-defined information to send the Supplemental Enhancement Information (SEI) for the H.264/H.265 video stream to the CDN live client. Maximum length: 4096 Bytes. For more information on SEI frames, see SEI-related questions.

◆ metadata

String io.agora.rtc.live.LiveTranscoding.metadata

The metadata sent to the CDN live client.

Deprecated:
This parameter is deprecated.