- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在使用 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: This preserves the aspect ratio, but fills the available screen area, cropping the video when necessary
基本上,如何准确获取 previewLayer 中显示的内容?
最佳答案
随着iOS 6 SDK I can use the following在 AVCaptureVideoPreviewLayer
(CGPoint)captureDevicePointOfInterestForPoint:(CGPoint)pointInLayer
关于iphone - AVLayerVideoGravityResizeAspectFill 在哪里裁剪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13643769/
我正在使用 AVCaptureSession 和 AVCaptureVideoPreviewLayer 以及 AVLayerVideoGravityResizeAspectFill 重力。 self.
我有一个这样的嵌套视频: Live camera feed 当用户拍照时,图像沿y轴偏移 Captured Still image 我确实想要捕获整个图像并让用户上下滚动。他们目前可以这样做,但我希望
我已经使用 AVPlayer 实现了自定义电影播放器。将 AVPlayerLayer 中的 videoGravity 值设置为 AVLayerVideoGravityResizeAspectFil
基于此SO post ,下面的代码会旋转、居中和裁剪用户实时捕获的视频。 捕获 session 使用 AVCaptureSessionPresetHigh 作为预设值,预览层使用 AVLayerVid
我是一名优秀的程序员,十分优秀!