AgoraLiveTranscoding Class Reference

Inherits from NSObject
Declared in AgoraObjects.h

Overview

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

  size

The size of the video (width and height in pixels).

@property (assign, nonatomic) CGSize size

Discussion

  • When pushing video streams to the CDN, ensure that both the width and height are at least 64; otherwise, the Agora server adjusts the value to 64.
  • When pushing audio streams to the CDN, set the width and height as 0.

Declared In

AgoraObjects.h

  videoBitrate

Bitrate of the CDN live output video stream.

@property (assign, nonatomic) NSInteger videoBitrate

Discussion

The default value is 400 Kbps.

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.

Declared In

AgoraObjects.h

  videoFramerate

Frame rate of the CDN live output video stream.

@property (assign, nonatomic) NSInteger videoFramerate

Discussion

The default value is 15 fps, and the value range is (0,30].

Note: The Agora server adjusts any value over 30 to 30.

Declared In

AgoraObjects.h

  lowLatency

Latency mode. DEPRECATED from v2.8.0

@property (assign, nonatomic) BOOL lowLatency

Discussion

  • YES: Low latency with unassured quality.
  • NO:(Default)High latency with assured quality.

Declared In

AgoraObjects.h

  videoGop

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

@property (assign, nonatomic) NSInteger videoGop

Declared In

AgoraObjects.h

  videoCodecProfile

Video codec profile type

@property (assign, nonatomic) AgoraVideoCodecProfileType videoCodecProfile

Discussion

Set it as 66, 77, or 100 (default), see AgoraVideoCodecProfileType.

If you set this parameter to other values, Agora adjusts it to the default value of 100.

Declared In

AgoraObjects.h

  videoCodecType

Video codec type Set it as 1(default), 2 , see AgoraVideoCodecType.

@property (assign, nonatomic) AgoraVideoCodecTypeForStream videoCodecType

Declared In

AgoraObjects.h

  transcodingUsers

An AgoraLiveTranscodingUser object managing the user layout configuration in the CDN live stream. Agora supports a maximum of 17 transcoding users in a CDN live stream channel. See AgoraLiveTranscodingUser.

@property (copy, nonatomic) NSArray<AgoraLiveTranscodingUser*> *transcodingUsers

Declared In

AgoraObjects.h

  transcodingExtraInfo

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

@property (copy, nonatomic) NSString *transcodingExtraInfo

Declared In

AgoraObjects.h

  watermark

The watermark image added to the CDN live publishing stream.

@property (strong, nonatomic) AgoraImage *watermark

Discussion

The audience of the CDN live publishing stream can see the watermark. Ensure that the format of the image is PNG.

See AgoraImage for the definition of the watermark.

Declared In

AgoraObjects.h

  backgroundImage

The background image added to the CDN live publishing stream.

@property (strong, nonatomic) AgoraImage *backgroundImage

Discussion

The audience of the CDN live publishing stream can see the background image. See AgoraImage for the definition of the background image.

Declared In

AgoraObjects.h

  backgroundColor

The background color in RGB hex.

@property (strong, nonatomic) COLOR_CLASS *backgroundColor

Discussion

Value only. Do not include a preceding #. For example, 0xFFB6C1 (light pink). The default value is 0x000000 (black).

COLOR_CLASS is a general name for the type:

  • iOS: UIColor
  • macOS: NSColor

Declared In

AgoraObjects.h

  audioSampleRate

Self-defined audio sample rate: AgoraAudioSampleRateType.

@property (assign, nonatomic) AgoraAudioSampleRateType audioSampleRate

Declared In

AgoraObjects.h

  audioBitrate

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

@property (assign, nonatomic) NSInteger audioBitrate

Declared In

AgoraObjects.h

  audioChannels

The number of audio channels for the CDN live stream.

@property (assign, nonatomic) NSInteger audioChannels

Discussion

Agora recommends choosing 1 (mono), or 2 (stereo) audio channels. Special players are required if you choose 3, 4, or 5.

  • 1: (Default) Mono
  • 2: Stereo
  • 3: Three audio channels
  • 4: Four audio channels
  • 5: Five audio channels

Declared In

AgoraObjects.h

  audioCodecProfile

Audio codec profile. See AgoraAudioCodecProfileType.

@property (assign, nonatomic) AgoraAudioCodecProfileType audioCodecProfile

Discussion

The default value is AgoraAudioCodecProfileLCAAC(0).

Declared In

AgoraObjects.h

+ defaultTranscoding

Creates a default transcoding object.

+ (AgoraLiveTranscoding *_Nonnull)defaultTranscoding

Return Value

Default AgoraLiveTranscoding object.

Declared In

AgoraObjects.h

– addUser:

Adds a user displaying the video in CDN live.

- (int)addUser:(AgoraLiveTranscodingUser *_Nonnull)user

Parameters

user

The transcoding user. See AgoraLiveTranscodingUser.

Return Value

  • 0: Success.
  • < 0: Failure.

Declared In

AgoraObjects.h

– removeUser:

Removes a user from CDN live.

- (int)removeUser:(NSUInteger)uid

Parameters

uid

The user ID of the user to remove from CDN live.

Return Value

  • 0: Success.
  • < 0: Failure.

Declared In

AgoraObjects.h