我正在尝试使用 AVAssetWriter 执行屏幕录制,它也接受音频输入。但是,我一直陷入这个错误,在appendSampleBuffer:(内部encodeAudioFrame:)进行几次调用后,AVAssetWriter有时会变成 AVAssetWriterStatusFailed
Failed: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x32b570 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x70d710 "The operation couldn\xe2\x80\x99t be completed. (OSStatus error -12737.)", NSLocalizedFailureReason=An unknown error occurred (-12737)}\nRun Code Online (Sandbox Code Playgroud)\n\n几点观察:
\n\n任何帮助将不胜感激。
\n\n下面是我正在使用的代码,为简洁起见,省略了几个部分。我目前使用的是 OSX 10.9 SDK,ARC 已关闭。
\n\n- (BOOL) startRecording\n{\n if (!isRecording)\n {\n dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{\n [self startCapture];\n\n [self setUpWriter];\n\n startedAt = [NSDate date];\n isRecording …Run Code Online (Sandbox Code Playgroud) macos objective-c avfoundation avcapturesession avassetwriter