On-premise Recording SDK v3.0.6 API Reference for Linux (Java)
Public Attributes | List of all members
io.agora.recording.common.RecordingConfig Class Reference

Public Attributes

boolean isAudioOnly
 
boolean isVideoOnly
 
boolean isMixingEnabled
 
MIXED_AV_CODEC_TYPE mixedVideoAudio
 
String mixResolution
 
String decryptionMode
 
String secret
 
String appliteDir
 
String recordFileRootDir
 
String cfgFilePath
 
VIDEO_FORMAT_TYPE decodeVideo
 
AUDIO_FORMAT_TYPE decodeAudio
 
int lowUdpPort
 
int highUdpPort
 
int idleLimitSec
 
int captureInterval
 
int audioIndicationInterval
 
CHANNEL_PROFILE_TYPE channelProfile
 
REMOTE_VIDEO_STREAM_TYPE streamType
 
int triggerMode
 
int proxyType
 
String proxyServer
 
int audioProfile
 
String defaultVideoBgPath
 
String defaultUserBgPath
 
boolean autoSubscribe
 
boolean enableCloudProxy
 
String subscribeVideoUids
 
String subscribeAudioUids
 
boolean enableIntraRequest
 
boolean enableH265Support
 

Member Data Documentation

◆ isAudioOnly

boolean io.agora.recording.common.RecordingConfig.isAudioOnly

Sets whether or not to record audio only:

  • true: Enables audio recording and disables video recording.
  • false: (Default) Enables both audio and video recording.

Used together with isVideoOnly:

  • If isAudioOnly is true and isVideoOnly is false, only records audio.
  • If isAudioOnly is false and isVideoOnly is true, only records video.
  • If isAudioOnly is false and isVideoOnly is false, records both audio and video.
  • isAudioOnly and isVideoOnly can not be set as true at the same time.

◆ isVideoOnly

boolean io.agora.recording.common.RecordingConfig.isVideoOnly

Sets whether or not to record video only:

  • true: Enables video recording and disable audio recording.
  • false: (Default) Enables both audio and video recording.

Used together with isAudioOnly:

  • If isAudioOnly is true and isVideoOnly is false, only records audio.
  • If isAudioOnly is false and isVideoOnly is true, only records video.
  • If isAudioOnly is false and isVideoOnly is false, records both audio and video.
  • isAudioOnly and isVideoOnly can not be set as true at the same time.

◆ isMixingEnabled

boolean io.agora.recording.common.RecordingConfig.isMixingEnabled

Sets whether or not to enable the audio- or video-composite mode.

  • true: Enables composite recording mode, which means the audio of all uids is mixed in an audio file and the video of all uids is mixed in a video file. You can set the audio profile of the recording file by the audioProfile parameter and set the video profile by the mixResolution parameter.
  • false: (Default) Enables individual recording mode, which means one audio or video file for each uid. The sampling rate of the recording file is 48 kHz, and the bitrate and audio channel number of the recording file are the same as those of the original audio stream. The video profile of the recording file is the same as that of the original video stream.

◆ mixedVideoAudio

MIXED_AV_CODEC_TYPE io.agora.recording.common.RecordingConfig.mixedVideoAudio

If you set isMixingEnabled as true, mixedVideoAudio allows you to mix the audio and video in an MP4 file in real time. For more information, see MIXED_AV_CODEC_TYPE.

Note
It is recommended to set mixedVideoAudio to AV_CODEC_MIXED_TS_ONLY(6) or AV_CODEC_MIXED_TS_AND_MP4(7) in the composite recording mode to ensure the availability of recording files after the recording process crashes. If it is set to AV_CODEC_MIXED_TS_AND_MP4(7), there will be a certain degree of performance regression for recording.

◆ mixResolution

String io.agora.recording.common.RecordingConfig.mixResolution

If you set isMixingEnabled as true, mixResolution allows you to set the video profile, including the width, height, frame rate, and bitrate. The default setting is 360 x 640, 15 fps, 500 Kbps.

