ios exportAsynchronouslyWithCompletionHandler NSErrorFailingURLKey

я использую AVAssetExportSession и AVURLAsset, также связанную с ним импортированную библиотеку.

мой код

NSData *data = [NSData dataWithContentsOfURL:movieUrl];
            NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

            NSString  *documentsDirectory = [paths objectAtIndex:0];
           NSString *path = [NSString stringWithFormat:@"%@/%@", documentsDirectory,@"capturedvideo1.MOV"];
            NSURL *url = [NSURL URLWithString:path];
            [data writeToFile:path atomically:YES];
                       //Delete the original asset
            NSArray *paths1 = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

            NSString  *documentsDirectory1 = [paths1 objectAtIndex:0];
            NSString *path1 = [NSString stringWithFormat:@"%@/%@", documentsDirectory1,@"capturedvideo11.MOV"];
            NSURL *url1 = [NSURL URLWithString:path1];

            [self convertVideoToLowQuailtyWithInputURL:url outputURL:url1 handler:Nil];

- (void)convertVideoToLowQuailtyWithInputURL:(NSURL*)inputURL
                                   outputURL:(NSURL*)outputURL
                                     handler:(void (^)(AVAssetExportSession*))handler

{

    AVURLAsset *asset = [AVURLAsset URLAssetWithURL:inputURL options:nil];
    AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetMediumQuality];
    exportSession.outputURL = outputURL;
    if ([[UIApplication sharedApplication]canOpenURL:inputURL]){
        NSLog(@"open");
    }
    exportSession.outputFileType = AVFileTypeQuickTimeMovie;
    NSLog(@"%@", exportSession.error);
    [exportSession exportAsynchronouslyWithCompletionHandler:^(void)
     {
         if(exportSession.status != AVAssetExportSessionStatusCompleted){
             NSLog(@"%@", exportSession.error);
         }

     }];
}

Но я получаю ошибку ниже

    Error Domain=NSURLErrorDomain Code=-1 "unknown error" UserInfo=0x1da3aed0 
NSErrorFailingURLStringKey=/var/mobile/Applications/6EF91ECE-9E7A-4019-9F07-6DFE028EFFEA/Documents
/capturedvideo1.MOV, NSErrorFailingURLKey=/var/mobile/Applications/6EF91ECE-
9E7A-4019-9F07-6DFE028EFFEA/Documents/capturedvideo1.MOV, NSLocalizedDescription=unknown error, 
NSUnderlyingError=0x1da3ef70 "The operation couldn’t be completed. (OSStatus error -12935.)",
 NSURL=/var/mobile/Applications/6EF91ECE-9E7A-4019-9F07-6DFE028EFFEA/Documents/capturedvideo1.MOV}

Я хочу уменьшить размер видеофайла. Видео высокого качества.


person Mohammed Ebrahim    schedule 18.12.2012    source источник
comment
Связано: stackoverflow.com/questions/8089972/   -  person    schedule 18.12.2012
comment
Кроме того, пожалуйста, не злоупотребляйте тегом Xcode.   -  person    schedule 18.12.2012
comment
Проверьте свой ввод. Перед тем, как пытаться перекодировать CaptureVideo1.mov, проверьте, можете ли вы воспроизвести (файл) с помощью проигрывателя фильмов.   -  person danh    schedule 18.12.2012
comment
Удалось решить проблему? Подскажите, пожалуйста, как, если это возможно?   -  person Sufian    schedule 09.03.2013