简体   繁体   中英

Screen video recording at Mac OS X

I'm working with AVFoundation to record screen or part of screen. Here 2 code samples for which i work.

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

Simple fullscreen recording or recording with cropping rect just fine, but when i'm trying to change rect while recording, i'm getting error:

Did finish recording to file://localhost/Users/Shared/screenMovie.mp4 due to error Error Domain=AVFoundationErrorDomain Code=-11806 "Recording Stopped" UserInfo=0x13a07f9e0 {AVErrorRecordingSuccessfullyFinishedKey=true, NSLocalizedDescription=Recording Stopped, NSLocalizedRecoverySuggestion=Try recording again.}

Apple documentation says about error with code -11806:

AVErrorSessionConfigurationChanged Recording stopped because the configuration of media sources and destinations changed.

I can't find any info in docs about it. i have suggestion, that i can't change rect while recording. But at the same time i can't find any proof about it.

When you change the rect while recording, the recording format changes and it can't continue to record to same output. However, you can continue recording to a new file.

- (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

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM