11

I have tried to capture a screen video using this sample code How to capture screen activity to a movie file using AV Foundation

It's working fine but I am wondering how can I capture a specified window of some individual app (not screen area specified by CGRect).

I'm asking because Google Hangouts can share specified window even if it isn't visible. Google Hangouts

So, my questions are:

  1. How can I modify the code above to achieve this?
  2. Is it possible to capture few windows at the same time?
LembergSun
  • 641
  • 7
  • 14

1 Answers1

0

I'm not sure it is possible to capture video of background window using AVFoundation, unless you make your own concrete subclass of AVCaptureInput. But taking screenshot of background window can be implemented using CGWindowListCreateImage() function from Core Graphics framework. Apple's SonOfGrab sample code may be helpful.

toma
  • 1,471
  • 12
  • 20