我正在使用AVCaptureSession
AVCaptureVideoPreviewLayer
AVLayerVideoGravityResizeAspectFill
重力。
self.captureSession =[[AVCaptureSession alloc] init];
captureSession.sessionPreset = AVCaptureSessionPresetPhoto;
self.previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.captureSession];
[self.previewLayer setVideoGravity: AVLayerVideoGravityResizeAspectFill];
如何知道如何调整视频大小以适应AVLayerVideoGravityResizeAspectFill
的预览区域?在预览区域中可以看到图像的哪一部分?
来自the doc:
AVLayerVideoGravityResizeAspectFill:这会保留宽高比,但会填充可用的屏幕区域,必要时裁剪视频
基本上,如何准确获取previewLayer中显示的内容?
答案 0 :(得分:1)
AVCaptureVideoPreviewLayer
(CGPoint)captureDevicePointOfInterestForPoint:(CGPoint)pointInLayer