Re: Fastest way to do screen captures on OSX ?
Re: Fastest way to do screen captures on OSX ?
- Subject: Re: Fastest way to do screen captures on OSX ?
- From: Half Activist <email@hidden>
- Date: Wed, 16 Oct 2013 11:10:14 +0200
Definitely not using CGWindowListCreateImage.
In the past, inspired by some code, i wrote a screen capture test program using opengl, the trick was to declare a fullscreen context without a curtain window or setting it to transparent and then reading the pixels, and that was quite fast, on a G4 i could achieve hundreds (or thousands?) of FPS (which is completely useless i agree on a 60Hz display).
The problem is, since 10.7 (?) this stopped working, all the pixels you read are black.
In the meantime, quicktime was added screen capture support and something was added to AVFoundation, and you can directly capture the screen using it, I personally never used it.
https://developer.apple.com/library/mac/qa/qa1740/_index.html
Regards.
On Oct 16, 2013, at 7:26 AM, email@hidden wrote:
> Date: Wed, 09 Oct 2013 23:16:49 -0400
> From: Mauritz Jameson <email@hidden>
> To: email@hidden
> Subject: Fastest way to do screen captures on OSX ?
> Message-ID:
> <email@hidden>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I have created a function to do screen captures on OSX.
>
> Since I'm new to OSX, Xcode and the SDKs on OSX, I've asked for a code
> review of the screen capture function here:
>
> http://codereview.stackexchange.com/questions/32466/reviewing-c-function-which-captures-the-screen
>
> The function is a bit messy since it's a prototype. I would be very happy
> if you could tell me how I can optimize the code I've posted in the link
> above.
>
> The screen capture function is being called every 100ms approximately and
> these frequent function calls seems to slow everything else down. After my
> program has run for a little while, the desktop and mouse pointer becomes
> very laggy/non-responsive. The mouse pointer icon periodically changes to
> that spinning circle (equivalent to the hour glass on Windows). Opening
> other apps while my program is running is also a problem. After my program
> has run for 30 seconds or so, opening up a browser takes more than a
> minute. Eventually everything just hangs and I have to reboot.
>
> I'm wondering if it's the screen capture method itself (i.e. using the Core
> Graphics API) which isn't ideal for this type of application or if there's
> something in the screen capture code which is causing the above mentioned
> problems.
>
> If I comment out the code in the screen capture function and run my
> program, I don't get the same laggy behavior. So the bottleneck/problem
> definitely seems to have something to do with the way I capture the screen.
>
> Any suggestions, comments, questions etc. are highly appreciated.
>
> Thank you!!
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden