BradLarson / GPUImage

An open source iOS framework for GPU-based image and video processing
http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
BSD 3-Clause "New" or "Revised" License
20.25k stars 4.61k forks source link

Add filters on Already recorded video #2429

Open jaskiratSeraphic opened 7 years ago

jaskiratSeraphic commented 7 years ago

Please tell me about how can i add the filter on already recorded video. Seems, I found the steps to resolve the issue in GPUImage documentation but it unable to resolve my problem.

`movieFile = [[GPUImageMovie alloc] initWithURL:sampleURL]; pixellateFilter = [[GPUImagePixellateFilter alloc] init];

[movieFile addTarget:pixellateFilter];

NSString pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Movie.m4v"]; unlink([pathToMovie UTF8String]); NSURL movieURL = [NSURL fileURLWithPath:pathToMovie];

movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(480.0, 640.0)]; [pixellateFilter addTarget:movieWriter];

movieWriter.shouldPassthroughAudio = YES; movieFile.audioEncodingTarget = movieWriter; [movieFile enableSynchronizedEncodingUsingMovieWriter:movieWriter];

[movieWriter startRecording]; [movieFile startProcessing];

[pixellateFilter removeTarget:movieWriter]; [movieWriter finishRecording];`

It save the Zero byte video in my document directory. Please tell me the Answer Thanks,