View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Videos

Open Menu Close Menu
  • Collections
  • All Videos
  • About

Back to WWDC26

  • About
  • Summary
  • Transcript
  • Code
  • Support the Center Stage front camera in your iOS app

    Supercharge your iOS camera app with Center Stage using AVCapture APIs with the front camera on iPhone 17, iPhone 17 Pro and iPhone Air. Explore how APIs enable zoom and rotate options, for more flexible ways to frame selfies and videos and to automatically get everyone in a group shot. Integrate Center Stage for video calls to automatically adjust the framing, so you're front and center for virtual meetings and FaceTime calls. And learn how to stabilize your video for real-time video conferencing.

    Chapters

    • 0:00 - Introduction
    • 1:07 - Center Stage front camera
    • 2:09 - Center Stage for photos
    • 3:09 - Capture session setup
    • 3:56 - Dynamic aspect ratio
    • 6:47 - Smart framing monitor
    • 9:24 - Sensor orientation compensation
    • 11:53 - Center Stage for video recordings
    • 13:16 - Center Stage for video calls

    Resources

    • Supporting Center Stage front camera in your iOS app
    • AVCam: Building a camera app
    • AVFoundation
    • Capture setup
      • HD Video
      • SD Video

    Related Videos

    WWDC26

    • Implement high resolution photo capture

    WWDC23

    • Support external cameras in your iPadOS app

    WWDC21

    • What’s new in camera capture
  • Search this video…

    Hi, I’m Tracy! I’m an engineer on the Camera Software team.

    I’m excited to show you how to support the Center Stage front camera in your iOS app. I love taking selfies! Whether I’m traveling solo or with a group of friends. Getting the right framing isn’t always easy. If you’re anything like me, you’ve probably reached for a selfie stick or passed your phone to your friend with the longest arms. The Center Stage front camera on iPhone 17, iPhone Air, and iPhone 17 Pro takes care of this. It gives you greater flexibility in framing your shots. I'll start with an overview of the Center Stage front camera. Then, I'll cover APIs to support Center Stage for photos. I'll wrap up with how to support Center Stage for video recordings and video calls.

    Traditionally, smartphone front camera sensors have a 4x3 aspect ratio, which limits your framing based on the phone orientation. However, the Center Stage front camera has a square image sensor. This square shape lets you choose any aspect ratio.

    You can take a portrait selfie, or a landscape one, without having to rotate your iPhone. This gives you a more secure, one-handed grip.

    And since the camera is centered, your eye contact feels more natural.

    This square sensor is also paired with a lens that has a 95 degree field of view, the widest on any iPhone front camera. This wide field of view helps you better frame group selfies, stabilize videos, and keep you centered during video calls.

    Now that you know what the Center Stage front camera can do, I’ll show you how to bring perfect photo framing experience into your app. The key feature here is Auto Zoom and Auto Rotate. By combining the square sensor, wide field of view, and automatic face and gaze detection, the Center Stage front camera smartly adapts its orientation and adjusts between narrow and wide views. Let me show you how that works. Here, I’m taking a selfie outside. As my friend Karen joins me, the frame zooms out. As more friends get into the shot, the frame rotates to include everyone. To build this experience in your app, I'll first review the capture session setup, and then dive into two APIs: dynamic aspect ratio, and smart framing monitor. Lastly, I’ll cover sensor orientation compensation. Starting with a typical photo capture setup. First, create an AVCaptureSession.

    Find the Center Stage front camera, represented in the API as AVCaptureDevice with the .builtInUltraWideCamera device type.

    Create an AVCaptureDeviceInput for that camera.

    To get a camera preview, add an AVCaptureVideoPreviewLayer to the capture session.

    Also, add an AVCapturePhotoOutput to receive photos.

    As you add inputs and outputs, the capture session implicitly forms AVCaptureConnections between those with compatible media types. With that setup in place, I'll move to dynamic aspect ratio, the building block for both manual and automatic framing.

    Starting in iOS 26, AVCaptureDevice includes a dynamicAspectRatio property. When you set this property, the capture device crops your chosen aspect ratio out of the square image sensor as shown earlier, without rebuilding the capture session or interrupting preview. The switch is seamless and quick. Here is a table that lists example formats that support dynamic aspect ratio.

    It requires the front-facing .builtInUltraWideCamera as mentioned before.

    It's only supported on the square formats, with resolutions ranging from 1280 up to 4032.

    There are five aspect ratios available: 3x4, 4x3, 9x16, 16x9, and 1x1.

    Be aware that the 4032 photo format only supports 3x4 and 4x3 because these two aspect ratios give you the highest resolution for photos.

    With those format requirements in mind, let me show you how to implement a Tap to Rotate button using dynamic aspect ratio to switch between orientations.

    First, select the Center Stage front camera by creating an AVCaptureDevice.DiscoverySession.

    Specify .builtInUltraWideCamera as the only device type you’re interested in, and .front as a position.

    Since you’ve only asked for a single device, you can just get the first element in the discovery session’s device array.

    Find a format that supports your desired aspect ratio. Here, I’ll use 4x3 as an example. Check each format's supportedDynamicAspectRatios property. This returns an array of aspect ratios the format supports. For simplicity, I'm picking the first match.

    After locking the device for configuration, set your chosen format as the activeFormat.

    Next, set the dynamic aspect ratio to 4x3.

    This call returns the timestamp of the first buffer when the change takes effect.

    With that code in place, your app now supports Tap to Rotate, letting you change orientation with a single tap.

    Next up is the smart framing monitor API. It works alongside dynamic aspect ratio to automatically adjust framing as people move in and out of the scene.

    Starting in iOS 26, AVCaptureDevice includes an AVCaptureSmartFramingMonitor object. This monitor gives periodic framing recommendations based on automatic face and gaze detection.

    Each recommendation contains an aspect ratio and a zoom factor that your app can apply or ignore.

    Since this monitor is designed for photo capture, it only provides recommendations when you use the 4032 photo format. Now I'll walk through how to set up the monitor in code.

    With the ultra-wide front camera already selected from the dynamic aspect ratio setup, you can go ahead and find a format that supports both your desired aspect ratios and smart framing. Once you've found the format, lock the device for configuration and set the activeFormat.

    Next, get the smartFramingMonitor from the camera. By default, the monitor provides no recommendations. Here, I’m setting enabledFramings to all of the supportedFramings. But you can limit this to a subset of supported framings, such as just the 4x3 aspect ratio with narrow and wide zoom factors. After you configure your monitor, key-value observe the monitor’s recommendedFraming property. As the monitor recommends a new framing, apply the recommendation by setting the camera’s dynamic aspect ratio and video zoom factor. For a smooth preview transition, set the aspectRatio first, then the zoomFactor.

    Now you can start the monitor at any time, including while your AVCaptureSession is running. If your UI allows people to turn off automatic framing, unregister your key-value observation and stopMonitoring.

    Your app now supports Auto Zoom and Auto Rotate, giving people the best framing recommendations for group selfies.

    One last topic for photo capture, sensor orientation compensation. Since the earliest iPhone front cameras, the sensor has been mounted in Landscape Left orientation. If you take a selfie while holding the phone in Portrait orientation, the image buffer is delivered to the photo output in the native sensor orientation.

    The buffer carries an EXIF orientation metadata tag, indicating it should be rotated 270 degrees on playback.

    However, on iPhone 17, iPhone Air, and iPhone 17 Pro, the Center Stage front camera sensor is mounted in Portrait orientation.

    If your app relies on rotation values that worked before, photos may appear sideways or upside down.

    To handle this, AVCapturePhotoOutput automatically applies sensor orientation compensation by default. It physically rotates photos and updates EXIF metadata before delivering them to your app.

    The resulting photos are in landscape left orientation, just like on previous iPhone front cameras.

    You can keep using the same rotation values you used before.

    Keep in mind that this compensation is only applied to HEIC, JPEG, and uncompressed processed photos. It is never applied to Bayer RAW or Apple ProRAW captures. Starting in iOS 26, you can control this behavior with the cameraSensorOrientation- CompensationEnabled property. If you use AVCapturePhotoOutput, test with compensation off for best performance, and make sure photo orientation remains correct.

    To learn more about image rotation handling with AVCaptureRotationCoordinator, check out the "Support external cameras in your iPadOS app” from WWDC 2023. Now, on to Center Stage for videos. I’ll cover video recordings, and video calls.

    The dynamic aspect ratio API also works great for recordings. You can Tap to Rotate for a wider view. However, QuickTime movie tracks require all samples to have the same dimensions. Video recording will need to stop if you change the dynamic aspect ratio during capture.

    Here's the photo capture setup I walked through before. To modify it for video recording, you can use AVCaptureMovieFileOutput instead of AVCapturePhotoOutput.

    In such a setup, recording will stop automatically when the aspect ratio is changed. You can also use AVCaptureVideoDataOutput with AVAssetWriter to record videos. The setDynamicAspectRatio completion timestamp allows you to end the current recording and start a new one with the updated aspect ratio.

    Video recordings also benefit from cinematic stabilization modes: cinematicExtended and cinematicExtendedEnhanced. Both are face-aware on the Center Stage front camera. They prioritize keeping the subject stable over the background. Next, I'll talk about Center Stage for video calls.

    Here, I’m on a FaceTime call. When a friend joins me on the trail, the camera automatically widens to include both of us. Center Stage is already supported if your video conferencing app uses the Voice over IP background mode to keep calls connected when the phone is locked.

    People can directly turn on Center Stage from Control Center's Video Effects menu.

    If your app is not using Voice over IP background mode, you can still adopt the Center Stage API. This is available on the iPhone front camera, starting with iPhone 17, iPhone Air, and iPhone 17 Pro.

    Like all system-wide video effects, such as Portrait, Studio Light, and Gestures, Center Stage is enabled per process. Once active, it applies to any supported camera in your app.

    Here's the photo capture setup again. For video calls, the output is different. Video conferencing apps typically use a video data output to receive video buffers as a stream. Display, encoding, and transmission are all handled at the app layer.

    With this setup in mind, here's how to enable Center Stage. First, find a supported format. Set it as the active one after locking the device.

    By default, people toggle Center Stage through Control Center, not your app. Before turning it on, set a control mode: cooperative or app. Cooperative mode lets people also control it from a button in your app.

    Then, set isCenterStageEnabled to true. With that, Center Stage is active.

    Framing now automatically adjusts to keep all people centered.

    To learn more about the Center Stage API when it was first added for iPad, check out "What’s New in camera capture" from WWDC 2021.

    Beyond Center Stage, there's one more way to improve your video call experience. The Center Stage front camera supports a real-time, low-latency stabilization mode starting in iOS 26. It's off by default. To turn it on, set the preferredVideoStabilizationMode on the AVCaptureConnection to lowLatency.

    Here’s a side-by-side comparison of the same video call with low latency stabilization on and off.

    In the left video, stabilization is off. There’s noticeable shake as I walk. In the right video, stabilization is on. The footage is much more stable.

    With that, you have everything you need to support the Center Stage front camera in your iOS app. Here are some next steps to further improve your app’s framing experience.

    First, incorporate framing controls into your app to support orientation switching, toggles for Auto Zoom and Auto Rotate, and Center Stage activation.

    Second, optimize front camera performance. Test with sensor orientation compensation turned off.

    Make sure your app handles photo rotation correctly. Also consider supporting 18-megapixel photo capture for exceptional resolution and details. For best practices, check out "Implement high resolution photo capture” from WWDC 2026.

    The Center Stage front camera has completely changed the way I take selfies and make video calls on my iPhone. I look forward to seeing how it transforms your app. Thank you for watching.

    • 5:29 - Support dynamic aspect ratio

      // Select the Center Stage front camera
      
      import AVFoundation
      
      let deviceDiscoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInUltraWideCamera], mediaType: .video, position: .front)
      
      guard let camera = deviceDiscoverySession.devices.first else {
          print("Failed to find the capture device")
          return
      }
      
      // Find a format that supports the 4x3 aspect ratio
      
      for format in camera.formats {
          if format.supportedDynamicAspectRatios.contains(.ratio4x3) {
              try! camera.lockForConfiguration()
              camera.activeFormat = format
              camera.unlockForConfiguration()
              break
          }
      }
      
      // Set dynamic aspect ratio
      
      try! camera.lockForConfiguration()
      
      let timestamp = try! await camera.setDynamicAspectRatio(.ratio4x3)
      print("Applied dynamic aspect ratio at timestamp: \(timestamp)")
      
      camera.unlockForConfiguration()
    • 7:39 - Support smart framing monitor

      // Find a format that supports smart framing
      
      import AVFoundation
      
      for format in camera.formats {
          if format.isSmartFramingSupported {
              try! camera.lockForConfiguration()
              camera.activeFormat = format
              camera.unlockForConfiguration()
              break
          }
      }
      
      // Configure the smart framing monitor
      
      let monitor = camera.smartFramingMonitor!
      
      try! camera.lockForConfiguration()
      monitor.enabledFramings = monitor.supportedFramings
      camera.unlockForConfiguration()
      
      // Monitor framing recommendations
      
      observation = monitor.observe(\.recommendedFraming, options: [.new,]) { monitor, change in
          if let framing = monitor.recommendedFraming {
      
              Task {
                  try! camera.lockForConfiguration()
                  try! await camera.setDynamicAspectRatio(framing.aspectRatio)
                  camera.videoZoomFactor = CGFloat(framing.zoomFactor)
                  camera.unlockForConfiguration()
              }
      
          }
      }
      
      // Start the smart framing monitor
      
      try! monitor.startMonitoring()
      
      // Stop the smart framing monitor
      
      observation?.invalidate()
      observation = nil
      
      monitor.stopMonitoring()
    • 14:44 - Support Center Stage for video calls

      // Find a format that supports Center Stage
      
      import AVFoundation
      
      for format in camera.formats {
          if format.isCenterStageSupported {
              try! camera.lockForConfiguration()
              camera.activeFormat = format
              camera.unlockForConfiguration()
              break
          }
      }
      
      // Turn on Center Stage
      
      AVCaptureDevice.centerStageControlMode = .cooperative
      AVCaptureDevice.isCenterStageEnabled = true
    • 0:00 - Introduction
    • Center Stage front camera is available on iPhone 17, iPhone Air, and iPhone 17 Pro. Discover how its square sensor and wide field of view give you greater flexibility to perfectly frame selfies, group shots, and video calls.

    • 1:07 - Center Stage front camera
    • Take a closer look at the Center Stage front camera's hardware. Learn how its square image sensor and 95-degree field of view let you shoot in any orientation without rotating your device, keeping your grip secure and eye contact natural.

    • 2:09 - Center Stage for photos
    • Bring a perfect framing experience to your app. Explore how Auto Zoom and Auto Rotate combine the wide field of view with automatic face and gaze detection to smartly adjust framing as people move in and out of your shots.

    • 3:09 - Capture session setup
    • An overview of the AVCaptureSession setup required to use the Center Stage front camera. Configure an AVCaptureSession with the built-in ultra-wide camera. Add a video preview layer, and receive photos via AVCapturePhotoOutput.

    • 3:56 - Dynamic aspect ratio
    • Discover the dynamic aspect ratio API. Learn how to query supported formats and seamlessly switch aspect ratios without interrupting your camera preview or rebuilding the capture session.

    • 6:47 - Smart framing monitor
    • Automate your framing with AVCaptureSmartFramingMonitor. Learn how to configure the monitor to receive periodic recommendations for aspect ratio and zoom factor based on face and gaze detection, keeping your subjects perfectly framed.

    • 9:24 - Sensor orientation compensation
    • Understand how iOS handles the native portrait orientation of the Center Stage front camera sensor. Learn how AVCapturePhotoOutput automatically applies orientation compensation.

    • 11:53 - Center Stage for video recordings
    • Apply dynamic aspect ratio to video recordings using AVCaptureMovieFileOutput or AVAssetWriter. Learn how to manage recording transitions and take advantage of cinematic stabilization modes for exceptionally smooth footage.

    • 13:16 - Center Stage for video calls
    • Enhance your video conferencing app with Center Stage. Learn how to adopt the API in cooperative or app mode to keep everyone centered, and discover how to enable low-latency stabilization for significantly smoother video calls.

Developer Footer

  • Videos
  • WWDC26
  • Support the Center Stage front camera in your iOS app
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines