Improving the transition between ultra wide and wide angle lens

I'm building an app which uses the camera and want to take advantage of the ability of the builtInTripleCamera and builtInDualWideCamera to automatically switch between the ultra wide and wide angle lens to focus on close up shots.

It's working fine - except that the transition between the two lenses is a bit jumpy. I looked at what the native Camera app does and it seems to apply a small amount of blurring when the transition happens to help "mask" the jumpiness. How can I replicate this, or is there another way to improve the UX of switching between one lens and another automatically?

Answered by DTS Engineer in 823617022

Hello @yqiang,

You can key-value observe the activePrimaryConstituent to observe when this value changes.

If you are using AVCaptureVideoDataOutput, you can also examine the input port of the AVCaptureConnection for each sample you receive.

When the device changes, you can use that information to create a transition in your UI.

-- Greg

Hello @yqiang,

You can key-value observe the activePrimaryConstituent to observe when this value changes.

If you are using AVCaptureVideoDataOutput, you can also examine the input port of the AVCaptureConnection for each sample you receive.

When the device changes, you can use that information to create a transition in your UI.

-- Greg

Improving the transition between ultra wide and wide angle lens
 
 
Q