QTKit Capture API是否支持屏幕記錄 - 即,我可以指定當前屏幕輸出作爲記錄的輸入源嗎?如果是這樣,怎麼樣?QTKit Capture API:如何實現視頻屏幕錄製(如在Quicktime X Player中)?
Quicktime Player X支持屏幕錄製,但QTKit Capture API Documentation只提到從外部攝像頭捕獲。
QTKit Capture API是否支持屏幕記錄 - 即,我可以指定當前屏幕輸出作爲記錄的輸入源嗎?如果是這樣,怎麼樣?QTKit Capture API:如何實現視頻屏幕錄製(如在Quicktime X Player中)?
Quicktime Player X支持屏幕錄製,但QTKit Capture API Documentation只提到從外部攝像頭捕獲。
一種方法可以捕捉與CGWindow API(搜索:抓住的兒子)的靜態截圖,並使用addImage它們添加到一個QTMovie對象:forDuration:withAttributes:
相關Apple代碼例如:StillMotion(開發商.apple.com/mac/library/samplecode/StillMotion/Introduction/Intro.html)
從Lion開始,您可以使用AVFoundation框架。 快速教程可以找到here。
另一種方法是完全避開QTKit並使用OpenGL。 Apple在此處有示例代碼:http://developer.apple.com/mac/library/samplecode/OpenGLScreenCapture/Introduction/Intro.html – bjoern 2010-06-09 16:15:32