AliyunCrop
@interface AliyunCrop : NSObject
* A crop class.
-
* The crop callback.
Declaration
Objective-C
@property (nonatomic, weak) id<AliyunCropDelegate> delegate;
-
* The path of the source video/audio file. Required.
Declaration
Objective-C
@property (nonatomic, copy) NSString *inputPath;
-
* The path to save the cropped file. Required. Specify a valid path.
Declaration
Objective-C
@property (nonatomic, copy) NSString *outputPath;
-
* The resolution of the video after cropping. Even numbers only. Optional when cropping audio files.
Declaration
Objective-C
@property (nonatomic) CGSize outputSize;
-
* The crop start time in seconds.
Declaration
Objective-C
@property (nonatomic) float startTime;
-
* The crop end time in seconds.
Declaration
Objective-C
@property (nonatomic) float endTime;
-
Deprecated
deprecated
* The transition duration of the video clip. Deprecated.
Declaration
Objective-C
@property (nonatomic) long fadeDuration;
-
* The crop mode. Optional when cropping audio files.
Declaration
Objective-C
@property (nonatomic) AliyunCropCutMode cropMode;
-
* The crop rectangle. The resolution of the video to be kept. This setting only takes effect when the crop mode is set to 1. Optional when cropping audio files. Unit: pixels.
Declaration
Objective-C
@property (nonatomic) CGRect rect;
-
* The video quality. Default value: AliyunVideoQualityMedium Optional when cropping audio files.
Declaration
Objective-C
@property (nonatomic) AliyunVideoQuality videoQuality;
-
* The video frame rate. Default value: 25 Optional when cropping audio files.
Declaration
Objective-C
@property (nonatomic) int fps;
-
* The GOP size. Default value: 5 Optional when cropping audio files.
Declaration
Objective-C
@property (nonatomic) int gop;
-
* The encoding mode. 0: Software encoding. 1: Hardware encoding.
Declaration
Objective-C
@property (nonatomic) int encodeMode;
-
* The video bitrate. Unit: bit/s Optional when cropping audio files.
Declaration
Objective-C
@property (nonatomic) int bitrate;
-
Deprecated
deprecated
* Whether to enable GPU cropping. Optional when cropping audio files.
Declaration
Objective-C
@property (nonatomic) BOOL useHW;
-
* Whether to enable optimization. When set to true, video is cropped without decoding or encoding. Optional when cropping audio files. Default is false.
Declaration
Objective-C
@property (nonatomic) BOOL shouldOptimize;
-
* The background color. This setting only takes effect when the crop mode is set to 0. Optional when cropping audio files.
Declaration
Objective-C
@property(nonatomic, strong) UIColor *fillBackgroundColor
-
* Initializer.
Declaration
Objective-C
- (instancetype)initWithDelegate:(id<AliyunCropDelegate>)delegate;
Parameters
delegate
The AliyunCropDelegate object.
Return Value
AliyunCrop
-
* Starts cropping.
Declaration
Objective-C
- (int)startCrop;
-
* Cancels cropping.
Declaration
Objective-C
- (void)cancel;
-
Deprecated
deprecated
* Gets the SDK version.
Declaration
Objective-C
+ (NSString *)version;
Return Value
The SDK version.