iphone 4 - 如何在视频上方录制视频叠加层?
有谁知道该怎么做?
有人能提供一个例子吗?我相信这已经超出了 NDA,就像 4.0 版本中提供的那样?
Does anyone know how to do this?
Is anyone able to provide an example? I believe this is out of NDA now as was available in version 4.0 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 AVFoundation 框架,特别是 avcapture avsession avinputdevice 等。您可以在 iPhone 开发中心论坛中找到一些列表:搜索“avcapture”
AVFoundation 是你想要用来记录、修改原始帧、显示它们的框架,当然还可以添加一些覆盖层。
如果你只想做覆盖层,那么 UIImagePickerController 应该足够了。
Take a look to AVFoundation framework , specially to avcapture avsession avinputdevice, etc. You can find some listings in the iPhone dev center forums: search "avcapture"
AVFoundation is the framework you want to use to record, modify raw frames, show them, an offcourse add some overlay
If you want to do only overlay then, UIImagePickerController should b enough.
如果我明白,您想要正确执行的操作,您已经设置了视频捕获功能,就像Apple在此问答中建议的那样:http://developer.apple.com/iphone/library/qa/qa2010/qa1702.html
从那里开始应该不成问题使用此答案中描述的方法:根据顶部图像的 alpha/透明度混合两个 uiimages 来混合使用叠加层进行预览,前提是您首先在 UIImage 中绘制它。将生成的图像输入缓冲区并相应保存。
不过,这种方法肯定不会给你很多每秒的帧数。
If i understand, what you are trying to do corectly, you have set up video capture someting like suggested by Apple in this Q&A:http://developer.apple.com/iphone/library/qa/qa2010/qa1702.html
From there it shouldn't be much of a Problem to use the method described in this answer:blend two uiimages based on alpha/transparency of top image to blend the preview with your overlay, provided you draw it in a UIImage first. Feed the resulting images to a buffer and save it accordingly.
Though, this method most certainly wouldn't give you a lot of frames per second.