As a preset, AVCaptureSessionPresetHigh
makes a lot of sense to me. Hardware is always changing and it makes sense to have an option to tell AVCapture that "I want the highest quality you can give me given current hardware" What is driving me nuts though, is just because I want to set the session to an abstract value, doesn't mean I don't need to know the resolution it's displaying.
The only way to figure out the current resolution is to actually capture a frame and check the size of said frame. Or even worse, manually find all these resolutions, create a lookup dictionary, ask the device for it's model and then fetch the hardcoded resolution. This is a complete hack, but still better than forcing a frame capture and then asking a UIImage for its frame size.
I desperately need this information, in order to dynamically make decisions based on the aspect ratio the camera is providing. Why does apple not have an interface for such a simple query?
Does anyone know of a resource that lists all of the possible resolutions for both cameras across the entire apple hardware market? I can google my way through some, but I cannot track down a complete list.
Given the AVCaptureDevice
, you should be able to enumerate at formats
or examine activeFormat
, and then look at highResolutionStillImageDimensions
of the resulting AVCaptureDeviceFormat
.
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