We are seeing this issue with all applications. Issue is that the content rect given by Screen Capture Kit in CMSampleBufer includes the empty space at the top. This makes it very difficult to select only the area where window content is present.
Post
Replies
Boosts
Views
Activity
It seems when window is in full screen the CMSampleBuffer returned has different video dimensions in CMVideoFormatDescription and the Content Rect.
CMSampleBuffer
formatDescription = <CMVideoFormatDescription 0x6000027066d0 [0x7ff8558ff750]> {
mediaType:'vide'
mediaSubType:'420v'
mediaSpecific: {
codecType: '420v' dimensions: 3584 x 2240
}
}
sampleAttachmentsArray[0] = {
sample 0:
SCStreamUpdateFrameDisplayResolution = 2
SCStreamUpdateFrameContentRect = {
Height = "1120.000020503998";
Width = "1724.261199951172";
X = 0;
Y = 0;
}
}
It seems video dimension gives the correct rect which excludes the empty space. So having ContentRectHeight * DisplayRes - (ContentRectHeight * DisplayRes - VideoDimensionheight) from content rect will give the actual content rect.