MediaRecorderConfiguration

Used to configure parameters for audio and video stream recording.

public static class MediaRecorderConfiguration {
  public String storagePath;
  public int containerFormat = CONTAINER_MP4;
  public int streamType = STREAM_TYPE_BOTH;
  public int maxDurationMs = 120000;
  public int recorderInfoUpdateInterval = 0;
  public int width;
  public int height;
  public int fps;
  public int sample_rate;
  public int channel_num;
  public int videoSourceType;
}
Since
Available since v3.5.2.

Properties

storagePath
(Required) Absolute path to save the recording file locally, including file name and extension. For example: Android: /storage/emulated/0/Android/data/<package name>/files/example.mp4.
Note: Make sure the specified path exists and is writable.
containerFormat
The container format of the recording file. Currently only supports:
  • CONTAINER_MP4: MP4 format.
streamType
Type of content to record:
  • STREAM_TYPE_AUDIO: Record audio only.
  • STREAM_TYPE_VIDEO: Record video only.
  • STREAM_TYPE_BOTH: (Default) Record both audio and video.
maxDurationMs
Maximum duration of the recording in milliseconds. Default is 120000.
recorderInfoUpdateInterval
Interval for updating recording information, in milliseconds. Valid range is [1000, 10000]. The SDK triggers the onRecorderInfoUpdated callback based on this value to update recording information.
width
(Required) Width of the recorded video in pixels. The product of width and height must not exceed 3840 × 2160.
height
(Required) Height of the recorded video in pixels. The product of width and height must not exceed 3840 × 2160.
fps
(Required) Frame rate of the recorded video. The maximum frame rate must not exceed 30, e.g., 5, 10, 15, 24, 30, etc.
sample_rate
(Required) Sample rate (Hz) of the recorded audio. Can be set to 16000, 32000, 44100, 48000.
channel_num
(Required) Number of audio channels:
  • 1: Mono.
  • 2: Stereo.
videoSourceType
(Required) Type of video source used for recording. See VideoSourceType.