我正在使用本教程:https://github.com/BradLarson/GPUImage在iOS中创建视频捕获应用程序。

该应用程序已启动并正在运行。我有一个查询...

我们使用以下代码启动实时视频捕获会话:

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

 GPUImageFilter *customFilter = [[GPUImageFilter alloc]
 initWithFragmentShaderFromFile:@"CustomShader"];
 GPUImageView *filteredVideoView = [[GPUImageView alloc] initWithFrame:CGRectMake(0.0,
 0.0, viewWidth, viewHeight)];


 [videoCamera addTarget:customFilter];
 [customFilter addTarget:filteredVideoView];

 [videoCamera startCameraCapture];

但是如何在此框架中启用“图像选择器”样式的“轻按聚焦”和轻敲曝光校正。

可能吗?您能指出我正确的方向吗?

请帮忙。

提前致谢。

最佳答案

得到它,部分地:

 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {

   UITouch *touch = [touches anyObject];
   CGPoint touchPoint = [touch locationInView:self.view];

    if([videoCamera.inputCamera isFocusPointOfInterestSupported]&&[videoCamera.inputCamera isFocusModeSupported:AVCaptureFocusModeAutoFocus])
   {

   if([videoCamera.inputCamera lockForConfiguration :nil])
   {
    [videoCamera.inputCamera setFocusPointOfInterest :touchPoint];
    [videoCamera.inputCamera setFocusMode :AVCaptureFocusModeLocked];

     if([videoCamera.inputCamera isExposurePointOfInterestSupported])
      {
        [videoCamera.inputCamera setExposurePointOfInterest:touchPoint];
        [videoCamera.inputCamera setExposureMode:AVCaptureExposureModeLocked];
    }
    [videoCamera.inputCamera unlockForConfiguration];
}
}

}

曝光和焦点已锁定,但一段时间后冻结...

正在努力。

关于iphone - GPUImage视频拍摄具有“轻按聚焦”和曝光控制,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17986661/

10-08 23:06