View Full Version : API functions to capture screen video?

Feb 8, 2012, 08:02 AM

I am quite new to Mac programming and was wondering if the OSX provides any API functions that handles recording of videos from screen information?
I am developping in c++, and ideally require functions similar to:

bool initializeRecorder(int resolutionX,int resolutionY,const char* filename,int framerate);

bool addFrame(const char* buffer);

bool endRecorder();

Any fileformat is fine (e.g. Qt, avi, etc.). I am also interested if there is any 3rd party library that offers above functionality.
Thanks for any insight!!

Feb 9, 2012, 10:55 AM
If you are targeting Lion you must use AVFoundation.

Feb 9, 2012, 11:01 AM
Thank you for the reply sumpfmonster.

I actually also need the code working on previous versions of Mac OSX (say, from Leopard on)


Feb 9, 2012, 01:14 PM
There is a Apple sample called "From a view to a movie":


It demonstrates the pre-AVFoundation way via OpenGL and QuickTime. Even though the sample is for 10.6, the demonstrated techniques should work without too much work on 10.5.

Feb 10, 2012, 09:37 AM
Thanks a lot Sumpfmonster!!