View in English

  • Apple Developer
    • 今すぐ始める

    「今すぐ始める」を詳しく見る

    • 概要
    • 学ぶ
    • Apple Developer Program

    最新情報

    • 最新ニュース
    • Hello Developer
    • プラットフォーム

    プラットフォームを詳しく見る

    • Appleプラットフォーム
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    特集

    • デザイン
    • 配信
    • ゲーム
    • アクセサリ
    • Web
    • Home
    • CarPlay
    • テクノロジー

    テクノロジーを詳しく見る

    • 概要
    • Xcode
    • Swift
    • SwiftUI

    特集

    • アクセシビリティ
    • App Intent
    • Apple Intelligence
    • ゲーム
    • 機械学習とAI
    • セキュリティ
    • Xcode Cloud
    • コミュニティ

    コミュニティを詳しく見る

    • 概要
    • 「Appleに相談」イベント
    • コミュニティによるイベント
    • デベロッパフォーラム
    • オープンソース

    特集

    • WWDC
    • Swift Student Challenge
    • デベロッパストーリー
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Center
    • ドキュメント

    ドキュメントを詳しく見る

    • ドキュメントライブラリ
    • テクノロジー概要
    • サンプルコード
    • ヒューマンインターフェイスガイドライン
    • ビデオ

    リリースノート

    • 注目のアップデート
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • ダウンロード

    ダウンロードを詳しく見る

    • すべてのダウンロード
    • オペレーティングシステム
    • アプリ
    • デザインリソース

    特集

    • Xcode
    • TestFlight
    • フォント
    • SF Symbols
    • Icon Composer
    • サポート

    サポートを詳しく見る

    • 概要
    • ヘルプガイド
    • デベロッパフォーラム
    • フィードバックアシスタント
    • お問い合わせ

    特集

    • アカウントヘルプ
    • App Reviewガイドライン
    • App Store Connectヘルプ
    • 近日導入予定の要件
    • 契約およびガイドライン
    • システムステータス
  • クイックリンク

    • イベント
    • ニュース
    • Forum
    • サンプルコード
    • ビデオ
 

ビデオ

メニューを開く メニューを閉じる
  • コレクション
  • すべてのビデオ
  • 利用方法

