【问题标题】:Where does AVLayerVideoGravityResizeAspectFill cropAVLayerVideoGravityResizeAspectFill 在哪里裁剪
【发布时间】:2014-01-09 15:56:31
【问题描述】:

我使用AVCaptureSessionAVCaptureVideoPreviewLayerAVLayerVideoGravityResizeAspectFill 重力。

self.captureSession =[[AVCaptureSession alloc] init];
captureSession.sessionPreset = AVCaptureSessionPresetPhoto;
self.previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.captureSession];
[self.previewLayer setVideoGravity: AVLayerVideoGravityResizeAspectFill];

如何知道视频将如何调整大小以适应带有AVLayerVideoGravityResizeAspectFill 的预览区域?图片的哪一部分在预览区可见?

来自the doc

AVLayerVideoGravityResizeAspectFill:保留纵横比,但填充可用屏幕区域,必要时裁剪视频

基本上,如何准确获取 previewLayer 中显示的内容?

【问题讨论】:

    标签: iphone ios camera


    【解决方案1】:

    AVCaptureVideoPreviewLayer 中使用iOS 6 SDK I can use the following

    (CGPoint)captureDevicePointOfInterestForPoint:(CGPoint)pointInLayer
    

    【讨论】:

      猜你喜欢
      • 2023-03-31
      • 2011-03-07
      • 1970-01-01
      • 1970-01-01
      • 2015-02-02
      • 2019-05-10
      • 1970-01-01
      • 2020-08-28
      • 1970-01-01
      相关资源
      最近更新 更多