问题描述
我正在尝试开发一款处理/过滤和录制视频的iPhone应用。
I am trying to develop an iPhone app that processes/filters and records video.
我有两个示例应用,其中包含我需要的方面,并且我正在尝试合并它们。
I have two sample apps that have aspects of what I need and am trying to combine them.
-
(需要Apple Developer ID)
这涉及捕获/录制视频。
AVCamDemo from the WWDC10 sample code package (Apple Developer ID required)
This deals with capturing/recording video.
Brad Larson的ColorTracking示例应用引用
这涉及使用OpenGL ES实时处理视频
Brad Larson's ColorTracking sample app referenced here
This deals with live processing of video using OpenGL ES
我试图将两者合并时遇到困难。
I get stuck when trying to combine the two.
我一直试图做的就是使用 AVCaptureVideoOutput
和 AVCaptureVideoDataOutputSampleBufferProtocol
通过OpenGL ES处理/过滤视频帧(如在-2-中),同时以某种方式使用 AVCaptureMovieFileOutput
来记录处理过的视频(如在-1-)。
What I have been trying to do is to use AVCaptureVideoOutput
and the AVCaptureVideoDataOutputSampleBufferProtocol
to process/filter the video frames through OpenGL ES (as in -2-), and at the same time somehow use AVCaptureMovieFileOutput
to record the processed video (as in -1-).
这种方法可行吗?如果是这样,我怎么需要在 AVSession
中设置连接?
Is this approach possible? If so, how would I need to set up the connections within the AVSession
?
或者我是否需要使用 AVCaptureVideoDataOutputSampleBufferProtocol
处理/过滤视频,然后将各个帧重新组合成电影 - 不使用 AVCaptureMovieFileOutput
进行保存电影文件?
Or do I need to use the AVCaptureVideoDataOutputSampleBufferProtocol
to process/filter the video AND then recombine the individual frames back into a movie - without using AVCaptureMovieFileOutput
to save the movie file?
非常感谢任何有关实现此目标的最佳方法的建议!
Any suggestions for the best approach to accomplish this are much appreciated!
推荐答案
您可以尝试使用AV Foundation捕获视频这个链接,非常有帮助。希望你的一个问题能得到解决
you can try this link to Capture Video using AV Foundation, very Helpful. Hope your one problem will be resolved
这篇关于通过iPhone上的着色器处理视频时捕获视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!