The short video SDK allows you to import videos, images, and materials from local devices and the draft box.

Supported editions

Edition Supported
Professional Yes
Standard Yes
Basic No

Related classes

Class Description
AliyunImporter The core class for video import. This class is used to create configuration files and configure media clips.
AliyunIClipConstructor The class that is used to obtain, add, and delete media clips.
AliyunClip The class for media clips. This class is used to obtain information such as the start time, end time, display mode, and rotation angle of a clip.
AliyunVideoParam The class that defines video parameters, including the quality, padding mode, and encoding type of a video.

Import local media resources

You can use the AliyunImporter class to add media clips and generate a source video file as the input parameter of the AliyunIEditor class.

//0. Specify the configuration path and output video resolution.
NSString *taskPath = @"xxx"; 

//1. Create an instance.
AliyunImporter *importer = [[AliyunImporter alloc] initWithPath:taskPath outputSize:outputResolution];

//2.1 Add a video.
AliyunClip *videoClip = [[AliyunClip alloc] initWithVideoPath:@"your video path" animDuration:0];
[importer addMediaClip:videoClip];

//3. Configure output parameters.
AliyunVideoParam *param = [[AliyunVideoParam alloc] init];
param.fps=30; // Frame rate
param.gop=90; // Keyframe interval
param.videoQuality=AliyunVideoQualityHight; // Video quality
param.scaleMode=AliyunScaleModeFill; // Scaling mode
param.codecType=AliyunVideoCodecHardware; // Encoding mode
[importer setVideoParam:param];

//4. Generate the configuration file for video sources.
[importer generateProjectConfigure];

//5. Create an editor.
 self.editor = [[AliyunEditor alloc] initWithPath:taskPath
                                             preview:self.preView];

Import videos from the draft box

The editing status is finally recorded in the draft box in the form of the project configuration. You can restore the editing status from the draft box as long as the project configuration file is provided. For more information, see Draft box.