AVCaptureSessionPreset中等图像大小?
当使用 AVCaptureSessionPresetMedium 时,
// Create the session
AVCaptureSession * newSession = [[AVCaptureSession alloc] init];
// Configure our capturesession
newSession.sessionPreset = AVCaptureSessionPresetMedium;
有没有办法动态地告诉宽度 x 高度将解析为什么?显然,我可以等到像
- (void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection
Gets 这样的委托被调用并在那里确定它,但我宁愿提前这样做,以便出于性能原因我可以预先计算一些值。
When using AVCaptureSessionPresetMedium
// Create the session
AVCaptureSession * newSession = [[AVCaptureSession alloc] init];
// Configure our capturesession
newSession.sessionPreset = AVCaptureSessionPresetMedium;
Is there any way to dynamically tell what this will resolve to for width x height? Obviously I can wait until a delegate like
- (void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection
Gets called and determine it there, but I would rather do it in advance so that I can precalculate some values for performance reasons.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我很高兴在这一点上被证明是错误的,但如果您不想对数字进行硬编码,下面的步骤似乎是正确的方法:
必须在
startRunning
调用之后调用,否则结果为 0,0。我不知道将来会发生什么,所以这就是我循环遍历ports
数组的原因。I'd be very happy to be proven wrong on this, but the steps below seem to be the proper way if you don't want to hardcode the numbers:
This has to be called after the
startRunning
call, otherwise the result is 0,0. I don't know what to expect in the future, so that's why I loop over theports
array.