Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use GPUImage framework only that you are using... that is best framework until now for video filters. GO through the documentation of the framework <a href="https://github.com/BradLarson/GPUImage" rel="nofollow">https://github.com/BradLarson/GPUImage</a> scroll down the page you will find the details of the filters available...</p> <p>this filters are applied on the video and to write the video you have to use the GPUImageMovieWriter class...It automatically handles audio ..</p> <p>you don't have to maintain it...Use shouldPassThroughAudio property of GPUImageMovieWriter and it will manage the audio on its own.</p> <p>Use this tutorial for help <a href="http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework" rel="nofollow">http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework</a></p> <p>Here is the code where I am using GPUImage framework to crop the video and audio is stored not removed after editing.</p> <p>NSURL *videoUrl = [selectedAsset defaultRepresentation].url;</p> <pre><code>GPUImageMovie *movieUrl = [[GPUImageMovie alloc] initWithURL:videoUrl]; self.cropFilter = [[GPUImageCropFilter alloc] initWithCropRegion:videoArea]; movieUrl.runBenchmark = YES; movieUrl.playAtActualSpeed = YES; [movieUrl addTarget:self.cropFilter]; //Setting path for temporary storing the video in document directory NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *myPathDocs = [documentsDirectory stringByAppendingPathComponent: [NSString stringWithFormat:@"CroppedVideo-%d.mov",arc4random() % 1000]]; NSURL *movieURL = [NSURL fileURLWithPath:myPathDocs]; AVURLAsset *asset = [AVURLAsset URLAssetWithURL:videoUrl options:nil]; AVAssetTrack *videoAssetTrack = [[asset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; CGAffineTransform videoTransform = videoAssetTrack.preferredTransform; movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(videoAssetTrack.naturalSize.width, videoAssetTrack.naturalSize.height)]; [_cropFilter addTarget:movieWriter]; movieWriter.shouldPassthroughAudio = YES; movieUrl.audioEncodingTarget = movieWriter; [movieUrl enableSynchronizedEncodingUsingMovieWriter:movieWriter]; [self.movieWriter startRecordingInOrientation:videoTransform]; [self.movieWriter startRecording]; [movieUrl startProcessing]; __block BOOL completeRec = NO; __unsafe_unretained typeof(self) weakSelf = self; [self.movieWriter setCompletionBlock:^{ [weakSelf.cropFilter removeTarget:weakSelf.movieWriter]; [weakSelf.movieWriter finishRecording]; [movieUrl removeTarget:weakSelf.cropFilter]; if (!completeRec) { [weakSelf videoCropDoneUrl:movieURL]; completeRec = YES; } }]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload