Tag: gpuimage

在GPUImage iOS中不显示文本叠加

我正在尝试在video上叠加一些文字,至今尚未取得任何成效。 videoCamera = [[GPUImageStillCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack]; videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; cropFilter = [[GPUImageCropFilter alloc] initWithCropRegion:CGRectMake(0, 0, 1, 1)]; mCurrentImage = [UIImage imageNamed:@"tex16"]; sourcePicture = [[GPUImagePicture alloc] initWithImage:mCurrentImage smoothlyScaleOutput:NO]; [sourcePicture processImage]; customFilter = [[GPUFilter alloc] initWithFragmentShaderFromFile:@"shader"]; [videoCamera addTarget:cropFilter]; [cropFilter addTarget:customFilter atTextureLocation:0]; [sourcePicture addTarget:customFilter atTextureLocation:1]; [customFilter addTarget:mViewCameraPreview];//(GPUImageView*)mViewCameraPreview]; blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; blendFilter.mix = 1.0; UILabel *timeLabel […]

'GPUImageOutput <GPUImageInput>'没有可见的@interface声明select器'imageFromCurrentlyProcessedOutputWithOrientation:'

我负责pipe理其他人在我公司创build的旧项目,现在我必须使用XCode 5.1进行一些更改 事情是,即使它一年前(2013年春)编译好,它现在不编译。 该项目包含GPUImage库子项目。 这是XCode产生的错误: 'GPUImageOutput <GPUImageInput>'没有可见的@interface声明select器'imageFromCurrentlyProcessedOutputWithOrientation:' 当我尝试编译这两行时: if( self.grayScaleOutput ) { photo = [grayscaleFilter imageFromCurrentlyProcessedOutputWithOrientation:UIImageOrientationUp]; } else { photo = [blendFilter imageFromCurrentlyProcessedOutputWithOrientation:UIImageOrientationUp]; } 我甚至让Xcode 5.1改变了我的项目的一些设置(它build议我这样做),但没有运气。 任何提示? 任何设置我需要激活? 一些ARC的苦难,它可能仍然在我的旧的代码行? 注意:我已经replace了我使用的1年前的GPUImage库,以及刚刚从GitHUB下载的GPUImage库。 也没有运气。

神秘的应用程序与OpenGL崩溃

我正在使用GPUIImage库来开发iOS相机应用程序。 有时,当应用程序在2-3分钟后暂停时,Xcode会在应用程序中给我一个崩溃,指向方法中的行: – (void)presentBufferForDisplay; { [self.context presentRenderbuffer:GL_RENDERBUFFER]; } 什么可能是这次事故的原因? 我有一个非常长的相机设置,代码本身在GPUImageContext类。 我可能在这里做错了什么?

我如何修改GPUImageGaussianSelectBlurFilter在矩形而不是圆上操作?

我已经使用了GPUImage框架来模拟类似于Instagram应用程序的模糊效果,在这个模式下,我已经为从图片库中获取图片做了一个观察,然后对它作了一个效果。 其中一个影响是select性模糊效果,其中只有一小部分图像清晰,其余部分模糊。 GPUImageGaussianSelectiveBlurFilterselect图像的圆形部分不被模糊。 我怎样才能改变这一点,使锐利的区域形状是矩形?

GPUImagePicture与imageFromCurrentlyProcessedOutput不会得到UIImage

我正在使用GPUImage处理本地照片,我正在使用它来初始化: localImageSource = [[GPUImagePicture alloc] initWithImage:selectedImage]; 然后我添加filter,我可以在屏幕上看到它。 问题是我需要UIImage来保存它,但是当我打电话时: [localImageSource imageFromCurrentlyProcessedOutput] 我什么也得不到 请帮忙!

无法使用GPUImage编辑video

我使用AVFoundation创build了video,现在我想通过GPUImage框架进行编辑。 我在这里提到了所有的设置。 看到他的“SimpleVideoFileFilter”的例子后,我刚刚复制他的代码,并replace我的video资产URL。 这是代码。 movieFile = [[GPUImageMovie alloc] initWithURL:player.contentURL]; 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]; NSLog(@"precess started"); [movieWriter setCompletionBlock:^{ [pixellateFilter removeTarget:movieWriter]; […]

初始化The Amazing Audio Engine后,没有录像中的audio(使用GPUImage)

我在我的项目中使用了两个第三方工具。 一个是“惊人的audio引擎” 。 我使用这个audiofilter。 另一个是GPUImage,或者更具体地说是GPUImageMovieWriter 。 当我录制video时,我将录音与video合并在一起。 这工作正常。 但是,有时我不使用惊人的audio引擎,只使用GPUImageMovieWriter录制一个正常的video。 问题是,即使在初始化“惊人的audio引擎”之后,video在开始时只有一小部分的audio,然后audio消失了。 + (STAudioManager *)sharedManager { static STAudioManager *manager = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ if (!manager) { manager = [[STAudioManager alloc] init]; manager.audioController = [[AEAudioController alloc] initWithAudioDescription:[AEAudioController nonInterleaved16BitStereoAudioDescription] inputEnabled:YES]; manager.audioController.preferredBufferDuration = 0.005; manager.audioController.voiceProcessingEnabled = YES; manager.audioController.useMeasurementMode = YES; } }); return manager; } TAAE初始化时发生了一些事情。 我怀疑这是AVAudioSession的事情,因为它是一个sharedInstance。 […]

