I run into the following exception when I attempt to record 4k or 1080p footage at 60 FPS in Pro Res format
AVCaptureMovieFileOutput startRecordingToOutputFileURL:recordingDelegate:] Capturing 1080p60 with ProRes codec on this device is supported only on external storage device.'
This should be possible to do as other apps like Blackmagic cam (https://www.blackmagicdesign.com/ca/products/blackmagiccamera) allows this to be done.
Code snippets below for reference:
do {
try self.videoDeviceInput.device.lockForConfiguration()
self.videoDeviceInput.device.activeFormat = self.videoDeviceInput.device.findFormat()!
self.videoDeviceInput.device.activeColorSpace = .appleLog
let frameRate = CMTimeMake(value: 1, timescale: 60)
self.videoDeviceInput.device.activeVideoMaxFrameDuration = frameRate
self.videoDeviceInput.device.activeVideoMinFrameDuration = frameRate
self.videoDeviceInput.device.unlockForConfiguration()
} catch {
print("Could not lock device for configuration: \(error)")
}
// Start recording video to a temporary file.
let outputFileName = NSUUID().uuidString
let outputFilePath = (NSTemporaryDirectory() as NSString).appendingPathComponent((outputFileName as NSString).appendingPathExtension("mov")!)
movieFileOutput.startRecording(to: URL(fileURLWithPath: outputFilePath), recordingDelegate: self)
I have set all the correct activeFormat values and activeColorspace to allow for this.