我正在创建一个带有动画图像的视频文件。我跟踪导出进度和状态,但是在导出进度达到 1.0 完成回调后不会调用,并且导出状态仍然等于“AVAssetExportSessionStatusExporting”。
AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:movieAsset presetName:AVAssetExportPresetMediumQuality];
self.session = exportSession;
[exportSession release];
session.videoComposition = self.videoComposition;
NSString *filePath = NSTemporaryDirectory();
NSString *fileName = [[@"Output_" stringByAppendingString:number] stringByAppendingString:@".mov"];
filePath = [filePath stringByAppendingPathComponent:fileName];
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
[[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];
}
session.fileLengthLimit = 1024 * 1024 * 10;
session.outputURL = [NSURL fileURLWithPath:filePath];
session.outputFileType = AVFileTypeQuickTimeMovie;
[session exportAsynchronouslyWithCompletionHandler:^{
dispatch_async(dispatch_get_main_queue(), ^{
[self exportDidFinish];
});
}];
它实际上是在创建一个不可读的输出文件。我想看到一些错误消息,但error
导出会话的属性保持为空。