PoporFFmpegCommand
示例
要运行示例项目,请先克隆仓库,然后从Example目录运行pod install
。
要求
安装
PoporFFmpegCommand可通过CocoaPods获取。安装它,只需在Podfile中添加以下行:
pod 'PoporFFmpegCommand'
#import <PoporFFmpegCommand/PoporFFmpegCommand.h>
#import <mobileffmpeg/MobileFFmpegConfig.h>
#import <mobileffmpeg/MobileFFmpeg.h>
+ (void)executeCommand:(NSString * _Nonnull)ffmpegCommand finish:(void (^ __nullable)(BOOL executeFinish))finish {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//NSLog(@"FFmpeg process started with arguments\n\'%@\'\n", ffmpegCommand);
int result = [MobileFFmpeg execute:ffmpegCommand];
//NSLog(@"FFmpeg process exited with rc %d\n", result);
dispatch_async(dispatch_get_main_queue(), ^{
if (result == RETURN_CODE_SUCCESS) {
if (finish) {
finish(YES);
}
} else {
if (finish) {
finish(NO);
}
}
});
});
}
作者
wangkq, [email protected]
许可
PoporFFmpegCommand遵循MIT许可证。有关更多信息,请参阅LICENSE文件。