その他のビデオ

  • 概要
  • Summary
  • コード
  • 応答性が高く起動の速いカメラアプリの構築

    完璧なショットを逃すことがないよう迅速に起動できるカメラアプリを構築する方法を紹介します。アプリの起動から最初のプレビュー表示までに至るカメラ起動のシーケンス全体を最適化する方法を確認します。起動を高速化する新しいAPIや、プレビューのスムーズなレンダリングと持続的なパフォーマンス維持のためのベストプラクティスについて学び、アプリのカメラ体験を洗練させましょう。

    関連する章

    • 0:00 - Introduction
    • 2:02 - Fast Launch
    • 6:52 - Adopt deferred start
    • 15:06 - Steady preview
    • 18:04 - Sustained performance
    • 21:14 - Deterministic file writing

    リソース

    • Performance and metrics
    • AVCam: Building a camera app
      • HDビデオ
      • SDビデオ

    関連ビデオ

    WWDC26

    • 高解像度の写真キャプチャの実装

    WWDC23

    • より応答性の高いカメラ体験の実現
  • このビデオを検索
    • 9:14 - Automatic deferred start delegate

      import AVFoundation
      
      class DeferredStartDelegate: NSObject, AVCaptureSessionDeferredStartDelegate {
          func sessionWillRunDeferredStart(_ session: AVCaptureSession)
          {
              // This is called before deferred start begins for the deferred outputs
          }
      
          func sessionDidRunDeferredStart(_ session: AVCaptureSession)
          {
              // This is called after deferred start completes for all outputs
          }
      }
    • 9:46 - Adopt automatic deferred start

      import AVFoundation
      
      let captureSession = AVCaptureSession()
      captureSession.beginConfiguration()
      captureSession.automaticallyRunsDeferredStart = true
      
      let videoPreviewLayer = AVCaptureVideoPreviewLayer(session: captureSession)
      videoPreviewLayer.isDeferredStartEnabled = false
      
      let photoOutput = AVCapturePhotoOutput()
      photoOutput.isDeferredStartEnabled = true
      captureSession.addOutput(photoOutput)
      
      captureSession.setDeferredStartDelegate(deferredStartDelegate, deferredStartDelegateCallbackQueue: sessionQueue)
      
      captureSession.commitConfiguration()
      captureSession.startRunning()
    • 11:30 - Adopt manual deferred start

      import AVFoundation
      
      let captureSession = AVCaptureSession()
      captureSession.beginConfiguration()
      captureSession.automaticallyRunsDeferredStart = false
      
      let videoOutput = AVCaptureVideoDataOutput()
      captureSession.addOutput(videoOutput)
      videoOutput.isDeferredStartEnabled = false
      
      let photoOutput = AVCapturePhotoOutput()
      photoOutput.isDeferredStartEnabled = true
      captureSession.addOutput(photoOutput)
      
      captureSession.setDeferredStartDelegate(deferredStartDelegate, deferredStartDelegateCallbackQueue: sessionQueue)
      
      captureSession.commitConfiguration()
      captureSession.startRunning()
    • 11:53 - Manage runDeferredStartWhenNeeded

      import AVFoundation
      import QuartzCore
      
      private var firstFramePresented = false
      guard let drawable = layer.nextDrawable()
      if (!firstFramePresented) {
          drawable.addPresentedHandler({ drawable in
              // Set up postponed UI elements
              captureSession.runDeferredStartWhenNeeded()
          })
          firstFramePresented = true
      }
    • 14:07 - Enable responsive capture

      import AVFoundation
      
      func configurePhotoOutput(for session: AVCaptureSession, device: AVCaptureDevice) {
          let photoOutput = AVCapturePhotoOutput()
      
          guard session.canAddOutput(photoOutput) else { return }
          session.addOutput(photoOutput)
      
          photoOutput.maxPhotoQualityPrioritization = .quality
          // Responsive capture lets the photo output capture immediately
          photoOutput.isResponsiveCaptureEnabled = photoOutput.isResponsiveCaptureSupported
      }
    • 20:16 - Monitor for system pressure

      import AVFoundation
      
      let captureSession = AVCaptureSession()
      let device = activeVideoInput?.device
      captureSession.beginConfiguration()
      // ...
      captureSession.commitConfiguration()
      
      guard captureSession.hardwareCost <= 1.0 else {
          print("hardwareCost \(captureSession.hardwareCost) — cannot start session. Reconfiguring.")
          setupLowCostConfiguration()
      }
      
      captureSession.startRunning()
      let systemPressureObserver = device?.observe(\.systemPressureState,
                                                     options: [.initial, .new],
                                                     changeHandler: { /* Handle state change */ })
    • 22:17 - Manage pro video storage

      import AVFoundation
      
      func configureProVideoStorage() {
          guard AVProVideoStorage.isSupported else { return }
          let storage = AVProVideoStorage.shared
          guard storage.remainingCapacity != 0 else {
              storage.openSettings()
              return
          }
      }
    • 22:43 - Adopt AVProVideoStorage for deterministic file write speeds

      import AVFoundation
      
      guard AVProVideoStorage.isSupported else { return }
      guard let pvs = AVProVideoStorage.shared else { return }
      
      // Configure and set up AVCaptureSession, AVCaptureConnections and format
      // ...
      let movieOutput = AVCaptureMovieFileOutput()
      
      guard movieOutput.isProVideoStorageSupported else { return }
      guard !pvs.isBusy else { return }
      
      let movieFileURL = FileManager.default.temporaryDirectory
                  .appendingPathComponent(UUID().uuidString)
                  .appendingPathExtension("mov")
      
      movieOutput.usesProVideoStorage = true // Also available with AVAssetWriter
      movieOutput.startRecording(to: movieFileURL, recordingDelegate: delegate)
    • 0:00 - Introduction
    • Why a fast-appearing preview frame is the single biggest factor in a camera launch feeling responsive, and what the session covers — accelerating launch, rendering best practices, and capturing the moment without missing it.

    • 2:02 - Fast Launch
    • Learn how to minimize UI overhead and explore best practices for creating and configuring AVCaptureSession to get the camera preview on screen faster.

    • 6:52 - Adopt deferred start
    • Discover the deferred start API that allows you to defer the initialization of expensive capture outputs until after the preview is running, featuring both automatic and manual modes.

    • 15:06 - Steady preview
    • Explore best practices for rendering preview frames, comparing the simplicity of AVCaptureVideoPreviewLayer against the flexibility of AVCaptureVideoDataOutput.

    • 18:04 - Sustained performance
    • Learn how to assess hardware cost and adapt to system pressure using new APIs to maintain a smooth and responsive camera experience under demanding conditions.

    • 21:14 - Deterministic file writing
    • Adopt the AVProVideoStorage API to achieve sustained high-bandwidth input/output required for high data-rate video captures like ProRes.

Developer Footer

  • ビデオ
  • WWDC26
  • 応答性が高く起動の速いカメラアプリの構築
  • メニューを開く メニューを閉じる
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    メニューを開く メニューを閉じる
    • アクセシビリティ
    • アクセサリ
    • Apple Intelligence
    • App Extension
    • App Store
    • オーディオとビデオ(英語)
    • 拡張現実
    • デザイン
    • 配信
    • 教育
    • フォント(英語)
    • ゲーム
    • ヘルスケアとフィットネス
    • アプリ内課金
    • ローカリゼーション
    • マップと位置情報
    • 機械学習とAI
    • オープンソース(英語)
    • セキュリティ
    • SafariとWeb(英語)
    メニューを開く メニューを閉じる
    • 英語ドキュメント(完全版)
    • 日本語ドキュメント(一部トピック)
    • チュートリアル
    • ダウンロード
    • フォーラム(英語)
    • ビデオ
    Open Menu Close Menu
    • サポートドキュメント
    • お問い合わせ
    • バグ報告
    • システム状況(英語)
    メニューを開く メニューを閉じる
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles(英語)
    • フィードバックアシスタント
    メニューを開く メニューを閉じる
    • 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 Research Device Program(英語)
    Open Menu Close Menu
    • Appleに相談
    • Apple Developer Center
    • App Store Awards(英語)
    • Apple Design Awards
    • Apple Developer Academy(英語)
    • WWDC
    最新ニュースを読む。
    Apple Developerアプリを入手する。
    Copyright © 2026 Apple Inc. All rights reserved.
    利用規約 プライバシーポリシー 契約とガイドライン