簡體   English   中英

在Mac OS X上進行屏幕錄像

[英]Screen video recording at Mac OS X

我正在使用AVFoundation來錄制屏幕或部分屏幕。 這里有兩個我工作的代碼示例。

1. http://developer.apple.com/library/mac/#samplecode/AVScreenShack/Listings/AVScreenShack_AVScreenShackDocument_m.html

2. http://developer.apple.com/library/mac/#qa/qa1740/_index.html

簡單的全屏錄制或使用裁剪矩陣錄制就好了,但是當我在錄制時嘗試更改矩形時,我收到錯誤:

完成錄制到文件://localhost/Users/Shared/screenMovie.mp4由於錯誤錯誤Domain = AVFoundationErrorDomain Code = -11806“Recording Stopped”UserInfo = 0x13a07f9e0 {AVErrorRecordingSuccessfullyFinishedKey = true,NSLocalizedDescription =錄制已停止,NSLocalizedRecoverySuggestion =再次嘗試錄制}

Apple文檔說明了代碼為-11806的錯誤:

AVErrorSessionConfigurationChanged由於媒體源和目標的配置已更改,因此錄制停止。

我在文檔中找不到任何關於它的信息。 我有建議,錄音時我不能改變矩形。 但與此同時,我找不到任何關於它的證據。

錄制時更改矩形時,錄制格式會發生變化,無法繼續錄制到同一輸出。 但是,您可以繼續錄制到新文件。

- (void)captureOutput:(AVCaptureFileOutput *)captureOutput didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL fromConnections:(NSArray *)connections error:(NSError *)error {

// Check for error
// If an error occurred and AVErrorRecordingSuccessfullyFinishedKey is YES, then
// start recording to a new file here

}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM