You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to create with
mp4-》filter↘️
mp4 —》alphaBlend ↘️
GPUImageUIElement -》alphaBlend -》GPUImageView
a thought from this one trace
`
self.movieFile = [[THImageMovie alloc]initWithURL:self.movieFileURL];//PlayerItem:playItem];
self.movieFile.runBenchmark = YES;
self.movieFile.playAtActualSpeed = YES;
self.filter = [[GPUImageToonFilter alloc] init];
GPUImageAlphaBlendFilter *alphaBlendFilter = [[GPUImageAlphaBlendFilter alloc]init];
[alphaBlendFilter setMix:0.5];
self.secondMovie = [[THImageMovie alloc]initWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Yh1" ofType:@"mp4"]]];
self.secondMovie.runBenchmark = YES;
self.secondMovie.playAtActualSpeed = YES;
UIView *contentView = [self uielementView];
self.uiElementInput = [[GPUImageUIElement alloc]initWithView:contentView];
//输入
[self.movieFile addTarget:self.filter];
@weakify(self);
//输过程
[self.filter addTarget:alphaBlendFilter];
// [self.uiElementInput addTarget:alphaBlendFilter];
[self.secondMovie addTarget:alphaBlendFilter];
GPUImageTwoInputFilter *twoInputFilter = [[GPUImageTwoInputFilter alloc]init];
[self.uiElementInput addTarget:twoInputFilter];
[alphaBlendFilter addTarget:twoInputFilter];
[self.filter setFrameProcessingCompletionBlock:^(GPUImageOutput *output, CMTime frameTime) {
LxDBAnyVar(frameTime);
}];
NSArray *thMovies = @[self.movieFile,self.secondMovie];
// In addition to displaying to the screen, write out a processed version of the movie to disk
NSString *pathToMovie = [self movieSavedPath];
unlink([pathToMovie UTF8String]); // If a file already exists, AVAssetWriter won't let you record new frames, so delete the old movie
NSURL *movieURL = [NSURL fileURLWithPath:pathToMovie];
LxDBAnyVar(self.mutableVideoComposition.renderSize);
self.movieWriter = [[THImageMovieWriter alloc] initWithMovieURL:movieURL size:self.mutableVideoComposition.renderSize movies:thMovies];
GPUImageView *filterView = self.movieImageView;
[twoInputFilter addTarget:filterView];
[twoInputFilter addTarget:self.movieWriter];
// Configure this for video from the movie file, where we want to preserve all video frames and audio samples
//渲染
[self.movieFile startProcessing];
[self.secondMovie startProcessing];
[self.movieWriter startRecording];
[self.movieWriter setCompletionBlock:^{
@strongify(self);
LxDBAnyVar(@"record complete");
[self.filter removeTarget:self.movieWriter];
[self.movieFile endProcessing];
[self.secondMovie endProcessing];
[self.movieWriter finishRecording];
[movieURL saveToCameraRollWithCompletion:^(NSString * _Nullable path, NSError * _Nullable error) {
LxDBAnyVar(@"save complete");
LxDBAnyVar(error);
}];
[subscriber sendNext:nil];
[subscriber sendCompleted];
}];`
but it can't work out.
I've try mp4+mp4 ,it works well,and mp4+ uielement too.
can someone help with this,vary vary thanks.
By the way ,the THImageMovie is a class that subclass GPUImageMovie which help with write the audioTrack.
The text was updated successfully, but these errors were encountered:
I need to create with↘️ ↘️
mp4-》filter
mp4 —》alphaBlend
GPUImageUIElement -》alphaBlend -》GPUImageView
a thought from this one trace
`
self.movieFile = [[THImageMovie alloc]initWithURL:self.movieFileURL];//PlayerItem:playItem];
self.movieFile.runBenchmark = YES;
self.movieFile.playAtActualSpeed = YES;
self.filter = [[GPUImageToonFilter alloc] init];
but it can't work out.
I've try mp4+mp4 ,it works well,and mp4+ uielement too.
can someone help with this,vary vary thanks.
By the way ,the THImageMovie is a class that subclass GPUImageMovie which help with write the audioTrack.
The text was updated successfully, but these errors were encountered: