[英]App Terminating Due to Unavailable PixelFormat Type on an AVCaptureConnection
我正在嘗試在AVCaptureConnection上設置Pixel格式類型,但對於所有RGB設置都將終止,但可用於kCVPixelFormatType_32BGRA。
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** -[AVCaptureVideoDataOutput setVideoSettings:] Unsupported
pixel format type - use -availableVideoCVPixelFormatTypes'
產生此錯誤的代碼是這樣的:
let settings: [AnyHashable: Any] = [kCVPixelBufferPixelFormatTypeKey as AnyHashable: kCVPixelFormatType_30RGB]
output.videoSettings = settings as! [String : Any]
弄清楚了!
我查看了該相機上可用的PixelFormat,發現它僅支持三種不同類型的像素格式。
420f,BGRA和420v
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.