如何减lessGPUImageGaussianSelectBlurFilter效果中的内存消耗?

我正在使用GPUImage框架实现GPUImageGaussianSelectiveBlurFilter效果。 现在GPUImageGaussianSelectiveBlurFilter效果已经实现了,但是内存消耗太多了。我知道通过forceProcessingAtSize方法可以减less一些内存消耗,但是减less内存消耗太less了。 如果processImage方法没有被调用,内存消耗会减less很多,那么如何用另一个方法来replace呢? 如何减less内存消耗? #import "ViewController.h" #import "GPUImage.h" @interface ViewController () { UIImageView *captureImageView; UIScrollView *scrollView; GPUImageView *imageViewGpu; GPUImageGaussianSelectiveBlurFilter *filter; BOOL filterFalg; } @end @implementation ViewController -(void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor clearColor]; // create scrollView scrollView = [[UIScrollView alloc] initWithFrame:self.view.frame]; [self.view addSubview:scrollView]; scrollView.minimumZoomScale = 1.0; scrollView.maximumZoomScale = 3.0; scrollView.delegate = self; scrollView.showsHorizontalScrollIndicator = […]

GPUImageAlphaBlendFilter从GPUImageStillCamera源实时处理

我正在使用GPUImage库,我试图实时混合两个图像,并将它们显示在GPUImageView 。 我正在尝试将纯相机input与其过滤版本进行alpha混合。 这是我想要做的: —————–>—-v –camera–| alpha blend —-> image view —–> color filter –^ 我发现了一些关于使用混合filter的文章,但是他们似乎并不是实时处理的方法。 我发现https://github.com/BradLarson/GPUImage/issues/319,GPUImage :混合两个图像 ,和https://github.com/BradLarson/GPUImage/issues/751 (但他们不是实时处理,(第一和第二),或不工作(第三)。 我已经尝试了几乎所有的东西,但是我得到的只是GPUImageView中的一个白色图像。 如果我不使用阿尔法混合filter,比如只使用一个错误的颜色filter或类似的东西,它就可以完美的工作。 这是我的代码: blendFilter = [[GPUImageAlphaBlendFilter alloc] init]; blendFilter.mix = 0.5; [blendFilter prepareForImageCapture]; [blendFilter addTarget:imageView]; passThrough = [[GPUImageFilter alloc] init]; [passThrough prepareForImageCapture]; [passThrough addTarget:blendFilter]; selectedFilter = [[GPUImageFalseColorFilter alloc] init]; [selectedFilter prepareForImageCapture]; [selectedFilter addTarget:blendFilter]; stillCamera = […]

GPUImage:将文件应用于现有的video文件

我试图使用GPUImage框架的videofilter。 我遵循过滤和重新编码电影教程。 它给我错误Unknown type name GPUImageRotationFilter 。 所以我试图将一个简单的filter应用到我的video文件 这是我的代码 viewController.h @interface ViewController : UIViewController<GPUImageMovieWriterDelegate,GPUImageInput> { GPUImageMovie *_movieFile; GPUImageOutput<GPUImageInput> *_sketchFilter; GPUImageMovieWriter *_movieWriter; } @property (nonatomic,retain) GPUImageMovie *movieFile; @property (nonatomic,retain) GPUImageOutput<GPUImageInput> *sketchFilter; @property (nonatomic,retain) GPUImageMovieWriter *movieWriter; @end viewController.m NSURL *sampleURL = [[NSBundle mainBundle] URLForResource:@"sample_iPod" withExtension:@"m4v"]; self.movieFile = [[GPUImageMovie alloc] initWithURL:sampleURL]; self.sketchFilter = [[GPUImageSketchFilter alloc] init]; [self.movieFile addTarget:self.sketchFilter]; […]