Osstatus Error 12780
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error recording to movie file with AVFoundation up vote 1 down vote favorite 1 This is a strange problem. I have not changed any code involving this in my project but my video recording has randomly stopped working. When I try to save to a movie to a file I get the following error: Error Domain=NSOSStatusErrorDomain Code=-12780 "The operation couldn’t be completed. (OSStatus error -12780.)" I start my capture with the following code: - (void)initVideoCapture { self.captureSession = [[AVCaptureSession alloc] init]; AVCaptureDevice *videoCaptureDevice = [self frontFacingCameraIfAvailable]; AVCaptureDeviceInput *videoInput = [AVCaptureDeviceInput deviceInputWithDevice:videoCaptureDevice error:nil]; [self.captureSession addInput:videoInput]; aMovieFileOutput = [[AVCaptureMovieFileOutput alloc] init]; [self.captureSession addOutput:aMovieFileOutput]; [self detectVideoOrientation:aMovieFileOutput]; [self.captureSession setSessionPreset:AVCaptureSessionPresetMedium]; [self.captureSession startRunning]; } I then call this method from the viewController to start recording: - (void) startRecord { NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init]; [outputFormatter setDateFormat:@"yyyyMMddHHmmss"]; NSString *newDateString = [outputFormatter stringFromDate:[NSDate date]]; [outputFormatter release]; NSString * fileString = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.mov",newDateString]]; recordFileURL = [[NSURL alloc] initFileURLWithPath:fileString]; [aMovieFileOutput startRecordingToOutputFileURL:recordFileURL recordingDelegate:self]; } At this time I get the error in this function. (void)captureOutput:(AVCaptureFileOutput *)captureOutput didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL fromConnections:(NSArray *)connections error:(NSError *)error What is really weird is that it randomly works so
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a http://stackoverflow.com/questions/7535113/error-recording-to-movie-file-with-avfoundation community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up OSStatus error - 12780 when invoking insertTimeRange:ofTrack:atTime:error: of AVMutableCompositionTrack for the second time up vote 6 down vote favorite 3 First of all I have to say that I love this forum, it helped http://stackoverflow.com/questions/5961654/osstatus-error-12780-when-invoking-inserttimerangeoftrackattimeerror-of-av/33920096 me so many time. I have a problem and I couldn't find an answer to it anywhere so this is my first question here. My problem is this: I have a video represented by AVPlayerItem, the user can edit the video start time using the cutBefore button that cuts the video to the left of the slider The method responsible for cutting the video is the following: - (void)CutBeforeAction { AVMutableComposition *composition = [AVMutableComposition composition]; // Get the audio and video tracks of the video AVMutableCompositionTrack *compositionVideoTrack = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; AVMutableCompositionTrack *compositionAudioTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; // Calculate the new duration CMTime currStartTime = _player.currentItem.currentTime; CMTime endTime = _player.currentItem.duration; CMTimeRange range = CMTimeRangeFromTimeToTime(currStartTime, endTime); // Insert the new duration to the tracks NSError *error = nil; [compositionVideoTrack insertTimeRange:range ofTrack:[[_player.currentItem.asset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] atTime:kCMTimeZero error:&error]; [compositionAudioTrack insertTimeRange:range ofTrack:[[_player.currentItem.asset tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0] atTime:kCMTimeZero error:&error]; // Create a new AVPlayerItem with the new composition AVPlayerItem *item = [AVPlayerItem playerItemWithAsset:composition]; [self setPlayerItem:item]; [_pla
of AVMutableCompositionTrack for the second time Tags: iphone video http://www.4answered.com/questions/view/5af7b6/OSStatus-error-12780-when-invoking-insertTimeRangeofTrackatTimeerror-of-AVMutableCompositionTrack-for-the-second-time edit By : Sahar Source: Stackoverflow.com Question! First of http://lists.apple.com/archives/cocoa-dev/2011/Apr/msg00799.html all I have to say that I love this forum, it helped me so many time. I have a problem and I couldn't find an answer to it anywhere so this is my first question here. My osstatus error problem is this: I have a video represented by AVPlayerItem, the user can edit the video start time using the cutBefore button that cuts the video to the left of the slider The method responsible for cutting the video is the following: - (void)CutBeforeAction { AVMutableComposition *composition osstatus error 12780 = [AVMutableComposition composition]; // Get the audio and video tracks of the video AVMutableCompositionTrack *compositionVideoTrack = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; AVMutableCompositionTrack *compositionAudioTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; // Calculate the new duration CMTime currStartTime = _player.currentItem.currentTime; CMTime endTime = _player.currentItem.duration; CMTimeRange range = CMTimeRangeFromTimeToTime(currStartTime, endTime); // Insert the new duration to the tracks NSError *error = nil; [compositionVideoTrack insertTimeRange:range ofTrack:[[_player.currentItem.asset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] atTime:kCMTimeZero error:&error]; [compositionAudioTrack insertTimeRange:range ofTrack:[[_player.currentItem.asset tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0] atTime:kCMTimeZero error:&error]; // Create a new AVPlayerItem with the new composition AVPlayerItem *item = [AVPlayerItem playerItemWithAsset:composition]; [self setPlayerItem:item]; [_player replaceCurrentItemWithPlayerItem:item]; // change the player location to the beginning of the video [_player seekToTime:CMTimeMakeWithSeconds(0, 1)]; [self syncTimeLabel]; [self syncScrubber]; } When running the - (void)cutBefore method for the firs time it works fine, when I run it for the second time (the video has been already edited once) the [compositionVideoTrack insertTimeRange:range ofTrack:[[
& Media Library Assets From: Joshua Tidsbury