if (self.assetWriter.status == AVAssetWriterStatusUnknown ||
self.assetWriter.status == AVAssetWriterStatusCompleted ||
self.assetWriter.status == AVAssetWriterStatusCancelled ||
self.assetWriter.status == AVAssetWriterStatusFailed) {
}else {
[self.assetWriterVideoInput markAsFinished];
[self.assetWriterAudioInput markAsFinished];
[self.assetWriterAudioAppInput markAsFinished];
[self.assetWriter endSessionAtSourceTime:endTime];
}
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
__weak typeof(self)weakSelf = self;
[_encoder.assetWriter finishWritingWithCompletionHandler:^{
weakSelf.encoder.assetWriterVideoInput = nil;
weakSelf.encoder.assetWriterAudioInput = nil;
weakSelf.encoder.assetWriterAudioAppInput = nil;
weakSelf.encoder.assetWriter = nil;
dispatch_semaphore_signal(semaphore);
}];
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
Post
Replies
Boosts
Views
Activity
When I used
BOOL compatible = UIVideoAtPathIsCompatibleWithSavedPhotosAlbum([pathUrl path]);
if (compatible) {
UISaveVideoAtPathToSavedPhotosAlbum([pathUrl path], self, @selector(savedPhotoImage:didFinishSavingWithError:contextInfo:), nil);
}
to save video,but here is some error.
My phone has 33.72GB available and the video is only 4.2GB in size.
What should i do?
ps: I try to use [PHPhotoLibrary sharedPhotoLibrary] performChanges to save, but i got the same error. error code -3305.