iPhone:实时视频颜色信息、焦距、光圈?
有没有办法使用 AVFoundation 和 CoreVideo 实时获取颜色信息、光圈和焦距值?
让我解释一下。假设当我拍摄视频时,我想在屏幕的一小部分中采样颜色并将其以 RGB 值输出到屏幕?另外,我想展示当前光圈的设置。
有谁知道是否可以收集这些值?目前我只看到静态图像是可能的。
有想法吗?
Is there any way using AVFoundation and CoreVideo to get color info, aperture and focal length values in real-time?
Let me explain. Say when I am shooting video I want to sample the color in a small portion of the screen and output that in RGB values to the screen? Also, I would like to show what the current aperture is set at.
Does anyone know if it is possible to gather these values? Currently I have only seen that this is possible with still images.
Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
AVCaptureStillImageOutput 将从视频流中获取实时静态图像,包括焦距、光圈等的 exif 数据。您可以根据该位图自行计算颜色信息。
AVCaptureStillImageOutput will get you a real time still from the video stream, including exif data for focal length, aperture, etc. Color info you could calculate yourself from that bitmap.
AVFoundation、CoreVideo 和 CoreMedia 支持“实时”获取视频位图。从那里您可以根据需要处理一部分 RGB 像素。
我不知道当前有任何公共 iOS API 可以帮助您获取光圈。
焦距是固定的,但不同产品型号的焦距有所不同。 ifixit.com 可能有该信息。
AVFoundation, CoreVideo, and CoreMedia include support for getting a video bitmap in "real-time". From there you can process a portion of the RGB pixels however you want.
I don't know of any current public iOS API to get you the aperture.
The focal length is fixed, but differs between product models. ifixit.com might have that info.
您可以通过以下方式获取光圈:-
camera.lensAperture
这将给出您选择的 iPhone 相机的光圈
You can get the aperture by:-
camera.lensAperture
this will give the aperture of the camera of iPhone whichever you selected