|
Agora Java API Reference for Android
|
Audio and video stream recording configuration. More...
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 |
Audio and video stream recording configuration.
| String io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.storagePath |
The absolute path where the recording file is saved locally. The path must include the file name and extension. For example:
/storage/emulated/0/Android/data/<package name>/files/example.mp4 | int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.containerFormat = CONTAINER_MP4 |
The format of the recording file. Currently, only CONTAINER_MP4 is supported.
| int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.streamType = STREAM_TYPE_BOTH |
Recording content:
STREAM_TYPE_AUDIO: Audio only.STREAM_TYPE_VIDEO: Video only.STREAM_TYPE_BOTH: (Default) Both audio and video. | int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.maxDurationMs = 120000 |
Maximum recording duration in milliseconds. The default value is 120000.
| int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.recorderInfoUpdateInterval = 0 |
Interval for updating recording information, in milliseconds. The valid range is [1000, 10000]. The SDK triggers the onRecorderInfoUpdated callback based on this value to report the updated recording information.
| int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.width |
Width (px) of the recorded video. The maximum value of width × height must not exceed 3840 × 2160. This parameter is required only when you call createMediaRecorder and set the recorderStreamType of RecorderStreamInfo to 0.
| int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.height |
Height (px) of the recorded video. The maximum value of width × height must not exceed 3840 × 2160. This parameter is required only when you call createMediaRecorder and set the recorderStreamType of RecorderStreamInfo to 1.
| int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.fps |
Frame rate for recording video. The maximum value must not exceed 30, such as: 5, 10, 15, 24, 30, etc. You only need to pass this parameter when calling createMediaRecorder and setting the recorderStreamType of RecorderStreamInfo to 1.
| int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.sample_rate |
Sampling rate (Hz) for recording audio. You can set it to 16000, 32000, 44100, or 48000. This parameter is required only when you call createMediaRecorder and set the recorderStreamType of RecorderStreamInfo to 1.
| int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.channel_num |
Number of channels for audio capturing:
createMediaRecorder and set the recorderStreamType in RecorderStreamInfo to 1. | int io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration.videoSourceType |
The type of the video source for recording. See VideoSourceType. You only need to specify this parameter when calling createMediaRecorder and setting the recorderStreamType of RecorderStreamInfo to 1.
1.8.18