AgoraMediaRecorderConfiguration

  • macOS

更新时间不可用

音视频录制参数配置。

Objective-C
__attribute__((visibility("default"))) @interface AgoraMediaRecorderConfiguration : NSObject
@property(copy, nonatomic) NSString* _Nonnull storagePath;
@property(assign, nonatomic) AgoraMediaRecorderContainerFormat containerFormat;
@property(assign, nonatomic) AgoraMediaRecorderStreamType streamType;
@property(assign, nonatomic) NSUInteger maxDurationMs;
@property(assign, nonatomic) NSUInteger recorderInfoUpdateInterval;
@property(assign, nonatomic) NSUInteger width;
@property(assign, nonatomic) NSUInteger height;
@property(assign, nonatomic) NSUInteger fps;
@property(assign, nonatomic) NSUInteger sample_rate;
@property(assign, nonatomic) NSUInteger channel_num;
@property(assign, nonatomic) AgoraVideoSourceType videoSourceType;
@end

属性

参数名描述
storagePath

本地录制文件的绝对路径。路径必须包含文件名和扩展名。例如:iOS:/App Sandbox/Library/Caches/example.mp4,macOS:/Library/Logs/example.mp4。

注: 请确保指定路径存在且可写。

containerFormat

录制文件的封装格式。详见 AgoraMediaRecorderContainerFormat。

streamType

录制内容类型。详见 AgoraMediaRecorderStreamType。

maxDurationMs

录制的最大时长,单位为毫秒。默认值为 120000。

recorderInfoUpdateInterval

录制信息更新的时间间隔,单位为毫秒。取值范围为 [1000, 10000]。SDK 会根据该设置触发 mediaRecorder:informationDidUpdated:uid:info: 回调以报告录制信息更新。

width

录制视频的宽度(单位:px)。

注: 仅在调用 createMediaRecorder 且在 AgoraRecorderStreamInfo 中将 type 设置为 AgoraRecorderStreamTypePreview 时需要设置该参数。宽度 × 高度的最大值不能超过 3840 × 2160。

height

录制视频的高度(单位:px)。

注: 仅在调用 createMediaRecorder 且在 AgoraRecorderStreamInfo 中将 type 设置为 AgoraRecorderStreamTypePreview 时需要设置该参数。宽度 × 高度的最大值不能超过 3840 × 2160。

fps

录制视频的帧率,最大值为 30。例如:5、10、15、24、30 等。

注: 仅在调用 createMediaRecorder 且在 AgoraRecorderStreamInfo 中将 type 设置为 AgoraRecorderStreamTypePreview 时需要设置该参数。

sample_rate

录制音频的采样率(单位:Hz)。可设置为 16000、32000、44100 或 48000。

注: 仅在调用 createMediaRecorder 且在 AgoraRecorderStreamInfo 中将 type 设置为 AgoraRecorderStreamTypePreview 时需要设置该参数。

channel_num

注: 仅在调用 createMediaRecorder 且在 AgoraRecorderStreamInfo 中将 type 设置为 AgoraRecorderStreamTypePreview 时需要设置该参数。

录制音频的声道数:

  • 1:单声道。
  • 2:双声道。
videoSourceType

录制使用的视频源类型。详见 AgoraVideoSourceType。

注: 仅在调用 createMediaRecorder 且在 AgoraRecorderStreamInfo 中将 type 设置为 AgoraRecorderStreamTypePreview 时需要设置该参数。

表格内容超出当前宽度,可横向滚动查看更多列。

这个页面有帮助吗?