PDA

View Full Version : API functions to capture screen video?




marcimatz
Feb 8, 2012, 08:02 AM
Hello,

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!!



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

marcimatz
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)

Cheers

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

https://developer.apple.com/library/mac/#samplecode/From_A_View_to_A_Movie/Introduction/Intro.html#//apple_ref/doc/uid/DTS40009025

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.

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