逐帧使用AVFoundation录制音频和视频 [英] Recording Audio and Video using AVFoundation frame by frame

查看:133
本文介绍了逐帧使用AVFoundation录制音频和视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在iOS4中逐帧使用AVFoundation录制音频和视频?

How to record audio and video using AVFoundation frame by frame in iOS4?

推荐答案

你提到的AVCamDemo接近什么你需要做的,并且应该能够使用它作为参考,其中这些是你需要使用以下类来实现你正在尝试的...所有的类都是 AVFoundation ,您需要

The AVCamDemo you mention is close to what you need to do and should be able to use that as reference, among those these are the following classes you need to use in order to achive what you are trying... All the classes are part of AVFoundation, you need

  • AVCaptureVideoDataOutput and AVCaptutureAudioDataOutput - use these classes to get raw samples from the video camera and the microphone

使用 AVAssetWriter AVAssetWriterInput 为了将原始样本编码到文件中 - 以下示例mac OS X 项目显示了如何使用这些类(示例也适用于ios),但是他们使用AVAssetReader进行输入(它重新编码电影文件)而不是摄像头和麦克风......您可以使用上面提到的输出作为在你的情况下输入你想要的东西

Use AVAssetWriter and AVAssetWriterInput in order to encode the raw samples into a file - the following sample mac OS X project shows how to use these classes (the sample should work for ios too), however they use an AVAssetReader for input (it reencodes a movie file) instead of the Camera and microphone... You can use the outputs mentioned above as the input in your case to write what you want

这应该是你需要的所有东西,以达到你想要的做...

That should be all you need in order to achieve what you want to do...

下面是一个链接,显示如何使用 VideoDataOutput

Heres a link showing how to use VideoDataOutput

希望有所帮助

这篇关于逐帧使用AVFoundation录制音频和视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