我想写通过AVAssetWriter
创建的视频文件,它抛出以下错误:AVAssetWriter显示URL错误
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[AVAssetWriter initWithURL:fileType:error:] invalid parameter not satisfying: [outputURL isFileURL]'
我的代码如下:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *savedVideoPath = [documentsDirectory stringByAppendingPathComponent:@"videoOutput"];
NSURL *url = [NSURL URLWithString:[appDelegate_.documentDirectory
stringByAppendingPathComponent:@"VideoRecording.mov"]];
NSError *error = nil;
videoWriter_ = [[AVAssetWriter alloc] initWithURL:url fileType:AVFileTypeQuickTimeMovie error:&error];
任何帮助将是明显的。提前致谢。