Agora C++ API Reference for All Platforms

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
agora::media::MediaRecorderConfiguration Struct Reference

`#include <AgoraMediaBase.h>`

## Public Member Functions
| MediaRecorderConfiguration ()
| MediaRecorderConfiguration (const char *path, MediaRecorderContainerFormat format, MediaRecorderStreamType type, int duration, int interval)

## Public Attributes
const char * | storagePath
MediaRecorderContainerFormat | containerFormat
MediaRecorderStreamType | streamType
int | maxDurationMs
int | recorderInfoUpdateInterval
int | width
int | height
int | fps
int | sample_rate
int | channel_num
agora::rtc::VIDEO_SOURCE_TYPE | videoSourceType

## Detailed Description

Since
  v3.5.2

## Constructor & Destructor Documentation

## ◆ MediaRecorderConfiguration() [1/2]

agora::media::MediaRecorderConfiguration::MediaRecorderConfiguration | ( |  | ) |
| inline

## ◆ MediaRecorderConfiguration() [2/2]

agora::media::MediaRecorderConfiguration::MediaRecorderConfiguration | ( | const char * | path,
|  | MediaRecorderContainerFormat | format,
|  | MediaRecorderStreamType | type,
|  | int | duration,
|  | int | interval )
| inline

## Member Data Documentation

## ◆ storagePath

const char* agora::media::MediaRecorderConfiguration::storagePath

The absolute path where the recording file will be saved locally, including the file name and format. For example:

- Windows: `C:\Users\<user_name>\AppData\Local\Agora\<process_name>\example.mp4`
- iOS: `/App Sandbox/Library/Caches/example.mp4`
- macOS: `/Library/Logs/example.mp4`
- Android: `/storage/emulated/0/Android/data/<package name>/files/example.mp4`
  Note
    Make sure the specified path exists and is writable.

## ◆ containerFormat

MediaRecorderContainerFormat agora::media::MediaRecorderConfiguration::containerFormat

The format of the recording file. See `MediaRecorderContainerFormat`.

## ◆ streamType

MediaRecorderStreamType agora::media::MediaRecorderConfiguration::streamType

The content to record. See `MediaRecorderStreamType`.

## ◆ maxDurationMs

int agora::media::MediaRecorderConfiguration::maxDurationMs

Maximum recording duration in milliseconds. Default is 120000.

## ◆ recorderInfoUpdateInterval

int agora::media::MediaRecorderConfiguration::recorderInfoUpdateInterval

Interval for recording information updates, in milliseconds. The valid range is [1000,10000]. The SDK triggers the `onRecorderInfoUpdated` callback based on this value to report updated recording information.

## ◆ width

int agora::media::MediaRecorderConfiguration::width

Width (px) of the recorded video. The maximum value for width × height must not exceed 3840 × 2160. This parameter is required only when calling `createMediaRecorder` and setting `type` in `RecorderStreamInfo` to PREVIEW.

## ◆ height

int agora::media::MediaRecorderConfiguration::height

Height (px) of the recorded video. The maximum value for width × height must not exceed 3840 × 2160. This parameter is required only when calling `createMediaRecorder` and setting `type` in `RecorderStreamInfo` to PREVIEW.

## ◆ fps

int agora::media::MediaRecorderConfiguration::fps

Frame rate of the recorded video. The maximum is 30. For example: 5, 10, 15, 24, 30. This parameter is required only when calling `createMediaRecorder` and setting `type` in `RecorderStreamInfo` to PREVIEW.

## ◆ sample_rate

int agora::media::MediaRecorderConfiguration::sample_rate

Sample rate (Hz) of the recorded audio. Supported values: 16000, 32000, 44100, or 48000. This parameter is required only when calling `createMediaRecorder` and setting `type` in `RecorderStreamInfo` to PREVIEW.

## ◆ channel_num

int agora::media::MediaRecorderConfiguration::channel_num

Number of audio channels to record:

- 1: Mono
- 2: Stereo This parameter is required only when calling `createMediaRecorder` and setting `type` in `RecorderStreamInfo` to PREVIEW.

## ◆ videoSourceType

agora::rtc::VIDEO_SOURCE_TYPE agora::media::MediaRecorderConfiguration::videoSourceType

Type of video source to record. See `VIDEO_SOURCE_TYPE`. This parameter is required only when calling `createMediaRecorder` and setting `type` in `RecorderStreamInfo` to PREVIEW.