QTKit Capture API:如何实现视频屏幕录制(就像Quicktime X Player中一样)?

5

QTKit Capture API是否支持屏幕录制 - 即,我可以将当前屏幕输出指定为输入源进行录制吗?如果可以,如何操作?

Quicktime Player X支持屏幕录制,但QTKit Capture API文档仅提到从外部摄像头捕获。

2个回答

4

从Lion开始,您可以使用AVFoundation框架。您可以在这里找到一个快速教程。


1
一种方法是使用CGWindow API(搜索:Son of Grab)捕获静态截图,并使用addImage:forDuration:withAttributes:将它们附加到QTMovie对象上。
相关的苹果代码示例:StillMotion(developer.apple.com/mac/library/samplecode/StillMotion/Introduction/Intro.html)

1
另一种方法是完全绕过QTKit并使用OpenGL。苹果在这里提供了示例代码:http://developer.apple.com/mac/library/samplecode/OpenGLScreenCapture/Introduction/Intro.html - bjoern

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接