AliyunMixRecorder
@interface AliyunMixRecorder : NSObject
* The recorder of mix video
-
* The video output path.
Required.
Declaration
Objective-C
@property (nonatomic, copy) NSString *outputPath;
-
* The view for displaying the video.
Declaration
Objective-C
@property (nonatomic, readonly) int *preview;
-
* The delegate.
Declaration
Objective-C
@property (nonatomic, weak) id<AliyunMixRecorderDelegate> delegate;
-
* Whether beauty mode is enabled or not.
Declaration
Objective-C
@property (nonatomic) BOOL beautifyStatus;
-
* The beauty level. Valid values: [0, 100]
Declaration
Objective-C
@property (nonatomic) int beautifyValue;
-
* The exposure level. Valid values: [0, 1]
Declaration
Objective-C
@property (nonatomic) CGFloat exposureValue;
-
* The capture resolution of the front camera.
Default value: AVCaptureSessionPreset640x480 For more parameters, see: AVCaptureSession.h
Declaration
Objective-C
@property (nonatomic, copy) NSString *frontCaptureSessionPreset;
-
* The capture resolution of the rear camera.
Default value: AVCaptureSessionPreset1280x720 For more parameters, see: AVCaptureSession.h
Declaration
Objective-C
@property (nonatomic, copy) NSString *backCaptureSessionPreset;
-
* The rotation angle of the camera.
Declaration
Objective-C
@property (nonatomic) int cameraRotate;
-
* The focus point on the preview.
Declaration
Objective-C
@property (nonatomic) CGPoint focusPoint;
-
* The zoom factor.
The actual value is one hundredth of the specified value. For example, when videoZoomFactor is set to 10.0f, the actual value is += 0.1f. When videoZoomFactor is set to -5.0f, the actual value is -= 0.05f This parameter does not apply to the front camera.
Declaration
Objective-C
@property (nonatomic) CGFloat videoZoomFactor;
-
* The front camera is not support zoom factor in default. when frontCameraSupportVideoZoomFactor is set YES,the front camera support zoom factor .
Declaration
Objective-C
@property (nonatomic) BOOL frontCameraSupportVideoZoomFactor;
-
* The encoding mode.
0 indicates software encoding. 1 indicates hardware encoding. Hardware encoding is required in iOS.
Declaration
Objective-C
@property (nonatomic) int encodeMode;
-
* The GOP size. Valid values: [0, 9,000]. Both 0 and 1 indicate full I-frames.
Default value: 5
Declaration
Objective-C
@property (nonatomic) int GOP;
-
* The recording frame rate. Valid values: (0, 30] The default value is used if an invalid value is specified.
Default value: 25
Declaration
Objective-C
@property (nonatomic) int recordFps;
-
* Whether the recording is muted or not.
This parameter is invalid if music is added.
Declaration
Objective-C
@property (nonatomic) BOOL mute;
-
* The video quality. This parameter is invalid if the bitrate parameter is set.
Declaration
Objective-C
@property (nonatomic) AliyunVideoQuality videoQuality;
-
* The video output bitrate in bit/s. Valid values: [200,000, 20,000,000]
Declaration
Objective-C
@property (nonatomic) int bitrate;
-
* The pixel format. Select one from the following three formats: kCVPixelFormatType_420YpCbCr8BiPlanarFullRange kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange kCVPixelFormatType_32BGRA Default is kCVPixelFormatType_420YpCbCr8BiPlanarFullRange.
Declaration
Objective-C
@property (nonatomic) AliyunIRecorderVideoOutputPixelFormatType outputType;
-
* Whether facial recognition is enabled.
When facial recognition is enabled, the movements of human faces are automatically detected and tracked.
Declaration
Objective-C
@property (nonatomic) BOOL useFaceDetect;
-
* Sets the maximum number of faces that can be recognized at the same time. Valid values: 1, 2, and 3.
To disable facial recognition, set useFaceDetect to NO.
Declaration
Objective-C
@property (nonatomic) int faceDetectCount;
-
* Whether to synchronize with the movements of human faces.
When enabled, the movements of human faces are dynamically synchronized to the video. For models that have poor capabilities, video stuttering may occur. When disabled, the movements of human faces are not dynamically synchronized to the video. This ensures smooth video recording. Default is YES. It is recommended to select Yes for iPhone models above 6.
Declaration
Objective-C
@property (nonatomic) BOOL faceDectectSync;
-
* The device permissions.
Microphone and camera permissions.
Declaration
Objective-C
@property (nonatomic, readonly) AliyunIRecorderDeviceAuthor authorizationStatus;
-
* Whether the torch is available.
Declaration
Objective-C
@property (nonatomic, readonly) BOOL hasTorch;
-
* The torch mode.
Declaration
Objective-C
@property (nonatomic, readonly) AliyunIRecorderTorchMode torchMode;
-
* The camera type.
Declaration
Objective-C
@property (nonatomic, readonly) AliyunIRecorderCameraPosition cameraPosition;
-
* The maximum zoom factor.
Declaration
Objective-C
@property (nonatomic, readonly) CGFloat videoMaxZoomFactor;
-
* Whether the recording is in progress.
Declaration
Objective-C
@property (nonatomic, readonly) BOOL isRecording;
-
* AEC modes,default is AliyunIRecorderAECTypeNone,- see: AliyunIRecorderAECType,API_AVAILABLE(3.19.0)
Declaration
Objective-C
@property (nonatomic) AliyunIRecorderAECType recorderAECType;
-
* The callback that outputs the number of human faces.
This parameter only takes effect when useFaceDetect is set to YES.
Declaration
Objective-C
@property (nonatomic, copy) void (^)(int) faceNumbersCallback;
-
* Initializer.
Declaration
Objective-C
- (instancetype)initWithMediaInfo:(AliyunMixMediaInfoParam *)param outputSize:(CGSize)outputSize;
Parameters
param
The media information.
outputSize
The output resolution.
Return Value
The duet object.
-
* Sets the type of audio track used for composite video, Default value: MixAudioSourceTypeOriginal
Declaration
Objective-C
- (void)setMixAudioSource:(MixAudioSourceType)audioSourceType;
Parameters
audioSourceType
- see: MixAudioSourceType.
-
* Sets the volume of audio track [0~100] API_AVAILABLE(3.19.0)
Declaration
Objective-C
- (void)setMixAudioOriginalWeight:(int)originalWeight recordWeight:(int)recordWeight;
Parameters
originalWeight
the voice of media play volume .
recordWeight
the voice of recorded volume .
-
* Deletes the last media clip.
Declaration
Objective-C
- (void)deleteLastMediaClip;
-
* Sets the maximum recording duration. Default value: 8 seconds.
Declaration
Objective-C
- (void)setRecordMaxDuration:(CGFloat)maxDuration;
Parameters
maxDuration
The maximum recording duration.
-
* Gets the maximum recording duration.
Declaration
Objective-C
- (CGFloat)recordMaxDuration;
Return Value
The maximum recording duration.
-
* Sets the minimum recording duration. Default value: 0.5 second.
Declaration
Objective-C
- (void)setRecordMinDuration:(CGFloat)minDuration;
Parameters
minDuration
The minimum recording duration.
-
* Gets the minimum recording duration.
Declaration
Objective-C
- (CGFloat)recordMinDuration;
Return Value
The minimum recording duration.
-
* Gets the duration of the recorded video.
Declaration
Objective-C
- (CGFloat)recordDuration;
Return Value
The duration of the recorded video.
-
* Gets the number of recorded video clips.
Declaration
Objective-C
- (NSInteger)partCount;
Return Value
The number of recorded video clips.
-
* Specifies backgroundColor of the result view, de. API_AVAILABLE(3.19.0)
Declaration
Objective-C
- (void)setBackgroundColor:(int)backgroundColor;
Parameters
backgroundColor
The result view backgroundColor.
-
* Specifies backgroundImageFilePath and displayMode of the result view. API_AVAILABLE(3.19.0)
Declaration
Objective-C
- (void)setBackgroundImageFilePath:(NSString *)backgroundImageFilePath imageDisplayMode: (AliyunMixVideoBackgroundImageMode)imageDisplayMode;
Parameters
backgroundImageFilePath
The result view backgroundImageFilePath, nil is clear, default is nil
imageDisplayMode
The imageDisplayMode. - see: AliyunMixVideoBackgroundImageMode.
-
* Starts preview.
Declaration
Objective-C
- (void)startPreviewWithPositon:(AliyunIRecorderCameraPosition)cameraPosition;
Parameters
cameraPosition
The camera type. Front camera or rear camera.
-
* Starts preview. The front camera is used by default.
Declaration
Objective-C
- (void)startPreview;
-
* Stops preview.
Declaration
Objective-C
- (void)stopPreview;
-
* Starts recording.
Declaration
Objective-C
- (int)startRecording;
-
* Stops recording.
The callback indicates whether the recording is successfully stopped.
Declaration
Objective-C
- (void)stopRecording;
-
* Finishes recording.
The callback indicates whether the recording is successfully finished.
Declaration
Objective-C
- (void)finishRecording;
-
Releases resources.
Declaration
Objective-C
- (void)destroyRecorder;
-
* Takes a picture asynchronously.
image The image after rendering. rawImage The original image.
Declaration
Objective-C
- (void)takePhoto:(void (^)(UIImage *, UIImage *))handler;
-
* Switches the camera.
Declaration
Objective-C
- (AliyunIRecorderCameraPosition)switchCameraPosition;
Return Value
The type of the camera that is in use.
-
* Switches the torch mode. Default is off. The preset sequence of torch modes is: off —> on —> auto
Declaration
Objective-C
- (AliyunIRecorderTorchMode)switchTorchMode;
Return Value
The torch mode to be used.
-
* Switches to a specified torch mode.
Declaration
Objective-C
- (BOOL)switchTorchWithMode:(AliyunIRecorderTorchMode)torchMode;
Parameters
torchMode
The torch mode to be used.
Return Value
YES if the invocation is successful.
-
* Applies a sticker.
Declaration
Objective-C
- (int)applyPaster:(AliyunEffectPaster *)paster;
Parameters
paster
The sticker to be applied.
-
* Applies a filter.
Declaration
Objective-C
- (int)applyFilter:(AliyunEffectFilter *)filter;
Parameters
filter
The filter to be applied.
-
* Applies an animated filter.
Declaration
Objective-C
- (int)applyAnimationFilter:(AliyunEffectFilter *)filter;
Parameters
filter
The filter to be applied.
Return Value
A return value.
-
* update an animated filter.
Declaration
Objective-C
- (int)updateAnimationFilter:(AliyunEffectFilter *)filter;
Parameters
filter
The filter to be updated.
Return Value
A return value.
-
* Applies a watermark.
Declaration
Objective-C
- (int)applyImage:(AliyunEffectImage *)image;
Parameters
image
The watermark image to be applied.
-
* Applies a music effect.
Declaration
Objective-C
- (int)applyMusic:(AliyunEffectMusic *)music;
Parameters
music
The music effect to be applied.
Return Value
A return value. This method can only be called before recording is started.
-
* Sets the recording speed.
Declaration
Objective-C
- (void)setRate:(CGFloat)rate;
Parameters
rate
The recording speed. Recommended values: [0.5, 2.0]
-
* Removes a sticker.
Declaration
Objective-C
- (void)deletePaster:(AliyunEffectPaster *)paster;
Parameters
paster
The sticker to be removed.
-
* Removes a filter.
Declaration
Objective-C
- (void)deleteFilter;
-
* Removes an animated filter.
Declaration
Objective-C
- (void)deleteAnimationFilter;
-
* Removes a watermark.
Declaration
Objective-C
- (void)deleteImage:(AliyunEffectImage *)image;
Parameters
image
The watermark image to be deleted.
-
* Sets the coordinate of a sticker or watermark.
Declaration
Objective-C
- (void)setEffectView:(CGRect)rect effect:(AliyunEffect *)effect;
Parameters
rect
The coordinate, (x,y,width,height), is relative to the view size. If the view size is (400, 400), and the position of the sticker is (50, 50, 100, 100), the value of rect is set to (0.125,0.125,0.25,0.25).
effect
Currently, only stickers and watermarks are supported.