【问题标题】:GPUImage video camera imageView is blackGPUImage 摄像机 imageView 为黑色
【发布时间】:2015-09-10 06:16:20
【问题描述】:

所以我刚刚发现了 gpuImage,我正在尝试按照 gpuimage github readme.... 进行一些基本的视频过滤。

我或多或少地复制了他们的代码,但是当我将 gpuImageView 作为子视图添加到我的 ViewController 时,它只是显示为黑屏。谁能解释为什么图像没有出现?谢谢!!!

GPUImageVideoCamera *videoCamera = [[GPUImageVideoCamera alloc]
                                    initWithSessionPreset:AVCaptureSessionPreset640x480
                                    cameraPosition:AVCaptureDevicePositionBack];

videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;

GPUImageSepiaFilter *filter = [[GPUImageSepiaFilter alloc] init];
[filter setIntensity: 0.5];

GPUImageView *filteredVideoView = [[GPUImageView alloc] initWithFrame:self.view.frame];

[videoCamera addTarget:filter];

[filter addTarget:filteredVideoView];

[self.view addSubview:filteredVideoView];

[videoCamera startCameraCapture];

【问题讨论】:

    标签: ios video camera subview gpuimage


    【解决方案1】:

    没关系,我整理好了。

    指向相机和滤镜的指针刚刚超出范围并被清理!我不得不将它们设为@property,事后看来这很明显。哈哈

    还是谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-16
      相关资源
      最近更新 更多