Sunset Lake Software - Comments for "Load a movie &amp;gt; Filtering &amp;gt; Save to Camera Roll" http://www.sunsetlakesoftware.com/forum/load-movie-filtering-save-camera-roll Comments for "Load a movie > Filtering > Save to Camera Roll" en Thank you, Brad! http://www.sunsetlakesoftware.com/forum/load-movie-filtering-save-camera-roll#comment-1409 <p>Thank you, Brad!</p> pubDate Sun, 27 May 2012 06:34:28 +0000 dc:creator sigurdasson guid false comment 1409 at http://www.sunsetlakesoftware.com Your problem is that you're http://www.sunsetlakesoftware.com/forum/load-movie-filtering-save-camera-roll#comment-1408 <p>Your problem is that you're trying to save the movie to the library right after it starts recording, rather than when the movie is done. You need to place the movie saving code within the completion block.</p> pubDate Sat, 26 May 2012 20:33:01 +0000 dc:creator Brad Larson guid false comment 1408 at http://www.sunsetlakesoftware.com Thanks, Brad. I'm using the http://www.sunsetlakesoftware.com/forum/load-movie-filtering-save-camera-roll#comment-1404 <p>Thanks, Brad. I'm using the following code, but it still not working:</p> <p><div class="geshifilter"><pre class="geshifilter-cocoa">- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [picker dismissModalViewControllerAnimated:YES]; NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType]; &nbsp; if ([mediaType isEqualToString:@&quot;public.movie&quot;]){ NSURL *videoURL = [info objectForKey:UIImagePickerControllerMediaURL]; &nbsp; movieFile = [[GPUImageMovie alloc] initWithURL:videoURL]; movieFile.runBenchmark = YES; filter = [[GPUImageColorInvertFilter alloc] init]; [movieFile addTarget:filter]; &nbsp; NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@&quot;Documents/Movie.m4v&quot;]; unlink([pathToMovie UTF8String]); NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie]; &nbsp; movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(640.0, 480.0)]; [filter addTarget:movieWriter]; &nbsp; movieWriter.shouldPassthroughAudio = YES; movieFile.audioEncodingTarget = movieWriter; [movieFile enableSynchronizedEncodingUsingMovieWriter:movieWriter]; &nbsp; [movieWriter startRecording]; [movieFile startProcessing]; &nbsp; [movieWriter setCompletionBlock:^{ [filter removeTarget:movieWriter]; [movieWriter finishRecording]; }]; &nbsp; if ( UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(pathToMovie)) //without it not working too { UISaveVideoAtPathToSavedPhotosAlbum(pathToMovie, nil, NULL, NULL); NSLog(@&quot;Saving&quot;); } &nbsp; } }</pre></div></p> pubDate Thu, 24 May 2012 10:01:46 +0000 dc:creator sigurdasson guid false comment 1404 at http://www.sunsetlakesoftware.com Once the movie has been http://www.sunsetlakesoftware.com/forum/load-movie-filtering-save-camera-roll#comment-1399 <p>Once the movie has been recorded to disk, you can use code like the following to copy it into the user's media library:</p> <p>UISaveVideoAtPathToSavedPhotosAlbum(pathToMovie, nil, NULL, NULL);</p> pubDate Wed, 23 May 2012 14:31:31 +0000 dc:creator Brad Larson guid false comment 1399 at http://www.sunsetlakesoftware.com Thank you, Brad, great http://www.sunsetlakesoftware.com/forum/load-movie-filtering-save-camera-roll#comment-1398 <p>Thank you, Brad, great example! But I still have a question.<br /> What can I use for saving a movie to camera roll: movieWriter or something else?</p> pubDate Wed, 23 May 2012 10:29:22 +0000 dc:creator sigurdasson guid false comment 1398 at http://www.sunsetlakesoftware.com Look at the http://www.sunsetlakesoftware.com/forum/load-movie-filtering-save-camera-roll#comment-1397 <p>Look at the SimpleVideoFileFilter, it shows how to do the filtering to another file. From there, it's easy to write that movie into the user's media library.</p> pubDate Tue, 22 May 2012 15:45:14 +0000 dc:creator Brad Larson guid false comment 1397 at http://www.sunsetlakesoftware.com