0

I am trying to set the Pixel format type on an AVCaptureConnection but it terminates for all the RGB settings but works for the kCVPixelFormatType_32BGRA.

Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '*** -[AVCaptureVideoDataOutput setVideoSettings:] Unsupported 
pixel format type - use -availableVideoCVPixelFormatTypes'

The code that produces this error is this:

let settings: [AnyHashable: Any] = [kCVPixelBufferPixelFormatTypeKey as AnyHashable: kCVPixelFormatType_30RGB]
output.videoSettings = settings as! [String : Any]
btomtom5
  • 842
  • 8
  • 16

1 Answers1

0

Figured it out!

I looked at the available PixelFormats on that camera and found that it only supports three different types of pixel formats..

420f, BGRA, and 420v

btomtom5
  • 842
  • 8
  • 16