我正在创build一个带有滤镜的自定义相机。 当我添加下面的行时,它崩溃而不显示任何exception。 //设置video输出 func setupBuffer() { videoBuffer = AVCaptureVideoDataOutput() videoBuffer?.alwaysDiscardsLateVideoFrames = true videoBuffer?.videoSettings = [(kCVPixelBufferPixelFormatTypeKey as NSString): NSNumber(value: kCVPixelFormatType_32RGBA)] videoBuffer?.setSampleBufferDelegate(self, queue: DispatchQueue.main) captureSession?.addOutput(videoBuffer) } public func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, from connection: AVCaptureConnection!) { if connection.videoOrientation != .portrait { connection.videoOrientation = .portrait } guard let image = GMVUtility.sampleBufferTo32RGBA(sampleBuffer) else { print("No Image 😂") […]