Agora Java API Reference for Android

Public Member Functions | Public Attributes | List of all members
io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration Class Reference

## Public Member Functions
| MediaRecorderConfiguration (String storagePath, int containerFormat, int streamType, int maxDurationMs, int recorderInfoUpdateInterval)
| MediaRecorderConfiguration (String storagePath, int containerFormat, int streamType, int maxDurationMs, int recorderInfoUpdateInterval, int width, int height, int fps, int sample_rate, int channel_num, int videoSourceType)

## Public Attributes
String | storagePath
int | containerFormat = CONTAINER_MP4
int | streamType = STREAM_TYPE_BOTH
int | maxDurationMs = 120000
int | recorderInfoUpdateInterval = 0
int | width
int | height
int | fps
int | sample_rate
int | channel_num
int | videoSourceType

## Detailed Description

Configurations for the local audio and video recording.

Since
  v3.5.2

## Member Data Documentation

## ◆ storagePath

String io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.storagePath

The absolute path (including the filename extensions) for the recording file. For example, `/storage/emulated/0/Android/data/<package name>/files/example.mp4`.

Note
  Ensure that the specified path exists and is writable.

## ◆ containerFormat

int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.containerFormat = CONTAINER_MP4

The format of the recording file. The SDK currently supports only CONTAINER_MP4(1).

## ◆ streamType

int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.streamType = STREAM_TYPE_BOTH

The recording content:

- STREAM_TYPE_AUDIO(0x1): Only audio.
- STREAM_TYPE_VIDEO(0x2): Only video.
- STREAM_TYPE_BOTH(0x3): (Default) Audio and video.

## ◆ maxDurationMs

int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.maxDurationMs = 120000

The maximum recording duration, in milliseconds. The default value is 120000.

## ◆ recorderInfoUpdateInterval

int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.recorderInfoUpdateInterval = 0

The interval (ms) of updating the recording information. The value range is [1000,10000]. Based on the set value of `recorderInfoUpdateInterval`, the SDK triggers the {onRecorderInfoUpdated} callback to report the updated recording information.

## ◆ width

int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.width

The video width

## ◆ height

int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.height

The video height

## ◆ fps

int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.fps

The video fps

## ◆ sample_rate

int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.sample_rate

The audio sample rate

## ◆ channel_num

int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.channel_num

The audio channel nums

## ◆ videoSourceType

int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.videoSourceType

The video source just for out channel recoder