Osstatus Error 12124
here for a quick overview of the site Help Center Detailed answers to any exportasynchronouslywithcompletionhandler swift questions you might have Meta Discuss the workings and policies error domain=avfoundationerrordomain code=-11800 of this site About Us Learn more about Stack Overflow the company Business Learn more about avassetexportsession example 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 AVAssetExport fails for some files up vote 16 down vote favorite 1 I have tried to export audio file from the iPod-Library. My objective is to create new file in app Document folder with this iPod-Library file .Its fails to create files for some items only . Below is my code snippet. AVURLAsset *songAsset = [AVURLAsset URLAssetWithURL: url options:nil]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset: songAsset presetName: AVAssetExportPresetAppleM4A]; exporter.outputFileType = @"com.apple.m4a-audio"; NSString *songName = [filename stringByAppendingString:@".m4a"]; NSString *musicfilepath = [documentsDirectory stringByAppendingPathComponent:@"musics/"]; [[NSFileManager defaultManager] createDirectoryAtPath:musicfilepath withIntermediateDirectories:YES attributes:nil error:nil]; NSString *exportFile = [musicfilepath stringByAppendingPathComponent:songName]; NSError *error1; if([[NSFileManager defaultManager] fileExistsAtPath:exportFile]) { [[NSFileManager defaultManager] removeItemAtPath:exportFile error:&error1]; } NSURL* exportURL = [[NSURL fileURLWithPath:exportFile] retain]; exporter.outputURL = exportURL; Am getting Error as shown below when tried with the error handler block : [exporter exportAsynchronouslyWithCompletionHandler:^{ int exportStatus = exporter.status; switch (exportStatus) { case AVAssetExportSessionStatusFailed: { NSError *exportError = exporter.error; NSLog (@"AVAssetExportSessionStatusFailed: %@", exportError); break; } } }]; AVAssetExportSessionStatusFailed: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x214f20 {NSLocalizedFailureReason=An unknown error occurred (-12124), NSUnderlyingError=0x218270 "The operation couldn’t be completed. (OSStatus error
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 http://stackoverflow.com/questions/11308456/avassetexport-fails-for-some-files is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error in extracting audio from .m4v video file up vote 2 down vote favorite I am trying to extract the audio file from .m4v video. It shows the error like, http://stackoverflow.com/questions/21572728/error-in-extracting-audio-from-m4v-video-file Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x15e350d0 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x15d1c6b0 "The operation couldn’t be completed. (OSStatus error -12124.)", NSLocalizedFailureReason=An unknown error occurred (-12124)} This is my code: -(void)extractAudioFromVideo{ //Create a audia composition and add audio track AVMutableComposition *newAudioAsset = [AVMutableComposition composition]; AVMutableCompositionTrack *dstCompositionTrack = [newAudioAsset addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; //Get video asset from which the audio should be extracted NSURL *url = [[NSBundle mainBundle] URLForResource:@"sample_iPod" withExtension:@"m4v"]; AVAsset *srcAsset = [AVAsset assetWithURL:url]; NSArray *trackArray = [srcAsset tracksWithMediaType:AVMediaTypeAudio]; if(!trackArray.count){ NSLog(@"Track returns empty array for mediatype AVMediaTypeAudio"); return; } AVAssetTrack *srcAssetTrack = [trackArray objectAtIndex:0]; //Extract time range CMTimeRange timeRange = srcAssetTrack.timeRange; //Insert audio from the video to mutable avcomposition track NSError *err = nil; if(NO == [dstCompositionTrack insertTimeRange:timeRange ofTrack:srcAssetTrack atTime:kCMTimeZero error:&err]){ NSLog(@"Failed to insert audio from the video to mutable avcomposition track"); return; } //Export the avcompostion track to destination path NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex: 0]; NSString *dstPath
Sign in Pricing Blog Support Search GitHub This repository Watch 5 Star 15 Fork 7 an-rahulpandey/ios-audio-picker Code Issues 4 Pull requests 0 Projects 0 Pulse Graphs New issue Add Music only shows Playlists #5 Open dwahila https://github.com/an-rahulpandey/ios-audio-picker/issues/5 opened this Issue Sep 17, 2015 · 10 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 2 participants dwahila commented Sep 17, 2015 ... and in each http://www.cocoachina.com/bbs/3g/read.php?tid=143235 of the playlists, there are 0 items to select. This is fresh install of the demo code, in a new cordova project. Only plugin installed is yours. I'm testing on an iPhone5 with iOS 8.4 (12H143). osstatus error I added a new playlist, and the plugin shows it, but does not show the songs contained inside it. Also, when the picker opens, I can see a list of menu items scroll off the top of the screen (Albums, Songs, Artists...), leaving only "Playlists" behind. Owner an-rahulpandey commented Sep 18, 2015 Check this out #4 . Owner an-rahulpandey commented Sep 18, 2015 Also you have to select the song by pressing the osstatus error 12124 '+' icon next to each songs, then press the done button. The plugin will copy the songs to app documents folder, then you can use Media plugin to play those songs. dwahila commented Sep 18, 2015 To clarify, I'm not seeing any songs listed. So I can't press '+' — literally on the add screen, I have one link, Playlists, and when I tap that, I have a list of playlists. Tapping any of those goes to an empty list. So I'm not sure if the cdvfile is needed... yet. Right now I just want to see my list of songs. Owner an-rahulpandey commented Sep 18, 2015 Are those songs present in the iCloud or local device? dwahila commented Sep 18, 2015 Good call! All the music on that phone was in the cloud. Downloaded some and they appeared. But the problem now is that even when I tap on it, it does not select/toggle it to be added. To recap, I have one album purchased form iTunes downloaded on the phone. I can open the picker, and see the songs, but I can't tap to select. It will not toggle it's state. In the debug console I see 2015-09-18 16:28:07.725 HelloCordova[5917:2281415] title = Aerodynamic Beats / Gabrielle, Forget About the World (Live) 2015-09-18 16:28:07.725 HelloCordova[
exportSession.status 如果使用真机(6.1)测试 返回Fail, AVAssetExportSessionStatusFailed == exportSession.status 有没有人知道怎么回事啊 求教啊 !!! lee7231392 回复于: 06-03 14:56 lee7231392 回复于: 06-04 09:57 AVAsset *asset = [AVAsset assetWithURL:audioFileInput]; NSError *writeError = nil; AVAssetWriter *assetWrite = [[AVAssetWriter assetWriterWithURL:audioFileOutput fileType:AVFileTypeAppleM4A error:&writeError] retain]; NSLog(@"writeError : %@ %d",writeError,assetWrite.status); AVAssetExportSession *exportSession = [AVAssetExportSession exportSessionWithAsset:asset presetName:AVAssetExportPresetAppleM4A]; if (exportSession == nil) { if(self.delegate && [self.delegate respondsToSelector:@selector(AudioExportFailedWithSourceFilePath:)]) { [self.delegate AudioExportFailedWithSourceFilePath:destMp3Path]; } return; } //trim CMTime startTime = CMTimeMakeWithSeconds(vocalStartMarker, 1); CMTime stopTime = CMTimeMakeWithSeconds(vocalEndMarker, 1); CMTimeRange exportTimeRange = CMTimeRangeFromTimeToTime(startTime, stopTime); exportSession.outputURL = audioFileOutput; exportSession.outputFileType = AVFileTypeAppleM4A; exportSession.timeRange = exportTimeRange; 我的大致方法是这样的有人能帮忙看看吗 . lee7231392 回复于: 06-04 09:58 [exportSession exportAsynchronouslyWithCompletionHandler:^{ if (AVAssetExportSessionStatusCompleted == exportSession.status) { if(self.delegate && [self.delegate respondsToSelector:@selector(AudioExportSuccedWithSourceFilePath:)]) { [self.delegate AudioExportSuccedWithSourceFilePath:destMp3Path]; } } else if (AVAssetExportSessionStatusFailed == exportSession.status) { if(self.delegate && [self.delegate respondsToSelector:@selector(AudioExportFailedWithSourceFilePath:)]) { [self.delegate AudioExportFailedWithSourceFilePath:destMp3Path]; } } }]; lee7231392 回复于: 06-04 10:25 Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x1d5a0490 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x1d59ebb0 "The operation