Cannot Be Saved To The Saved Photos Album Error Domain
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 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Unable to saving a video to photo library up vote 0 down vote favorite Here's my code: ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; NSURL *videoURL =[info objectForKey:UIImagePickerControllerMediaURL]; if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:videoURL]) { [library writeVideoAtPathToSavedPhotosAlbum:videoURL completionBlock:^(NSURL *assetURL, NSError *error) { if (error) { NSLog(@"error"); } else { NSLog(@"video assetUrl is %@", assetURL); } }]; } else NSLog(@"videoAtPath is not compatible with photos Album."); The videoURL is file:///private/var/mobile/Containers/Data/Application/B1F512EA-6D13-4DF1-86DB-F6166F0D533F/tmp/capture-T0x17511a30.tmp.pG4PbH/capturedvideo.MOV I keep getting error when saving the video to the saved photo album. And this is return message: Video /private/var/mobile/Containers/Data/Application/B1F512EA-6D13-4DF1-86DB-F6166F0D533F/tmp/capture-T0x17511a30.tmp.pG4PbH/capturedvideo.MOV cannot be saved to the saved photos album: Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo=0x1b3e5e40 {NSErrorFailingURLStringKey=file:///private/var/mobile/Containers/Data/Application/B1F512EA-6D13-4DF1-86DB-F6166F0D533F/tmp/capture-T0x17511a30.tmp.pG4PbH/capturedvideo.MOV, NSErrorFailingURLKey=file:///private/var/mobile/Containers/Data/Application/B1F512EA-6D13-4DF1-86DB-F6166F0D533F/tmp/capture-T0x17511a30.tmp.pG4PbH/capturedvideo.MOV, NSLocalizedDescription=The requested URL was not found on this server., NSUnderlyingError=0x1b2ce310 "The operation couldn’t be completed. No such file or directory", NSURL=file:///private/v
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 http://stackoverflow.com/questions/26447713/unable-to-saving-a-video-to-photo-library Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to Save Recorded video to camera roll? up vote 0 down vote favorite I am trying to http://stackoverflow.com/questions/36382057/how-to-save-recorded-video-to-camera-roll record video with iPhone camera and saving to camera roll following this blog. However, using AVCaptureSession ,camera gets initialized. But when try to save video to camera roll, it gives URL error. Here's my code snippet NSString *outputPath = [[NSString alloc] initWithFormat:@"%@%@", NSTemporaryDirectory(), @"myApp.mov"]; NSURL *outputURL = [NSURL URLWithString:outputPath]; // NSLog(@"Output URL %@ AND ABSOLUTE STRING %@",outputURL,outputURL.absoluteString); NSFileManager *fileManager = [NSFileManager defaultManager]; if ([fileManager fileExistsAtPath:outputPath]) { NSError *error; if ([fileManager removeItemAtPath:outputPath error:&error] == NO) { //Error - handle if requried } } //Start recording [MovieFileOutput startRecordingToOutputFileURL:outputURL recordingDelegate:self]; It gives the below error [AVCaptureMovieFileOutput startRecordingToOutputFileURL:recordingDelegate:] - Cannot record to URL /private/var/mobile/Containers/Data/Application/FEA51E75-B2A6-45DD-991B-AFFBF5794EAC/tmp/myApp.mov because it is not a file URL. But if I change URL to initFileURLWithPath, it gives another error. Video /private/var/mobile/Containers/Data/Application/B6876493-4354-4607-B348-63C5262AF2D9/tmp/myApp.mov cannot be saved to the saved photos album: Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo={NSErrorFailingURLStringKey=file:///private/var/mobile/Containers/Data/Application/B6876493-4354-4607-B348-63C5262AF2D9/tmp/myApp.mov, NSErr
but I cant get the video to save to camera roll. Here is my code so far - (void)downloadButtonPressed:(UIButton *)sender { if http://technology.ezeenow.com/posts/56174/Cannot_download_Instagram_video_to_camera_roll ([self.mediaModel.mediaType isEqualToString:@"video"]) { NSURL *videoURL = [NSURL URLWithString:_mediaModel.videoStandardResolutionURL]; if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(videoURL.path)) { NSLog(@"compatible"); } else { NSLog(@"not compatible"); } //UISaveVideoAtPathToSavedPhotosAlbum(videoPath, nil, nil, nil); } else { UIImageWriteToSavedPhotosAlbum(self.imageView.image, nil, nil, nil); } } First http://trello.info/question/view/en/YUhSMGNEb3ZMM04wWVdOcmIzWmxjbVpzYjNjdVkyOXRMM0YxWlhOMGFXOXVjeTh4TXpFek9ETTROUzlvYjNjdGRHOHRkWE5sTFdGMllYTnpaWFIzY21sMFpYSXRkRzh0ZDNKcGRHVXRhREkyTkMxemRISmxiUzFwYm5SdkxYWnBaR1Z2 I check is the media type is a video or not. If not then the image is straightforward to save. If not I check if the videoURL.path is compatible but this is cannot be where I get stuck and I get an error like this: Video /hphotos-xaf1/t50.2886-16/11803693_1632141970376671_10815617_n.mp4 cannot be saved to the saved photos album: Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo=0x7f8b48f25d00 {NSUnderlyingError=0x7f8b48f39f90 "The operation couldn’t be completed. No such file or directory", NSErrorFailingURLStringKey=file:///hphotos-xaf1/t50.2886-16/11803693_1632141970376671_10815617_n.mp4, NSErrorFailingURLKey=file:///hphotos-xaf1/t50.2886-16/11803693_1632141970376671_10815617_n.mp4, NSURL=file:///hphotos-xaf1/t50.2886-16/11803693_1632141970376671_10815617_n.mp4, NSLocalizedDescription=The requested URL was not found on this server.} Would really appreciate the help. Thanks alot!
cannot be saved Aug 27 Related posts How to avoid circular patterns in Node? Need sample AXML for Android Card content blocks When to use classes, and when to use POD (PDS) + functions Android running thread every 1 Second to Increment Unix Timestamp Get phone number by contact name Issue with Itunes Connect not sending out Beta invite email to External users Iis it possible to box own Datatypes in more than 1 Level In C language fscanf reads last number twice Android toast message not working Spinner selection won't populate edittext Recent Viewed Is it possible to stub startActivityForResult? Android: None of the following function can be called with arguments supplied (kotlin) how to use Offline googleMap in my app How do I build a message feed just like Apple's Messages app with Xcode? Can I use CocoaPods when creating a Cocoa Touch Framework? Posting my own hackathon [on hold] How to move from one fragment to another by countdown timer How to execute a piece of code at a time picked with UIDatePicker in Swift 2 Decrypt Apple Receipt C# iOS - How can I add my own ads (which SDstream from server to a video file, but when I used assetwrite.finishwrite, the XCode reportsVideo /var/mobile/Applications/DE4196F1-BB77-4B7D-8C20-7A5D6223C64D/Documents/test.mov cannot be saved to the saved photos album: Error Domain=NSOSStatusErrorDomain Code=-12847 "This movie format is not supported." UserInfo=0x5334830 {NSLocalizedDescription=This movie format is not supported.}"Below is my code:data is the h.264 frame, just one frame, it might be i frame or p.(void)_encodeVideoFrame2:(NSData *) data time:(double)tm {CMBlockBufferRef videoBlockBuffer=NULL;CMFormatDescriptionRef videoFormat=NULL;CMSampleBufferRef videoSampleBuffer=NULL;CMItemCount numberOfSampleTimeEntries=1;CMItemCount numberOfSamples=1;CMVideoFormatDescriptionCreate(kCFAllocatorDefault, kCMVideoCodecType_H264, 320, 240, NULL, &videoFormat);OSStatus result;result=CMBlockBufferCreateWithMemoryBlock(kCFAllocatorDefault, NULL, data.length, kCFAllocatorDefault, NULL, 0, data.length, kCMBlockBufferAssureMemoryNowFlag, &videoBlockBuffer);result=CMBlockBufferReplaceDataBytes(data.bytes, videoBlockBuffer, 0, data.length);CMSampleTimingInfo videoSampleTimingInformation={CMTimeMake(tm*600, 600)};size_t sampleSizeArray[1];sampleSizeArray[0]=data.length;result=CMSampleBufferCreate(kCFAllocatorDefault, videoBlockBuffer, TRUE, NULL, NULL, videoFormat, numberOfSamples, numberOfSampleTimeEntries, &videoSampleTimingInformation, 1, sampleSizeArray, &videoSampleBuffer);result = CMSampleBufferMakeDataReady(videoSampleBuffer);[assetWriterInput appendSampleBuffer:videoSampleBuffer]; }maybe the CMSampleBufferCreate arguments are wrong? Thank you. 2 answers to this question Answer #1 Try this code(IBAction)createVideo:(id)sender {///////////// setup OR function def if we move this to a separate function ////////////// this should be moved to its own function, that can take an imageArray, videoOutputPath, etc...//- (void)exportImages:(NSMutableArray *)imageArray// asVideoToPath:(NSString *)videoOutputPath// withFrameSize:(CGSize)imageSize// framesPerSecond:(NSUInteger)fps {NSError *error = nil;// set up file manager, and file videoOutputPath, remove "test_output.mp4" if it exists...//NSString *videoOutputPath = @"/Users/someuser/Desktop/test_output.mp4";NSFileManager *fileMgr = [NSFileManager defaultManager];NSString *documentsDirectory = [NSHomeDirectory()stringByAppendingPathComponent:@"Documents"];NSString *videoOutputPath = [documentsDirectory stringByAppendingPathComponent:@"test_output.mp4"];//NSLog(@"-->videoOutputPath= %@", videoOutputPath);// get rid of existing mp4 if exists...if ([fileMgr removeItemAtPath:videoOutpu