我试图让video过滤工作

我试过GPUImage库中的例子。 我尝试了'SimpleVideoFileFilter',但我看到它的滑动黑屏。 我试图通过我自己做同样的事情,我得到了完美的图像。 但我无法真正了解videostream程。 从项目本身拍摄video的例子? 从Mac文件夹? 或从iPhone的video? 我没有Apple开发者帐户,所以我无法真正在我的设备上进行testing。 我find了方法把一个随机(.m4v)文件在iPhone模拟器,并试图播放/过滤video。

有谁有这个问题? 我想现在只是从iPhone模拟器或资源文件播放video..我真的不知道它的作品在哪里。 我试过这个链接,没有运气。

下面是我们可以在GPUImage中find的示例的一部分:

- (void)viewDidLoad { [super viewDidLoad]; NSURL *sampleURL = [[NSBundle mainBundle] URLForResource:@"sample_iPod" withExtension:@"m4v"]; movieFile = [[GPUImageMovie alloc] initWithURL:sampleURL]; movieFile.runBenchmark = YES; movieFile.playAtActualSpeed = YES; filter = [[GPUImagePixellateFilter alloc] init]; // filter = [[GPUImageUnsharpMaskFilter alloc] init]; [movieFile addTarget:filter]; // Only rotate the video for display, leave orientation the same for recording GPUImageView *filterView = (GPUImageView *)self.view; [filter addTarget:filterView]; // In addition to displaying to the screen, write out a processed version of the movie to disk NSString *pathToMovie = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/TestMovie.m4v"]; 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]; movieWriter = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(640.0, 480.0)]; [filter addTarget:movieWriter]; // Configure this for video from the movie file, where we want to preserve all video frames and audio samples movieWriter.shouldPassthroughAudio = YES; movieFile.audioEncodingTarget = movieWriter; [movieFile enableSynchronizedEncodingUsingMovieWriter:movieWriter]; [movieWriter startRecording]; [movieFile startProcessing]; [movieWriter setCompletionBlock:^{ [filter removeTarget:movieWriter]; [movieWriter finishRecording]; }]; } 

简单的代码,应该过滤video..所有我从那里是黑色的屏幕与滑块..

我在谈论这个项目。

使用GPUImage,模拟器中的电影播放function目前不起作用。 你需要在实际的设备上运行这个工作。

我不确定为什么电影文件在模拟器中运行时不输出任何内容,但欢迎您深入研究GPUImageMovie代码,看看可能出现什么问题。 由于它在实际的硬件上运行时运行良好,所以它不是我的优先事项。