2017-07-18 19 views
0

我正在尝试使用图像/音频创建电影文件。音频输出格式属性,AVAssetWriter错误代码561211770

{ AVFormatIDKey : @(kAudioFormatMPEG4AAC), AVEncoderBitRateKey : @120000, AVNumberOfChannelsKey : @1, AVSampleRateKey : @44100.0 }; 

视频输出格式属性,

{ AVVideoCodecKey : AVVideoCodecH264, AVVideoWidthKey : @(600), AVVideoHeightKey : @(400) }; 

当我做finishWritingWithCompletionHandler上AVAssetWriter我得到7完全相同的代码工作于iPhone 4s/5S iPhone上的此错误消息。

没有保存由于错误错误域= AVFoundationErrorDomain 代码= -11800 “操作无法完成” 的UserInfo = {NSLocalizedDescription =无法完成操作, NSUnderlyingError = {0x14e1eb90误差区域= NSOSStatusErrorDomain 代码= 561211770 “(空)”},NSLocalizedFailureReason =未知错误 发生(561211770)}

什么的此特定错误代码的含义?谢谢。

回答

0

前段时间我和它合作过。这是我使用的设置:

settings = [NSDictionary dictionaryWithObjectsAndKeys: 
             [ NSNumber numberWithInt: kAudioFormatMPEG4AAC], AVFormatIDKey, 
             [ NSNumber numberWithInt: ch], AVNumberOfChannelsKey, 
             [ NSNumber numberWithFloat: rate], AVSampleRateKey, 
             [ NSNumber numberWithInt: 64000 ], AVEncoderBitRateKey, 
      nil]; 

从基本视频接收的NumberOfChannels和SampleRate。