I\'m recording the screen from my iPhone device to my Mac. As a preview layer I am collecting sample buffers directly from a AVCaptureVideoDataOutput
, from whic
I've come across the same issue, the problem was not asking for Metal compatibility when configuring the AVCaptureVideoDataOutput
. I guess the system started to check this in macOS 10.13, possibly to apply some optimization when not requested.
The solution was to add the kCVPixelBufferMetalCompatibilityKey
to the videoSettings
property of AVCaptureVideoDataOutput
.
In Objective-C:
outputCapture.videoSettings = @{
/* ... */
(NSString *)kCVPixelBufferMetalCompatibilityKey: @YES
};
In Swift:
outputCapture.videoSettings = [
/* ... */
kCVPixelBufferMetalCompatibilityKey as String: true
]
I think this warrants a radar, to ask Apple to at least print a warning message when this occurs. I'll update this if I get to it.