Package io.agora.rtc2

Class AgoraMediaRecorder.MediaRecorderConfiguration

java.lang.Object
io.agora.rtc2.AgoraMediaRecorder.MediaRecorderConfiguration
Enclosing class:
AgoraMediaRecorder

public static class AgoraMediaRecorder.MediaRecorderConfiguration extends Object
Since:
v3.5.2
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    Number of channels for audio capturing: - 1: Mono - 2: Stereo This parameter is required only when you call `createMediaRecorder` and set the `recorderStreamType` in `RecorderStreamInfo` to 1.
    int
    The format of the recording file.
    int
    Frame rate for recording video.
    int
    Height (px) of the recorded video.
    int
    Maximum recording duration in milliseconds.
    int
    Interval for updating recording information, in milliseconds.
    int
    Sampling rate (Hz) for recording audio.
    The absolute path where the recording file is saved locally.
    int
    Recording content: - `STREAM_TYPE_AUDIO`: Audio only.
    int
    The type of the video source for recording.
    int
    Width (px) of the recorded video.
  • Constructor Summary

    Constructors
    Constructor
    Description
    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)
     
  • Method Summary

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • storagePath

      public String storagePath
      The absolute path where the recording file is saved locally. The path must include the file name and extension. For example: - Android: `/storage/emulated/0/Android/data//files/example.mp4`
    • containerFormat

      public int containerFormat
      The format of the recording file. Currently, only `CONTAINER_MP4` is supported.
    • streamType

      public int streamType
      Recording content: - `STREAM_TYPE_AUDIO`: Audio only. - `STREAM_TYPE_VIDEO`: Video only. - `STREAM_TYPE_BOTH`: (Default) Both audio and video.
    • maxDurationMs

      public int maxDurationMs
      Maximum recording duration in milliseconds. The default value is 120000.
    • recorderInfoUpdateInterval

      public int recorderInfoUpdateInterval
      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.
    • width

      public int 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.
    • height

      public int 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.
    • fps

      public int 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.
    • sample_rate

      public int 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.
    • channel_num

      public int channel_num
      Number of channels for audio capturing: - 1: Mono - 2: Stereo This parameter is required only when you call `createMediaRecorder` and set the `recorderStreamType` in `RecorderStreamInfo` to 1.
    • videoSourceType

      public int 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.
  • Constructor Details

    • MediaRecorderConfiguration

      public MediaRecorderConfiguration(String storagePath, int containerFormat, int streamType, int maxDurationMs, int recorderInfoUpdateInterval)
    • MediaRecorderConfiguration

      public 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)