Note
Agora only supports the following frame rates: 1 fps, 7 fps, 10 fps, 15 fps, 24 fps, 30 fps and 60 fps. The default value is 15 fps. If you set the frame rate as other values, the SDK uses the default value.

See the Video Profile Table.

◆ decryptionMode

String io.agora.recording.common.RecordingConfig.decryptionMode

When the whole channel is encrypted, the recording SDK uses decryptionMode to enable the built-in decryption function:

  • "aes-128-xts": AES-128, XTS mode
  • "aes-128-ecb": AES-128, ECB mode
  • "aes-256-xts": AES-256, XTS mode
  • "aes-128-gcm": AES-128, GCM mode
  • "aes-256-gcm": AES-256, GCM mode

The default value is NULL.

Note
The decryption method of the recording server must be the same as that of the Native/Web SDK.

◆ secret

String io.agora.recording.common.RecordingConfig.secret

The decryption password when decryption mode is enabled. The default value is NULL.

◆ appliteDir

String io.agora.recording.common.RecordingConfig.appliteDir

Sets the path of AgoraCoreService. The default path of AgoraCoreService is Agora_Recording_SDK_for_Linux_FULL/bin/.

◆ recordFileRootDir

String io.agora.recording.common.RecordingConfig.recordFileRootDir

Sets the path of the recorded files. The default value is NULL.

After setting recordFileRootDir, the subdirectory will be automatically generated according to the date of the recording.

◆ cfgFilePath

String io.agora.recording.common.RecordingConfig.cfgFilePath

Sets the path of the configuration file. The default value is NULL. For example, --cfgFilePath /home/guest/recording_dir/cfg.json.

The content in the configuration file must be in JSON format. You can configure the following parameters:

  • Recording_Dir: The absolute directory of the output in the string format. The recording service does not automatically create a subdirectory.

    For example, {"Recording_Dir": "/home/guest/recording_dir/"}, which means the recording service stores the recording files in the /home/guest/recording_dir/ directory.

  • Chunk_Time_Span: Time interval (s) between two successive recorded files in the string format. Only in the LiveBroadcasting channel profile and in an individual recording session can you set Chunk_Time_Span, which must be >= 10.

    For example: {"Chunk_Time_Span": "15"}, which means the recording service creates a file every 15 seconds.

  • Secondary_Recorder: String. Records audio files in two formats. Secondary_Recorder is the added audio file format.

    For example: {"Secondary_Recorder":"mp3"}, which means to generate audio files in AAC and MP3 formats.

  • Audio_Only_Record: String. Records audio files in one format only. Audio_Only_Record is the audio file format.

    For example: {"Audio_Only_Record":"mp3"}, which means to generate audio files only in MP3 format.

  • Audio_Sample_Rate: Number. Sets the sample rate of the recorded audio files.

    For example: {"Audio_Sample_Rate":16000},which means the sample rate of the recorded audio is 16000Hz.

  • Pcm_Sample_Rate: Number. Sets the sample rate for recording original audio data in PCM format (getAudioFrame is 2 or 3).

    For example: {"Pcm_Sample_Rate":16000},which means the sample rate of the recorded original audio in PCM format is 16000Hz.

Note
  • You can set the Chunk_Time_Span parameter only when you use the recording service in individual recording mode in an interactive live streaming channel.
  • To use the Chunk_Time_Span parameter, you must set enableIntraRequest as true to enable the keyframe request. Whether the sender sends the keyframe depends on the Agora RTC SDK version used by the sender.
  • Slicing occurs only when an I frame appears, therefore the actual slicing time interval may be slightly different from the set time interval.
  • Audio_Sample_Rate can be set to 16000Hz, 32000Hz, 44100Hz, 48000Hz. If the sample rate you set is not within the above range, the default sample rate is 16000Hz.
  • Pcm_Sample_Rate can be set to 8000Hz, 16000Hz, 32000Hz. If the sample rate you set is not within the above range, the configuration does not take effect.

