As far as I know, there is no way to exclude certain windows from OS X's built-in write APIs:
- AVFoundation AVCaptureScreenInput (10.7 +)
- Core Graphics CGDisplayStream (10.8+)
Both of the above methods seem to capture the contents of the screen after the layout, when the final screen output has already been compiled together.
Thus, excluding your recording window, you will need to use an API that allows you to compose windows yourself, and then add these custom frames to AVAssetWriterInput.
Quartz Window Services allows you to take snapshots of single windows through CGWindowListCreateImage. A good sample project that also shows how to combine several window shots together, Son of robbery .
After extracting the stitched image together, you will have to add it to AVAssetWriterInput. AVFoundation provides a convenience class for adding custom pixel buffers to a movie: AVAssetWriterInputPixelBufferAdaptor .
In particular, part of AVFoundation can become very frustrating, and you may run into performance issues, as composition is more likely to be slower than the OS X built-in linker, but overall you can achieve what you want.
source share