2014-07-04 2 views
1

저는 AVAssetExportSession을 사용하여 정사각형 비디오를 자르려고했습니다. 그러나 어떤 이유로 난 그냥이 오류가 계속 : 애플의 웹 사이트에서OSStatus 오류 -12769?

Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x1a03be70 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x1a04c5e0 "The operation couldn’t be completed. (OSStatus error -12769.)", NSLocalizedFailureReason=An unknown error occurred (-12769)} 

을 나는 -11800OSStatus error -12769에 대한 알 수없는 오류,하지만 것을 발견? 인터넷상의 모든 곳을 검색했으며이 오류 코드와 관련된 질문이나 문제점을 보지 못했습니다. 도와주세요. 감사! 여기

내 코드 :

AVAsset *asset = [[AVURLAsset alloc]initWithURL:self.originalVidUrl options:nil]; 
AVAssetTrack *clipVideoTrack = [[asset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; 
if (clipVideoTrack.naturalSize.width==clipVideoTrack.naturalSize.height) { 
    NSLog(@"Square video"); 
    NSArray *presets = [AVAssetExportSession exportPresetsCompatibleWithAsset:asset]; 
    if ([presets containsObject:AVAssetExportPresetHighestQuality]) { 
     self.exportSession = [[AVAssetExportSession alloc]initWithAsset:asset presetName:AVAssetExportPresetHighestQuality]; 
     self.exportSession.outputURL = [NSURL fileURLWithPath: self.tmpVidPath]; 
     self.exportSession.outputFileType = AVFileTypeMPEG4; 
     CMTime start = ... 
     CMTime duration = ... 
     CMTimeRange range = CMTimeRangeMake(start, duration); 
     self.exportSession.timeRange = range; 
     [self.exportSession exportAsynchronouslyWithCompletionHandler:^{ 
      switch ([self.exportSession status]) { 
       case AVAssetExportSessionStatusFailed: 
        NSLog(@"%@",self.exportSession.error); 
        break; 
       case AVAssetExportSessionStatusCancelled: 
        NSLog(@"Export canceled"); 
        break; 
       default: 
        NSLog(@"Export Success, File Saved."); 
        break; 
      } 
     }]; 
    } 
} 

P.S. 이 코드는 기본 카메라 앱 (비 정사각형/비 처리 동영상)으로 찍은 동영상에 적용됩니다.

답변

4

솔루션을 찾은 것 같지만 왜 또는 어떻게 작동하는지 전혀 알 수 없습니다.

프리셋 이름을 AVAssetExportPresetHighestQuality에서 AVAssetExportPreset1280x720으로 변경하기 만하면됩니다.

+0

이 문제는 너무 .. –

+0

비디오의 원래 해상도를 유지해야합니다. 그렇지 않으면 고쳐야 할 아이디어가 있습니까? – Xys

관련 문제