diff --git a/ARVideoKit/Rendering/Writer/WritAR.swift b/ARVideoKit/Rendering/Writer/WritAR.swift index 33af7b6..6a4c1d5 100644 --- a/ARVideoKit/Rendering/Writer/WritAR.swift +++ b/ARVideoKit/Rendering/Writer/WritAR.swift @@ -57,14 +57,15 @@ class WritAR: NSObject, AVCaptureAudioDataOutputSampleBufferDelegate { AVVideoHeightKey: height as AnyObject ] - let attributes: [String: Bool] = [ - kCVPixelBufferCGImageCompatibilityKey as String: true, - kCVPixelBufferCGBitmapContextCompatibilityKey as String: true + let sourcePixelBufferAttributesDictionary: [String: Any] = [ + kCVPixelBufferPixelFormatTypeKey as String : kCVPixelFormatType_32BGRA, + kCVPixelBufferWidthKey as String: width, + kCVPixelBufferHeightKey as String: height ] videoInput = AVAssetWriterInput(mediaType: .video, outputSettings: videoOutputSettings) videoInput.expectsMediaDataInRealTime = true - pixelBufferInput = AVAssetWriterInputPixelBufferAdaptor(assetWriterInput: videoInput, sourcePixelBufferAttributes: nil) + pixelBufferInput = AVAssetWriterInputPixelBufferAdaptor(assetWriterInput: videoInput, sourcePixelBufferAttributes: sourcePixelBufferAttributesDictionary) var angleEnabled: Bool { for v in orientaions {