2017-07-18 20 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。