I see a couple of things that do not look right.
First, you write directly to NSHomeDirectory , which returns an application directory that is not writable (see reference ). Either write to the Documents folder, or to the Library/Caches .
Secondly, I do not see how videoCameraFilter is videoCameraFilter . You must be sure to add it as a movieFile target
GPUImageMovie *movieFile = [[GPUImageMovie alloc] initWithURL:sampleURL]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *pathToMovie = [documentsDirectory stringByAppendingPathComponent:@"filtered-movie.m4v"]; unlink([pathToMovie UTF8String]); NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie]; GPUImageMovieWriter *movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(1920.0, 1080.0)]; GPUImageBoxBlurFilter * videoCameraFilter = [[GPUImageBoxBlurFilter alloc] init];
* EDIT:
Have you tried making the moviePlayer property / ivar as @SAMIR RATHOD suggested? The fact that moviePlayer remains there with endless buffering is most likely due to the fact that it does not persist.
add a property to your viewController interface:
@property (nonatomic, strong) MPMoviePlayerController *moviePlayer;
and create an instance of MPMoviewPlayerController :
self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
source share