一个轻量级工具,可以将UIlmage数组转换为电影,用Objective-C编写。
将这些图像
转换为这部电影
通过CocoaPods可以获取EKMovieMaker。要安装它,只需将以下行添加到Podfile中
pod "EKMovieMaker", '~> 0.0.1'
#import <EKMovieMaker.h>
- (void)viewDidLoad {
[super viewDidLoad];
NSArray *images = @[
[UIImage imageNamed:@"image1.jpg"],
[UIImage imageNamed:@"image2.jpg"],
[UIImage imageNamed:@"image3.jpg"],
[UIImage imageNamed:@"image4.jpg"],
[UIImage imageNamed:@"image5.jpg"]
];
EKMovieMaker movieMaker = [[EKMovieMaker alloc] initWithImages:self.images];
movieMaker.movieSize = CGSizeMake(400.0f, 200.0f);
movieMaker.framesPerSecond = 60.0f;
movieMaker.frameDuration = 3.0f;
[movieMaker createMovieWithCompletion:^(NSString *moviePath) {
NSLog(@"Movie path => %@", moviePath);
}];
}
Ekhoo, [email protected]
与MIT许可证下,有关更多信息,请参阅LICENSE文件。