Re: Fast way to grab the screen
Re: Fast way to grab the screen
- Subject: Re: Fast way to grab the screen
- From: Kyle Sluder <email@hidden>
- Date: Wed, 23 Feb 2011 15:39:27 -0800
On Wed, Feb 23, 2011 at 3:21 PM, Ken Thomases <email@hidden> wrote:
> On Feb 23, 2011, at 4:40 PM, Kyle Sluder wrote:
>
>> On Wed, Feb 23, 2011 at 2:17 PM, eveningnick eveningnick
>> <email@hidden> wrote:
>>> i am trying to write a video grabber, CGWindow API seems pretty convenient
>>> (because it allows to select which window to "grab"), but i am worried about
>>> the speed, because i need to record the grabbed frames to the video file.
>>
>> http://developer.apple.com/library/mac/#samplecode/OpenGLScreenCapture/Introduction/Intro.html#//apple_ref/doc/uid/DTS10004445-Intro-DontLinkElementID_2
>
> Actually, I don't think that's an improvement over the CGWindow API that eveningnick was already using (CGWindowListCreateImage, I assume). In general, if a high-level (more abstract) API achieves the desired result, it will be at least as efficient as the low-level API -- because, if the low-level approach is faster, the high-level API would just use it.
Except the high-level APIs are geared around taking a static
screenshot. Remember, the OP is trying to capture a video.
The method in the sample project creates multiple pixel buffers and
asynchronously swaps the framebuffer contents into them. By design,
the synchronous screen capture APIs cannot be as fast as working at
this level.
--Kyle Sluder
_______________________________________________
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