Reputation: 1040
I am writing a MacOS or OSX application where I need to record only the View of my application (Not the Whole display) with the Audio it emits.
Think it as a game app and I need to record the complete GamePlay View Of the Application.How should I go about doing this?
I am aware of "AVCaptureScreenInput" and, the example. But how to capture only the view of my application?
Upvotes: 1
Views: 968
Reputation: 279
Read the document carefully, there is a comment, about the displays:
// If you're on a multi-display system and you want to capture a secondary display, // you can call CGGetActiveDisplayList() to get the list of all active displays. // For this example, we just specify the main display. // To capture both a main and secondary display at the same time, use two active // capture sessions, one for each display. On Mac OS X, AVCaptureMovieFileOutput // only supports writing to a single video track.
Upvotes: 0
Reputation: 14973
From the website you posted:
Note: By default,
AVCaptureScreenInput
captures the entire screen. You may set itscropRect
property to limit the capture rectangle to a subsection of the screen.
Just set this property to the windows/views rect and you're done
Of course you need to update and restart the recording when the windows/views rect changes.
Upvotes: 2