How to capture video from specified window on Mac OS
I tried to capture screen video using this example code How to capture screen activity to movie file using AV Foundation
It works fine, but I'm wondering how I can capture a specific window of some particular application (and not the area of ββthe screen specified by CGRect).
I am asking as Google Hangouts can share the said window even though it is not showing.
So my questions are:
- How can I modify the above code to achieve this?
- Can multiple windows be captured at the same time?
source to share
I'm not sure if it is possible to render the background window video using AVFoundation
, unless you create your own concrete subclass AVCaptureInput
. But taking a screenshot of the background can be done using the CGWindowListCreateImage () function from the framework Core Graphics
. Apple SonOfGrab may find some sample code helpful.
source to share