◆ decodeVideo

VIDEO_FORMAT_TYPE io.agora.recording.common.RecordingConfig.decodeVideo

Sets the video decoding format. See VIDEO_FORMAT_TYPE.

Note
When VIDEO_FORMAT_TYPE = 1, 2, 3 or 4, isMixingEnabled cannot be set as true.

◆ decodeAudio

AUDIO_FORMAT_TYPE io.agora.recording.common.RecordingConfig.decodeAudio

Sets the audio decoding format. See AUDIO_FORMAT_TYPE.

Note
When AUDIO_FORMAT_TYPE = 1 or 2, isMixingEnabled cannot be set as true.

◆ lowUdpPort

int io.agora.recording.common.RecordingConfig.lowUdpPort

Sets the lowest UDP port. The default value is 0. Ensure that the value of highUdpPort - lowUdpPort ≥ 6.

◆ highUdpPort

int io.agora.recording.common.RecordingConfig.highUdpPort

Sets the highest UDP port. The default value is 0. Ensure that the value of highUdpPort - lowUdpPort ≥ 6.

◆ idleLimitSec

int io.agora.recording.common.RecordingConfig.idleLimitSec

Sets a time period. The value must be ≥ 3 seconds. The default value is 300 seconds.

When the Agora Recording SDK is recording, if there is no user in the channel after a time period of idleLimitSec, it automatically stops recording and leaves the channel.

Note
  • We charge you this time period.
  • In a communication channel, the recording service does not recognize a channel as an idle channel, so long as the channel has users, regardless of whether they send stream or not.
  • If a live streaming channel has an audience without a host for a set time (idleLimitSec), the recording service automatically stops and leaves the channel.

◆ captureInterval

int io.agora.recording.common.RecordingConfig.captureInterval

Sets the interval of the screen capture. The interval must be longer than 1 second and the default value is 5 seconds.

Note
captureInterval is only valid when decodeVideo is set as 3, 4 or 5.

◆ audioIndicationInterval

int io.agora.recording.common.RecordingConfig.audioIndicationInterval

Sets whether or not to detect the users who speak.

  • ≤ 0: (Default) Do not detect the users who speak.
  • > 0: Sets the interval (ms) of detecting the users who speak. Agora recommends setting the interval to be longer than 200 ms. When the SDK detects the users who speak, the SDK returns the UID of the user who speaks loudest in the onActiveSpeaker callback and returns the UIDs of all users who speak and their voice volumes in the onAudioVolumeIndication callback.

◆ channelProfile

CHANNEL_PROFILE_TYPE io.agora.recording.common.RecordingConfig.channelProfile

Sets the channel mode. See CHANNEL_PROFILE_TYPE.

◆ streamType

REMOTE_VIDEO_STREAM_TYPE io.agora.recording.common.RecordingConfig.streamType

streamType takes effect only when the Agora Native SDK/Web SDK enables the dual-stream mode (high stream by default). See REMOTE_VIDEO_STREAM_TYPE.

◆ triggerMode

int io.agora.recording.common.RecordingConfig.triggerMode

Sets whether to start the recording automatically or manually:

  • 0: (Default) Automatically
  • 1: Manually

If you wish to call startService and stopService, then choose Manually.

◆ proxyType

int io.agora.recording.common.RecordingConfig.proxyType

Sets the type of the proxy server:

  • 0: Deploy the proxy server of the SOCKS5 type.
  • 1: (Default) Use the cloud proxy service, and configure the domain (recommended).
  • 2: Use the cloud proxy service, and configure the IP list (recommended when you can not resolve a domain to an IP address).

After setting the proxyType parameter, you need to set the proxyServer parameter. See Use Cloud Proxy for details.

◆ proxyServer

String io.agora.recording.common.RecordingConfig.proxyServer

