Curious, what would this be in Swift 4?
stimageout = AVCapturePhotoOutput()
stimageout?.outputSettings = [AVVideoCodecKey : AVVideoCodecJPEG]
Currently, it errors with Value of type 'AVCapturePhotoOutput' has no member 'outputSettings'
which is odd since I don't have memory of Apple changing this.
This is not "begging for help"-type question. I'm just curious if Apple changed this and the steps I need to do in order to fix this issue.
Thanks in advance. :)
The problem is outputSettings
is a property on AVCaptureStillImageOutput
, not AVCapturePhotoOutput
.
AVCaptureStillImageOutput
is deprecated in iOS 10, so for iOS 10+, use AVCapturePhotoOutput
instead. To set settings using the new API, you can use an AVCapturePhotoSettings
object.
let stimageout = AVCapturePhotoOutput()
let settings = AVCapturePhotoSettings()
settings.livePhotoVideoCodecType = .jpeg
stimageout.capturePhoto(with: settings, delegate: self)
Apple's AVCapturePhotoOutput
Documentation: https://developer.apple.com/documentation/avfoundation/avcapturephotooutput
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With