Sets the IP address (domain) and port of the proxy server for a recording within the intranet according to the type of the proxy server that you choose with the proxyType parameter.

  • If proxyType is 0, set it as "<ip>:<port>".
  • If proxyType is 1, set it as "<domain>:<port>".
  • If proxyType is 2, set it as "<ip1>,<ip2>,...,<ipx>:<port>".

See Use Cloud Proxy for details.

◆ audioProfile

int io.agora.recording.common.RecordingConfig.audioProfile

If you set isMixingEnabled as true, mixResolution allows you to set the audio profile of the recording file:

  • AUDIO_PROFILE_DEFAULT = 0: (Default) Sampling rate of 48 KHz, communication encoding, mono, and a bitrate of up to 48 Kbps.
  • AUDIO_PROFILE_MUSIC_HIGH_QUALITY = 1: Sampling rate of 48 KHz, music encoding, mono, and a bitrate of up to 128 Kbps.
  • AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO = 2: Sampling rate of 48 KHz, music encoding, stereo, and a bitrate of up to 192 Kbps.

◆ defaultVideoBgPath

String io.agora.recording.common.RecordingConfig.defaultVideoBgPath

Sets the path of the default background image of the canvas in composite recording mode.

If defaultVideoBgPath is not set, the canvas displays the background color.

Note
Only supports local images in JPEG format.

◆ defaultUserBgPath

String io.agora.recording.common.RecordingConfig.defaultUserBgPath

Sets the path of the default background image of users in composite recording mode.

The background image is displayed when a user is online and does not send any video stream.

If defaultUserBgPath is not set, the user region displays the background color.

Note
  • Only supports local images in JPEG format.
  • The background image is not displayed for users using the Agora Web SDK.

◆ autoSubscribe

boolean io.agora.recording.common.RecordingConfig.autoSubscribe

Sets whether to record the streams of all users or specified users.

  • true: (Default) Record the streams of all users.
  • false: Record the streams of specified users.
Note
If you set autoSubscribe as false, you should set subscribeVideoUids or subscribeAudioUids to specify users whose video or audio you want to record.

◆ enableCloudProxy

boolean io.agora.recording.common.RecordingConfig.enableCloudProxy

Sets whether or not to enable the cloud proxy:

  • true: Enables the cloud proxy.
  • false: (Default) Disables the cloud proxy.

See Use Cloud Proxy for details.

◆ subscribeVideoUids

String io.agora.recording.common.RecordingConfig.subscribeVideoUids

An array of UIDs whose video streams you want to record.

If you set autoSubscribe as false, subscribeVideoUids enables you to record the video streams of specified users.

◆ subscribeAudioUids

String io.agora.recording.common.RecordingConfig.subscribeAudioUids

An array of UIDs whose audio streams you want to record.

If you set autoSubscribe as false, subscribeAudioUids enables you to record the audio streams of specified users.

◆ enableIntraRequest

boolean io.agora.recording.common.RecordingConfig.enableIntraRequest

Sets whether to enable the keyframe request. The default value is true, which can improve the audio and video quality under poor network conditions. To play the video file recorded in individual recording mode from a specified position, you must set enableIntraRequest as false.

  • true: (Default) Leave it to the sender to decide whether to enable the keyframe request. After the keyframe request is enabled, you cannot play a video file, which is recorded in individual recording mode, from a specified position.
  • false: Disable the keyframe request. All senders in the channel send the keyframe at an interval of 2 seconds. After the keyframe request is disabled, you can play a video file, which is recorded in individual recording mode, from a specified position.
Note
If the sender uses Agora RTC SDK v2.9.2 or earlier, this parameter is valid only in the live-broadcast scenario.

◆ enableH265Support

boolean io.agora.recording.common.RecordingConfig.enableH265Support

Sets whether to enable recording video stream in H.265 format:

  • true: Enable recording video stream in H.265 format.
  • false: (Default) Disable recording stream in H.265 format. Other remote users in the channel can no longer send video stream in H.265 format.